// 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 { fromIdLists } from "../state/selection"; 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.setSelection(fromIdLists(sel)); 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 (
{session.clashes.length === 0 &&
{t("clash.empty")}
}
); }