[330] Tests nach Antrittspunkt: DXF schreibt ihn als CIRCLE, Pfeil-Test zählt nur Dreiecke, CLI-Golden nachgeführt
This commit is contained in:
4 files changed
+9
-4
No files matched your search
@@ -33,6 +33,7 @@
|
||||
<line x1="3.2" y1="1.49917" x2="4.2" y2="1.49917" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.05"/>
|
||||
<line x1="3.2" y1="1.28583" x2="4.2" y2="1.28583" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.05"/>
|
||||
<polygon points="3.9,3.09917 3.76667,3.24917 3.63333,2.94917 3.5,3.09917 3.2,3.09917 3.2,4.2725 4.2,4.2725 4.2,3.09917" fill="none" stroke="#1a1a1a" stroke-width="0.013"/>
|
||||
<circle cx="3.7" cy="4.2725" r="0.075" fill="#1a1a1a" stroke="#1a1a1a" stroke-width="0.01"/>
|
||||
<line x1="3.7" y1="4.2725" x2="3.7" y2="3.09917" stroke="#1a1a1a" stroke-width="0.01"/>
|
||||
<line x1="3.7" y1="3.09917" x2="3.7" y2="1.0725" stroke="#1a1a1a" stroke-width="0.01" stroke-dasharray="0.2 0.1" stroke-dashoffset="0.13667"/>
|
||||
<polyline points="3.579,1.2925 3.7,1.0725 3.821,1.2925" fill="none" stroke="#1a1a1a" stroke-width="0.01"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -72,6 +72,9 @@ describe.skipIf(!hasEzdxf)("DXF-Export gegen ezdxf", { timeout: 60_000 }, () =>
|
||||
});
|
||||
const plan = generatePlan(world, "eg", new Set(flattenCategories(world.layers).map((l) => l.code)));
|
||||
const r = ezdxfRead("demo-haus", buildPlanDxf(plan, world));
|
||||
// [330] Antrittspunkt der Lauflinie: gefülltes 16-Eck einer Treppe, in der DXF als CIRCLE erkannt (arc_fit).
|
||||
const isRunStartMark = (p: Extract<Plan["primitives"][number], { kind: "polygon" }>) => !!p.stairId && p.pts.length >= 12 && p.fill !== "none";
|
||||
expect(r.result!.entities.filter((e) => e.type === "CIRCLE").length).toBeGreaterThanOrEqual(plan.primitives.filter((p) => p.kind === "polygon" && isRunStartMark(p)).length);
|
||||
expect(r.result, r.err).not.toBeNull();
|
||||
expect(r.result!.errors).toEqual([]);
|
||||
expect(r.status).toBe(0);
|
||||
@@ -80,7 +83,7 @@ describe.skipIf(!hasEzdxf)("DXF-Export gegen ezdxf", { timeout: 60_000 }, () =>
|
||||
// Ohne unsichtbare Pick-Bänder und ohne Öffnungs-Polygone (Fensterrahmen liegen im Block, nicht im Modellbereich).
|
||||
const polys = plan.primitives.filter(
|
||||
(p): p is Extract<Plan["primitives"][number], { kind: "polygon" }> =>
|
||||
p.kind === "polygon" && !p.openingId && !(p.stroke === "none" && p.fill === "none" && p.hatch.pattern === "none"),
|
||||
p.kind === "polygon" && !p.openingId && !(p.stroke === "none" && p.fill === "none" && p.hatch.pattern === "none") && !isRunStartMark(p),
|
||||
);
|
||||
const ezPolys = r.result!.entities.filter((e) => e.type === "LWPOLYLINE");
|
||||
expect(ezPolys.length).toBe(polys.length);
|
||||
|
||||
@@ -27,8 +27,9 @@ function flatCounts(plan: Plan, project: Project): Record<string, number> {
|
||||
}
|
||||
|
||||
/** Polygone, die der Export schreibt: unsichtbare Pick-Bänder (weder Füllung noch Umriss noch Schraffur) entfallen. */
|
||||
// [330] Ohne den Antrittspunkt der Lauflinie (gefülltes 16-Eck einer Treppe): die DXF schreibt ihn als CIRCLE (arc_fit).
|
||||
const visiblePolys = (polys: Extract<Plan["primitives"][number], { kind: "polygon" }>[]) =>
|
||||
polys.filter((p) => !p.openingId && !(p.stroke === "none" && p.fill === "none" && p.hatch.pattern === "none" && p.hatch.kind !== "gradient"));
|
||||
polys.filter((p) => !p.openingId && !(p.stroke === "none" && p.fill === "none" && p.hatch.pattern === "none" && p.hatch.kind !== "gradient") && !(p.stairId && p.pts.length >= 12 && p.fill !== "none"));
|
||||
|
||||
describe("DXF-Export (R2018 über acadrust)", () => {
|
||||
// 1:50: Wände mit Schichten und Schraffur (ab 1:100 schwarz, [140]).
|
||||
|
||||
@@ -66,7 +66,7 @@ describe("generatePlan — Treppen-Pfeil", () => {
|
||||
expect(arrowLines.length).toBe(2);
|
||||
// Keine gefüllte Pfeil-Fläche (Tritt-Polygone tragen fill:"none").
|
||||
const filled = prims.filter(
|
||||
(p) => p.kind === "polygon" && p.stairId === "st-1" && p.fill !== "none",
|
||||
(p) => p.kind === "polygon" && p.stairId === "st-1" && p.fill !== "none" && p.pts.length === 3, // ohne Antrittspunkt ([330])
|
||||
);
|
||||
expect(filled.length).toBe(0);
|
||||
});
|
||||
@@ -76,7 +76,7 @@ describe("generatePlan — Treppen-Pfeil", () => {
|
||||
.primitives;
|
||||
expect(prims.some((p) => p.kind === "line" && p.cls === "stair-arrow")).toBe(false);
|
||||
const filled = prims.filter(
|
||||
(p) => p.kind === "polygon" && p.stairId === "st-1" && p.fill !== "none",
|
||||
(p) => p.kind === "polygon" && p.stairId === "st-1" && p.fill !== "none" && p.pts.length === 3, // ohne Antrittspunkt ([330])
|
||||
);
|
||||
expect(filled.length).toBe(1);
|
||||
expect(filled[0].kind === "polygon" && filled[0].pts.length).toBe(3);
|
||||
|
||||
Reference in new issue
Block a user