Dach: Grundriss-Masse (Breite/Tiefe) im Panel editierbar

Bisher liess sich der Dach-Grundriss nach dem Platzieren nicht mehr in der
Grösse ändern. RoofSection bekommt Breite/Tiefe-Felder, die das Umriss-
Rechteck neu bilden (untere/linke Ecke bleibt fix). RoofInfo trägt
width/depth/minX/minY. tsc + vitest grün.
This commit is contained in:
2026-07-10 00:37:32 +02:00
parent 64f61797d8
commit 826685ceaf
4 changed files with 40 additions and 0 deletions
+25
View File
@@ -434,6 +434,16 @@ export function ColumnSection({
// ── Treppen-Attribut-Abschnitt ───────────────────────────────────────────────
// Grundform (gerade/L/Wendel), Laufbreite, Stufenanzahl, Steighöhe (+ abgeleitete
// Steigungshöhe/Auftrittstiefe), Laufrichtung; Referenzgeschoss + UK/OK read-only.
/** Rechteck-Umriss (CCW) aus unterer/linker Ecke + Breite/Tiefe (für Dach-Resize). */
function rectOutline(x0: number, y0: number, w: number, d: number) {
return [
{ x: x0, y: y0 },
{ x: x0 + w, y: y0 },
{ x: x0 + w, y: y0 + d },
{ x: x0, y: y0 + d },
];
}
/** Dach-Abschnitt: Form, Neigung(en), Überstand, Firstrichtung, Dicke. */
export function RoofSection({
roof,
@@ -514,6 +524,21 @@ export function RoofSection({
host.onSetRoofPatch({ pitchUpperDeg: Math.max(0, Math.min(85, v)) }),
)}
{/* Grundriss-Masse (Breite/Tiefe): das Umriss-Rechteck neu bilden, die
untere/linke Ecke (minX/minY) bleibt fix. */}
{numField("objinfo.roof.width", roof.width, 0.1, (v) => {
const w = Math.max(0.2, v);
host.onSetRoofPatch({
outline: rectOutline(roof.minX, roof.minY, w, roof.depth),
});
})}
{numField("objinfo.roof.depth", roof.depth, 0.1, (v) => {
const d = Math.max(0.2, v);
host.onSetRoofPatch({
outline: rectOutline(roof.minX, roof.minY, roof.width, d),
});
})}
{/* Überstand + Dicke (Meter). */}
{numField("objinfo.roof.overhang", roof.overhang, 0.05, (v) =>
host.onSetRoofPatch({ overhang: Math.max(0, v) }),