DXF-Import: CIRCLE/ARC als echte glatte Kreis-/Bogen-Formen (statt tesselliertem Vieleck)

This commit is contained in:
2026-07-05 15:06:25 +02:00
parent 45e19b7293
commit 4ac99d37cb
7 changed files with 200 additions and 15 deletions
+14 -2
View File
@@ -444,7 +444,13 @@ function arcContour(e: DxfEntity): Contour | null {
const t = start + (sweep * i) / segs;
pts.push({ x: cx + r * Math.cos(t), y: cy + r * Math.sin(t) });
}
return { z, pts, closed: false, layer: e.layer };
return {
z,
pts,
closed: false,
layer: e.layer,
curve: { kind: "arc", cx, cy, r, a0: start, a1: start + sweep },
};
}
/** CIRCLE → geschlossener Kreis-Linienzug (voller Umlauf, letzter Punkt weggelassen). */
@@ -471,7 +477,13 @@ function circleContour(e: DxfEntity): Contour | null {
const t = (Math.PI * 2 * i) / segs;
pts.push({ x: cx + r * Math.cos(t), y: cy + r * Math.sin(t) });
}
return { z, pts, closed: true, layer: e.layer };
return {
z,
pts,
closed: true,
layer: e.layer,
curve: { kind: "circle", cx, cy, r, a0: 0, a1: Math.PI * 2 },
};
}
/**