From def99830f00eda98b877c5d41d14103afaeef86b Mon Sep 17 00:00:00 2001 From: karim Date: Thu, 22 Oct 2026 01:49:45 +0200 Subject: [PATCH] Test: Ansicht mit Daechern auf L-Grundriss (Sattel/Pult/Mansarde/Walm) --- src/plan/toElevation.test.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/plan/toElevation.test.ts b/src/plan/toElevation.test.ts index 010a56eb..e8668e70 100644 --- a/src/plan/toElevation.test.ts +++ b/src/plan/toElevation.test.ts @@ -617,6 +617,37 @@ describe("Dächer in der Ansicht (roofWorldFacesAll)", () => { }); }); +describe("Dächer auf L-Grundriss in der Ansicht", () => { + const L = [ + { x: 0, y: 0 }, { x: 11, y: 0 }, { x: 11, y: 4 }, { x: 8, y: 4 }, { x: 8, y: 6 }, { x: 0, y: 6 }, + ]; + for (const shape of ["sattel", "pult", "mansarde", "walm"] as const) { + it(`${shape}: Dachpolygone mit endlichen Koordinaten`, () => { + const base = elevationProject({ overhang: false }); + const p = { + ...base, + roofs: [ + { + id: "R1", type: "roof", floorId: "eg", categoryCode: "35", outline: L, shape, + pitchDeg: 30, overhang: 0, ridgeAxis: "x", baseElevation: 3, thickness: 0.2, + }, + ], + } as unknown as Project; + const level = p.drawingLevels.find((z) => z.kind === "elevation")!; + const plan = generateElevationPlan(p, level); + const roofPolys = plan!.primitives.filter( + (pr) => pr.kind === "polygon" && (pr as { roofId?: string }).roofId === "R1", + ); + expect(roofPolys.length).toBeGreaterThanOrEqual(1); + for (const pr of roofPolys) { + for (const q of (pr as { pts: { x: number; y: number }[] }).pts) { + expect(Number.isFinite(q.x) && Number.isFinite(q.y)).toBe(true); + } + } + }); + } +}); + describe("toElevation — Tür-Teilverglasung (glazingRatio)", () => { const GLASS_FILL_COLOR = "#9fc2d9"; const DOOR_LEAF_FILL_COLOR = "#ede6d9";