[180] Grau im 3D: Klassen im Darstellungsmodus „grau" als gedämpfte Geisterschicht

Kern ClassFilter mit grey/lock/ghost (Hauptmodell ohne graue Elemente, ghost nur sie; Öffnungen grau mit Klasse
oder Wirt; gesperrte nicht anwählbar), render3d ghost.rs + set_ghost_model (hell entsättigt, durchscheinend),
Viewer, natives 3D-Fenster (native.rs), CLI model3d --grey und render_png.
This commit is contained in:
Claude committed 2026-11-12 07:12:19 +00:00
1 parent cd76a2475c
commit 52925abaf2
20 files changed
+543 -54

No files matched your search

+14 -2
View File
@@ -13,7 +13,10 @@ import type { Plan } from "../../core";
import { materializeUnderlay } from "../../core";
import type { Project } from "../../model/types";
import { planSceneBin } from "../../core";
import { projectToModel3d } from "../../core";
import { ghostFilter3d, projectToModel3d } from "../../core";
import type { Hide3d } from "../../core";
type Model3d = ReturnType<typeof projectToModel3d>;
/** Sammel-Fenster: Modelländerungen werden gebündelt gepusht (nicht je Frame). */
const DEBOUNCE_MS = 200;
@@ -89,14 +92,23 @@ export function pushNativeWalls(
project: Project,
/** Explosionsabstand ([65], 0 = aus): dasselbe Modell wie im WASM-Viewport (`projectToModel3d`). */
explode = lastExplode,
/** [180] Darstellungsmodus wie im WASM-Viewport (ausgeblendete, graue Klassen; graue als `ghost`-Schicht). */
hide?: Hide3d,
): void {
if (!isTauri()) return;
lastExplode = explode;
clearTimeout(wallsTimer);
wallsTimer = setTimeout(async () => {
if (!(await isNativeEnabled())) return;
void invokeNative("push_native_walls", { walls: projectToModel3d(project, { voids: true, explode }) });
void invokeNative("push_native_walls", { walls: nativeModel3d(project, explode, hide) });
}, DEBOUNCE_MS);
}
/** [180] Modell fürs native 3D-Fenster: ohne die grauen Klassen, die stehen gedämpft in `ghost` (render3d `ghost.rs`). */
export function nativeModel3d(project: Project, explode: number, hide?: Hide3d): Model3d & { ghost?: Model3d } {
const model = projectToModel3d(project, { voids: true, explode, hide });
const ghost = ghostFilter3d(hide);
return ghost ? { ...model, ghost: projectToModel3d(project, { voids: true, explode, hide: ghost }) } : model;
}