Dach: getrennter Überstand Traufe/Ortgang (statt ringsum)

Bisher ein einziger overhang ringsum (Designdoc-Prio #2). Neu Roof.overhangGable
für den Ortgang (Giebelseite, entlang First); overhang gilt für die Traufe
(senkrecht zum First). Fehlt overhangGable, gilt ringsum overhang (rückwärts-
kompatibel). Geometrie mappt die Überstände je nach ridgeAxis auf die Outline-
Achsen. Panel: zweites Feld 'Überstand Ortgang' (ausser flach/zelt). +3 Tests.
672/672 grün.
This commit is contained in:
2026-07-10 02:10:03 +02:00
parent 4319e12e35
commit c9baff58b0
7 changed files with 58 additions and 9 deletions
+10 -5
View File
@@ -336,11 +336,16 @@ const swapLine = (l: [Vec2, Vec2]): [Vec2, Vec2] => [swap2(l[0]), swap2(l[1])];
*/
export function roofGeometry(roof: Roof, eavesZ: number): RoofGeometry {
const bb = roofBBox(roof.outline);
const o = Math.max(0, roof.overhang);
let x0 = bb.x0 - o;
let y0 = bb.y0 - o;
let x1 = bb.x1 + o;
let y1 = bb.y1 + o;
const oe = Math.max(0, roof.overhang); // Traufüberstand (senkrecht zum First)
const og = Math.max(0, roof.overhangGable ?? roof.overhang); // Ortgang (entlang First)
// Der First liegt entlang der `ridgeAxis`-Achse: dort wirkt der Ortgang-, quer
// dazu der Traufüberstand. In OUTLINE-Koordinaten je nach Firstrichtung mappen.
const ox = roof.ridgeAxis === "x" ? og : oe;
const oy = roof.ridgeAxis === "x" ? oe : og;
let x0 = bb.x0 - ox;
let y0 = bb.y0 - oy;
let x1 = bb.x1 + ox;
let y1 = bb.y1 + oy;
const flip = roof.ridgeAxis === "y";
if (flip) {
[x0, y0, x1, y1] = [y0, x0, y1, x1];