[187] [143] [T6] Höhenlinien-Sätze im Schnitt (Geländelinie, Erdreich, Höhen-Griff je Linie); Treppen-Antritt (baseOffset, Griff, Objekt-Info)

This commit is contained in:
Claude committed 2026-11-12 03:04:07 +00:00
1 parent f356b91eed
commit 3ce43f3844
24 files changed
+304 -42

No files matched your search

+1 -1
View File
@@ -74,7 +74,7 @@ export { arcApex, drawingVertices, gripPt, openEdges, polylineEdgeGrips, ringEdg
export { verticalExtents } from "../geometry/grips";
export type { VerticalExtent } from "../geometry/grips";
export type { GripRequest, RingKind } from "../geometry/grips";
export { clampInside, coincidentGripPoints, excavationGripPoints, gripArcWallRadius, gripArcWallResize, gripArcWallTarget, gripAxisLock, gripEdgeTarget, gripPolar, gripPolarPoint, openingGripPoint, openingSheetSlide, openingTypedPosition, sheetHeightDrag, snapSheetHeight, stairMoveHandle, stairParamPoints, wallGripPoints } from "../geometry/gripDrag";
export { clampInside, coincidentGripPoints, excavationGripPoints, gripArcWallRadius, gripArcWallResize, gripArcWallTarget, gripAxisLock, gripEdgeTarget, gripPolar, gripPolarPoint, openingGripPoint, openingSheetSlide, openingTypedPosition, contourMarks, sheetHeightDrag, snapSheetHeight, 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";
+24 -2
View File
@@ -112,10 +112,10 @@ export function gripEdgeTarget(edge: EdgeGrip, raw: Vec2, d: EdgeDrive = {}): Ve
export type SheetHeightKind =
| "wallTop" | "openingTop" | "openingBottom" | "wallBottom" | "ceilingTop" | "ceilingBottom"
// Dach: Traufe, First (bzw. Neigung), Attika; Treppe: Austritt; Gelände: Oberkante (Netz) bzw. Sohle (Baugrube).
| "roofEave" | "roofTop" | "parapetTop" | "stairTop" | "contextTop" | "contextBottom";
| "roofEave" | "roofTop" | "parapetTop" | "stairTop" | "stairBottom" | "contextTop" | "contextBottom" | "contourLine";
const SHEET_KIND = { wallTop: 0, openingTop: 1, openingBottom: 2, wallBottom: 3, ceilingTop: 4, ceilingBottom: 6,
roofEave: 7, roofTop: 8, parapetTop: 9, stairTop: 10, contextTop: 4, contextBottom: 7 } as const;
roofEave: 7, roofTop: 8, parapetTop: 9, stairTop: 10, stairBottom: 11, contextTop: 4, contextBottom: 7, contourLine: 4 } as const;
/**
* Höhen-Griff auf die Blatt-Höhe `y` ziehen (1-cm-Raster, `free` = ohne): neue Ober-/Unterkante im Blatt für die
@@ -134,6 +134,28 @@ export function sheetHeightDrag(
return f.length ? { top: f[0], bottom: f[1] } : { top: g.top, bottom: g.bottom };
}
/**
* [187] Griffe der Höhenlinien eines Satzes im Schnitt: Schnittpunkte der Linien mit der Schnittebene (Punkt `base` im
* Grundriss, Richtung `uAxis`) als Blatt-Koordinate `{ u, z }` samt Index der Linie im Satz. Gleiche Rechnung und Bezugshöhe
* wie die Geländelinie des Schnitts (Kern `sheet_height::contour_marks`).
*/
export function contourMarks(
contours: readonly { z: number; closed: boolean; pts: readonly Vec2[] }[],
base: Vec2,
uAxis: Vec2,
referenceMasl: number | undefined,
): { u: number; z: number; index: number }[] {
const flat: number[] = [base.x, base.y, uAxis.x, uAxis.y, referenceMasl ?? NaN];
for (const c of contours) {
flat.push(c.z, c.closed ? 1 : 0, c.pts.length);
for (const q of c.pts) flat.push(q.x, q.y);
}
const f = core().grip_contour_marks(Float64Array.from(flat));
const out: { u: number; z: number; index: number }[] = [];
for (let i = 0; i + 2 < f.length; i += 3) out.push({ u: f[i], z: f[i + 1], index: f[i + 2] });
return out;
}
/** Fang einer Blatt-Höhe auf die nächste Kote aus `levels` innerhalb `tol` Metern. */
export function snapSheetHeight(y: number, levels: readonly number[], tol: number): number {
return core().grip_snap_height(y, Float64Array.from(levels), tol);
+1 -1
View File
@@ -57,7 +57,7 @@ export type GripRequest =
| { op: "deletePoint"; id: string; index: number }
| { op: "vertexType"; id: string; index: number; vertexType: "corner" | "arc" | "spline" }
// [187] Höhen-Griff im Schnitt/in der Ansicht: Kante `kind` auf die Blatt-Höhe `a` (absolutes Z) ziehen (Kern `sheet_height.rs`).
| { op: "sheetHeight"; kind: SheetHeightKind; id: string; a: number; b?: number; free?: boolean; newId: string; newName: string }
| { op: "sheetHeight"; kind: SheetHeightKind; id: string; a: number; b?: number; index?: number; free?: boolean; newId: string; newName: string }
| { op: "wallThickness" | "ceilingThickness"; id: string; thickness: number; newId: string; newName: string }
// [144] Wandöffnung gleiten lassen (Kern `opening_slide`): Griff-Zug nach `pt` bzw. Position `a` ab Wandanfang.
| { op: "openingSlide"; id: string; pt: P }
+1
View File
@@ -901,6 +901,7 @@ export const de = {
"objinfo.stair.profile.flach": "Flachstahl",
"objinfo.stair.steps": "Stufenanzahl",
"objinfo.stair.rise": "Steighöhe (gesamt)",
"objinfo.stair.baseOffset": "Antritt über Geschoss-Basis",
"objinfo.stair.riser": "Steigungshöhe",
"objinfo.stair.tread": "Auftrittstiefe",
"objinfo.stair.concreteVolume": "Betonvolumen Lauf",
+1
View File
@@ -885,6 +885,7 @@ export const en: Record<TranslationKey, string> = {
"objinfo.stair.profile.flach": "Flat bar",
"objinfo.stair.steps": "Step count",
"objinfo.stair.rise": "Total rise",
"objinfo.stair.baseOffset": "Start above floor base",
"objinfo.stair.riser": "Riser height",
"objinfo.stair.tread": "Tread depth",
"objinfo.stair.concreteVolume": "Concrete volume (flight)",
+5
View File
@@ -3512,6 +3512,11 @@ export type Stair = {
* beim Auflösen die Geschosshöhe des zugehörigen Geschosses.
*/
totalRise?: number;
/**
* [187] Antrittsversatz in Metern: Höhe des Antritts über der Basis des Geschosses (negativ = darunter). Der
* Austritt bleibt auf `totalRise` ab Geschoss-Basis, die Steigung ist `totalRise - baseOffset`. Fehlt es: 0.
*/
baseOffset?: number;
/**
* Anzahl der Steigungen (Setzstufen). Die Trittanzahl = stepCount (letzte =
* Austritt aufs obere Geschoss). Steigungshöhe = totalRise / stepCount.
+2
View File
@@ -551,6 +551,8 @@ export interface PanelHostValue {
onSetStairSteps: (stepCount: number) => void;
/** Setzt die Gesamt-Steighöhe (Meter, OKFF → OKFF). */
onSetStairRise: (totalRise: number) => void;
/** [187] Antritt über/unter der Geschoss-Basis (Meter). */
onSetStairBaseOffset: (baseOffset: number) => void;
/** Setzt die Laufrichtung (aufwärts/abwärts). */
onSetStairUp: (up: boolean) => void;
/** Setzt die Pfeil-Darstellung (offener Winkel- vs. gefüllter Vollpfeil). */
+5
View File
@@ -259,6 +259,11 @@ export function StairSection({
value={stair.totalRise}
onCommit={(v) => host.onSetStairRise(v)}
/>
<DimensionField
label={t("objinfo.stair.baseOffset")}
value={stair.baseOffset ?? 0}
onCommit={(v) => host.onSetStairBaseOffset(v)}
/>
{/* Abgeleitete Werte (read-only). */}
<div className="objinfo-field">
@@ -212,6 +212,9 @@ export function buildElementAttributesHost(c: FlatHostOpts) {
if (selection?.kind === "stair" && totalRise > 0)
updateStair(selection.id, { totalRise });
},
onSetStairBaseOffset: (baseOffset) => {
if (selection?.kind === "stair" && Number.isFinite(baseOffset)) updateStair(selection.id, { baseOffset });
},
onSetStairUp: (up) => {
if (selection?.kind === "stair") updateStair(selection.id, { up });
},
+3 -3
View File
@@ -423,7 +423,7 @@ export interface ProjectSlice {
/** Setzt die Gesamtdicke einer Decke (thickness-Übersteuerung, Meter). */
setCeilingThickness: (ceilingId: string, thickness: number) => void;
/** [187] Höhen-Griff im Schnitt/in der Ansicht: Kante `kind` des Bauteils `id` auf die Blatt-Höhe `y` (absolutes Z) ziehen. */
sheetHeightGrip: (kind: SheetHeightKind, id: string, y: number, free?: boolean, from?: number) => void;
sheetHeightGrip: (kind: SheetHeightKind, id: string, y: number, free?: boolean, from?: number, index?: number) => void;
// ── Öffnungs-Editieren (Object-Info-Panel) ────────────────────────────────
/** Generischer immutabler Patch auf eine Öffnung (per ID). */
@@ -1323,14 +1323,14 @@ export function createProjectSlice(
newName: t("default.ceilingTypeSingle", { thickness: thickness.toFixed(2) }),
}),
sheetHeightGrip: (kind, id, y, free, from) =>
sheetHeightGrip: (kind, id, y, free, from, index) =>
applyGrip({
op: "sheetHeight",
kind,
id,
a: y,
b: from, // Griffhöhe vor dem Zug: Dach, Treppe, Gelände zählen den Zug relativ
index, // Höhenlinie `contourLine`
free: !!free,
newId: `ct-${Date.now()}`,
newName: t("default.ceilingTypeSingle", { thickness: "{t}" }), // {t} setzt der Kern ein
+3 -1
View File
@@ -268,8 +268,10 @@ export interface StairInfo {
width: number;
/** Stufenanzahl (Setzstufen). */
stepCount: number;
/** Gesamt-Steighöhe (Meter, OKFF → OKFF). */
/** Austrittshöhe ab Geschoss-Basis (Meter; ohne Antrittsversatz die Gesamt-Steighöhe OKFF → OKFF). */
totalRise: number;
/** [187] Antritt über (negativ: unter) der Geschoss-Basis (Meter); die Steigung ist totalRise − baseOffset. */
baseOffset: number;
/** Abgeleitete Steigungshöhe (Meter) = totalRise / stepCount. */
riserHeight: number;
/** Abgeleitete Auftrittstiefe (Meter). */
+5 -2
View File
@@ -38,7 +38,9 @@ declare global {
openings: { id: string; sillHeight: number; height: number }[];
/** [187] Teil 2: Traufe (absolutes Z), Neigung, Attika-Höhe; Steighöhe der Treppen; Sohle der Baugruben. */
roofs: { id: string; eave: number; pitchDeg: number; parapetHeight: number }[];
stairs: { id: string; totalRise: number }[];
stairs: { id: string; totalRise: number; baseOffset: number }[];
/** [187] Höhe je Höhenlinie der Höhenlinien-Sätze. */
contours: { id: string; zs: number[] }[];
excavations: { id: string; bottom: number }[];
};
/** [144] Auswahl setzen (wie ein Klick), z. B. `{ openings: ["D1"] }`. */
@@ -108,7 +110,8 @@ export function installTestHooks(): void {
const f = p.drawingLevels.find((l) => l.id === r.floorId);
return { id: r.id, eave: r.baseElevation ?? (f ? (f.baseElevation ?? 0) + (f.floorHeight ?? 0) : 0), pitchDeg: r.pitchDeg, parapetHeight: r.parapetHeight ?? 0 };
}),
stairs: (p.stairs ?? []).map((st) => ({ id: st.id, totalRise: st.totalRise ?? NaN })),
stairs: (p.stairs ?? []).map((st) => ({ id: st.id, totalRise: st.totalRise ?? NaN, baseOffset: st.baseOffset ?? 0 })),
contours: (p.context ?? []).flatMap((c) => (c.type === "contourSet" ? [{ id: c.id, zs: c.contours.map((k) => k.z) }] : [])),
excavations: (p.context ?? []).flatMap((c) => (c.type === "excavation" ? [{ id: c.id, bottom: c.bottom }] : [])),
};
},
+24 -10
View File
@@ -29,6 +29,7 @@ import {
openingSheetSlide,
openingTypedPosition,
sheetHeightDrag,
contourMarks,
snapSheetHeight,
stairMoveHandle,
stairParamPoints,
@@ -96,7 +97,7 @@ export function useGripEditing(opts: {
* Schnitt-u-Achse `uAxis` (Grundriss, Einheit) aufs Bauteil übertragen, die
* Vorschau zeigt die verschobenen Schnittflächen im Blatt.
*/
sheet?: { levelId: string; uAxis: Vec2 } | null;
sheet?: { levelId: string; uAxis: Vec2; /** Punkt der Schnittlinie im Grundriss (u = 0). */ base?: Vec2 } | null;
visibleCodes: Set<string>;
/** Papier-Massstab (1:N) — die Bemassungs-Griffe hängen daran (Papier-mm). */
scaleDenominator: number;
@@ -109,7 +110,7 @@ export function useGripEditing(opts: {
/** [144] Wandöffnung gleiten lassen (Kern: Wand, Bogenwand, Nachbaröffnungen). */
slideOpening: (id: string, to: { position: number } | { pt: Vec2 }, coalesceKey?: string) => void;
/** [187] Höhen-Griff im Schnitt/in der Ansicht anwenden (Kern `sheet_height.rs`); EIN Aufruf je Zug. */
sheetHeightGrip: (kind: SheetHeightKind, id: string, y: number, free?: boolean, from?: number) => void;
sheetHeightGrip: (kind: SheetHeightKind, id: string, y: number, free?: boolean, from?: number, index?: number) => 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;
@@ -294,6 +295,8 @@ export function useGripEditing(opts: {
bottom: number;
/** Decke mit gebundener Unterkante: die Oberkante ändert dann die Dicke statt die Platte zu verschieben. */
bottomFixed?: boolean;
/** Höhenlinie (`contourLine`): Index im Satz. */
index?: number;
};
// [187] Höhen-Griffe im Schnitt/in der Ansicht: Wand (Ober-/Unterkante), Öffnung (Brüstung, Sturz), Decke (Ober-/
// Unterkante). Breite (u, entlang der Schnittlinie) aus den gezeichneten Umrissen, Höhen (v) aus dem Modell; die
@@ -357,18 +360,29 @@ export function useGripEditing(opts: {
}
return out;
}
// Treppe: Austrittshöhe (Steighöhe ab Geschoss-Basis; der Antritt liegt im Modell fest auf der Basis).
// Treppe: Austritt (Steighöhe ab Geschoss-Basis) oben rechts, Antritt (`baseOffset`) unten links. Der Kern zählt beide
// Züge relativ zur gezeichneten Kante.
if (selectedStairId) {
const st = (project.stairs ?? []).find((x) => x.id === selectedStairId);
const bb = st && bbox("stair", st.id);
if (!st || !bb || st.locked) return [];
return [{ kind: "stairTop", pt: { x: bb.u1, y: bb.v1 }, id: st.id, u0: bb.u0, u1: bb.u1, base: bb.v0, top: bb.v1, bottom: bb.v0 }];
const common = { id: st.id, u0: bb.u0, u1: bb.u1, base: bb.v0, top: bb.v1, bottom: bb.v0 };
return [
{ kind: "stairTop", pt: { x: bb.u1, y: bb.v1 }, ...common },
{ kind: "stairBottom", pt: { x: bb.u0, y: bb.v0 }, ...common },
];
}
// Gelände: Netz (Oberkante des Profils) bzw. Baugrube (Sohle) um die Differenz versetzen. Höhenlinien-Sätze
// zeichnet der Schnitt nicht — dafür gibt es keinen Griff.
// Gelände: Netz (Oberkante des Profils) bzw. Baugrube (Sohle) um die Differenz versetzen; Höhenlinien-Satz: ein Griff
// je Schnittpunkt einer Linie mit der Schnittebene (Höhe der Linie ändern).
if (selection.contextObjects.length === 1) {
const o = (project.context ?? []).find((c) => c.id === selection.contextObjects[0]);
if (!o) return [];
if (o.type === "contourSet") {
if (!sheet.base) return [];
return contourMarks(o.contours, sheet.base, sheet.uAxis, project.referenceElevationMasl).map((m) => ({
kind: "contourLine" as const, pt: { x: m.u, y: m.z }, id: o.id, u0: m.u, u1: m.u, base: m.z, top: m.z, bottom: m.z, index: m.index,
}));
}
if (o.type === "terrainMesh" || o.type === "importedMesh") {
const bb = bbox("context", o.id);
if (!bb) return [];
@@ -812,7 +826,7 @@ export function useGripEditing(opts: {
/** Aufgeschobene Öffnungs-Verschiebung im Schnitt/in der Ansicht (neue `position`). */
const pendingOpeningMoveRef = useRef<{ id: string; position: number } | null>(null);
/** Aufgeschobene Höhen-Änderung im Schnitt (Kante `kind` auf die Höhe `y`, Kern `sheetHeight`). */
const pendingSheetHeightRef = useRef<{ kind: SheetHeightKind; id: string; y: number; free: boolean; from: number } | null>(null);
const pendingSheetHeightRef = useRef<{ kind: SheetHeightKind; id: string; y: number; free: boolean; from: number; index?: number } | null>(null);
/** [187] Kote der gezogenen Kante im laufenden Höhen-Zug (Tab-Feld „Kote“). */
const sheetDragRef = useRef<{ z: number } | null>(null);
/** Laufendes Blatt-Delta (u, Meter) eines Zugs im Schnitt (s. moveInSheet). */
@@ -1151,7 +1165,7 @@ export function useGripEditing(opts: {
}
const ins = gripOwners[index];
// [191] Scheitel-Griff einer Bogenkante: Bulge live, ein Undo-Schritt je Zug.
if (modelEditable && ins?.arcSeg != null && ins.ring && ins.ring.kind !== "excavation" && ins.ring.kind !== "polyline") {
if (modelEditable && ins?.arcSeg != null && ins.ring && ins.ring.kind !== "excavation" && ins.ring.kind !== "polyline" && ins.ring.kind !== "contours") {
storeState().setRingArc(ins.ring.kind, ins.ring.id, ins.arcSeg, pt);
return;
}
@@ -1343,7 +1357,7 @@ export function useGripEditing(opts: {
const commitPendingGripChanges = () => {
const ph = pendingSheetHeightRef.current;
pendingSheetHeightRef.current = null;
if (ph) sheetHeightGrip(ph.kind, ph.id, ph.y, ph.free, ph.from);
if (ph) sheetHeightGrip(ph.kind, ph.id, ph.y, ph.free, ph.from, ph.index);
const pc = pendingContourRef.current;
pendingContourRef.current = null;
if (pc) {
@@ -1625,7 +1639,7 @@ export function useGripEditing(opts: {
const z = g.kind.endsWith("Top") ? top : bottom;
// Wand-UK über der Oberkante: die Mindesthöhe (0.30 m) hält sie fest; unter der Geschoss-Basis ist sie erlaubt (Kellerwand).
const clamped = g.kind === "wallBottom" && y > g.top - 0.3;
pendingSheetHeightRef.current = { kind: g.kind, id: g.id, y, free, from: g.pt.y };
pendingSheetHeightRef.current = { kind: g.kind, id: g.id, y, free, from: g.pt.y, index: g.index };
sheetDragRef.current = { z };
setDraft({
preview: [{
+1 -1
View File
@@ -73,7 +73,7 @@ export function useGripInputs(opts: {
if (!plane) return null;
const u = sectionUAxisModel(plane);
const len = Math.hypot(u.x, u.y) || 1;
return { levelId: activeLevel.id, uAxis: { x: u.x / len, y: u.y / len } };
return { levelId: activeLevel.id, uAxis: { x: u.x / len, y: u.y / len }, base: { x: plane.point[0], y: plane.point[2] } };
}, [activeLevel]);
// Snap ohne Entwurfspunkte (Griff-Ziehen, s. useGripEditing).