The conversion of the IDF points to pointsarray format is mostly straightforward. In the case where the 3rd value is a zero, you simply copy the X and Y values into the points array and make the 3rd element zero also.
In the case of the angle value in the 3rd value, you will need to do the math to figure out where the center point of the circle is. The values given for X and Y in the IDF data represent the endpoint of the arc, so you need to insert another element into the pointsarray, to represent the center of the circle.
Pseudo code would look like this:
Loop through point data
split the line of text into the separate elements, throwing away the first one because it looks like it's always zero
if the 3rd element is zero, just copy all three values right into the points array
if the 3rd element is not zero then
do the math to calclulate the center point of the arc
put the coordinates of the center point into the points array, with the 3rd element the value of the radius of the arc
add a new element to the pointsarray with the X and Y values from the original data., This is the endpoint of the arc.
end if
End loop
The resulting data would look like this:
1694.88 2372.04 0
1694.88 1750 0
1919.29 1750 0
1919.29 2324.80 0 'this is the first endpoint of the arc
1872.04 2324.80 47.25 'this is the centerpoint of the arc, and the radius
1872.04 2372.04 0 'this is the endpoint of the arc
1694.88 2372.04 0
You see that there are now 7 rows of data, where there were only 6 before.
The math involved to find the center of the arc is fairly complicated. You have to consider that the line before the arc could be coming from any direction, and the angle can be any value from 0 to 360, and positive or negative. It's a handful to wrap your mind around. Not undoable, but will take you some time to figure it all out. When I have done problems like this in the past, I found it helpful to construct a cardboard circle/angle wheel with 2 arrows pinned to the center. I used the two arrows to visualize the relationship between the three points needed to define the arc. The tricky case is where the included angle goes across the 0°/360° point, because then you have to reset to the new reference.
10° - 27° is not -17°, but 343°
Your trig and math skills will get a workout.