[65] Explosion: 3D-Griffe, Arbeitsebene, Boden-Spuren und natives 3D-Fenster folgen dem Versatz (WIP)

This commit is contained in:
Claude committed 2026-11-05 00:19:23 +00:00
1 parent a721c1b895
commit 0e648e930b
10 files changed
+133 -22

No files matched your search

+9 -2
View File
@@ -82,18 +82,25 @@ export function pushNativeScene(plan: Plan): void {
* Öffnungs-Teilquadern plus Deckenplatten — ans native 3D-Fenster schieben.
* No-op ohne Tauri.
*/
export function pushNativeWalls(project: Project): void {
export function pushNativeWalls(
project: Project,
/** Explosionsabstand ([65], 0 = aus): dasselbe Modell wie im WASM-Viewport (`projectToModel3d`). */
explode = lastExplode,
): void {
if (!isTauri()) return;
lastProject = project;
lastExplode = explode;
clearTimeout(wallsTimer);
wallsTimer = setTimeout(async () => {
if (!(await isNativeEnabled())) return;
void invokeNative("push_native_walls", { walls: projectToModel3d(project, { voids: true }) });
void invokeNative("push_native_walls", { walls: projectToModel3d(project, { voids: true, explode }) });
}, DEBOUNCE_MS);
}
/** Letztes an {@link pushNativeWalls} übergebenes Projekt (für den Re-Push unten). */
let lastProject: Project | null = null;
/** Letzter Explosionsabstand (Re-Push nach truck-Ergebnis behält ihn). */
let lastExplode = 0;
// truck-Extrusionen (s. toWalls3d.ts emitExtrudedSolids) laden WASM asynchron;
// ohne diesen Re-Push nach Abschluss bliebe eine fertige Extrusion im nativen
+11 -4
View File
@@ -36,7 +36,7 @@ import { levelMarkerPrimitives, levelMarksEnabled } from "../core";
import { unitsForLevel } from "../tools/displayUnits";
import { setSheetOwnerOutlines, setSheetSnapSegments, snapSegmentsFromPrimitives } from "../tools/sheetSnapGeometry";
import { pushNativeScene, pushNativeWalls } from "./plan/nativeSync";
import { selectionHighlightLines } from "../core";
import { explodeFloorOffsets, selectionHighlightLines } from "../core";
import { clashHighlightLines } from "../analysis/clash";
import { useClashSession } from "../panels/clashSession";
import { applyGroupDimmingToPlan } from "../state/groupActions";
@@ -274,6 +274,11 @@ export const Content = memo(function Content({
const clashes = useClashSession().clashes;
// Explosionsaxonometrie ([65]): Hervorhebung folgt dem auseinandergezogenen 3D-Modell.
const explode = useStore((s) => (s.explode3d ? s.explode3dGap : 0));
// Arbeitsebene/Raster/Zeichnen-Vorschau auf dem gehobenen aktiven Geschoss.
const explodeLift = useMemo(
() => (explode > 0 ? (explodeFloorOffsets(project, explode)[level.id] ?? 0) : 0),
[project, explode, level.id],
);
const { walls, ceilings, openings, stairs, roofs, contextObjects } = selection;
const selectionLines = useMemo(
() =>
@@ -310,7 +315,7 @@ export const Content = memo(function Content({
renderMode={renderMode}
detail={detail}
view3d={view3d}
groundElevation={level.baseElevation ?? 0}
groundElevation={(level.baseElevation ?? 0) + explodeLift}
gridVisible={grid3dVisible}
onToggleGrid={onToggleGrid3d}
section3d={section3d}
@@ -828,9 +833,11 @@ function LevelPlanView({
useEffect(() => {
pushNativeScene(plan);
}, [plan]);
// Explosionsaxonometrie ([65]) auch im nativen 3D-Fenster.
const explode = useStore((s) => (s.explode3d ? s.explode3dGap : 0));
useEffect(() => {
pushNativeWalls(project);
}, [project]);
pushNativeWalls(project, explode);
}, [project, explode]);
return (
<section className="pane">