Merge branch 'worktree-agent-a0efa41aca12320a1' into claude/practical-noether-1hb2s1
# Conflicts: # TODO.md
This commit is contained in:
46 files changed
+1976
-336
No files matched your search
@@ -1042,6 +1042,7 @@ export default function App() {
|
||||
setCeilingThickness,
|
||||
updateStair,
|
||||
moveStairBy,
|
||||
dragStairParam,
|
||||
updateRoom,
|
||||
moveRoomBy,
|
||||
moveRoomGrip,
|
||||
@@ -1143,6 +1144,7 @@ export default function App() {
|
||||
slideOpening,
|
||||
updateWall,
|
||||
moveStairBy,
|
||||
dragStairParam,
|
||||
moveRoomGrip,
|
||||
moveCeilingGrip,
|
||||
moveExcavationGrip,
|
||||
|
||||
@@ -6,8 +6,25 @@
|
||||
<polygon points="5.4,7.08564 5.4,6.18564 4,6.18564 4,7.08564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="5.4,4.88564 5.4,4.48564 4,4.48564 4,4.88564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4,7.08564 4,4.48564 0.8275,4.48564 0.8275,7.08564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="5.4,6.18564 5.4,6.46781 5.28083,6.46781 4.99867,6.18564" fill="#8f959e" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,4.86697 5.2,4.86697 5.21867,4.88564 4.21867,4.88564" fill="#8f959e" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,4.86697 5.2,4.86697 5.2,4.48564 4.2,4.48564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,5.04031 5.2,5.04031 5.2,4.65897 4.2,4.65897" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,5.21364 5.2,5.21364 5.2,4.83231 4.2,4.83231" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="6.1725,4.48564 6.1725,1.88564 0.8275,1.88564 0.8275,4.48564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,5.38697 5.2,5.38697 5.2,5.00564 4.2,5.00564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,5.56031 5.2,5.56031 5.2,5.17897 4.2,5.17897" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,5.73364 5.2,5.73364 5.2,5.35231 4.2,5.35231" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,5.90697 5.2,5.90697 5.2,5.52564 4.2,5.52564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,6.08031 5.2,6.08031 5.2,5.69897 4.2,5.69897" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,6.25364 5.2,6.25364 5.2,5.87231 4.2,5.87231" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,6.42697 5.2,6.42697 5.2,6.04564 4.2,6.04564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,6.60031 5.2,6.60031 5.2,6.21897 4.2,6.21897" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,6.77364 5.2,6.77364 5.2,6.39231 4.2,6.39231" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,6.94697 5.2,6.94697 5.2,6.56564 4.2,6.56564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="0.6,1.88564 6.4,1.88564 6.4,0.5 0.6,0.5" fill="#b8735c" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,7.08564 5.2,7.08564 5.2,6.73897 4.2,6.73897" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="4.2,7.08564 5.2,7.08564 5.2,6.91231 4.2,6.91231" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1,4.54564 6,4.54564 6,4.48564 1,4.48564" fill="#c9c2b3" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1,4.58564 6,4.58564 6,4.54564 1,4.54564" fill="#ffffff" stroke="none" stroke-width="0"/>
|
||||
<polygon points="1,4.78564 6,4.78564 6,4.58564 1,4.58564" fill="#9aa0a6" stroke="none" stroke-width="0"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 8.5 KiB |
@@ -2,9 +2,11 @@
|
||||
// 1) „Startpunkt der Treppe:" → Punkt (Antritt, unterste Stufe).
|
||||
// 2) „Laufrichtung / Ende:" → Punkt: definiert Richtung + Lauflänge des ersten
|
||||
// Laufs. Bei L folgt ein zweiter Lauf (Ende des zweiten Laufs); bei Wendel
|
||||
// ist der zweite Punkt der äußere Rand (Radius). Committet die Treppe.
|
||||
// ist der zweite Punkt der äußere Rand (Radius). U: gleich langer Gegenlauf links
|
||||
// daneben (Auge 0.1, Halbpodest = Laufbreite); gerade mit Podest: der Punkt ist das
|
||||
// Ende der ganzen Treppe (zwei gleiche Läufe, Podest = Laufbreite). Committet die Treppe.
|
||||
//
|
||||
// Optionen (togglebar, IMMER sichtbar): Grundform gerade/L/Wendel, Auf-/Ab-
|
||||
// Optionen (togglebar, IMMER sichtbar): Grundform gerade/L/U/gerade mit Podest/Wendel, Auf-/Ab-
|
||||
// Umschalter, Referenz (links/mitte/rechts), Trittmass-Modus (mit/ohne).
|
||||
// Tab-Felder in BEIDEN Phasen: Breite (idle + run). Im Laufschritt zusätzlich:
|
||||
// • Trittmass-Modus „ohne": Stufen + Steighöhe (heutiges Verhalten).
|
||||
@@ -222,7 +224,9 @@ export const stairCommand: Command = {
|
||||
if (input.kind === "option") {
|
||||
const next = { ...s } as StairCmdState;
|
||||
if (input.id === "shape") {
|
||||
next.shape = s.shape === "straight" ? "L" : s.shape === "L" ? "spiral" : "straight";
|
||||
// gerade → L → U → gerade mit Podest → Wendel → gerade
|
||||
const cycle: StairShape[] = ["straight", "L", "U", "straightLanding", "spiral"];
|
||||
next.shape = cycle[(cycle.indexOf(s.shape) + 1) % cycle.length];
|
||||
} else if (input.id === "updown") {
|
||||
next.up = !s.up;
|
||||
} else if (input.id === "referenz") {
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ export { drawingVertices, gripPt, openEdges, polylineEdgeGrips, ringEdges } from
|
||||
export { verticalExtents } from "../geometry/grips";
|
||||
export type { VerticalExtent } from "../geometry/grips";
|
||||
export type { GripRequest } from "../geometry/grips";
|
||||
export { coincidentGripPoints, excavationGripPoints, gripAxisLock, gripEdgeTarget, gripPolar, gripPolarPoint, openingGripPoint, openingSheetSlide, openingTypedPosition, sheetHeightDrag, stairMoveHandle, wallGripPoints } from "../geometry/gripDrag";
|
||||
export { coincidentGripPoints, excavationGripPoints, gripAxisLock, gripEdgeTarget, gripPolar, gripPolarPoint, openingGripPoint, openingSheetSlide, openingTypedPosition, sheetHeightDrag, stairMoveHandle, stairParamPoints, wallGripPoints } from "../geometry/gripDrag";
|
||||
export type { EdgeDrive, GripLocks, SheetHeightKind } from "../geometry/gripDrag";
|
||||
export { openingPreviewProject, openingPreviewSvgs } from "../plan/openingPreview";
|
||||
export type { OpeningPreviewSvgs } from "../plan/openingPreview";
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import type { EdgeGrip, Excavation, Opening, Stair, Vec2, Wall } from "../model/types";
|
||||
import { core } from "../engine/coreWasm";
|
||||
import { encodeStair } from "./stair";
|
||||
|
||||
const v = (f: ArrayLike<number>, i = 0): Vec2 => ({ x: f[i], y: f[i + 1] });
|
||||
|
||||
@@ -135,6 +136,14 @@ export function stairMoveHandle(st: Stair): Vec2 {
|
||||
return v(core().grip_stair_handle(st.shape === "spiral", c?.x ?? NaN, c?.y ?? NaN, st.start.x, st.start.y, st.dir?.x ?? 0, st.dir?.y ?? 0, st.runLength));
|
||||
}
|
||||
|
||||
/**
|
||||
* [151] Parameter-Griffe einer Podesttreppe (L, U, gerade mit Podest): Ende Lauf 1, Ende letzter Lauf, bei
|
||||
* U / gerade mit Podest der Podestrand. Andere Formen: keine. Den Zug rechnet der Kern (Griff `stairParam`).
|
||||
*/
|
||||
export function stairParamPoints(st: Stair): Vec2[] {
|
||||
return points(core().grip_stair_param_points(encodeStair(st)));
|
||||
}
|
||||
|
||||
/** Griffe einer Wand: Start, Ende, bei einer Bogenwand ([T2]) der Bogenscheitel. */
|
||||
export function wallGripPoints(w: Pick<Wall, "start" | "end" | "bulge">): Vec2[] {
|
||||
return points(core().grip_wall_points(w.start.x, w.start.y, w.end.x, w.end.y, w.bulge ?? 0));
|
||||
|
||||
@@ -29,6 +29,8 @@ export type GripRequest =
|
||||
| { op: "roomStamp"; id: string; delta: P; pt?: P }
|
||||
| { op: "ceilingEdge" | "roomEdge"; id: string; a: number; b: number; delta: P }
|
||||
| { op: "excavationGrip"; id: string; index: number; pt: P }
|
||||
// [151] Parameter-Griff einer Podesttreppe (Kern `grip_drag::stair_param_drag`).
|
||||
| { op: "stairParam"; id: string; index: number; pt: P }
|
||||
| { op: "excavationEdge"; id: string; a: number; b: number; delta: P }
|
||||
| { op: "insertPoint"; id: string; seg: number; pt: P }
|
||||
| { op: "deletePoint"; id: string; index: number }
|
||||
|
||||
@@ -11,7 +11,7 @@ import { core } from "../engine/coreWasm";
|
||||
export const IDEAL_TREAD = 0.29;
|
||||
export const MIN_STEPS = 2;
|
||||
|
||||
const FORM = { straight: 0, L: 1, spiral: 2 } as const;
|
||||
const FORM = { straight: 0, L: 1, spiral: 2, U: 3, straightLanding: 4 } as const;
|
||||
const REFERENZ = { mitte: 0, links: 1, rechts: 2 } as const;
|
||||
|
||||
const pt = (f: Float64Array, i: number): Vec2 => ({ x: f[i], y: f[i + 1] });
|
||||
@@ -22,7 +22,7 @@ function ptsAt(f: Float64Array, i: number, n: number): Vec2[] {
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Treppen-Parameter als 16 Zahlen (Aufbau: `src-tauri/core/src/stair.rs`); fehlend = NaN. */
|
||||
/** Treppen-Parameter als 21 Zahlen (Aufbau: `src-tauri/core/src/stair.rs`); fehlend = NaN. */
|
||||
export function encodeStair(s: Stair): Float64Array {
|
||||
const n = (v: number | undefined) => (v === undefined ? Number.NaN : v);
|
||||
return Float64Array.of(
|
||||
@@ -39,6 +39,12 @@ export function encodeStair(s: Stair): Float64Array {
|
||||
s.stepCount,
|
||||
s.up === undefined ? Number.NaN : s.up ? 1 : 0,
|
||||
REFERENZ[s.referenz ?? "mitte"] ?? 0,
|
||||
// [151] U / gerade mit Podest
|
||||
n(s.gap),
|
||||
n(s.landingLength),
|
||||
n(s.run1Steps),
|
||||
n(s.midSteps),
|
||||
n(s.run2Offset),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -58,6 +64,7 @@ export interface SpiralOutlineSegments {
|
||||
* Aussenlinie einer Treppe im Grundriss je nach Form:
|
||||
* • gerade → geschlossenes Rechteck als Polygon-Punkte.
|
||||
* • L → L-Polygon via Linien-Schnittpunkten.
|
||||
* • U / gerade mit Podest → Umriss um Läufe und Podest(e), bei U innen um das Auge.
|
||||
* • Wendel → `SpiralOutlineSegments` (Bögen + radiale Linien).
|
||||
*
|
||||
* Genau einer von `polygon` / `spiral` ist nicht null (bei Unsinn-Eingabe beide null).
|
||||
|
||||
+14
-2
@@ -841,6 +841,18 @@ export const de = {
|
||||
"objinfo.stair.shape.straight": "Gerade",
|
||||
"objinfo.stair.shape.L": "L-Treppe",
|
||||
"objinfo.stair.shape.spiral": "Wendel",
|
||||
"objinfo.stair.shape.U": "U-Treppe",
|
||||
"objinfo.stair.shape.straightLanding": "Gerade mit Podest",
|
||||
"objinfo.stair.run1": "Lauf 1 (Länge)",
|
||||
"objinfo.stair.run2": "Letzter Lauf (Länge)",
|
||||
"objinfo.stair.run1Steps": "Steigungen Lauf 1",
|
||||
"objinfo.stair.turn": "Drehsinn",
|
||||
"objinfo.stair.turn.left": "Links",
|
||||
"objinfo.stair.turn.right": "Rechts",
|
||||
"objinfo.stair.gap": "Treppenauge",
|
||||
"objinfo.stair.landing": "Podesttiefe",
|
||||
"objinfo.stair.midSteps": "Steigungen Mittellauf",
|
||||
"objinfo.stair.run2Offset": "Versatz Gegenlauf",
|
||||
"objinfo.stair.width": "Laufbreite",
|
||||
"objinfo.stair.column": "Mittelsäule (Radius)",
|
||||
"objinfo.stair.steps": "Stufenanzahl",
|
||||
@@ -2522,8 +2534,8 @@ export const de = {
|
||||
"ifc.reason.holes": "Raum mit Loch",
|
||||
"ifc.reason.part": "Teil eines anderen Bauteils",
|
||||
"ifc.reason.roofForm": "Dachform nicht abbildbar (kein Rechteck, ungleiche Neigung, Tonnendach …)",
|
||||
"ifc.reason.stairForm": "keine gleichmässige gerade, L- oder Wendeltreppe",
|
||||
"ifc.reason.stairTurn": "Podesttreppe mit Wende (U, mehrere Podeste): Dossier kennt nur gerade, L- und Wendeltreppen",
|
||||
"ifc.reason.stairForm": "keine gleichmässige gerade, L-, U-, Podest- oder Wendeltreppe",
|
||||
"ifc.reason.stairTurn": "Podesttreppe, die Dossier nicht abbildet (mehr als zwei Podeste, Podest nicht an der Ecke, ungleiche Läufe)",
|
||||
"menu.native.importMesh": "3D-Modell importieren …",
|
||||
"mesh.import.title": "3D-Modell importieren",
|
||||
"mesh.import.failed": "3D-Modell-Import fehlgeschlagen",
|
||||
|
||||
+14
-2
@@ -859,6 +859,18 @@ export const en: Record<TranslationKey, string> = {
|
||||
"objinfo.stair.referenz.links": "Left",
|
||||
"objinfo.stair.referenz.mitte": "Centre",
|
||||
"objinfo.stair.referenz.rechts": "Right",
|
||||
"objinfo.stair.shape.U": "U-shaped",
|
||||
"objinfo.stair.shape.straightLanding": "Straight with landing",
|
||||
"objinfo.stair.run1": "Flight 1 (length)",
|
||||
"objinfo.stair.run2": "Last flight (length)",
|
||||
"objinfo.stair.run1Steps": "Risers flight 1",
|
||||
"objinfo.stair.turn": "Turn",
|
||||
"objinfo.stair.turn.left": "Left",
|
||||
"objinfo.stair.turn.right": "Right",
|
||||
"objinfo.stair.gap": "Stairwell gap",
|
||||
"objinfo.stair.landing": "Landing depth",
|
||||
"objinfo.stair.midSteps": "Risers middle flight",
|
||||
"objinfo.stair.run2Offset": "Offset of return flight",
|
||||
// ── Room attributes (object info panel) ──────────────────────────────────
|
||||
"objinfo.room.section": "Room",
|
||||
"objinfo.room.name": "Name",
|
||||
@@ -2472,8 +2484,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"ifc.reason.holes": "room with a hole",
|
||||
"ifc.reason.part": "part of another element",
|
||||
"ifc.reason.roofForm": "roof shape not mappable (not a rectangle, unequal pitch, barrel roof …)",
|
||||
"ifc.reason.stairForm": "not a regular straight, L or spiral stair",
|
||||
"ifc.reason.stairTurn": "landing stair with a turn (U, several landings): Dossier only has straight, L and spiral stairs",
|
||||
"ifc.reason.stairForm": "not a regular straight, L, U, landing or spiral stair",
|
||||
"ifc.reason.stairTurn": "landing stair Dossier cannot represent (more than two landings, landing not at the corner, unequal flights)",
|
||||
"menu.native.importMesh": "Import 3D model …",
|
||||
"mesh.import.title": "Import 3D model",
|
||||
"mesh.import.failed": "3D model import failed",
|
||||
|
||||
@@ -10,7 +10,7 @@ import { applyOps, validateProject } from "../core/ops";
|
||||
import { projectDiffOps } from "../core/projectDiff.testutil";
|
||||
import { exportIfcSpf } from "../export/exportIfc";
|
||||
import { emptyProject, sampleProject } from "../model/sampleProject";
|
||||
import type { Column, Opening, Project, Vec2, Wall } from "../model/types";
|
||||
import type { Column, Opening, Project, Stair, Vec2, Wall } from "../model/types";
|
||||
import { wallTypeThickness } from "../model/types";
|
||||
import { formatIfcElementsSummary, type IfcElementsSummary } from "./ifcImport";
|
||||
import { importIfcInto } from "./importView.testutil";
|
||||
@@ -213,6 +213,34 @@ describe("IFC-Import als Bauteile: Rundreise Demo-Haus", () => {
|
||||
expect(near(s2.position, { x: 3, y: 2 }, 1e-4)).toBe(true);
|
||||
expect(s2.profile.kind === "round" && s2.profile.radius).toBeCloseTo(0.15, 6);
|
||||
});
|
||||
|
||||
// [151] U (Halbpodest, versetzter Gegenlauf; zwei Viertelpodeste mit Mittellauf) und gerade mit
|
||||
// Zwischenpodest: Export (IfcStair mit IfcStairFlight + IfcSlab LANDING) → Import → gleiche Form und Masse.
|
||||
const base: Stair = sampleProject.stairs![0];
|
||||
const cases: [string, string, Partial<Stair>][] = [
|
||||
["U Halbpodest, Beton", "stair-standard", { shape: "U", start: { x: 0.6, y: 2.3 }, dir: { x: 1, y: 0 }, runLength: 2.4, run2Length: 2.4, turn: -1, gap: 0.15, landingLength: 1.0, stepCount: 15 }],
|
||||
["U versetzt, massiv", "stair-massiv", { shape: "U", start: { x: 0.6, y: 0.6 }, dir: { x: 1, y: 0 }, runLength: 2.1, run2Length: 1.8, turn: 1, gap: 0.2, landingLength: 1.2, run2Offset: 0.3, run1Steps: 8, stepCount: 15 }],
|
||||
["U Mittellauf, massiv", "stair-massiv", { shape: "U", start: { x: 0.8, y: 0.4 }, dir: { x: 0, y: 1 }, runLength: 1.5, run2Length: 1.5, turn: -1, gap: 1.2, landingLength: 1.0, midSteps: 4, run1Steps: 5, stepCount: 16 }],
|
||||
["gerade mit Podest, Beton", "stair-standard", { shape: "straightLanding", start: { x: 0.5, y: 0.6 }, dir: { x: 1, y: 0 }, runLength: 1.5, run2Length: 1.5, landingLength: 1.0, run1Steps: 7, stepCount: 15 }],
|
||||
];
|
||||
for (const [name, typeId, patch] of cases) {
|
||||
it(`[151] Treppe ${name}: Rundreise`, async () => {
|
||||
const st0: Stair = { ...base, ...patch, typeId };
|
||||
const { project: p, summary } = await importInto(emptyProject, { ...sampleProject, stairs: [st0] });
|
||||
expect(summary.stairs).toBe(1);
|
||||
const st = p.stairs![0];
|
||||
expect([st.shape, st.stepCount, st.turn ?? null, st.midSteps ?? null], JSON.stringify(st)).toEqual([st0.shape, st0.stepCount, st0.turn ?? null, st0.midSteps ?? null]);
|
||||
expect(near(st.start, st0.start, 1e-4) && near(st.dir, st0.dir, 1e-6), JSON.stringify(st)).toBe(true);
|
||||
expect(st.width).toBeCloseTo(st0.width, 4);
|
||||
expect(st.runLength).toBeCloseTo(st0.runLength, 4);
|
||||
expect(st.run2Length!).toBeCloseTo(st0.run2Length!, 4);
|
||||
expect(st.landingLength!).toBeCloseTo(st0.landingLength!, 4);
|
||||
if (st0.shape === "U") expect(st.gap!).toBeCloseTo(st0.gap!, 4);
|
||||
expect(st.run2Offset ?? 0).toBeCloseTo(st0.run2Offset ?? 0, 4);
|
||||
expect(st.totalRise!).toBeCloseTo(st0.totalRise!, 4);
|
||||
expect(validateProject(p)).toEqual([]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe("Kontext-Mesh: Farbe und GlobalId", () => {
|
||||
|
||||
@@ -3048,10 +3048,28 @@ export type Stair = {
|
||||
dir: Vec2;
|
||||
/** Lauflänge des (ersten) Laufs in Metern (entlang `dir`). */
|
||||
runLength: number;
|
||||
/** Nur L: Lauflänge des zweiten Laufs in Metern. */
|
||||
/** Nur L / U / gerade mit Podest: Lauflänge des zweiten (bei U: des letzten) Laufs in Metern. */
|
||||
run2Length?: number;
|
||||
/** Nur L: Abbiegerichtung des zweiten Laufs (+1 = links, −1 = rechts). */
|
||||
/** Nur L / U: Abbiegerichtung des zweiten Laufs bzw. Drehsinn (+1 = links, −1 = rechts). */
|
||||
turn?: 1 | -1;
|
||||
/**
|
||||
* [151] Nur U: lichte Weite des Treppenauges zwischen erstem und letztem Lauf (Meter; fehlt = 0.1).
|
||||
*/
|
||||
gap?: number;
|
||||
/** [151] Nur U / gerade mit Podest: Podesttiefe in Laufrichtung (Meter; fehlt = Laufbreite). */
|
||||
landingLength?: number;
|
||||
/**
|
||||
* [151] Nur L / U / gerade mit Podest: Steigungen im ersten Lauf bis zum Podest (fehlt = nach
|
||||
* Lauflängen aufgeteilt). Jedes Podest zählt als eine Steigung.
|
||||
*/
|
||||
run1Steps?: number;
|
||||
/**
|
||||
* [151] Nur U: Steigungen im Mittellauf quer über das Auge (zwei Viertelpodeste); fehlt/0 =
|
||||
* Halbpodest. Auftritt wie Lauf 1, höchstens Augenweite / Steigungen.
|
||||
*/
|
||||
midSteps?: number;
|
||||
/** [151] Nur U: Versatz des letzten Laufs ins Podest hinein (Meter, entlang Lauf 1; fehlt = 0). */
|
||||
run2Offset?: number;
|
||||
/** Nur Wendel: Zentrum der Wendeltreppe (Meter). */
|
||||
center?: Vec2;
|
||||
/** Nur Wendel: Radius (Meter) von der Mitte zur Lauflinie. */
|
||||
@@ -3120,12 +3138,15 @@ export type Stair = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Grundform einer Treppe (DOSSIER: gerade / L / Wendel).
|
||||
* Grundform einer Treppe (DOSSIER: gerade / L / Wendel / U / gerade mit Podest).
|
||||
* • "straight" — ein gerader Lauf (Lauflinie = Start → Richtung).
|
||||
* • "L" — zwei rechtwinklige Läufe mit Zwischenpodest an der Ecke.
|
||||
* • "spiral" — Wendeltreppe um ein Zentrum (keilförmige Tritte).
|
||||
* • "U" — [151] zwei gegenläufige Läufe mit Halbpodest (Treppenauge `gap`, Drehsinn `turn`),
|
||||
* wahlweise mit Mittellauf quer über das Auge und zwei Viertelpodesten (`midSteps`).
|
||||
* • "straightLanding" — [151] zwei Läufe in einer Richtung mit Zwischenpodest (`landingLength`).
|
||||
*/
|
||||
export type StairShape = "straight" | "L" | "spiral";
|
||||
export type StairShape = "straight" | "L" | "spiral" | "U" | "straightLanding";
|
||||
|
||||
/**
|
||||
* Ein Treppentyp (Treppenstil) — wiederverwendbares Preset für {@link Stair}.
|
||||
|
||||
@@ -1417,6 +1417,81 @@ function RoofEdgesSection({
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* [151] Läufe und Podest einer Podesttreppe (L, U, gerade mit Podest): Lauflängen, Steigungen im ersten
|
||||
* Lauf, Drehsinn (L/U), Treppenauge, Mittellauf und Versatz (U), Podesttiefe (U, gerade mit Podest).
|
||||
*/
|
||||
function StairFlightFields({ stair, host }: { stair: StairInfo; host: ReturnType<typeof usePanelHost> }) {
|
||||
const isU = stair.shape === "U";
|
||||
const turn = stair.turn ?? 1;
|
||||
return (
|
||||
<>
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.run1")}
|
||||
value={stair.runLength ?? 0}
|
||||
onCommit={(v) => v > 0.1 && host.onSetStairPatch({ runLength: v })}
|
||||
/>
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.run2")}
|
||||
value={stair.run2Length ?? stair.runLength ?? 0}
|
||||
onCommit={(v) => v > 0.1 && host.onSetStairPatch({ run2Length: v })}
|
||||
/>
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.run1Steps")}
|
||||
unit="" step={1} digits={0} value={stair.run1Steps ?? 0}
|
||||
onCommit={(v) => host.onSetStairPatch({ run1Steps: v >= 1 ? Math.round(v) : undefined })}
|
||||
/>
|
||||
{stair.shape !== "straightLanding" && (
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.stair.turn")}</span>
|
||||
<div className="objinfo-segment">
|
||||
<button
|
||||
type="button"
|
||||
className={"objinfo-seg-btn" + (turn > 0 ? " active" : "")}
|
||||
onClick={() => host.onSetStairPatch({ turn: 1 })}
|
||||
>
|
||||
{t("objinfo.stair.turn.left")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={"objinfo-seg-btn" + (turn < 0 ? " active" : "")}
|
||||
onClick={() => host.onSetStairPatch({ turn: -1 })}
|
||||
>
|
||||
{t("objinfo.stair.turn.right")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{stair.shape !== "L" && (
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.landing")}
|
||||
value={stair.landingLength ?? stair.width}
|
||||
onCommit={(v) => v > 0.1 && host.onSetStairPatch({ landingLength: v })}
|
||||
/>
|
||||
)}
|
||||
{isU && (
|
||||
<>
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.gap")}
|
||||
value={stair.gap ?? 0.1}
|
||||
onCommit={(v) => v >= 0 && host.onSetStairPatch({ gap: v })}
|
||||
/>
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.midSteps")}
|
||||
unit="" step={1} digits={0} value={stair.midSteps ?? 0}
|
||||
onCommit={(v) => host.onSetStairPatch({ midSteps: v >= 1 ? Math.round(v) : undefined })}
|
||||
/>
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.run2Offset")}
|
||||
min={-10} value={stair.run2Offset ?? 0}
|
||||
onCommit={(v) => host.onSetStairPatch({ run2Offset: v !== 0 ? v : undefined })}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export function StairSection({
|
||||
stair,
|
||||
host,
|
||||
@@ -1456,6 +1531,8 @@ export function StairSection({
|
||||
options={[
|
||||
{ value: "straight", label: t("objinfo.stair.shape.straight") },
|
||||
{ value: "L", label: t("objinfo.stair.shape.L") },
|
||||
{ value: "U", label: t("objinfo.stair.shape.U") },
|
||||
{ value: "straightLanding", label: t("objinfo.stair.shape.straightLanding") },
|
||||
{ value: "spiral", label: t("objinfo.stair.shape.spiral") },
|
||||
]}
|
||||
title={t("objinfo.stair.shape")}
|
||||
@@ -1534,6 +1611,7 @@ export function StairSection({
|
||||
onCommit={(v) => host.onSetStairColumn(v)}
|
||||
/>
|
||||
)}
|
||||
{stair.shape !== "spiral" && stair.shape !== "straight" && <StairFlightFields stair={stair} host={host} />}
|
||||
<DimensionField
|
||||
label={t("objinfo.stair.steps")}
|
||||
value={stair.stepCount}
|
||||
|
||||
+4
-1
@@ -33,6 +33,7 @@ import type {
|
||||
Project,
|
||||
SiaCategory,
|
||||
SliceTermination,
|
||||
Stair,
|
||||
StairShape,
|
||||
Vec2,
|
||||
VerticalAnchor,
|
||||
@@ -538,7 +539,7 @@ export interface PanelHostValue {
|
||||
onDeleteSectionLine: () => void;
|
||||
|
||||
// ── Treppen-Attribute (Object-Info-Panel; nur die selektierte Treppe) ───
|
||||
/** Setzt die Grundform (gerade/L/Wendel). */
|
||||
/** Setzt die Grundform (gerade/L/Wendel/U/gerade mit Podest). */
|
||||
onSetStairShape: (shape: StairShape) => void;
|
||||
/** Setzt die Laufbreite (Meter). */
|
||||
onSetStairWidth: (width: number) => void;
|
||||
@@ -556,6 +557,8 @@ export interface PanelHostValue {
|
||||
onSetStairColumn: (radius: number) => void;
|
||||
/** Weist der Treppe einen Treppentyp (Bibliothek) zu; "" löst die Zuweisung. */
|
||||
onSetStairType: (typeId: string) => void;
|
||||
/** [151] Lauf-/Podest-Parameter (Lauflängen, Drehsinn, Auge, Podesttiefe, Stufen je Lauf, Versatz). */
|
||||
onSetStairPatch: (patch: Partial<Pick<Stair, "runLength" | "run2Length" | "turn" | "gap" | "landingLength" | "run1Steps" | "midSteps" | "run2Offset">>) => void;
|
||||
|
||||
// ── Raum-Attribute (Object-Info-Panel; nur der selektierte Raum) ────────
|
||||
/** Setzt den Raum-Namen. */
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
viewBox -4.2 0 37.045 17.678
|
||||
bytes 269563
|
||||
bytes 267390
|
||||
circle 4
|
||||
g 1
|
||||
line 625
|
||||
polygon 1581
|
||||
polygon 1563
|
||||
polyline 69
|
||||
rect 1
|
||||
svg 1
|
||||
text 4
|
||||
hash ea60895e1c1610dc
|
||||
hash 84c2ca315113d7e3
|
||||
@@ -1,12 +1,15 @@
|
||||
meshes [1930]
|
||||
meshes[].color [3] x1930
|
||||
meshes [1952]
|
||||
meshes[].color [3] x1952
|
||||
meshes[].indices [108] x6
|
||||
meshes[].indices [144] x36
|
||||
meshes[].indices [144] x55
|
||||
meshes[].indices [156642]
|
||||
meshes[].indices [180]
|
||||
meshes[].indices [192] x3
|
||||
meshes[].indices [348] x6
|
||||
meshes[].indices [36] x1858
|
||||
meshes[].indices [372]
|
||||
meshes[].indices [396]
|
||||
meshes[].indices [432]
|
||||
meshes[].indices [60] x9
|
||||
meshes[].indices [72]
|
||||
meshes[].indices [84] x2
|
||||
@@ -14,18 +17,21 @@ meshes[].indices [9288]
|
||||
meshes[].indices [96] x6
|
||||
meshes[].positions [1044] x6
|
||||
meshes[].positions [108] x30
|
||||
meshes[].positions [120]
|
||||
meshes[].positions [180] x9
|
||||
meshes[].positions [192]
|
||||
meshes[].positions [216]
|
||||
meshes[].positions [222]
|
||||
meshes[].positions [24] x1826
|
||||
meshes[].positions [252] x2
|
||||
meshes[].positions [264]
|
||||
meshes[].positions [288] x6
|
||||
meshes[].positions [306] x3
|
||||
meshes[].positions [324] x6
|
||||
meshes[].positions [4746]
|
||||
meshes[].positions [72] x2
|
||||
meshes[].positions [78837]
|
||||
meshes[].positions [78] x36
|
||||
meshes[].positions [78] x55
|
||||
roofLayers [59]
|
||||
roofLayers[].color [3] x59
|
||||
roofLayers[].normal [3] x59
|
||||
@@ -33,16 +39,16 @@ roofLayers[].polygon [17] x3
|
||||
roofLayers[].polygon [4] x50
|
||||
roofLayers[].polygon [5] x6
|
||||
roofLayers[].polygon[] [3] x281
|
||||
slabs [102]
|
||||
slabs[].color [3] x102
|
||||
slabs [70]
|
||||
slabs[].color [3] x70
|
||||
slabs[].outline [12]
|
||||
slabs[].outline [14] x5
|
||||
slabs[].outline [21] x4
|
||||
slabs[].outline [24]
|
||||
slabs[].outline [33] x5
|
||||
slabs[].outline [4] x81
|
||||
slabs[].outline [4] x49
|
||||
slabs[].outline [51] x5
|
||||
slabs[].outline[] [2] x934
|
||||
slabs[].outline[] [2] x806
|
||||
walls [1489]
|
||||
walls[].color [3] x1489
|
||||
walls[].end [2] x1489
|
||||
@@ -55,4 +61,4 @@ walls[].start [2] x1489
|
||||
walls[].startCut [4] x1164
|
||||
walls[].topDrop [2] x103
|
||||
walls[].topPlane [3] x259
|
||||
hash f6fa8d0643a66fab
|
||||
hash 16331bce2f4cf49c
|
||||
@@ -1,9 +1,9 @@
|
||||
viewBox 0.1 0 6.8 7.586
|
||||
bytes 6297
|
||||
bytes 8097
|
||||
g 1
|
||||
line 7
|
||||
polygon 43
|
||||
polygon 60
|
||||
polyline 6
|
||||
rect 1
|
||||
svg 1
|
||||
hash 965767e4ac42c4f0
|
||||
hash 92c8d38935671e86
|
||||
@@ -2143,7 +2143,7 @@ describe("emitStairRailings (Handlauf/Geländer, StairType.railing)", () => {
|
||||
});
|
||||
const stairProject = (
|
||||
railing: "keine" | "links" | "rechts" | "beide",
|
||||
shape: "straight" | "L" = "straight",
|
||||
shape: "straight" | "L" | "U" = "straight",
|
||||
): Project => ({
|
||||
...sampleProject,
|
||||
stairTypes: [stairType(railing)],
|
||||
@@ -2193,8 +2193,9 @@ describe("emitStairRailings (Handlauf/Geländer, StairType.railing)", () => {
|
||||
expect(railMeshes(stairProject("beide")).length).toBe(2 * (1 + 16));
|
||||
});
|
||||
|
||||
it("L-Treppe: bewusst (noch) kein Geländer (nur gerade Läufe unterstützt)", () => {
|
||||
expect(railMeshes(stairProject("beide", "L")).length).toBe(0);
|
||||
it("[151] L- und U-Treppe: Geländer je Gehseite über das Podest (Handlauf + Pfosten)", () => {
|
||||
expect(railMeshes(stairProject("beide", "L")).length).toBeGreaterThan(2);
|
||||
expect(railMeshes(stairProject("beide", "U")).length).toBeGreaterThan(2);
|
||||
});
|
||||
|
||||
it("Handlauf-Oberkante liegt RAIL_HEIGHT (0.9 m) über Boden- bzw. Austrittshöhe", () => {
|
||||
|
||||
@@ -428,6 +428,8 @@ export interface ProjectSlice {
|
||||
// ── Treppen-Editieren ──────────────────────────────────────────────────────
|
||||
/** Verschiebt eine Treppe (Antritt) um `delta`. */
|
||||
moveStairBy: (stairId: string, delta: Vec2) => void;
|
||||
/** [151] Parameter-Griff `index` einer Podesttreppe nach `pt` ziehen (Kern `stairParam`). */
|
||||
dragStairParam: (stairId: string, index: number, pt: Vec2) => void;
|
||||
/** Generischer immutabler Patch auf eine Treppe (per ID). */
|
||||
updateStair: (
|
||||
id: string,
|
||||
@@ -1277,6 +1279,7 @@ export function createProjectSlice(
|
||||
// ── Treppen-Editieren ──────────────────────────────────────────────────
|
||||
// (coalesceKey: siehe Kommentar bei moveGripOf.)
|
||||
moveStairBy: (stairId, delta) => applyGrip({ op: "stairBy", id: stairId, delta: gripPt(delta) }, `moveStairBy:${stairId}`),
|
||||
dragStairParam: (stairId, index, pt) => applyGrip({ op: "stairParam", id: stairId, index, pt: gripPt(pt) }, `dragStairParam:${stairId}:${index}`),
|
||||
|
||||
updateStair: (id, patch) =>
|
||||
applyChange((p) => mapStair(p, id, (s) => ({ ...s, ...patch }))),
|
||||
|
||||
@@ -271,6 +271,18 @@ export interface StairInfo {
|
||||
referenz?: "links" | "mitte" | "rechts";
|
||||
/** Nur Wendel: Radius der Mittelsäule (Meter); fehlt → keine Säule. */
|
||||
centerColumn?: number;
|
||||
/** Länge des (ersten) Laufs (Meter). */
|
||||
runLength?: number;
|
||||
/** [151] L / U / gerade mit Podest: Länge des zweiten bzw. letzten Laufs; Drehsinn (+1 links, −1 rechts). */
|
||||
run2Length?: number;
|
||||
turn?: 1 | -1;
|
||||
/** [151] U: Treppenauge; U / gerade mit Podest: Podesttiefe (Meter). */
|
||||
gap?: number;
|
||||
landingLength?: number;
|
||||
/** [151] Steigungen im ersten Lauf (fehlt → nach Lauflängen), im Mittellauf (U), Versatz des Gegenlaufs (U). */
|
||||
run1Steps?: number;
|
||||
midSteps?: number;
|
||||
run2Offset?: number;
|
||||
/** Zugewiesener Treppentyp (Bibliothek, `Stair.typeId`) oder undefined. */
|
||||
typeId?: string;
|
||||
/** Geschoss, dem die Treppe zugeordnet ist. */
|
||||
@@ -279,7 +291,7 @@ export interface StairInfo {
|
||||
/** Aufgelöste absolute UK/OK (Meter). */
|
||||
zBottom: number;
|
||||
zTop: number;
|
||||
/** Nur Ortbeton (gerade/Wendel): Betonvolumen des Laufs (m³, ohne Säule). */
|
||||
/** Nur Ortbeton: Betonvolumen der Läufe (m³, ohne Säule und Podest). */
|
||||
concreteVolume?: number;
|
||||
/** Nur Ortbeton: Untersicht (m², Schalfläche; bei der Wendel die Wendelfläche). */
|
||||
soffitArea?: number;
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
openingTypedPosition,
|
||||
sheetHeightDrag,
|
||||
stairMoveHandle,
|
||||
stairParamPoints,
|
||||
wallGripPoints,
|
||||
type GripLocks,
|
||||
} from "../core";
|
||||
@@ -100,6 +101,8 @@ export function useGripEditing(opts: {
|
||||
/** Wand ändern (Höhen-Griff im Schnitt); `coalesceKey` fasst einen Zug zu EINEM Undo-Schritt. */
|
||||
updateWall: (id: string, patch: Partial<import("../model/types").Wall>, coalesceKey?: string) => void;
|
||||
moveStairBy: (id: string, delta: Vec2) => void;
|
||||
/** [151] Parameter-Griff einer Podesttreppe ziehen (Index ohne den Bewegpunkt). */
|
||||
dragStairParam?: (id: string, index: number, pt: Vec2) => void;
|
||||
moveRoomGrip: (id: string, index: number, pt: Vec2) => void;
|
||||
moveCeilingGrip: (id: string, index: number, pt: Vec2) => void;
|
||||
moveExcavationGrip: (id: string, index: number, pt: Vec2) => void;
|
||||
@@ -298,9 +301,10 @@ export function useGripEditing(opts: {
|
||||
if (selectedStairId && modelEditable) {
|
||||
const st = (project.stairs ?? []).find((s) => s.id === selectedStairId);
|
||||
if (!st) return [];
|
||||
gripOwners.push({ localIndex: 0 });
|
||||
gripOwnerRange.push([0, 0]);
|
||||
return [stairMoveHandle(st)];
|
||||
// [151] Podesttreppen: dazu die Parameter-Griffe (Lauf-Enden, Podestrand).
|
||||
const pts = [stairMoveHandle(st), ...stairParamPoints(st)];
|
||||
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
|
||||
return pts;
|
||||
}
|
||||
if (selectedTree && modelEditable && !selectedTree.locked) {
|
||||
const pts = treeGrips(selectedTree);
|
||||
@@ -844,7 +848,8 @@ export function useGripEditing(opts: {
|
||||
// sodass er nach dem Move exakt unter dem Cursor sitzt.
|
||||
if (selectedStairId) {
|
||||
const st = (project.stairs ?? []).find((s) => s.id === selectedStairId);
|
||||
if (st) moveStairBy(st.id, sub(pt, stairMoveHandle(st)));
|
||||
if (st && index > 0) opts.dragStairParam?.(st.id, index - 1, pt);
|
||||
else if (st) moveStairBy(st.id, sub(pt, stairMoveHandle(st)));
|
||||
return;
|
||||
}
|
||||
// [149] Baum: Stammmitte bzw. Kronenrand live, ein Undo-Schritt je Zug (gleicher coalesceKey).
|
||||
|
||||
@@ -1066,6 +1066,9 @@ export function usePanelHostBase(opts: {
|
||||
onSetStairReferenz: (referenz) => {
|
||||
if (selection?.kind === "stair") updateStair(selection.id, { referenz });
|
||||
},
|
||||
onSetStairPatch: (patch) => {
|
||||
if (selection?.kind === "stair") updateStair(selection.id, patch);
|
||||
},
|
||||
// Typ-Zuweisung (Bibliothek): Treppentyp per typeId; leerer String löst die
|
||||
// Zuweisung (Inline-Verhalten). Treibt u. a. die 3D-Tragart (massiv/offen).
|
||||
onSetStairType: (typeId) => {
|
||||
|
||||
@@ -382,6 +382,7 @@ export function useProjectActions(
|
||||
const setCeilingThickness = useStore((s) => s.setCeilingThickness);
|
||||
const updateStair = useStore((s) => s.updateStair);
|
||||
const moveStairBy = useStore((s) => s.moveStairBy);
|
||||
const dragStairParam = useStore((s) => s.dragStairParam);
|
||||
const updateRoom = useStore((s) => s.updateRoom);
|
||||
const moveRoomBy = useStore((s) => s.moveRoomBy);
|
||||
const moveRoomGrip = useStore((s) => s.moveRoomGrip);
|
||||
@@ -501,6 +502,7 @@ export function useProjectActions(
|
||||
setCeilingThickness,
|
||||
updateStair,
|
||||
moveStairBy,
|
||||
dragStairParam,
|
||||
updateRoom,
|
||||
moveRoomBy,
|
||||
moveRoomGrip,
|
||||
|
||||
Reference in new issue
Block a user