Merge [281] Geneigte Decken und Rampen (IFC-Datensatz der geneigten Decke auf 27, 26 bleibt Geländer)

This commit is contained in:
Claude committed 2026-11-18 00:50:05 +00:00
commit b6d8a6c2ad
60 files changed
+1273 -66

No files matched your search

@@ -137,6 +137,33 @@ export function buildElementAttributesHost(c: FlatHostOpts) {
onSetCeilingBottom: (anchor) => {
if (selection?.kind === "ceiling") patchAll("ceilings", selection.id, { bottom: anchor ?? undefined });
},
onSetCeilingSlope: (slope) => {
if (selection?.kind !== "ceiling") return;
if (slope === null) return patchAll("ceilings", selection.id, { slope: undefined });
if (!("enable" in slope)) return patchAll("ceilings", selection.id, { slope }, "ceiling-slope");
// [281] Einschalten: je Decke eine Vorgabe aus ihrer Hüllbox (längere Seite = Gefällelinie, aufwärts).
const ramp = slope.enable === "ramp";
const ids = targetIds("ceilings", selection.id);
getState().groupChanges(() => {
for (const id of ids) {
const c = (getState().project.ceilings ?? []).find((x) => x.id === id);
if (!c || c.outline.length < 3) continue;
if (c.slope) {
updateCeiling(id, { slope: { ...c.slope, ramp: ramp || undefined } });
continue;
}
const xs = c.outline.map((q) => q.x);
const ys = c.outline.map((q) => q.y);
const [x0, x1, y0, y1] = [Math.min(...xs), Math.max(...xs), Math.min(...ys), Math.max(...ys)];
const alongX = x1 - x0 >= y1 - y0;
const from = alongX ? { x: x0, y: (y0 + y1) / 2 } : { x: (x0 + x1) / 2, y: y0 };
const to = alongX ? { x: x1, y: (y0 + y1) / 2 } : { x: (x0 + x1) / 2, y: y1 };
const len = Math.hypot(to.x - from.x, to.y - from.y);
if (!(len > 0.01)) continue;
updateCeiling(id, { slope: { from, to, rise: (ramp ? 0.06 : 0.02) * len, ramp: ramp || undefined } });
}
});
},
// ── Öffnungs-Attribute (nur bei selektierter Öffnung) ──────────────────
onSetOpeningKind: (kind) => {
if (selection?.kind === "opening")
+3
View File
@@ -19,6 +19,7 @@ import { EMPTY_SELECTION, mergeSelection, single } from "./selection";
import type { Selection } from "./selection";
import type {
AttributeSource,
CeilingSlope,
DimRef,
ColumnProfile,
ContextImage,
@@ -200,6 +201,8 @@ export interface CeilingInfo {
/** Aufgelöste absolute UK/OK (Meter). */
zBottom: number;
zTop: number;
/** [281] Neigung (geneigte Decke/Rampe); fehlt = waagrecht. */
slope?: CeilingSlope;
/** Aussparungen (Treppenauge/Schacht) als BBox-Masse, Reihenfolge = Modell. */
openings: { width: number; depth: number }[];
}
+4
View File
@@ -59,6 +59,8 @@ declare global {
fakeRender: () => void;
/** [173] Linien einer Klasse (z. B. "door-lintel") im Grundriss der aktiven Ebene (alle Kategorien, 1:50, Detailgrad der Anzeige). */
planLines: (cls: string) => number;
/** [281] Neigung je Decke (`id` → {rise, ramp}; waagrecht fehlt). */
ceilingSlopes: () => Record<string, { rise: number; ramp: boolean }>;
/** [173] Modelldarstellung der aktiven Ebene (Feld `modelViewOptionId`). */
modelView: () => string | undefined;
/** [173] Schnitt der aktiven Ebene (1:50, Detailgrad der Anzeige): Zahl der Wand-Schnittflächen und ihre Fläche (m²). */
@@ -157,6 +159,8 @@ export function installTestHooks(): void {
},
notices: () => getState().notifications.map((n) => n.message),
fakeRender: () => fakeRender(),
ceilingSlopes: () =>
Object.fromEntries((getState().project.ceilings ?? []).flatMap((c) => (c.slope ? [[c.id, { rise: c.slope.rise, ramp: !!c.slope.ramp }]] : []))),
planLines: (cls) => {
const s = getState();
const codes = new Set<string>();