Dach: Krueppelwalm am Satteldach (halfHipRatio, Feld im Objekt-Info)

This commit is contained in:
karim committed 2026-10-22 12:36:56 +02:00
1 parent 52d3b969ee
commit 83d054ad64
7 files changed
+64

No files matched your search

+31
View File
@@ -128,6 +128,37 @@ function computeCanonical(
case "sattel": { case "sattel": {
const rz = e + h; const rz = e + h;
const hh = Math.min(0.9, Math.max(0, roof.halfHipRatio ?? 0));
if (hh > 1e-6 && halfW > halfD * hh + 1e-6) {
// Krüppelwalm: oberer Giebelteil (Anteil `hh` der Firsthöhe) als kleine Walmflächen
// gleicher Neigung — Walmlauf = halbe Tiefe · hh, First entsprechend verkürzt.
const kz = e + h * (1 - hh);
const yk0 = y0 + halfD * (1 - hh);
const yk1 = y1 - halfD * (1 - hh);
const d = halfD * hh;
return {
eaves,
ridges: [[P(x0 + d, yc), P(x1 - d, yc)]],
hips: [
[P(x0, yk0), P(x0 + d, yc)],
[P(x0, yk1), P(x0 + d, yc)],
[P(x1, yk0), P(x1 - d, yc)],
[P(x1, yk1), P(x1 - d, yc)],
],
breaks: [],
planes: [
{ pts: [[x0, y0, e], [x1, y0, e], [x1, yk0, kz], [x1 - d, yc, rz], [x0 + d, yc, rz], [x0, yk0, kz]] },
{ pts: [[x0, y1, e], [x1, y1, e], [x1, yk1, kz], [x1 - d, yc, rz], [x0 + d, yc, rz], [x0, yk1, kz]] },
{ pts: [[x0, yk0, kz], [x0, yk1, kz], [x0 + d, yc, rz]] },
{ pts: [[x1, yk0, kz], [x1, yk1, kz], [x1 - d, yc, rz]] },
],
gables: [
[[x0, y0, e], [x0, y1, e], [x0, yk1, kz], [x0, yk0, kz]],
[[x1, y0, e], [x1, y1, e], [x1, yk1, kz], [x1, yk0, kz]],
],
ridgeHeight: h,
};
}
return { return {
eaves, eaves,
ridges: [[P(x0, yc), P(x1, yc)]], ridges: [[P(x0, yc), P(x1, yc)]],
+19
View File
@@ -143,3 +143,22 @@ describe("Walmdach über beliebigen einfachen Umrissen", () => {
expect(roofGeometry(mk(rect), 0).planes.length).toBe(4); expect(roofGeometry(mk(rect), 0).planes.length).toBe(4);
}); });
}); });
describe("Krüppelwalm (halfHipRatio) am Satteldach", () => {
const rect = [{ x: 0, y: 0 }, { x: 10, y: 0 }, { x: 10, y: 6 }, { x: 0, y: 6 }];
const mk = (halfHipRatio?: number) =>
({ id: "R", type: "roof", floorId: "eg", categoryCode: "31", outline: rect, shape: "sattel", pitchDeg: 45, overhang: 0, ridgeAxis: "x", halfHipRatio }) as unknown as Roof;
it("ohne Krüppelwalm: 2 Flächen, mit 0.3: 4 Flächen, gleiche Firsthöhe, Grundfläche bleibt", () => {
expect(roofGeometry(mk(), 0).planes.length).toBe(2);
const g = roofGeometry(mk(0.3), 0);
expect(g.planes.length).toBe(4);
expect(g.ridgeHeight).toBeCloseTo(3, 6);
expect(g.planes.reduce((s, p) => s + planArea(p.pts), 0)).toBeCloseTo(60, 6);
});
it("First um die Walmlänge verkürzt (halbe Tiefe 3 · 0.3 = 0.9 m je Seite)", () => {
const g = roofGeometry(mk(0.3), 0);
const [a, b] = g.ridges[0];
expect(a.x).toBeCloseTo(0.9, 6);
expect(b.x).toBeCloseTo(9.1, 6);
});
});
+1
View File
@@ -468,6 +468,7 @@ export const de = {
"objinfo.roof.mansard.walm": "Walm-Mansarde", "objinfo.roof.mansard.walm": "Walm-Mansarde",
"objinfo.roof.mansard.zelt": "Zelt-Mansarde", "objinfo.roof.mansard.zelt": "Zelt-Mansarde",
"objinfo.roof.mansardKnee": "Knicklage (% Spannweite)", "objinfo.roof.mansardKnee": "Knicklage (% Spannweite)",
"objinfo.roof.halfHip": "Krüppelwalm (% Firsthöhe)",
"objinfo.roof.width": "Breite (m)", "objinfo.roof.width": "Breite (m)",
"objinfo.roof.depth": "Tiefe (m)", "objinfo.roof.depth": "Tiefe (m)",
"objinfo.roof.overhang": "Überstand Traufe (m)", "objinfo.roof.overhang": "Überstand Traufe (m)",
+1
View File
@@ -466,6 +466,7 @@ export const en: Record<TranslationKey, string> = {
"objinfo.roof.mansard.walm": "Hip mansard", "objinfo.roof.mansard.walm": "Hip mansard",
"objinfo.roof.mansard.zelt": "Pavilion mansard", "objinfo.roof.mansard.zelt": "Pavilion mansard",
"objinfo.roof.mansardKnee": "Knee position (% span)", "objinfo.roof.mansardKnee": "Knee position (% span)",
"objinfo.roof.halfHip": "Half-hip (% ridge height)",
"objinfo.roof.width": "Width (m)", "objinfo.roof.width": "Width (m)",
"objinfo.roof.depth": "Depth (m)", "objinfo.roof.depth": "Depth (m)",
"objinfo.roof.overhang": "Eaves overhang (m)", "objinfo.roof.overhang": "Eaves overhang (m)",
+5
View File
@@ -1326,6 +1326,11 @@ export interface Roof {
* gemessen von der Traufe. Kleiner ⇒ steiler Sockel kürzer; fehlt ⇒ 0.4. * gemessen von der Traufe. Kleiner ⇒ steiler Sockel kürzer; fehlt ⇒ 0.4.
*/ */
mansardKneeRatio?: number; mansardKneeRatio?: number;
/**
* Nur Satteldach: Krüppelwalm. Anteil der Firsthöhe (0..0.9), der an BEIDEN Giebeln
* abgewalmt wird — 0/fehlt = voller Giebel, 0.3 = oberes Drittel als kleine Walmflächen.
*/
halfHipRatio?: number;
/** Dachüberstand an der TRAUFE (Meter, senkrecht zum First); 0 = bündig. */ /** Dachüberstand an der TRAUFE (Meter, senkrecht zum First); 0 = bündig. */
overhang: number; overhang: number;
/** /**
+5
View File
@@ -915,6 +915,11 @@ export function RoofSection({
host.onSetRoofPatch({ mansardKneeRatio: Math.max(5, Math.min(49, v)) / 100 }), host.onSetRoofPatch({ mansardKneeRatio: Math.max(5, Math.min(49, v)) / 100 }),
)} )}
{roof.shape === "sattel" &&
numField("objinfo.roof.halfHip", (roof.halfHipRatio ?? 0) * 100, 5, (v) =>
host.onSetRoofPatch({ halfHipRatio: Math.max(0, Math.min(90, v)) / 100 }),
)}
{/* Grundriss-Masse (Breite/Tiefe): das Umriss-Rechteck neu bilden, die {/* Grundriss-Masse (Breite/Tiefe): das Umriss-Rechteck neu bilden, die
untere/linke Ecke (minX/minY) bleibt fix. */} untere/linke Ecke (minX/minY) bleibt fix. */}
{numField("objinfo.roof.width", roof.width, 0.1, (v) => { {numField("objinfo.roof.width", roof.width, 0.1, (v) => {
+2
View File
@@ -96,6 +96,7 @@ export interface RoofInfo {
mansardType?: "giebel" | "walm" | "zelt"; mansardType?: "giebel" | "walm" | "zelt";
/** Mansarde-Knicklage (0..0.5 der halben Spannweite) — nur Mansarde relevant. */ /** Mansarde-Knicklage (0..0.5 der halben Spannweite) — nur Mansarde relevant. */
mansardKneeRatio?: number; mansardKneeRatio?: number;
halfHipRatio?: number;
/** Dachüberstand an der Traufe (Meter). */ /** Dachüberstand an der Traufe (Meter). */
overhang: number; overhang: number;
/** Dachüberstand am Ortgang (Giebelseite, Meter); fehlt ⇒ = Traufüberstand. */ /** Dachüberstand am Ortgang (Giebelseite, Meter); fehlt ⇒ = Traufüberstand. */
@@ -843,6 +844,7 @@ function roofSelection(project: Project, roof: Roof): Selection {
roofTypeId: roof.roofTypeId, roofTypeId: roof.roofTypeId,
mansardType: roof.mansardType, mansardType: roof.mansardType,
mansardKneeRatio: roof.mansardKneeRatio, mansardKneeRatio: roof.mansardKneeRatio,
halfHipRatio: roof.halfHipRatio,
overhang: roof.overhang, overhang: roof.overhang,
overhangGable: roof.overhangGable, overhangGable: roof.overhangGable,
ridgeAxis: roof.ridgeAxis, ridgeAxis: roof.ridgeAxis,