Dach: Zeltdach und Mansard-Zelt auf L/T/U als allseitig geneigtes Skelett-Dach

This commit is contained in:
karim committed 2026-10-22 11:53:38 +02:00
1 parent b2027f7b06
commit e647639b44
2 files changed
+17 -1

No files matched your search

+6 -1
View File
@@ -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)) {
+11
View File
@@ -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);
});
}
});