0

我正在尝试使用 DXF 文件中的一些坐标创建一个GraphicsPath对象。我按以下顺序和值捕获坐标,如下所示:

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

我用来在GraphicsPath myPath对象中插入每一行和拱门的代码如下:

对于行:

myPath.AddLine(
    X1,
    (Y1 * inversion),
    X2,
    (Y2 * inversion));

对于拱门:

myPath.AddArc(
    (X - RAD),
    (Y * inversion) - RAD,
    RAD * 2,
    RAD * 2,
    360 - EA,
    (CalcMax(SA, EA) - CalcMin(SA, EA)));

结果是以下 GraphicPath:(左边是结果,右边是预期的。)

在此处输入图像描述

这里的问题是,路径中忽略了拱门,即使正如我们在上面看到的,坐标匹配并且它们是以正确的顺序添加的。

有谁知道我能做些什么来解决这个问题?

4

0 回答 0