From e647639b447c3acbf32d17c8f3e7403e9fb90d55 Mon Sep 17 00:00:00 2001 From: karim Date: Thu, 22 Oct 2026 11:53:38 +0200 Subject: [PATCH] Dach: Zeltdach und Mansard-Zelt auf L/T/U als allseitig geneigtes Skelett-Dach --- src/geometry/roof.ts | 7 ++++++- src/geometry/roofSkeleton.test.ts | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/geometry/roof.ts b/src/geometry/roof.ts index 95703d0..dd06e59 100644 --- a/src/geometry/roof.ts +++ b/src/geometry/roof.ts @@ -338,7 +338,12 @@ const swapLine = (l: [Vec2, Vec2]): [Vec2, Vec2] => [swap2(l[0]), swap2(l[1])]; export function roofGeometry(roof: Roof, eavesZ: number): RoofGeometry { // Walmdach über einem rechtwinkligen, nicht-rechteckigen Grundriss (L/T/U …): // echte Flächen mit Graten und Kehlen statt Bounding-Box (s. roofSkeleton.ts). - if ((roof.shape === "walm" || roof.shape === "sattel" || (roof.shape === "mansarde" && roof.mansardType !== "zelt")) && isRectilinearNonRect(roof.outline)) { + // Zeltdach/Mansard-Zelt auf L/T/U: eine einzelne Spitze gibt es dort nicht — sinnvolles + // Gegenstück ist das allseitig geneigte Skelett-Dach (wie Walm, ohne Giebel). + if ( + (roof.shape === "walm" || roof.shape === "sattel" || roof.shape === "mansarde" || roof.shape === "zelt") && + isRectilinearNonRect(roof.outline) + ) { return rectilinearWalm(roof, eavesZ); } if (roof.shape === "pult" && isRectilinearNonRect(roof.outline)) { diff --git a/src/geometry/roofSkeleton.test.ts b/src/geometry/roofSkeleton.test.ts index 1c0152c..10f4b12 100644 --- a/src/geometry/roofSkeleton.test.ts +++ b/src/geometry/roofSkeleton.test.ts @@ -93,3 +93,14 @@ describe("Mansarde auf L-Grundriss", () => { expect(g.breaks.length).toBeGreaterThan(0); }); }); + +describe("Zelt-/Mansard-Zeltdach auf L-Grundriss", () => { + for (const [shape, extra] of [["zelt", {}], ["mansarde", { mansardType: "zelt", pitchUpperDeg: 15 }]] as const) { + it(`${shape}: allseitig geneigt über dem echten Umriss, keine Giebel`, () => { + const roof = { id: "R", type: "roof", floorId: "eg", categoryCode: "31", outline: L, shape, pitchDeg: 45, overhang: 0, ridgeAxis: "x", ...extra } as unknown as Roof; + const g = roofGeometry(roof, 0); + expect(g.planes.reduce((s, p) => s + planArea(p.pts), 0)).toBeCloseTo(11 * 4 + 8 * 2, 6); + expect(g.gables.length).toBe(0); + }); + } +});