From e7073d06a6ef233704560e49cc5428d3e8b893cb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 15:20:48 +0000 Subject: [PATCH] =?UTF-8?q?[330]=20Tests=20nach=20Antrittspunkt:=20DXF=20s?= =?UTF-8?q?chreibt=20ihn=20als=20CIRCLE,=20Pfeil-Test=20z=C3=A4hlt=20nur?= =?UTF-8?q?=20Dreiecke,=20CLI-Golden=20nachgef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/__golden__/grundriss-eg.svg | 1 + src/export/exportDxf.ezdxf.test.ts | 5 ++++- src/export/exportDxf.roundtrip.test.ts | 3 ++- src/plan/generatePlan.stairArrow.test.ts | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cli/__golden__/grundriss-eg.svg b/src/cli/__golden__/grundriss-eg.svg index 9f8d2a6f..fc83ec84 100644 --- a/src/cli/__golden__/grundriss-eg.svg +++ b/src/cli/__golden__/grundriss-eg.svg @@ -33,6 +33,7 @@ + diff --git a/src/export/exportDxf.ezdxf.test.ts b/src/export/exportDxf.ezdxf.test.ts index b7dbfbf2..b182f1a4 100644 --- a/src/export/exportDxf.ezdxf.test.ts +++ b/src/export/exportDxf.ezdxf.test.ts @@ -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) => !!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 => - 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); diff --git a/src/export/exportDxf.roundtrip.test.ts b/src/export/exportDxf.roundtrip.test.ts index c3c6d6ab..e2fba606 100644 --- a/src/export/exportDxf.roundtrip.test.ts +++ b/src/export/exportDxf.roundtrip.test.ts @@ -27,8 +27,9 @@ function flatCounts(plan: Plan, project: Project): Record { } /** 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[]) => - 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]). diff --git a/src/plan/generatePlan.stairArrow.test.ts b/src/plan/generatePlan.stairArrow.test.ts index 6e93adbe..42786b80 100644 --- a/src/plan/generatePlan.stairArrow.test.ts +++ b/src/plan/generatePlan.stairArrow.test.ts @@ -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);