Reduce wall rebuilds during window and door placement

This commit is contained in:
sudhir
2026-05-20 00:53:10 +00:00
committed by open-pascal
parent fe68dbeebd
commit d48be77f5d
7 changed files with 62 additions and 30 deletions
@@ -35,7 +35,10 @@ export const DoorSystem = () => {
clearDirty(id as AnyNodeId)
// Rebuild the parent wall so its cutout reflects the updated door geometry
if ((node as DoorNode).parentId) {
// Avoid triggering expensive wall CSG rebuilds while the door is being interactively moved/duplicated.
// The editor tools will request a final wall rebuild on commit.
const isTransient = !!(node.metadata as Record<string, unknown> | null)?.isTransient
if (!isTransient && (node as DoorNode).parentId) {
useScene.getState().dirtyNodes.add((node as DoorNode).parentId as AnyNodeId)
}
})
@@ -42,7 +42,10 @@ export const WindowSystem = () => {
clearDirty(id as AnyNodeId)
// Rebuild the parent wall so its cutout reflects the updated window geometry
if ((node as WindowNode).parentId) {
// Avoid triggering expensive wall CSG rebuilds while the window is being interactively moved/duplicated.
// The editor tools will request a final wall rebuild on commit.
const isTransient = !!(node.metadata as Record<string, unknown> | null)?.isTransient
if (!isTransient && (node as WindowNode).parentId) {
useScene.getState().dirtyNodes.add((node as WindowNode).parentId as AnyNodeId)
}
})