I am trying to create a GraphicsPath object using some coordinates from a DXF file. I catch the coordinates in the following order and values as seen below:
LINE found...
LINE -> |X1: 10 |Y1: 81 |X2: 10 |Y2: 105
ARC found...
ARC -> |X: 5 |Y: 105 |RAD: 5 |SA: 0 |EA: 90
LINE found...
LINE -> |X1: 5 |Y1: 110 |X2: -5 |Y2: 110
ARC found...
ARC -> |X: -5 |Y: 105 |RAD: 5 |SA: 90 |EA: 180
LINE found...
LINE -> |X1: -10 |Y1: 105 |X2: -10 |Y2: 81
ARC found...
ARC -> |X: -11 |Y: 81 |RAD: 1 |SA: 270 |EA: 0
LINE found...
LINE -> |X1: -11 |Y1: 80 |X2: -20 |Y2: 80
ARC found...
ARC -> |X: -20 |Y: 75 |RAD: 5 |SA: 90 |EA: 180
LINE found...
LINE -> |X1: -25 |Y1: 75 |X2: -25 |Y2: 5
ARC found...
ARC -> |X: -20 |Y: 5 |RAD: 5 |SA: 180 |EA: 270
LINE found...
LINE -> |X1: -20 |Y1: 0 |X2: 20 |Y2: 0
ARC found...
ARC -> |X: 20 |Y: 5 |RAD: 5 |SA: 270 |EA: 0
LINE found...
LINE -> |X1: 25 |Y1: 5 |X2: 25 |Y2: 75
ARC found...
ARC -> |X: 20 |Y: 75 |RAD: 5 |SA: 0 |EA: 90
LINE found...
LINE -> |X1: 20 |Y1: 80 |X2: 11 |Y2: 80
ARC found...
ARC -> |X: 11 |Y: 81 |RAD: 1 |SA: 180 |EA: 270
The code I use to insert each of the lines and the arches inside the GraphicsPath myPath object is the following:
For the lines:
myPath.AddLine(
X1,
(Y1 * inversion),
X2,
(Y2 * inversion));
For Archs:
myPath.AddArc(
(X - RAD),
(Y * inversion) - RAD,
RAD * 2,
RAD * 2,
360 - EA,
(CalcMax(SA, EA) - CalcMin(SA, EA)));
The result is the following GraphicPath:(on the left the result, on the right the expected.)
The issue here is, the Arches are being ignored from the Path, even when, as we can see above, the coordinates match, and they are being added in the correct order.
Does anyone know what can I do to solve this?
