[T3][T7][T8][T5] Merge: Wendelfläche + Handlauf-Wendel + Mittelsäule, Rotation/Loft-Befehle, Kollisionen im 3D, Import-Reparatur

Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
Claude committed 2026-10-30 09:06:15 +00:00
commit fe2fab6cf6
36 files changed
+1413 -56

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
// Kollisionen ([T8]): Liste der Treffer der letzten Prüfung. Klick wählt beide beteiligten Bauteile
// (Auswahl-Umriss im 3D) und fährt die 3D-Kamera auf die Durchdringung; im 3D sind alle Treffer als
// rote Hüllquader markiert (`clashHighlightLines`, `views/viewportContent.tsx`).
import { t } from "../i18n";
import { getState } from "../state/appStore";
import { clashSelection, type Clash } from "../analysis/clash";
import { focusCamera, viewportAvailable } from "../viewport/cameraBridge";
import { runClashAndStore, setClashSession, useClashSession } from "./clashSession";
/** Klick auf einen Treffer: Bauteile wählen, Kamera auf die Durchdringung. */
export function focusClash(c: Clash, index: number): void {
const s = getState();
const sel = clashSelection(c);
s.clearSelection();
s.setSelectedWallIds(sel.wallIds);
s.setSelectedCeilingIds(sel.ceilingIds);
s.setSelectedExtrudedSolidIds(sel.extrudedSolidIds);
s.setSelectedContextObjectIds(sel.contextObjectIds);
setClashSession({ selected: index });
const radius = Math.hypot(c.max[0] - c.min[0], c.max[1] - c.min[1], c.max[2] - c.min[2]) / 2;
if (viewportAvailable()) focusCamera(c.center, radius);
}
const itemText = (it: Clash["a"]) => `${t(`clash.kind.${it.kind}`)} ${it.id}`;
export function ClashPanel() {
const session = useClashSession();
return (
<div className="bcf-panel">
<div className="bcf-bar">
<button type="button" className="bcf-btn" disabled={session.running} onClick={() => void runClashAndStore()}>
{session.running ? t("clash.running") : t("clash.run")}
</button>
<button
type="button"
className="bcf-btn"
disabled={session.clashes.length === 0}
onClick={() => setClashSession({ clashes: [], selected: null })}
>
{t("clash.clear")}
</button>
</div>
{session.clashes.length === 0 && <div className="bcf-empty">{t("clash.empty")}</div>}
<ul className="bcf-list">
{session.clashes.map((c, k) => (
<li key={`${c.a.id}|${c.b.id}`}>
<button type="button" className={`bcf-topic${k === session.selected ? " is-active" : ""}`} onClick={() => focusClash(c, k)}>
<span className="bcf-status">{`K${k + 1}`}</span>
<span className="bcf-topic-title">{`${itemText(c.a)} ↔ ${itemText(c.b)}`}</span>
{c.volume !== null && <span className="bcf-count">{`${c.volume.toFixed(3)} m³`}</span>}
</button>
</li>
))}
</ul>
</div>
);
}
+7
View File
@@ -1461,6 +1461,13 @@ export function StairSection({
value={stair.width}
onCommit={(v) => host.onSetStairWidth(v)}
/>
{stair.shape === "spiral" && (
<DimensionField
label={t("objinfo.stair.column")}
value={stair.centerColumn ?? 0}
onCommit={(v) => host.onSetStairColumn(v)}
/>
)}
<DimensionField
label={t("objinfo.stair.steps")}
value={stair.stepCount}
+1 -1
View File
@@ -355,7 +355,7 @@ const TOOLS_2D: ToolId[] = [
"image",
];
const TOOLS_3D: ToolId[] = ["wall", "ceiling", "window", "door", "stair", "room"];
const COMMANDS_3D = ["column", "ceilingopening", "roof", "roofhole", "roofwindow", "dormer", "extrude", "solid", "solidbool", "sectionline", "viewline", "autodim", "excavation"];
const COMMANDS_3D = ["column", "ceilingopening", "roof", "roofhole", "roofwindow", "dormer", "extrude", "revolve", "loft", "solid", "solidbool", "sectionline", "viewline", "autodim", "excavation"];
const COMMANDS_EDIT = ["move", "copy", "array", "rotate", "mirror", "offset", "multiline", "trim", "break", "extend", "fillet", "chamfer", "join", "defblock", "measure"];
type ToolsView = "list" | "icons";
+12
View File
@@ -26,6 +26,7 @@ import { ElementTreePanel, ElementsTabIcon } from "./ElementTreePanel";
import { ViewSnapshotsPanel, ViewSnapshotsTabIcon } from "./ViewSnapshotsPanel";
import { LayoutsPanel, LayoutsTabIcon } from "./LayoutsPanel";
import { BcfPanel } from "./BcfPanel";
import { ClashPanel } from "./ClashPanel";
import { HistoryPanel } from "./HistoryPanel";
import {
ToolsTabIcon,
@@ -52,6 +53,7 @@ export const BUILTIN_PANEL_IDS = {
viewSnapshots: "view-snapshots",
layouts: "layouts",
bcf: "bcf",
clash: "clash",
history: "history",
} as const;
@@ -162,6 +164,16 @@ registerPanel({
render: () => <BcfPanel />,
});
// Kollisionen ([T8]) — Treffer der Kollisionsprüfung, Klick zoomt im 3D auf die Durchdringung. Nicht im
// Standard-Layout; öffnet sich beim Prüflauf („Modell > Kollisionsprüfung") bzw. über „Fenster > Panels".
registerPanel({
id: BUILTIN_PANEL_IDS.clash,
title: "nav.clash",
icon: <BcfTabIcon />,
hasDisplayMode: false,
render: () => <ClashPanel />,
});
// Verlauf ([84]) — Undo-Schritte als Liste, Klick springt zum Schritt. Nicht im Standard-Layout,
// erreichbar über „Bearbeiten > Verlauf" bzw. „Fenster > Panels".
registerPanel({
+65
View File
@@ -0,0 +1,65 @@
// Sitzungszustand der Kollisionsprüfung ([T8]): die Ergebnisse der letzten Prüfung leben ausserhalb des
// Projekts (Marker im Grundriss kommen weiterhin als Zeichnungs-Elemente), damit Liste (ClashPanel) und
// 3D-Hervorhebung (viewportContent) dieselben Treffer zeigen. Kleiner Modul-Speicher wie `bcfSession`.
import { useSyncExternalStore } from "react";
import { clashMarkerOps, runClashCheck, type Clash } from "../analysis/clash";
import { t } from "../i18n";
import { getState } from "../state/appStore";
export interface ClashSession {
clashes: Clash[];
/** Index des gewählten Treffers (Liste/Zoom) oder null. */
selected: number | null;
/** Prüfung läuft. */
running: boolean;
}
let state: ClashSession = { clashes: [], selected: null, running: false };
const listeners = new Set<() => void>();
export const getClashSession = (): ClashSession => state;
export function setClashSession(patch: Partial<ClashSession>): void {
state = { ...state, ...patch };
for (const l of listeners) l();
}
export function useClashSession(): ClashSession {
return useSyncExternalStore(
(cb) => {
listeners.add(cb);
return () => listeners.delete(cb);
},
getClashSession,
);
}
/**
* Prüfung ausführen: Ergebnis in die Sitzung (Liste + 3D-Hervorhebung), Marker in den Grundriss, Meldung.
* Läuft auf dem aktuellen Projektstand des Stores.
*/
export async function runClashAndStore(): Promise<void> {
if (state.running) return;
const st = getState();
setClashSession({ running: true });
try {
const clashes = await runClashCheck(st.project);
st.applyChange((p) => clashMarkerOps(p, clashes, st.activeCategoryCode));
setClashSession({ clashes, selected: null, running: false });
// window.alert ist im Tauri-WKWebView wirkungslos → Toast.
st.notify(
clashes.length === 0
? t("clash.none")
: `${t("clash.found")}: ${clashes.length} — ` +
clashes
.slice(0, 5)
.map((c, k) => `K${k + 1} ${c.a.kind}↔${c.b.kind}${c.volume !== null ? ` ${c.volume.toFixed(3)} m³` : ""}`)
.join(", "),
clashes.length === 0 ? "info" : "warning",
);
} catch (err) {
setClashSession({ running: false });
st.notify(`${t("clash.failed")}: ${err instanceof Error ? err.message : String(err)}`, "error");
}
}
+2
View File
@@ -530,6 +530,8 @@ export interface PanelHostValue {
onSetStairArrowStyle: (style: "line" | "filled") => void;
/** Setzt den Referenzpunkt der Laufbreite (links/mitte/rechts). */
onSetStairReferenz: (referenz: "links" | "mitte" | "rechts") => void;
/** Radius der Mittelsäule (Wendel) in Metern; ≤ 0 entfernt sie. */
onSetStairColumn: (radius: number) => void;
/** Weist der Treppe einen Treppentyp (Bibliothek) zu; "" löst die Zuweisung. */
onSetStairType: (typeId: string) => void;