@pascal-app/nodes 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -8
- package/dist/agent-operations/index.d.ts +5 -0
- package/dist/agent-operations/index.d.ts.map +1 -1
- package/dist/agent-operations/index.js +10 -0
- package/dist/agent-tools/index.d.ts +195 -0
- package/dist/agent-tools/index.d.ts.map +1 -1
- package/dist/agent-tools/index.js +82 -2
- package/dist/beam/actions/move-endpoint.d.ts +24 -0
- package/dist/beam/actions/move-endpoint.d.ts.map +1 -0
- package/dist/beam/actions/move-endpoint.js +54 -0
- package/dist/beam/definition.d.ts +65 -0
- package/dist/beam/definition.d.ts.map +1 -0
- package/dist/beam/definition.edit.d.ts +4 -0
- package/dist/beam/definition.edit.d.ts.map +1 -0
- package/dist/beam/definition.edit.js +133 -0
- package/dist/beam/definition.js +4 -0
- package/dist/beam/definition.render.d.ts +6 -0
- package/dist/beam/definition.render.d.ts.map +1 -0
- package/dist/beam/definition.render.js +32 -0
- package/dist/beam/draft-settings.d.ts +17 -0
- package/dist/beam/draft-settings.d.ts.map +1 -0
- package/dist/beam/draft-settings.js +81 -0
- package/dist/beam/drafting.d.ts +35 -0
- package/dist/beam/drafting.d.ts.map +1 -0
- package/dist/beam/drafting.js +103 -0
- package/dist/beam/floorplan-affordances.d.ts +8 -0
- package/dist/beam/floorplan-affordances.d.ts.map +1 -0
- package/dist/beam/floorplan-affordances.js +40 -0
- package/dist/beam/floorplan-move.d.ts +11 -0
- package/dist/beam/floorplan-move.d.ts.map +1 -0
- package/dist/beam/floorplan-move.js +54 -0
- package/dist/beam/floorplan.d.ts +11 -0
- package/dist/beam/floorplan.d.ts.map +1 -0
- package/dist/beam/floorplan.js +91 -0
- package/dist/beam/geometry.d.ts +19 -0
- package/dist/beam/geometry.d.ts.map +1 -0
- package/dist/beam/geometry.js +63 -0
- package/dist/beam/index.d.ts +3 -0
- package/dist/beam/index.d.ts.map +1 -0
- package/dist/beam/index.js +2 -0
- package/dist/beam/move-endpoint-tool.d.ts +21 -0
- package/dist/beam/move-endpoint-tool.d.ts.map +1 -0
- package/dist/beam/move-endpoint-tool.js +49 -0
- package/dist/beam/move-tool.d.ts +12 -0
- package/dist/beam/move-tool.d.ts.map +1 -0
- package/dist/beam/move-tool.js +114 -0
- package/dist/beam/panel-model.d.ts +28 -0
- package/dist/beam/panel-model.d.ts.map +1 -0
- package/dist/beam/panel-model.js +123 -0
- package/dist/beam/panel.d.ts +13 -0
- package/dist/beam/panel.d.ts.map +1 -0
- package/dist/beam/panel.js +107 -0
- package/dist/beam/parametrics.d.ts +3 -0
- package/dist/beam/parametrics.d.ts.map +1 -0
- package/dist/beam/parametrics.js +4 -0
- package/dist/beam/renderer.d.ts +13 -0
- package/dist/beam/renderer.d.ts.map +1 -0
- package/dist/beam/renderer.js +36 -0
- package/dist/beam/schema.d.ts +2 -0
- package/dist/beam/schema.d.ts.map +1 -0
- package/dist/beam/schema.js +1 -0
- package/dist/beam/tool.d.ts +13 -0
- package/dist/beam/tool.d.ts.map +1 -0
- package/dist/beam/tool.js +152 -0
- package/dist/block/definition.d.ts +67 -7
- package/dist/block/definition.d.ts.map +1 -1
- package/dist/block/definition.edit.d.ts +4 -0
- package/dist/block/definition.edit.d.ts.map +1 -0
- package/dist/block/definition.edit.js +28 -0
- package/dist/block/definition.js +5 -144
- package/dist/block/definition.render.d.ts +11 -0
- package/dist/block/definition.render.d.ts.map +1 -0
- package/dist/block/definition.render.js +120 -0
- package/dist/box-vent/definition.d.ts +103 -29
- package/dist/box-vent/definition.d.ts.map +1 -1
- package/dist/box-vent/definition.edit.d.ts +4 -0
- package/dist/box-vent/definition.edit.d.ts.map +1 -0
- package/dist/box-vent/definition.edit.js +151 -0
- package/dist/box-vent/definition.js +4 -212
- package/dist/box-vent/definition.render.d.ts +6 -0
- package/dist/box-vent/definition.render.d.ts.map +1 -0
- package/dist/box-vent/definition.render.js +40 -0
- package/dist/box-vent/move-tool.d.ts.map +1 -1
- package/dist/box-vent/move-tool.js +6 -5
- package/dist/box-vent/panel.d.ts.map +1 -1
- package/dist/box-vent/panel.js +8 -7
- package/dist/building/definition.d.ts +49 -11
- package/dist/building/definition.d.ts.map +1 -1
- package/dist/building/definition.edit.d.ts +4 -0
- package/dist/building/definition.edit.d.ts.map +1 -0
- package/dist/building/definition.edit.js +10 -0
- package/dist/building/definition.js +4 -54
- package/dist/building/definition.render.d.ts +6 -0
- package/dist/building/definition.render.d.ts.map +1 -0
- package/dist/building/definition.render.js +38 -0
- package/dist/builtin-definitions.d.ts +9784 -0
- package/dist/builtin-definitions.d.ts.map +1 -0
- package/dist/builtin-definitions.js +113 -0
- package/dist/builtin-edit-contributions.d.ts +9608 -0
- package/dist/builtin-edit-contributions.d.ts.map +1 -0
- package/dist/builtin-edit-contributions.js +112 -0
- package/dist/builtin-plugin-metadata.d.ts +5 -0
- package/dist/builtin-plugin-metadata.d.ts.map +1 -0
- package/dist/builtin-plugin-metadata.js +1 -0
- package/dist/cabinet/batchable.d.ts +10 -0
- package/dist/cabinet/batchable.d.ts.map +1 -0
- package/dist/cabinet/batchable.js +12 -0
- package/dist/cabinet/compartment-card.d.ts.map +1 -1
- package/dist/cabinet/compartment-card.js +142 -46
- package/dist/cabinet/countertop-layout.d.ts +5 -0
- package/dist/cabinet/countertop-layout.d.ts.map +1 -1
- package/dist/cabinet/definition.d.ts +497 -25
- package/dist/cabinet/definition.d.ts.map +1 -1
- package/dist/cabinet/definition.edit.d.ts +5 -0
- package/dist/cabinet/definition.edit.d.ts.map +1 -0
- package/dist/cabinet/definition.edit.js +1375 -0
- package/dist/cabinet/definition.js +6 -2112
- package/dist/cabinet/definition.render.d.ts +66 -0
- package/dist/cabinet/definition.render.d.ts.map +1 -0
- package/dist/cabinet/definition.render.js +751 -0
- package/dist/cabinet/dimension-input.d.ts +6 -0
- package/dist/cabinet/dimension-input.d.ts.map +1 -0
- package/dist/cabinet/dimension-input.js +8 -0
- package/dist/cabinet/essential-controls.d.ts.map +1 -1
- package/dist/cabinet/essential-controls.js +82 -17
- package/dist/cabinet/index.d.ts +1 -1
- package/dist/cabinet/index.d.ts.map +1 -1
- package/dist/cabinet/index.js +1 -1
- package/dist/cabinet/kitchen-catalog.d.ts +17 -4
- package/dist/cabinet/kitchen-catalog.d.ts.map +1 -1
- package/dist/cabinet/kitchen-catalog.js +45 -7
- package/dist/cabinet/kitchen-collection.d.ts.map +1 -1
- package/dist/cabinet/kitchen-collection.js +21 -5
- package/dist/cabinet/kitchen-module-actions.d.ts.map +1 -1
- package/dist/cabinet/kitchen-module-actions.js +108 -15
- package/dist/cabinet/neighbor-placement.d.ts +10 -0
- package/dist/cabinet/neighbor-placement.d.ts.map +1 -1
- package/dist/cabinet/panel.d.ts.map +1 -1
- package/dist/cabinet/panel.js +127 -50
- package/dist/cabinet/placement-dimensions.d.ts +36 -2
- package/dist/cabinet/placement-dimensions.d.ts.map +1 -1
- package/dist/cabinet/placement-dimensions.js +68 -2
- package/dist/cabinet/run-finishing.d.ts +5 -0
- package/dist/cabinet/run-finishing.d.ts.map +1 -1
- package/dist/cabinet/run-ops.d.ts +5 -0
- package/dist/cabinet/run-ops.d.ts.map +1 -1
- package/dist/cabinet/run-panel.d.ts.map +1 -1
- package/dist/cabinet/run-panel.js +203 -52
- package/dist/cabinet/system.js +1 -1
- package/dist/cabinet/tool.d.ts.map +1 -1
- package/dist/cabinet/tool.js +275 -19
- package/dist/cabinet/wall-snap.d.ts +5 -1
- package/dist/cabinet/wall-snap.d.ts.map +1 -1
- package/dist/cabinet/wall-snap.js +2 -2
- package/dist/ceiling/build-up-section.d.ts +7 -0
- package/dist/ceiling/build-up-section.d.ts.map +1 -0
- package/dist/ceiling/build-up-section.js +57 -0
- package/dist/ceiling/definition.d.ts +152 -19
- package/dist/ceiling/definition.d.ts.map +1 -1
- package/dist/ceiling/definition.edit.d.ts +4 -0
- package/dist/ceiling/definition.edit.d.ts.map +1 -0
- package/dist/ceiling/definition.edit.js +125 -0
- package/dist/ceiling/definition.js +4 -205
- package/dist/ceiling/definition.render.d.ts +6 -0
- package/dist/ceiling/definition.render.d.ts.map +1 -0
- package/dist/ceiling/definition.render.js +71 -0
- package/dist/ceiling/floorplan-affordances.d.ts +112 -0
- package/dist/ceiling/floorplan-affordances.d.ts.map +1 -1
- package/dist/ceiling/materials.d.ts +5 -0
- package/dist/ceiling/materials.d.ts.map +1 -1
- package/dist/ceiling/materials.js +17 -0
- package/dist/ceiling/panel-model.d.ts +13 -0
- package/dist/ceiling/panel-model.d.ts.map +1 -0
- package/dist/ceiling/panel-model.js +49 -0
- package/dist/ceiling/panel.d.ts.map +1 -1
- package/dist/ceiling/panel.js +82 -18
- package/dist/ceiling/renderer.d.ts.map +1 -1
- package/dist/ceiling/renderer.js +10 -4
- package/dist/ceiling/tool.d.ts.map +1 -1
- package/dist/ceiling/tool.js +24 -4
- package/dist/chimney/definition.d.ts +186 -17
- package/dist/chimney/definition.d.ts.map +1 -1
- package/dist/chimney/definition.edit.d.ts +4 -0
- package/dist/chimney/definition.edit.d.ts.map +1 -0
- package/dist/chimney/definition.edit.js +219 -0
- package/dist/chimney/definition.js +4 -390
- package/dist/chimney/definition.render.d.ts +6 -0
- package/dist/chimney/definition.render.d.ts.map +1 -0
- package/dist/chimney/definition.render.js +59 -0
- package/dist/chimney/move-tool.d.ts.map +1 -1
- package/dist/chimney/move-tool.js +6 -4
- package/dist/chimney/panel.d.ts.map +1 -1
- package/dist/chimney/panel.js +113 -41
- package/dist/column/__bench__/geometry.d.ts +2 -0
- package/dist/column/__bench__/geometry.d.ts.map +1 -0
- package/dist/column/__bench__/geometry.js +36 -0
- package/dist/column/bounds.d.ts +7 -0
- package/dist/column/bounds.d.ts.map +1 -0
- package/dist/column/bounds.js +127 -0
- package/dist/column/definition.d.ts +372 -20
- package/dist/column/definition.d.ts.map +1 -1
- package/dist/column/definition.edit.d.ts +4 -0
- package/dist/column/definition.edit.d.ts.map +1 -0
- package/dist/column/definition.edit.js +323 -0
- package/dist/column/definition.js +4 -436
- package/dist/column/definition.render.d.ts +6 -0
- package/dist/column/definition.render.d.ts.map +1 -0
- package/dist/column/definition.render.js +81 -0
- package/dist/column/edit-policy.d.ts +5 -0
- package/dist/column/edit-policy.d.ts.map +1 -0
- package/dist/column/edit-policy.js +43 -0
- package/dist/column/floorplan-affordances.d.ts.map +1 -1
- package/dist/column/floorplan-affordances.js +2 -0
- package/dist/column/floorplan-move.d.ts.map +1 -1
- package/dist/column/floorplan-move.js +5 -1
- package/dist/column/floorplan.d.ts.map +1 -1
- package/dist/column/floorplan.js +50 -91
- package/dist/column/geometry.d.ts +13 -0
- package/dist/column/geometry.d.ts.map +1 -0
- package/dist/column/geometry.js +294 -0
- package/dist/column/hosted-resize.d.ts +31 -3
- package/dist/column/hosted-resize.d.ts.map +1 -1
- package/dist/column/hosted-resize.js +7 -1
- package/dist/column/inspector-highlight.d.ts +29 -0
- package/dist/column/inspector-highlight.d.ts.map +1 -0
- package/dist/column/inspector-highlight.js +166 -0
- package/dist/column/paint.d.ts.map +1 -1
- package/dist/column/paint.js +12 -2
- package/dist/column/panel.d.ts.map +1 -1
- package/dist/column/panel.js +459 -283
- package/dist/column/parametrics.js +1 -1
- package/dist/column/post-options.d.ts +10 -0
- package/dist/column/post-options.d.ts.map +1 -0
- package/dist/column/post-options.js +71 -0
- package/dist/column/post-placement.d.ts +78 -0
- package/dist/column/post-placement.d.ts.map +1 -0
- package/dist/column/post-placement.js +157 -0
- package/dist/column/post-section.d.ts +17 -0
- package/dist/column/post-section.d.ts.map +1 -0
- package/dist/column/post-section.js +95 -0
- package/dist/column/post-tool.d.ts +11 -0
- package/dist/column/post-tool.d.ts.map +1 -0
- package/dist/column/post-tool.js +94 -0
- package/dist/column/preset-gallery.d.ts +8 -0
- package/dist/column/preset-gallery.d.ts.map +1 -0
- package/dist/column/preset-gallery.js +98 -0
- package/dist/column/presets.d.ts +16 -0
- package/dist/column/presets.d.ts.map +1 -0
- package/dist/column/presets.js +96 -0
- package/dist/column/property-preview.d.ts +8 -0
- package/dist/column/property-preview.d.ts.map +1 -0
- package/dist/column/property-preview.js +50 -0
- package/dist/column/renderer.d.ts +13 -1
- package/dist/column/renderer.d.ts.map +1 -1
- package/dist/column/renderer.js +174 -198
- package/dist/column/shape.d.ts +4 -4
- package/dist/column/shape.d.ts.map +1 -1
- package/dist/column/shape.js +1 -1
- package/dist/column/surface.d.ts.map +1 -1
- package/dist/column/surface.js +15 -8
- package/dist/column/tool.d.ts +3 -10
- package/dist/column/tool.d.ts.map +1 -1
- package/dist/column/tool.js +34 -11
- package/dist/construction-dimension/definition.d.ts +129 -3
- package/dist/construction-dimension/definition.d.ts.map +1 -1
- package/dist/construction-dimension/definition.edit.d.ts +4 -0
- package/dist/construction-dimension/definition.edit.d.ts.map +1 -0
- package/dist/construction-dimension/definition.edit.js +32 -0
- package/dist/construction-dimension/definition.js +4 -83
- package/dist/construction-dimension/definition.render.d.ts +6 -0
- package/dist/construction-dimension/definition.render.d.ts.map +1 -0
- package/dist/construction-dimension/definition.render.js +53 -0
- package/dist/construction-dimension/floorplan-tool.d.ts.map +1 -1
- package/dist/construction-dimension/floorplan-tool.js +2 -2
- package/dist/cupola/definition.d.ts +95 -10
- package/dist/cupola/definition.d.ts.map +1 -1
- package/dist/cupola/definition.edit.d.ts +4 -0
- package/dist/cupola/definition.edit.d.ts.map +1 -0
- package/dist/cupola/definition.edit.js +103 -0
- package/dist/cupola/definition.js +4 -148
- package/dist/cupola/definition.render.d.ts +6 -0
- package/dist/cupola/definition.render.d.ts.map +1 -0
- package/dist/cupola/definition.render.js +43 -0
- package/dist/cupola/move-tool.d.ts.map +1 -1
- package/dist/cupola/move-tool.js +6 -5
- package/dist/cupola/panel.d.ts.map +1 -1
- package/dist/cupola/panel.js +14 -7
- package/dist/definition-contributions.d.ts +14 -0
- package/dist/definition-contributions.d.ts.map +1 -0
- package/dist/definition-contributions.js +8 -0
- package/dist/door/actions.d.ts +7 -0
- package/dist/door/actions.d.ts.map +1 -0
- package/dist/door/actions.js +32 -0
- package/dist/door/contextual-dimensions.d.ts.map +1 -1
- package/dist/door/contextual-dimensions.js +11 -1
- package/dist/door/definition.d.ts +350 -22
- package/dist/door/definition.d.ts.map +1 -1
- package/dist/door/definition.edit.d.ts +4 -0
- package/dist/door/definition.edit.d.ts.map +1 -0
- package/dist/door/definition.edit.js +246 -0
- package/dist/door/definition.js +4 -314
- package/dist/door/definition.render.d.ts +6 -0
- package/dist/door/definition.render.d.ts.map +1 -0
- package/dist/door/definition.render.js +88 -0
- package/dist/door/floorplan-affordances.d.ts.map +1 -1
- package/dist/door/floorplan-affordances.js +5 -2
- package/dist/door/floorplan-move.d.ts.map +1 -1
- package/dist/door/floorplan-move.js +34 -9
- package/dist/door/floorplan.d.ts +2 -0
- package/dist/door/floorplan.d.ts.map +1 -1
- package/dist/door/floorplan.js +89 -16
- package/dist/door/mechanism.d.ts.map +1 -1
- package/dist/door/mechanism.js +1 -2
- package/dist/door/move-tool.d.ts.map +1 -1
- package/dist/door/move-tool.js +81 -35
- package/dist/door/paint.d.ts +2 -7
- package/dist/door/paint.d.ts.map +1 -1
- package/dist/door/paint.js +26 -2
- package/dist/door/panel.d.ts.map +1 -1
- package/dist/door/panel.js +242 -90
- package/dist/door/parametrics.js +1 -1
- package/dist/door/placement.d.ts.map +1 -1
- package/dist/door/placement.js +9 -2
- package/dist/door/swing.d.ts +22 -0
- package/dist/door/swing.d.ts.map +1 -0
- package/dist/door/swing.js +36 -0
- package/dist/door/tool.d.ts.map +1 -1
- package/dist/door/tool.js +77 -29
- package/dist/dormer/definition.d.ts +240 -11
- package/dist/dormer/definition.d.ts.map +1 -1
- package/dist/dormer/definition.edit.d.ts +4 -0
- package/dist/dormer/definition.edit.d.ts.map +1 -0
- package/dist/dormer/definition.edit.js +214 -0
- package/dist/dormer/definition.js +4 -319
- package/dist/dormer/definition.render.d.ts +6 -0
- package/dist/dormer/definition.render.d.ts.map +1 -0
- package/dist/dormer/definition.render.js +52 -0
- package/dist/dormer/panel-actions-section.d.ts.map +1 -1
- package/dist/dormer/panel-actions-section.js +3 -1
- package/dist/dormer/panel-position-section.d.ts.map +1 -1
- package/dist/dormer/panel-position-section.js +4 -3
- package/dist/dormer/panel-windows-section.d.ts.map +1 -1
- package/dist/dormer/panel-windows-section.js +38 -1
- package/dist/dormer/panel.d.ts.map +1 -1
- package/dist/dormer/panel.js +24 -18
- package/dist/downspout/definition.d.ts +108 -16
- package/dist/downspout/definition.d.ts.map +1 -1
- package/dist/downspout/definition.edit.d.ts +4 -0
- package/dist/downspout/definition.edit.d.ts.map +1 -0
- package/dist/downspout/definition.edit.js +134 -0
- package/dist/downspout/definition.js +4 -188
- package/dist/downspout/definition.render.d.ts +6 -0
- package/dist/downspout/definition.render.d.ts.map +1 -0
- package/dist/downspout/definition.render.js +46 -0
- package/dist/downspout/inspector-editors.d.ts.map +1 -1
- package/dist/downspout/inspector-editors.js +3 -2
- package/dist/duct-fitting/definition.d.ts +99 -11
- package/dist/duct-fitting/definition.d.ts.map +1 -1
- package/dist/duct-fitting/definition.edit.d.ts +4 -0
- package/dist/duct-fitting/definition.edit.d.ts.map +1 -0
- package/dist/duct-fitting/definition.edit.js +49 -0
- package/dist/duct-fitting/definition.js +4 -135
- package/dist/duct-fitting/definition.render.d.ts +6 -0
- package/dist/duct-fitting/definition.render.d.ts.map +1 -0
- package/dist/duct-fitting/definition.render.js +82 -0
- package/dist/duct-fitting/floorplan.js +1 -1
- package/dist/duct-fitting/geometry.js +2 -1
- package/dist/duct-fitting/inspector-editors.d.ts.map +1 -1
- package/dist/duct-fitting/inspector-editors.js +6 -1
- package/dist/duct-fitting/move-tool.d.ts.map +1 -1
- package/dist/duct-fitting/move-tool.js +19 -13
- package/dist/duct-fitting/selection.d.ts.map +1 -1
- package/dist/duct-fitting/selection.js +92 -80
- package/dist/duct-fitting/tool.d.ts.map +1 -1
- package/dist/duct-fitting/tool.js +11 -2
- package/dist/duct-segment/continuation.d.ts +2 -2
- package/dist/duct-segment/continuation.d.ts.map +1 -1
- package/dist/duct-segment/continuation.js +53 -2
- package/dist/duct-segment/definition.d.ts +91 -3
- package/dist/duct-segment/definition.d.ts.map +1 -1
- package/dist/duct-segment/definition.edit.d.ts +4 -0
- package/dist/duct-segment/definition.edit.d.ts.map +1 -0
- package/dist/duct-segment/definition.edit.js +100 -0
- package/dist/duct-segment/definition.js +4 -181
- package/dist/duct-segment/definition.render.d.ts +6 -0
- package/dist/duct-segment/definition.render.d.ts.map +1 -0
- package/dist/duct-segment/definition.render.js +89 -0
- package/dist/duct-segment/edit-inspector.d.ts +5 -0
- package/dist/duct-segment/edit-inspector.d.ts.map +1 -0
- package/dist/duct-segment/edit-inspector.js +163 -0
- package/dist/duct-segment/edit-operation.d.ts +17 -0
- package/dist/duct-segment/edit-operation.d.ts.map +1 -0
- package/dist/duct-segment/edit-operation.js +283 -0
- package/dist/duct-segment/floorplan.js +1 -1
- package/dist/duct-segment/geometry.d.ts +0 -40
- package/dist/duct-segment/geometry.d.ts.map +1 -1
- package/dist/duct-segment/geometry.js +2 -77
- package/dist/duct-segment/move-tool.d.ts.map +1 -1
- package/dist/duct-segment/move-tool.js +34 -35
- package/dist/duct-segment/parametrics.d.ts.map +1 -1
- package/dist/duct-segment/parametrics.js +2 -35
- package/dist/duct-segment/profile.d.ts +42 -0
- package/dist/duct-segment/profile.d.ts.map +1 -0
- package/dist/duct-segment/profile.js +78 -0
- package/dist/duct-segment/selection.d.ts.map +1 -1
- package/dist/duct-segment/selection.js +112 -53
- package/dist/duct-segment/tool.d.ts.map +1 -1
- package/dist/duct-segment/tool.js +103 -27
- package/dist/duct-terminal/definition.d.ts +68 -12
- package/dist/duct-terminal/definition.d.ts.map +1 -1
- package/dist/duct-terminal/definition.edit.d.ts +4 -0
- package/dist/duct-terminal/definition.edit.d.ts.map +1 -0
- package/dist/duct-terminal/definition.edit.js +14 -0
- package/dist/duct-terminal/definition.js +4 -87
- package/dist/duct-terminal/definition.render.d.ts +6 -0
- package/dist/duct-terminal/definition.render.d.ts.map +1 -0
- package/dist/duct-terminal/definition.render.js +66 -0
- package/dist/duct-terminal/geometry.d.ts.map +1 -1
- package/dist/duct-terminal/geometry.js +2 -1
- package/dist/duct-terminal/parametrics.d.ts.map +1 -1
- package/dist/duct-terminal/parametrics.js +1 -0
- package/dist/duct-terminal/ports.js +1 -1
- package/dist/duct-terminal/tool.d.ts.map +1 -1
- package/dist/duct-terminal/tool.js +11 -2
- package/dist/elevator/__bench__/runtime.d.ts +2 -0
- package/dist/elevator/__bench__/runtime.d.ts.map +1 -0
- package/dist/elevator/__bench__/runtime.js +38 -0
- package/dist/elevator/definition.d.ts +117 -10
- package/dist/elevator/definition.d.ts.map +1 -1
- package/dist/elevator/definition.edit.d.ts +4 -0
- package/dist/elevator/definition.edit.d.ts.map +1 -0
- package/dist/elevator/definition.edit.js +177 -0
- package/dist/elevator/definition.js +4 -258
- package/dist/elevator/definition.render.d.ts +11 -0
- package/dist/elevator/definition.render.d.ts.map +1 -0
- package/dist/elevator/definition.render.js +96 -0
- package/dist/elevator/floorplan-affordances.d.ts.map +1 -1
- package/dist/elevator/floorplan-affordances.js +11 -9
- package/dist/elevator/floorplan.d.ts +19 -0
- package/dist/elevator/floorplan.d.ts.map +1 -1
- package/dist/elevator/floorplan.js +3 -9
- package/dist/elevator/inspection.d.ts +17 -0
- package/dist/elevator/inspection.d.ts.map +1 -0
- package/dist/elevator/inspection.js +78 -0
- package/dist/elevator/panel.d.ts.map +1 -1
- package/dist/elevator/panel.js +177 -102
- package/dist/elevator/parametrics.d.ts +1 -1
- package/dist/elevator/parametrics.d.ts.map +1 -1
- package/dist/elevator/parametrics.js +7 -10
- package/dist/elevator/presets.d.ts +17 -0
- package/dist/elevator/presets.d.ts.map +1 -0
- package/dist/elevator/presets.js +52 -0
- package/dist/elevator/renderer.d.ts +2 -1
- package/dist/elevator/renderer.d.ts.map +1 -1
- package/dist/elevator/renderer.edit.d.ts +5 -0
- package/dist/elevator/renderer.edit.d.ts.map +1 -0
- package/dist/elevator/renderer.edit.js +8 -0
- package/dist/elevator/renderer.js +159 -60
- package/dist/elevator/tool.d.ts +2 -0
- package/dist/elevator/tool.d.ts.map +1 -0
- package/dist/elevator/tool.js +250 -0
- package/dist/eyebrow-vent/definition.d.ts +97 -11
- package/dist/eyebrow-vent/definition.d.ts.map +1 -1
- package/dist/eyebrow-vent/definition.edit.d.ts +4 -0
- package/dist/eyebrow-vent/definition.edit.d.ts.map +1 -0
- package/dist/eyebrow-vent/definition.edit.js +106 -0
- package/dist/eyebrow-vent/definition.js +4 -152
- package/dist/eyebrow-vent/definition.render.d.ts +6 -0
- package/dist/eyebrow-vent/definition.render.d.ts.map +1 -0
- package/dist/eyebrow-vent/definition.render.js +43 -0
- package/dist/eyebrow-vent/move-tool.d.ts.map +1 -1
- package/dist/eyebrow-vent/move-tool.js +6 -5
- package/dist/eyebrow-vent/panel.d.ts.map +1 -1
- package/dist/eyebrow-vent/panel.js +16 -6
- package/dist/fence/definition.d.ts +186 -17
- package/dist/fence/definition.d.ts.map +1 -1
- package/dist/fence/definition.edit.d.ts +4 -0
- package/dist/fence/definition.edit.d.ts.map +1 -0
- package/dist/fence/definition.edit.js +282 -0
- package/dist/fence/definition.js +5 -413
- package/dist/fence/definition.render.d.ts +8 -0
- package/dist/fence/definition.render.d.ts.map +1 -0
- package/dist/fence/definition.render.js +124 -0
- package/dist/fence/drafting.d.ts +2 -3
- package/dist/fence/drafting.d.ts.map +1 -1
- package/dist/fence/drafting.js +2 -3
- package/dist/fence/inspector-editors.d.ts.map +1 -1
- package/dist/fence/inspector-editors.js +64 -21
- package/dist/fence/move-endpoint-tool.d.ts.map +1 -1
- package/dist/fence/move-endpoint-tool.js +12 -3
- package/dist/fence/system.d.ts.map +1 -1
- package/dist/fence/system.js +13 -0
- package/dist/fence/tool.js +2 -2
- package/dist/fence-feature/actions.d.ts.map +1 -1
- package/dist/fence-feature/actions.js +5 -2
- package/dist/fence-feature/definition.d.ts +270 -3
- package/dist/fence-feature/definition.d.ts.map +1 -1
- package/dist/fence-feature/definition.edit.d.ts +5 -0
- package/dist/fence-feature/definition.edit.d.ts.map +1 -0
- package/dist/fence-feature/definition.edit.js +69 -0
- package/dist/fence-feature/definition.js +5 -116
- package/dist/fence-feature/definition.render.d.ts +9 -0
- package/dist/fence-feature/definition.render.d.ts.map +1 -0
- package/dist/fence-feature/definition.render.js +69 -0
- package/dist/fence-feature/inspector.d.ts.map +1 -1
- package/dist/fence-feature/inspector.js +150 -34
- package/dist/fence-feature/move-session.d.ts +1 -1
- package/dist/floor-opening/definition.d.ts +58 -2
- package/dist/floor-opening/definition.d.ts.map +1 -1
- package/dist/floor-opening/definition.edit.d.ts +4 -0
- package/dist/floor-opening/definition.edit.d.ts.map +1 -0
- package/dist/floor-opening/definition.edit.js +11 -0
- package/dist/floor-opening/definition.js +4 -41
- package/dist/floor-opening/definition.render.d.ts +6 -0
- package/dist/floor-opening/definition.render.d.ts.map +1 -0
- package/dist/floor-opening/definition.render.js +32 -0
- package/dist/floor-opening/floorplan.d.ts +29 -6
- package/dist/floor-opening/floorplan.d.ts.map +1 -1
- package/dist/floor-opening/floorplan.js +172 -14
- package/dist/guide/definition.d.ts +65 -9
- package/dist/guide/definition.d.ts.map +1 -1
- package/dist/guide/definition.edit.d.ts +4 -0
- package/dist/guide/definition.edit.d.ts.map +1 -0
- package/dist/guide/definition.edit.js +4 -0
- package/dist/guide/definition.js +4 -53
- package/dist/guide/definition.render.d.ts +6 -0
- package/dist/guide/definition.render.d.ts.map +1 -0
- package/dist/guide/definition.render.js +45 -0
- package/dist/gutter/definition.d.ts +113 -18
- package/dist/gutter/definition.d.ts.map +1 -1
- package/dist/gutter/definition.edit.d.ts +4 -0
- package/dist/gutter/definition.edit.d.ts.map +1 -0
- package/dist/gutter/definition.edit.js +121 -0
- package/dist/gutter/definition.js +4 -176
- package/dist/gutter/definition.render.d.ts +6 -0
- package/dist/gutter/definition.render.d.ts.map +1 -0
- package/dist/gutter/definition.render.js +44 -0
- package/dist/gutter/downspouts-panel.d.ts.map +1 -1
- package/dist/gutter/downspouts-panel.js +14 -2
- package/dist/gutter/move-tool.d.ts.map +1 -1
- package/dist/gutter/move-tool.js +5 -4
- package/dist/hvac-equipment/definition.d.ts +72 -12
- package/dist/hvac-equipment/definition.d.ts.map +1 -1
- package/dist/hvac-equipment/definition.edit.d.ts +4 -0
- package/dist/hvac-equipment/definition.edit.d.ts.map +1 -0
- package/dist/hvac-equipment/definition.edit.js +13 -0
- package/dist/hvac-equipment/definition.js +4 -92
- package/dist/hvac-equipment/definition.render.d.ts +6 -0
- package/dist/hvac-equipment/definition.render.d.ts.map +1 -0
- package/dist/hvac-equipment/definition.render.js +72 -0
- package/dist/hvac-equipment/floorplan.js +1 -1
- package/dist/hvac-equipment/geometry.d.ts.map +1 -1
- package/dist/hvac-equipment/geometry.js +2 -1
- package/dist/hvac-equipment/parametrics.d.ts.map +1 -1
- package/dist/hvac-equipment/parametrics.js +1 -0
- package/dist/hvac-equipment/ports.js +1 -1
- package/dist/hvac-equipment/tool.d.ts.map +1 -1
- package/dist/hvac-equipment/tool.js +3 -2
- package/dist/i18n/definition-messages.d.ts +5 -0
- package/dist/i18n/definition-messages.d.ts.map +1 -0
- package/dist/i18n/definition-messages.js +771 -0
- package/dist/imported-mesh/definition.d.ts +54 -4
- package/dist/imported-mesh/definition.d.ts.map +1 -1
- package/dist/imported-mesh/definition.edit.d.ts +4 -0
- package/dist/imported-mesh/definition.edit.d.ts.map +1 -0
- package/dist/imported-mesh/definition.edit.js +5 -0
- package/dist/imported-mesh/definition.js +4 -40
- package/dist/imported-mesh/definition.render.d.ts +6 -0
- package/dist/imported-mesh/definition.render.d.ts.map +1 -0
- package/dist/imported-mesh/definition.render.js +36 -0
- package/dist/index.d.ts +7 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -135
- package/dist/item/authored-params.d.ts.map +1 -1
- package/dist/item/authored-params.js +19 -4
- package/dist/item/definition.d.ts +280 -31
- package/dist/item/definition.d.ts.map +1 -1
- package/dist/item/definition.edit.d.ts +4 -0
- package/dist/item/definition.edit.d.ts.map +1 -0
- package/dist/item/definition.edit.js +206 -0
- package/dist/item/definition.js +4 -356
- package/dist/item/definition.render.d.ts +6 -0
- package/dist/item/definition.render.d.ts.map +1 -0
- package/dist/item/definition.render.js +128 -0
- package/dist/item/floorplan.d.ts +1 -1
- package/dist/item/floorplan.d.ts.map +1 -1
- package/dist/item/floorplan.js +2 -2
- package/dist/item/panel.d.ts.map +1 -1
- package/dist/item/panel.js +9 -7
- package/dist/item/renderer.d.ts.map +1 -1
- package/dist/item/renderer.js +2 -2
- package/dist/lean-to-extension/definition.d.ts +177 -3
- package/dist/lean-to-extension/definition.d.ts.map +1 -1
- package/dist/lean-to-extension/definition.edit.d.ts +4 -0
- package/dist/lean-to-extension/definition.edit.d.ts.map +1 -0
- package/dist/lean-to-extension/definition.edit.js +392 -0
- package/dist/lean-to-extension/definition.js +4 -433
- package/dist/lean-to-extension/definition.render.d.ts +6 -0
- package/dist/lean-to-extension/definition.render.d.ts.map +1 -0
- package/dist/lean-to-extension/definition.render.js +46 -0
- package/dist/level/definition.d.ts +49 -8
- package/dist/level/definition.d.ts.map +1 -1
- package/dist/level/definition.edit.d.ts +4 -0
- package/dist/level/definition.edit.d.ts.map +1 -0
- package/dist/level/definition.edit.js +4 -0
- package/dist/level/definition.js +4 -60
- package/dist/level/definition.render.d.ts +6 -0
- package/dist/level/definition.render.d.ts.map +1 -0
- package/dist/level/definition.render.js +53 -0
- package/dist/lineset/definition.d.ts +49 -14
- package/dist/lineset/definition.d.ts.map +1 -1
- package/dist/lineset/definition.edit.d.ts +4 -0
- package/dist/lineset/definition.edit.d.ts.map +1 -0
- package/dist/lineset/definition.edit.js +38 -0
- package/dist/lineset/definition.js +4 -119
- package/dist/lineset/definition.render.d.ts +6 -0
- package/dist/lineset/definition.render.d.ts.map +1 -0
- package/dist/lineset/definition.render.js +72 -0
- package/dist/lineset/floorplan.js +1 -1
- package/dist/lineset/geometry.js +1 -1
- package/dist/lineset/move-tool.d.ts.map +1 -1
- package/dist/lineset/move-tool.js +14 -7
- package/dist/liquid-line/definition.d.ts +47 -15
- package/dist/liquid-line/definition.d.ts.map +1 -1
- package/dist/liquid-line/definition.edit.d.ts +4 -0
- package/dist/liquid-line/definition.edit.d.ts.map +1 -0
- package/dist/liquid-line/definition.edit.js +31 -0
- package/dist/liquid-line/definition.js +4 -111
- package/dist/liquid-line/definition.render.d.ts +6 -0
- package/dist/liquid-line/definition.render.d.ts.map +1 -0
- package/dist/liquid-line/definition.render.js +70 -0
- package/dist/liquid-line/floorplan.js +1 -1
- package/dist/liquid-line/geometry.js +1 -1
- package/dist/liquid-line/tool.d.ts.map +1 -1
- package/dist/liquid-line/tool.js +10 -3
- package/dist/measurement/definition.d.ts +126 -3
- package/dist/measurement/definition.d.ts.map +1 -1
- package/dist/measurement/definition.edit.d.ts +4 -0
- package/dist/measurement/definition.edit.d.ts.map +1 -0
- package/dist/measurement/definition.edit.js +26 -0
- package/dist/measurement/definition.js +4 -67
- package/dist/measurement/definition.render.d.ts +6 -0
- package/dist/measurement/definition.render.d.ts.map +1 -0
- package/dist/measurement/definition.render.js +43 -0
- package/dist/measurement/floorplan.d.ts.map +1 -1
- package/dist/measurement/floorplan.js +3 -2
- package/dist/measurement/renderer.d.ts.map +1 -1
- package/dist/measurement/renderer.js +2 -3
- package/dist/measurement/selection.d.ts.map +1 -1
- package/dist/measurement/selection.js +2 -2
- package/dist/measurement/tool.d.ts +3 -3
- package/dist/measurement/tool.d.ts.map +1 -1
- package/dist/measurement/tool.js +9 -9
- package/dist/pipe-fitting/definition.d.ts +73 -9
- package/dist/pipe-fitting/definition.d.ts.map +1 -1
- package/dist/pipe-fitting/definition.edit.d.ts +4 -0
- package/dist/pipe-fitting/definition.edit.d.ts.map +1 -0
- package/dist/pipe-fitting/definition.edit.js +47 -0
- package/dist/pipe-fitting/definition.js +4 -105
- package/dist/pipe-fitting/definition.render.d.ts +6 -0
- package/dist/pipe-fitting/definition.render.d.ts.map +1 -0
- package/dist/pipe-fitting/definition.render.js +54 -0
- package/dist/pipe-fitting/floorplan.js +1 -1
- package/dist/pipe-fitting/geometry.js +1 -1
- package/dist/pipe-fitting/move-tool.d.ts +1 -1
- package/dist/pipe-fitting/move-tool.d.ts.map +1 -1
- package/dist/pipe-fitting/move-tool.js +28 -22
- package/dist/pipe-fitting/parametrics.d.ts.map +1 -1
- package/dist/pipe-fitting/parametrics.js +1 -0
- package/dist/pipe-fitting/ports.js +1 -1
- package/dist/pipe-fitting/selection.d.ts.map +1 -1
- package/dist/pipe-fitting/selection.js +73 -29
- package/dist/pipe-fitting/tool.d.ts.map +1 -1
- package/dist/pipe-fitting/tool.js +3 -2
- package/dist/pipe-segment/collar-connection.d.ts +12 -0
- package/dist/pipe-segment/collar-connection.d.ts.map +1 -0
- package/dist/pipe-segment/collar-connection.js +58 -0
- package/dist/pipe-segment/connect-operation.d.ts +9 -0
- package/dist/pipe-segment/connect-operation.d.ts.map +1 -0
- package/dist/pipe-segment/connect-operation.js +44 -0
- package/dist/pipe-segment/continuation.d.ts +3 -2
- package/dist/pipe-segment/continuation.d.ts.map +1 -1
- package/dist/pipe-segment/continuation.js +60 -1
- package/dist/pipe-segment/definition.d.ts +78 -13
- package/dist/pipe-segment/definition.d.ts.map +1 -1
- package/dist/pipe-segment/definition.edit.d.ts +4 -0
- package/dist/pipe-segment/definition.edit.d.ts.map +1 -0
- package/dist/pipe-segment/definition.edit.js +48 -0
- package/dist/pipe-segment/definition.js +4 -132
- package/dist/pipe-segment/definition.render.d.ts +6 -0
- package/dist/pipe-segment/definition.render.d.ts.map +1 -0
- package/dist/pipe-segment/definition.render.js +78 -0
- package/dist/pipe-segment/floorplan.d.ts +1 -1
- package/dist/pipe-segment/floorplan.d.ts.map +1 -1
- package/dist/pipe-segment/floorplan.js +34 -1
- package/dist/pipe-segment/geometry.d.ts.map +1 -1
- package/dist/pipe-segment/geometry.js +2 -1
- package/dist/pipe-segment/grade-affordance.d.ts +8 -0
- package/dist/pipe-segment/grade-affordance.d.ts.map +1 -0
- package/dist/pipe-segment/grade-affordance.js +116 -0
- package/dist/pipe-segment/grade-inspector.d.ts +5 -0
- package/dist/pipe-segment/grade-inspector.d.ts.map +1 -0
- package/dist/pipe-segment/grade-inspector.js +91 -0
- package/dist/pipe-segment/grade-label.d.ts +7 -0
- package/dist/pipe-segment/grade-label.d.ts.map +1 -0
- package/dist/pipe-segment/grade-label.js +32 -0
- package/dist/pipe-segment/grade-operation.d.ts +22 -0
- package/dist/pipe-segment/grade-operation.d.ts.map +1 -0
- package/dist/pipe-segment/grade-operation.js +114 -0
- package/dist/pipe-segment/move-tool.d.ts.map +1 -1
- package/dist/pipe-segment/move-tool.js +38 -15
- package/dist/pipe-segment/offset-inspector.d.ts +5 -0
- package/dist/pipe-segment/offset-inspector.d.ts.map +1 -0
- package/dist/pipe-segment/offset-inspector.js +112 -0
- package/dist/pipe-segment/offset-operation.d.ts +9 -0
- package/dist/pipe-segment/offset-operation.d.ts.map +1 -0
- package/dist/pipe-segment/offset-operation.js +104 -0
- package/dist/pipe-segment/parametrics.d.ts.map +1 -1
- package/dist/pipe-segment/parametrics.js +1 -9
- package/dist/pipe-segment/resize-inspector.d.ts +5 -0
- package/dist/pipe-segment/resize-inspector.d.ts.map +1 -0
- package/dist/pipe-segment/resize-inspector.js +75 -0
- package/dist/pipe-segment/resize-operation.d.ts +8 -0
- package/dist/pipe-segment/resize-operation.d.ts.map +1 -0
- package/dist/pipe-segment/resize-operation.js +143 -0
- package/dist/pipe-segment/run-move.d.ts +65 -0
- package/dist/pipe-segment/run-move.d.ts.map +1 -0
- package/dist/pipe-segment/run-move.js +110 -0
- package/dist/pipe-segment/selection.d.ts.map +1 -1
- package/dist/pipe-segment/selection.js +122 -178
- package/dist/pipe-segment/slope.d.ts +3 -0
- package/dist/pipe-segment/slope.d.ts.map +1 -1
- package/dist/pipe-segment/slope.js +47 -0
- package/dist/pipe-segment/tool.d.ts.map +1 -1
- package/dist/pipe-segment/tool.js +123 -28
- package/dist/pipe-trap/definition.d.ts +54 -9
- package/dist/pipe-trap/definition.d.ts.map +1 -1
- package/dist/pipe-trap/definition.edit.d.ts +4 -0
- package/dist/pipe-trap/definition.edit.d.ts.map +1 -0
- package/dist/pipe-trap/definition.edit.js +13 -0
- package/dist/pipe-trap/definition.js +4 -59
- package/dist/pipe-trap/definition.render.d.ts +6 -0
- package/dist/pipe-trap/definition.render.d.ts.map +1 -0
- package/dist/pipe-trap/definition.render.js +43 -0
- package/dist/pipe-trap/geometry.d.ts.map +1 -1
- package/dist/pipe-trap/geometry.js +2 -1
- package/dist/pipe-trap/parametrics.d.ts.map +1 -1
- package/dist/pipe-trap/parametrics.js +1 -0
- package/dist/pipe-trap/tool.d.ts.map +1 -1
- package/dist/pipe-trap/tool.js +7 -2
- package/dist/procedural-item/definition.d.ts +734 -3
- package/dist/procedural-item/definition.d.ts.map +1 -1
- package/dist/procedural-item/definition.edit.d.ts +4 -0
- package/dist/procedural-item/definition.edit.d.ts.map +1 -0
- package/dist/procedural-item/definition.edit.js +255 -0
- package/dist/procedural-item/definition.js +4 -325
- package/dist/procedural-item/definition.render.d.ts +6 -0
- package/dist/procedural-item/definition.render.d.ts.map +1 -0
- package/dist/procedural-item/definition.render.js +84 -0
- package/dist/procedural-item/renderer.d.ts.map +1 -1
- package/dist/procedural-item/renderer.edit.d.ts +5 -0
- package/dist/procedural-item/renderer.edit.d.ts.map +1 -0
- package/dist/procedural-item/renderer.edit.js +49 -0
- package/dist/procedural-item/renderer.js +12 -22
- package/dist/render.d.ts +4 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +4 -0
- package/dist/ridge-vent/definition.d.ts +95 -15
- package/dist/ridge-vent/definition.d.ts.map +1 -1
- package/dist/ridge-vent/definition.edit.d.ts +4 -0
- package/dist/ridge-vent/definition.edit.d.ts.map +1 -0
- package/dist/ridge-vent/definition.edit.js +148 -0
- package/dist/ridge-vent/definition.js +4 -197
- package/dist/ridge-vent/definition.render.d.ts +6 -0
- package/dist/ridge-vent/definition.render.d.ts.map +1 -0
- package/dist/ridge-vent/definition.render.js +42 -0
- package/dist/ridge-vent/move-tool.d.ts.map +1 -1
- package/dist/ridge-vent/move-tool.js +5 -4
- package/dist/ridge-vent/panel.d.ts.map +1 -1
- package/dist/ridge-vent/panel.js +22 -9
- package/dist/roof/barrel-panel.d.ts.map +1 -1
- package/dist/roof/barrel-panel.js +8 -4
- package/dist/roof/definition.d.ts +325 -8
- package/dist/roof/definition.d.ts.map +1 -1
- package/dist/roof/definition.edit.d.ts +4 -0
- package/dist/roof/definition.edit.d.ts.map +1 -0
- package/dist/roof/definition.edit.js +183 -0
- package/dist/roof/definition.js +4 -254
- package/dist/roof/definition.render.d.ts +7 -0
- package/dist/roof/definition.render.d.ts.map +1 -0
- package/dist/roof/definition.render.js +101 -0
- package/dist/roof/floorplan-overrides.d.ts +22 -0
- package/dist/roof/floorplan-overrides.d.ts.map +1 -0
- package/dist/roof/floorplan-overrides.js +46 -0
- package/dist/roof/floorplan-tool.d.ts +9 -0
- package/dist/roof/floorplan-tool.d.ts.map +1 -0
- package/dist/roof/floorplan-tool.js +168 -0
- package/dist/roof/floorplan.d.ts.map +1 -1
- package/dist/roof/floorplan.js +131 -41
- package/dist/roof/geometry-notice.d.ts +5 -0
- package/dist/roof/geometry-notice.d.ts.map +1 -0
- package/dist/roof/geometry-notice.js +27 -0
- package/dist/roof/glazing-controls.d.ts +2 -1
- package/dist/roof/glazing-controls.d.ts.map +1 -1
- package/dist/roof/glazing-controls.js +52 -14
- package/dist/roof/glazing-panel-editor.d.ts.map +1 -1
- package/dist/roof/glazing-panel-editor.js +40 -13
- package/dist/roof/glazing-panel.d.ts.map +1 -1
- package/dist/roof/glazing-panel.js +73 -9
- package/dist/roof/paint.d.ts +19 -0
- package/dist/roof/paint.d.ts.map +1 -0
- package/dist/roof/paint.js +158 -0
- package/dist/roof/panel.d.ts.map +1 -1
- package/dist/roof/panel.js +91 -22
- package/dist/roof/renderer.d.ts.map +1 -1
- package/dist/roof/renderer.js +13 -2
- package/dist/roof/roof-footprint-source.d.ts +17 -0
- package/dist/roof/roof-footprint-source.d.ts.map +1 -1
- package/dist/roof/roof-footprint-source.js +14 -0
- package/dist/roof/roof-footprint.d.ts +36 -2
- package/dist/roof/roof-footprint.d.ts.map +1 -1
- package/dist/roof/roof-footprint.js +124 -2
- package/dist/roof/roof-materials.d.ts.map +1 -1
- package/dist/roof/roof-materials.js +10 -1
- package/dist/roof/roof-placement-mode.d.ts +0 -2
- package/dist/roof/roof-placement-mode.d.ts.map +1 -1
- package/dist/roof/roof-placement-mode.js +8 -6
- package/dist/roof/roof-plan-creases.d.ts +50 -0
- package/dist/roof/roof-plan-creases.d.ts.map +1 -0
- package/dist/roof/roof-plan-creases.js +194 -0
- package/dist/roof/roof-ridge-mode.d.ts +20 -0
- package/dist/roof/roof-ridge-mode.d.ts.map +1 -0
- package/dist/roof/roof-ridge-mode.js +16 -0
- package/dist/roof/tool.d.ts +20 -4
- package/dist/roof/tool.d.ts.map +1 -1
- package/dist/roof/tool.js +264 -280
- package/dist/roof/type-thumbnail-assets.d.ts +3 -0
- package/dist/roof/type-thumbnail-assets.d.ts.map +1 -0
- package/dist/roof/type-thumbnail-assets.js +12 -0
- package/dist/roof/type-thumbnail.d.ts +5 -0
- package/dist/roof/type-thumbnail.d.ts.map +1 -0
- package/dist/roof/type-thumbnail.js +5 -0
- package/dist/roof/wall-catch.d.ts +106 -0
- package/dist/roof/wall-catch.d.ts.map +1 -0
- package/dist/roof/wall-catch.js +267 -0
- package/dist/roof-segment/build-up-section.d.ts +9 -0
- package/dist/roof-segment/build-up-section.d.ts.map +1 -0
- package/dist/roof-segment/build-up-section.js +191 -0
- package/dist/roof-segment/definition.d.ts +564 -9
- package/dist/roof-segment/definition.d.ts.map +1 -1
- package/dist/roof-segment/definition.edit.d.ts +4 -0
- package/dist/roof-segment/definition.edit.d.ts.map +1 -0
- package/dist/roof-segment/definition.edit.js +305 -0
- package/dist/roof-segment/definition.js +4 -319
- package/dist/roof-segment/definition.render.d.ts +6 -0
- package/dist/roof-segment/definition.render.d.ts.map +1 -0
- package/dist/roof-segment/definition.render.js +59 -0
- package/dist/roof-segment/floorplan-affordances.d.ts.map +1 -1
- package/dist/roof-segment/floorplan-affordances.js +70 -21
- package/dist/roof-segment/floorplan.d.ts.map +1 -1
- package/dist/roof-segment/floorplan.js +16 -12
- package/dist/roof-segment/paint.d.ts +3 -2
- package/dist/roof-segment/paint.d.ts.map +1 -1
- package/dist/roof-segment/paint.js +43 -3
- package/dist/roof-segment/panel-model.d.ts +23 -0
- package/dist/roof-segment/panel-model.d.ts.map +1 -0
- package/dist/roof-segment/panel-model.js +64 -0
- package/dist/roof-segment/panel.d.ts.map +1 -1
- package/dist/roof-segment/panel.js +117 -37
- package/dist/roof-segment/parametrics.d.ts.map +1 -1
- package/dist/roof-segment/parametrics.js +17 -11
- package/dist/roof-segment/renderer.d.ts.map +1 -1
- package/dist/roof-segment/renderer.js +26 -5
- package/dist/roof-segment/slots.d.ts +2 -0
- package/dist/roof-segment/slots.d.ts.map +1 -0
- package/dist/roof-segment/slots.js +1 -0
- package/dist/scan/definition.d.ts +57 -7
- package/dist/scan/definition.d.ts.map +1 -1
- package/dist/scan/definition.edit.d.ts +4 -0
- package/dist/scan/definition.edit.d.ts.map +1 -0
- package/dist/scan/definition.edit.js +4 -0
- package/dist/scan/definition.js +4 -52
- package/dist/scan/definition.render.d.ts +6 -0
- package/dist/scan/definition.render.d.ts.map +1 -0
- package/dist/scan/definition.render.js +46 -0
- package/dist/separator/definition.d.ts +47 -2
- package/dist/separator/definition.d.ts.map +1 -1
- package/dist/separator/definition.edit.d.ts +4 -0
- package/dist/separator/definition.edit.d.ts.map +1 -0
- package/dist/separator/definition.edit.js +13 -0
- package/dist/separator/definition.js +4 -39
- package/dist/separator/definition.render.d.ts +6 -0
- package/dist/separator/definition.render.d.ts.map +1 -0
- package/dist/separator/definition.render.js +27 -0
- package/dist/separator/floorplan-affordances.d.ts +9 -0
- package/dist/separator/floorplan-affordances.d.ts.map +1 -0
- package/dist/separator/floorplan-affordances.js +23 -0
- package/dist/separator/floorplan.d.ts +9 -0
- package/dist/separator/floorplan.d.ts.map +1 -0
- package/dist/separator/floorplan.js +54 -0
- package/dist/separator/renderer.d.ts +6 -1
- package/dist/separator/renderer.d.ts.map +1 -1
- package/dist/separator/renderer.edit.d.ts +5 -0
- package/dist/separator/renderer.edit.d.ts.map +1 -0
- package/dist/separator/renderer.edit.js +8 -0
- package/dist/separator/renderer.js +22 -9
- package/dist/separator/selection.d.ts +10 -0
- package/dist/separator/selection.d.ts.map +1 -0
- package/dist/separator/selection.js +35 -0
- package/dist/shared/accessory-placement.js +1 -1
- package/dist/shared/auto-fitting.js +1 -1
- package/dist/shared/auto-offset-tag.d.ts +1 -1
- package/dist/shared/auto-offset-tag.d.ts.map +1 -1
- package/dist/shared/auto-offset-tag.js +3 -1
- package/dist/shared/automatic-run-end-cap.d.ts +5 -0
- package/dist/shared/automatic-run-end-cap.d.ts.map +1 -1
- package/dist/shared/automatic-run-end-cap.js +17 -9
- package/dist/shared/build-up-controls.d.ts +88 -0
- package/dist/shared/build-up-controls.d.ts.map +1 -0
- package/dist/shared/build-up-controls.js +139 -0
- package/dist/shared/connection-feedback.d.ts +6 -3
- package/dist/shared/connection-feedback.d.ts.map +1 -1
- package/dist/shared/connection-feedback.js +29 -6
- package/dist/shared/curtain-opening-limits.d.ts.map +1 -1
- package/dist/shared/curtain-opening-limits.js +45 -16
- package/dist/shared/draft-axis-guides.d.ts.map +1 -1
- package/dist/shared/draft-axis-guides.js +2 -1
- package/dist/shared/duct-adapter.js +1 -1
- package/dist/shared/duct-collar-inspector.d.ts +5 -0
- package/dist/shared/duct-collar-inspector.d.ts.map +1 -0
- package/dist/shared/duct-collar-inspector.js +36 -0
- package/dist/shared/follower-frames.d.ts +15 -0
- package/dist/shared/follower-frames.d.ts.map +1 -0
- package/dist/shared/follower-frames.js +36 -0
- package/dist/shared/handle-drag-scope.d.ts +14 -0
- package/dist/shared/handle-drag-scope.d.ts.map +1 -0
- package/dist/shared/handle-drag-scope.js +36 -0
- package/dist/shared/hosted-resize.d.ts +3 -1
- package/dist/shared/hosted-resize.d.ts.map +1 -1
- package/dist/shared/hosted-resize.js +10 -8
- package/dist/shared/item-interaction-actions.d.ts.map +1 -1
- package/dist/shared/item-interaction-actions.js +11 -2
- package/dist/shared/layer-thickness.d.ts +2 -0
- package/dist/shared/layer-thickness.d.ts.map +1 -0
- package/dist/shared/layer-thickness.js +3 -0
- package/dist/shared/live-preview.d.ts +16 -0
- package/dist/shared/live-preview.d.ts.map +1 -0
- package/dist/shared/live-preview.js +36 -0
- package/dist/shared/move-roof-tool.d.ts.map +1 -1
- package/dist/shared/move-roof-tool.js +100 -5
- package/dist/shared/node-batch/batchable.d.ts +2 -0
- package/dist/shared/node-batch/batchable.d.ts.map +1 -1
- package/dist/shared/node-batch/batchable.js +4 -0
- package/dist/shared/node-batch/candidates.d.ts +21 -5
- package/dist/shared/node-batch/candidates.d.ts.map +1 -1
- package/dist/shared/node-batch/candidates.js +85 -50
- package/dist/shared/node-batch/system.d.ts.map +1 -1
- package/dist/shared/node-batch/system.js +24 -15
- package/dist/shared/opening-casing-move.d.ts +16 -0
- package/dist/shared/opening-casing-move.d.ts.map +1 -0
- package/dist/shared/opening-casing-move.js +33 -0
- package/dist/shared/opening-casing-section.d.ts +15 -0
- package/dist/shared/opening-casing-section.d.ts.map +1 -0
- package/dist/shared/opening-casing-section.js +38 -0
- package/dist/shared/opening-casing.d.ts +26 -0
- package/dist/shared/opening-casing.d.ts.map +1 -0
- package/dist/shared/opening-casing.js +80 -0
- package/dist/shared/opening-depth-position.d.ts +13 -0
- package/dist/shared/opening-depth-position.d.ts.map +1 -0
- package/dist/shared/opening-depth-position.js +34 -0
- package/dist/shared/opening-documentation.d.ts.map +1 -1
- package/dist/shared/opening-documentation.js +17 -8
- package/dist/shared/opening-guides-runtime.d.ts +2 -1
- package/dist/shared/opening-guides-runtime.d.ts.map +1 -1
- package/dist/shared/opening-guides-runtime.js +13 -9
- package/dist/shared/opening-labels.d.ts +11 -0
- package/dist/shared/opening-labels.d.ts.map +1 -0
- package/dist/shared/opening-labels.js +46 -0
- package/dist/shared/opening-placement-dimensions.d.ts.map +1 -1
- package/dist/shared/opening-placement-dimensions.js +12 -10
- package/dist/shared/opening-plane-offset.d.ts +4 -3
- package/dist/shared/opening-plane-offset.d.ts.map +1 -1
- package/dist/shared/opening-plane-offset.js +7 -4
- package/dist/shared/opening-swap.d.ts +8 -0
- package/dist/shared/opening-swap.d.ts.map +1 -0
- package/dist/shared/opening-swap.js +18 -0
- package/dist/shared/path-point-affordance.d.ts.map +1 -1
- package/dist/shared/path-point-affordance.js +19 -24
- package/dist/shared/path-segment-affordance.d.ts +2 -1
- package/dist/shared/path-segment-affordance.d.ts.map +1 -1
- package/dist/shared/path-segment-affordance.js +11 -8
- package/dist/shared/pipe-collar-inspector.d.ts +5 -0
- package/dist/shared/pipe-collar-inspector.d.ts.map +1 -0
- package/dist/shared/pipe-collar-inspector.js +27 -0
- package/dist/shared/polygon-vertex-affordance.d.ts +19 -0
- package/dist/shared/polygon-vertex-affordance.d.ts.map +1 -1
- package/dist/shared/polygon-vertex-affordance.js +65 -6
- package/dist/shared/refrigerant-line-selection.d.ts.map +1 -1
- package/dist/shared/refrigerant-line-selection.js +46 -29
- package/dist/shared/relative-roof-drag.d.ts.map +1 -1
- package/dist/shared/relative-roof-drag.js +5 -4
- package/dist/shared/roof-opening-host.d.ts +2 -1
- package/dist/shared/roof-opening-host.d.ts.map +1 -1
- package/dist/shared/roof-opening-host.js +14 -5
- package/dist/shared/roof-surface.d.ts.map +1 -1
- package/dist/shared/roof-surface.js +2 -0
- package/dist/shared/roof-wall-opening-cut.d.ts.map +1 -1
- package/dist/shared/roof-wall-opening-cut.js +14 -6
- package/dist/shared/roof-wall-opening-placement.d.ts +2 -1
- package/dist/shared/roof-wall-opening-placement.d.ts.map +1 -1
- package/dist/shared/roof-wall-opening-placement.js +6 -4
- package/dist/shared/run-hanger-inspector.d.ts.map +1 -1
- package/dist/shared/run-hanger-inspector.js +39 -5
- package/dist/shared/run-hangers.d.ts.map +1 -1
- package/dist/shared/run-hangers.js +2 -2
- package/dist/shared/run-move-connectivity.d.ts +15 -6
- package/dist/shared/run-move-connectivity.d.ts.map +1 -1
- package/dist/shared/run-move-connectivity.js +14 -5
- package/dist/shared/run-tool-options.d.ts +8 -0
- package/dist/shared/run-tool-options.d.ts.map +1 -0
- package/dist/shared/run-tool-options.js +166 -0
- package/dist/shared/system-check-panel.d.ts.map +1 -1
- package/dist/shared/system-check-panel.js +94 -15
- package/dist/shared/system-checks.d.ts.map +1 -1
- package/dist/shared/system-checks.js +2 -1
- package/dist/shared/vertical-offset.js +1 -1
- package/dist/shared/wall-attach-target.d.ts.map +1 -1
- package/dist/shared/wall-attach-target.js +6 -3
- package/dist/shared/wall-opening-ceiling.d.ts +6 -0
- package/dist/shared/wall-opening-ceiling.d.ts.map +1 -1
- package/dist/shared/wall-opening-ceiling.js +36 -7
- package/dist/shelf/definition.d.ts +108 -3
- package/dist/shelf/definition.d.ts.map +1 -1
- package/dist/shelf/definition.edit.d.ts +4 -0
- package/dist/shelf/definition.edit.d.ts.map +1 -0
- package/dist/shelf/definition.edit.js +155 -0
- package/dist/shelf/definition.js +4 -270
- package/dist/shelf/definition.render.d.ts +6 -0
- package/dist/shelf/definition.render.d.ts.map +1 -0
- package/dist/shelf/definition.render.js +122 -0
- package/dist/site/definition.d.ts +312 -9
- package/dist/site/definition.d.ts.map +1 -1
- package/dist/site/definition.edit.d.ts +4 -0
- package/dist/site/definition.edit.d.ts.map +1 -0
- package/dist/site/definition.edit.js +4 -0
- package/dist/site/definition.js +4 -55
- package/dist/site/definition.render.d.ts +6 -0
- package/dist/site/definition.render.d.ts.map +1 -0
- package/dist/site/definition.render.js +47 -0
- package/dist/site/ground-hole.d.ts +3 -3
- package/dist/site/ground-hole.js +3 -3
- package/dist/site/ground-veil.d.ts +5 -12
- package/dist/site/ground-veil.d.ts.map +1 -1
- package/dist/site/ground-veil.js +9 -33
- package/dist/site/panel.d.ts.map +1 -1
- package/dist/site/panel.js +52 -12
- package/dist/site/renderer.d.ts.map +1 -1
- package/dist/site/renderer.js +52 -23
- package/dist/skylight/definition.d.ts +158 -9
- package/dist/skylight/definition.d.ts.map +1 -1
- package/dist/skylight/definition.edit.d.ts +4 -0
- package/dist/skylight/definition.edit.d.ts.map +1 -0
- package/dist/skylight/definition.edit.js +218 -0
- package/dist/skylight/definition.js +4 -271
- package/dist/skylight/definition.render.d.ts +6 -0
- package/dist/skylight/definition.render.d.ts.map +1 -0
- package/dist/skylight/definition.render.js +50 -0
- package/dist/skylight/move-tool.d.ts.map +1 -1
- package/dist/skylight/move-tool.js +7 -5
- package/dist/skylight/panel.d.ts.map +1 -1
- package/dist/skylight/panel.js +49 -19
- package/dist/slab/deck-geometry.d.ts +28 -0
- package/dist/slab/deck-geometry.d.ts.map +1 -0
- package/dist/slab/deck-geometry.js +320 -0
- package/dist/slab/definition.d.ts +289 -19
- package/dist/slab/definition.d.ts.map +1 -1
- package/dist/slab/definition.edit.d.ts +4 -0
- package/dist/slab/definition.edit.d.ts.map +1 -0
- package/dist/slab/definition.edit.js +230 -0
- package/dist/slab/definition.js +4 -329
- package/dist/slab/definition.render.d.ts +6 -0
- package/dist/slab/definition.render.d.ts.map +1 -0
- package/dist/slab/definition.render.js +92 -0
- package/dist/slab/dependency-tracker.d.ts.map +1 -1
- package/dist/slab/dependency-tracker.js +3 -0
- package/dist/slab/floorplan-affordances.d.ts +500 -0
- package/dist/slab/floorplan-affordances.d.ts.map +1 -1
- package/dist/slab/geometry.d.ts.map +1 -1
- package/dist/slab/geometry.js +46 -9
- package/dist/slab/panel.d.ts.map +1 -1
- package/dist/slab/panel.js +97 -21
- package/dist/slab/renderer.d.ts +11 -0
- package/dist/slab/renderer.d.ts.map +1 -0
- package/dist/slab/renderer.js +19 -0
- package/dist/slab/system.d.ts.map +1 -1
- package/dist/slab/system.js +12 -1
- package/dist/solar-panel/definition.d.ts +145 -14
- package/dist/solar-panel/definition.d.ts.map +1 -1
- package/dist/solar-panel/definition.edit.d.ts +4 -0
- package/dist/solar-panel/definition.edit.d.ts.map +1 -0
- package/dist/solar-panel/definition.edit.js +213 -0
- package/dist/solar-panel/definition.js +4 -263
- package/dist/solar-panel/definition.render.d.ts +6 -0
- package/dist/solar-panel/definition.render.d.ts.map +1 -0
- package/dist/solar-panel/definition.render.js +42 -0
- package/dist/solar-panel/move-tool.d.ts.map +1 -1
- package/dist/solar-panel/move-tool.js +7 -5
- package/dist/solar-panel/panel.d.ts.map +1 -1
- package/dist/solar-panel/panel.js +49 -14
- package/dist/spawn/definition.d.ts +48 -3
- package/dist/spawn/definition.d.ts.map +1 -1
- package/dist/spawn/definition.edit.d.ts +4 -0
- package/dist/spawn/definition.edit.d.ts.map +1 -0
- package/dist/spawn/definition.edit.js +64 -0
- package/dist/spawn/definition.js +4 -109
- package/dist/spawn/definition.render.d.ts +6 -0
- package/dist/spawn/definition.render.d.ts.map +1 -0
- package/dist/spawn/definition.render.js +48 -0
- package/dist/stair/construction-controls.d.ts +3 -1
- package/dist/stair/construction-controls.d.ts.map +1 -1
- package/dist/stair/construction-controls.js +75 -12
- package/dist/stair/definition.d.ts +334 -8
- package/dist/stair/definition.d.ts.map +1 -1
- package/dist/stair/definition.edit.d.ts +4 -0
- package/dist/stair/definition.edit.d.ts.map +1 -0
- package/dist/stair/definition.edit.js +377 -0
- package/dist/stair/definition.js +4 -443
- package/dist/stair/definition.render.d.ts +6 -0
- package/dist/stair/definition.render.d.ts.map +1 -0
- package/dist/stair/definition.render.js +65 -0
- package/dist/stair/paint.d.ts +6 -0
- package/dist/stair/paint.d.ts.map +1 -1
- package/dist/stair/panel.d.ts.map +1 -1
- package/dist/stair/panel.js +244 -52
- package/dist/stair/parametrics.d.ts.map +1 -1
- package/dist/stair/parametrics.js +7 -0
- package/dist/stair/placement-defaults.d.ts +18 -0
- package/dist/stair/placement-defaults.d.ts.map +1 -0
- package/dist/stair/placement-defaults.js +27 -0
- package/dist/stair/railing-controls.d.ts.map +1 -1
- package/dist/stair/railing-controls.js +78 -18
- package/dist/stair/renderer.d.ts.map +1 -1
- package/dist/stair/renderer.js +16 -10
- package/dist/stair/structure-controls.d.ts +18 -0
- package/dist/stair/structure-controls.d.ts.map +1 -0
- package/dist/stair/structure-controls.js +275 -0
- package/dist/stair/tool.d.ts.map +1 -1
- package/dist/stair/tool.js +13 -9
- package/dist/stair/use-stair-render-data.d.ts +41 -0
- package/dist/stair/use-stair-render-data.d.ts.map +1 -1
- package/dist/stair-segment/definition.d.ts +130 -7
- package/dist/stair-segment/definition.d.ts.map +1 -1
- package/dist/stair-segment/definition.edit.d.ts +4 -0
- package/dist/stair-segment/definition.edit.d.ts.map +1 -0
- package/dist/stair-segment/definition.edit.js +135 -0
- package/dist/stair-segment/definition.js +4 -172
- package/dist/stair-segment/definition.render.d.ts +6 -0
- package/dist/stair-segment/definition.render.d.ts.map +1 -0
- package/dist/stair-segment/definition.render.js +38 -0
- package/dist/stair-segment/panel.d.ts.map +1 -1
- package/dist/stair-segment/panel.js +65 -18
- package/dist/structural-grid/definition.d.ts +50 -3
- package/dist/structural-grid/definition.d.ts.map +1 -1
- package/dist/structural-grid/definition.edit.d.ts +4 -0
- package/dist/structural-grid/definition.edit.d.ts.map +1 -0
- package/dist/structural-grid/definition.edit.js +18 -0
- package/dist/structural-grid/definition.js +4 -51
- package/dist/structural-grid/definition.render.d.ts +6 -0
- package/dist/structural-grid/definition.render.d.ts.map +1 -0
- package/dist/structural-grid/definition.render.js +35 -0
- package/dist/turbine-vent/definition.d.ts +97 -23
- package/dist/turbine-vent/definition.d.ts.map +1 -1
- package/dist/turbine-vent/definition.edit.d.ts +4 -0
- package/dist/turbine-vent/definition.edit.d.ts.map +1 -0
- package/dist/turbine-vent/definition.edit.js +66 -0
- package/dist/turbine-vent/definition.js +4 -121
- package/dist/turbine-vent/definition.render.d.ts +6 -0
- package/dist/turbine-vent/definition.render.d.ts.map +1 -0
- package/dist/turbine-vent/definition.render.js +40 -0
- package/dist/turbine-vent/move-tool.d.ts.map +1 -1
- package/dist/turbine-vent/move-tool.js +6 -5
- package/dist/turbine-vent/panel.d.ts.map +1 -1
- package/dist/turbine-vent/panel.js +14 -5
- package/dist/unit/definition.d.ts +53 -9
- package/dist/unit/definition.d.ts.map +1 -1
- package/dist/unit/definition.edit.d.ts +4 -0
- package/dist/unit/definition.edit.d.ts.map +1 -0
- package/dist/unit/definition.edit.js +4 -0
- package/dist/unit/definition.js +4 -38
- package/dist/unit/definition.render.d.ts +6 -0
- package/dist/unit/definition.render.d.ts.map +1 -0
- package/dist/unit/definition.render.js +30 -0
- package/dist/unit/unit-panel.d.ts.map +1 -1
- package/dist/unit/unit-panel.js +28 -12
- package/dist/wall/actions.d.ts +1 -1
- package/dist/wall/actions.d.ts.map +1 -1
- package/dist/wall/actions.js +17 -13
- package/dist/wall/construction-dimensions.d.ts +6 -0
- package/dist/wall/construction-dimensions.d.ts.map +1 -1
- package/dist/wall/construction-dimensions.js +8 -0
- package/dist/wall/contextual-dimensions.d.ts +6 -0
- package/dist/wall/contextual-dimensions.d.ts.map +1 -1
- package/dist/wall/contextual-dimensions.js +105 -18
- package/dist/wall/curtain-opening-frame.d.ts.map +1 -1
- package/dist/wall/curtain-opening-frame.js +6 -4
- package/dist/wall/curtain-wall-layout.d.ts +1 -1
- package/dist/wall/curtain-wall-layout.d.ts.map +1 -1
- package/dist/wall/curtain-wall-layout.js +6 -4
- package/dist/wall/curtain-wall-materials.d.ts.map +1 -1
- package/dist/wall/curtain-wall-materials.js +8 -3
- package/dist/wall/curtain-wall-panel.d.ts.map +1 -1
- package/dist/wall/curtain-wall-panel.js +242 -38
- package/dist/wall/curve-tool.d.ts.map +1 -1
- package/dist/wall/curve-tool.js +2 -3
- package/dist/wall/definition.d.ts +809 -3
- package/dist/wall/definition.d.ts.map +1 -1
- package/dist/wall/definition.edit.d.ts +4 -0
- package/dist/wall/definition.edit.d.ts.map +1 -0
- package/dist/wall/definition.edit.js +184 -0
- package/dist/wall/definition.js +4 -264
- package/dist/wall/definition.render.d.ts +6 -0
- package/dist/wall/definition.render.d.ts.map +1 -0
- package/dist/wall/definition.render.js +100 -0
- package/dist/wall/floorplan-affordances.d.ts.map +1 -1
- package/dist/wall/floorplan-affordances.js +9 -6
- package/dist/wall/floorplan-move.d.ts.map +1 -1
- package/dist/wall/floorplan-move.js +66 -16
- package/dist/wall/floorplan.d.ts +4 -5
- package/dist/wall/floorplan.d.ts.map +1 -1
- package/dist/wall/floorplan.js +63 -47
- package/dist/wall/measurement.d.ts.map +1 -1
- package/dist/wall/measurement.js +22 -5
- package/dist/wall/move-endpoint-tool.d.ts.map +1 -1
- package/dist/wall/move-endpoint-tool.js +4 -3
- package/dist/wall/move-shared.js +1 -1
- package/dist/wall/move-tool.d.ts.map +1 -1
- package/dist/wall/move-tool.js +77 -12
- package/dist/wall/paint.d.ts +2 -2
- package/dist/wall/paint.d.ts.map +1 -1
- package/dist/wall/paint.js +11 -4
- package/dist/wall/panel-model.d.ts +17 -2
- package/dist/wall/panel-model.d.ts.map +1 -1
- package/dist/wall/panel-model.js +159 -18
- package/dist/wall/panel.d.ts +8 -0
- package/dist/wall/panel.d.ts.map +1 -1
- package/dist/wall/panel.js +240 -159
- package/dist/wall/parametrics.d.ts +1 -1
- package/dist/wall/parametrics.d.ts.map +1 -1
- package/dist/wall/parametrics.js +14 -1
- package/dist/wall/quick-measurement.js +1 -1
- package/dist/wall/railing-wall-adapter.d.ts +7 -0
- package/dist/wall/railing-wall-adapter.d.ts.map +1 -0
- package/dist/wall/railing-wall-adapter.js +38 -0
- package/dist/wall/railing-wall-floorplan.d.ts +8 -0
- package/dist/wall/railing-wall-floorplan.d.ts.map +1 -0
- package/dist/wall/railing-wall-floorplan.js +27 -0
- package/dist/wall/railing-wall-geometry.d.ts +12 -0
- package/dist/wall/railing-wall-geometry.d.ts.map +1 -0
- package/dist/wall/railing-wall-geometry.js +51 -0
- package/dist/wall/railing-wall-guard.d.ts +81 -0
- package/dist/wall/railing-wall-guard.d.ts.map +1 -0
- package/dist/wall/railing-wall-guard.js +435 -0
- package/dist/wall/railing-wall-materials.d.ts +11 -0
- package/dist/wall/railing-wall-materials.d.ts.map +1 -0
- package/dist/wall/railing-wall-materials.js +31 -0
- package/dist/wall/railing-wall-panel-model.d.ts +30 -0
- package/dist/wall/railing-wall-panel-model.d.ts.map +1 -0
- package/dist/wall/railing-wall-panel-model.js +117 -0
- package/dist/wall/railing-wall-panel.d.ts +17 -0
- package/dist/wall/railing-wall-panel.d.ts.map +1 -0
- package/dist/wall/railing-wall-panel.js +42 -0
- package/dist/wall/rectangle-command.d.ts +80 -1
- package/dist/wall/rectangle-command.d.ts.map +1 -1
- package/dist/wall/rectangle-tool.d.ts.map +1 -1
- package/dist/wall/rectangle-tool.js +4 -2
- package/dist/wall/renderer.d.ts.map +1 -1
- package/dist/wall/renderer.js +3 -1
- package/dist/wall/skirting-floor-gaps.d.ts +8 -0
- package/dist/wall/skirting-floor-gaps.d.ts.map +1 -0
- package/dist/wall/skirting-floor-gaps.js +36 -0
- package/dist/wall/split-floorplan-layer.d.ts.map +1 -1
- package/dist/wall/split-floorplan-layer.js +2 -2
- package/dist/wall/split-tool.d.ts.map +1 -1
- package/dist/wall/split-tool.js +2 -2
- package/dist/wall/system.d.ts +0 -14
- package/dist/wall/system.d.ts.map +1 -1
- package/dist/wall/system.js +6 -1
- package/dist/wall/tool.d.ts +16 -0
- package/dist/wall/tool.d.ts.map +1 -1
- package/dist/wall/tool.js +285 -70
- package/dist/wall/treatments.d.ts +3 -0
- package/dist/wall/treatments.d.ts.map +1 -1
- package/dist/wall/treatments.js +57 -14
- package/dist/window/actions.d.ts +7 -0
- package/dist/window/actions.d.ts.map +1 -0
- package/dist/window/actions.js +29 -0
- package/dist/window/definition.d.ts +356 -15
- package/dist/window/definition.d.ts.map +1 -1
- package/dist/window/definition.edit.d.ts +4 -0
- package/dist/window/definition.edit.d.ts.map +1 -0
- package/dist/window/definition.edit.js +255 -0
- package/dist/window/definition.js +5 -329
- package/dist/window/definition.render.d.ts +8 -0
- package/dist/window/definition.render.d.ts.map +1 -0
- package/dist/window/definition.render.js +83 -0
- package/dist/window/floorplan-move.d.ts.map +1 -1
- package/dist/window/floorplan-move.js +12 -4
- package/dist/window/floorplan.d.ts +2 -0
- package/dist/window/floorplan.d.ts.map +1 -1
- package/dist/window/floorplan.js +58 -1
- package/dist/window/mechanism.d.ts.map +1 -1
- package/dist/window/mechanism.js +21 -1
- package/dist/window/move-tool.d.ts.map +1 -1
- package/dist/window/move-tool.js +17 -14
- package/dist/window/paint.d.ts +2 -7
- package/dist/window/paint.d.ts.map +1 -1
- package/dist/window/paint.js +31 -3
- package/dist/window/panel.d.ts.map +1 -1
- package/dist/window/panel.js +311 -69
- package/dist/window/placement.d.ts.map +1 -1
- package/dist/window/placement.js +5 -1
- package/dist/window/swing.d.ts +13 -0
- package/dist/window/swing.d.ts.map +1 -0
- package/dist/window/swing.js +16 -0
- package/dist/window/tool.d.ts.map +1 -1
- package/dist/window/tool.js +24 -16
- package/dist/zone/contextual-dimensions.d.ts.map +1 -1
- package/dist/zone/contextual-dimensions.js +1 -2
- package/dist/zone/definition.d.ts +264 -9
- package/dist/zone/definition.d.ts.map +1 -1
- package/dist/zone/definition.edit.d.ts +4 -0
- package/dist/zone/definition.edit.d.ts.map +1 -0
- package/dist/zone/definition.edit.js +38 -0
- package/dist/zone/definition.js +4 -97
- package/dist/zone/definition.render.d.ts +6 -0
- package/dist/zone/definition.render.d.ts.map +1 -0
- package/dist/zone/definition.render.js +55 -0
- package/dist/zone/floorplan-affordances.d.ts +136 -0
- package/dist/zone/floorplan-affordances.d.ts.map +1 -1
- package/dist/zone/quantities-panel.d.ts.map +1 -1
- package/dist/zone/quantities-panel.js +34 -9
- package/dist/zone/renderer.d.ts.map +1 -1
- package/dist/zone/renderer.js +9 -5
- package/package.json +27 -16
- package/dist/site/generic-foundation-geometry.d.ts +0 -16
- package/dist/site/generic-foundation-geometry.d.ts.map +0 -1
- package/dist/site/generic-foundation-geometry.js +0 -75
- package/dist/site/generic-foundation.d.ts +0 -4
- package/dist/site/generic-foundation.d.ts.map +0 -1
- package/dist/site/generic-foundation.js +0 -91
|
@@ -1,2112 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { buildCabinetGeometry } from './geometry.js';
|
|
8
|
-
import { withCabinetHostedChildren } from './hosted-resize.js';
|
|
9
|
-
import { toggleCabinetOperationState } from './interaction.js';
|
|
10
|
-
import { cabinetModuleParentFrame } from './move-frame.js';
|
|
11
|
-
import { cabinetPaint } from './paint.js';
|
|
12
|
-
import { cabinetModuleUsesFixedApplianceWidth } from './panel-visibility.js';
|
|
13
|
-
import { cabinetModuleParametrics, cabinetParametrics } from './parametrics.js';
|
|
14
|
-
import { cabinetPlacementNotice } from './placement-notice.js';
|
|
15
|
-
import { resolveCabinetGridPosition } from './placement-snap.js';
|
|
16
|
-
import useCabinetPlacementType from './placement-type.js';
|
|
17
|
-
import { metadataForSelectedWidth, metadataWithPresetWidthDebt } from './preset-width-debt.js';
|
|
18
|
-
import { cabinetQuickActions } from './quick-actions.js';
|
|
19
|
-
import { cabinetConnectedDepthBounds, cabinetResizeUpperBound, MAX_CABINET_DEPTH, MAX_CABINET_WIDTH, MIN_CABINET_DEPTH, MIN_CABINET_WIDTH, } from './resize-limits.js';
|
|
20
|
-
import { moduleSideOpen, reflowRunModules as reflowCabinetRunModules, runWallConstraints, sortRunModules, } from './run-layout.js';
|
|
21
|
-
import { backAlignedRunDepthOverrides, backAlignZ, buildWallCornerDepthIndex, bumpCabinetRunLayoutRevision, cabinetMetadataRecord, cabinetModulesForRun, cabinetModuleTotalHeight, totalCabinetHeight as cabinetTotalHeight, cornerSourceWidthOverridesForDerivedDepth, nestedCornerRunPositionOverrides, previewCornerRunsFromRunSources, resolveCabinetType, runModuleBaseY, syncCornerRunsFromRunSources, syncCornerRunsFromSourceModule, wallChildOf, wallCornerWidthOverridesForDepthTargets, } from './run-ops.js';
|
|
22
|
-
import { cabinetSceneAction } from './scene-action.js';
|
|
23
|
-
import { CabinetModuleNode, CabinetNode } from './schema.js';
|
|
24
|
-
import { backAnchoredModuleZ, isHoodCompartmentType, minCabinetCarcassHeightForStack, stackForCabinet, } from './stack.js';
|
|
25
|
-
import { cabinetModuleSurfaceProvider, cabinetSurfaceProvider } from './surfaces.js';
|
|
26
|
-
import { cabinetFloorplanAffectedIds, cabinetTreeChildIds, cabinetTreeHidden, cabinetTreeLabel, } from './tree-structure.js';
|
|
27
|
-
import { findClosestCabinetWallInPlan, resolveCabinetModuleWallSnapLocal, resolveCabinetRunWallSnap, resolveCabinetWallFaceOffset, } from './wall-snap.js';
|
|
28
|
-
function isCabinetDuplicableNode(node) {
|
|
29
|
-
return ((node?.type === 'cabinet' || node?.type === 'cabinet-module') &&
|
|
30
|
-
Array.isArray(node.position) &&
|
|
31
|
-
typeof node.rotation === 'number');
|
|
32
|
-
}
|
|
33
|
-
function stripCabinetDuplicateMetadata(metadata) {
|
|
34
|
-
const { cabinetCornerDerivedRun: _derived, cabinetCornerSourceLink: _source, nodeSelectionProxyId: _proxy, ...rest } = cabinetMetadataRecord(metadata);
|
|
35
|
-
return rest;
|
|
36
|
-
}
|
|
37
|
-
function cleanCabinetDuplicateNode(node) {
|
|
38
|
-
return {
|
|
39
|
-
...node,
|
|
40
|
-
metadata: stripCabinetDuplicateMetadata(node.metadata),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function composeCabinetDuplicatePose(parentPosition, parentRotation, childPosition, childRotation) {
|
|
44
|
-
const cos = Math.cos(parentRotation);
|
|
45
|
-
const sin = Math.sin(parentRotation);
|
|
46
|
-
return {
|
|
47
|
-
position: [
|
|
48
|
-
parentPosition[0] + childPosition[0] * cos + childPosition[2] * sin,
|
|
49
|
-
parentPosition[1] + childPosition[1],
|
|
50
|
-
parentPosition[2] - childPosition[0] * sin + childPosition[2] * cos,
|
|
51
|
-
],
|
|
52
|
-
rotation: parentRotation + childRotation,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function cabinetDuplicateWorldPose(node, nodes) {
|
|
56
|
-
if (!isCabinetDuplicableNode(node))
|
|
57
|
-
return null;
|
|
58
|
-
const parent = node.parentId ? nodes[node.parentId] : null;
|
|
59
|
-
if (isCabinetDuplicableNode(parent)) {
|
|
60
|
-
const parentPose = cabinetDuplicateWorldPose(parent, nodes);
|
|
61
|
-
return parentPose
|
|
62
|
-
? composeCabinetDuplicatePose(parentPose.position, parentPose.rotation, node.position, node.rotation)
|
|
63
|
-
: null;
|
|
64
|
-
}
|
|
65
|
-
return { position: [...node.position], rotation: node.rotation };
|
|
66
|
-
}
|
|
67
|
-
function prepareCabinetSubtreeClone(args) {
|
|
68
|
-
const parent = args.root.parentId ? args.nodes[args.root.parentId] : null;
|
|
69
|
-
const nestedRun = args.root.type === 'cabinet' && isCabinetDuplicableNode(parent);
|
|
70
|
-
const worldPose = nestedRun ? cabinetDuplicateWorldPose(args.root, args.nodes) : null;
|
|
71
|
-
const levelId = nestedRun ? findLevelAncestorId(args.rootId, args.nodes) : null;
|
|
72
|
-
const root = {
|
|
73
|
-
...cleanCabinetDuplicateNode(args.root),
|
|
74
|
-
...(worldPose ? { position: worldPose.position, rotation: worldPose.rotation } : null),
|
|
75
|
-
...(levelId ? { parentId: levelId } : null),
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
root,
|
|
79
|
-
descendants: args.descendants.map((node) => cleanCabinetDuplicateNode(node)),
|
|
80
|
-
parentId: levelId ? levelId : undefined,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function appendCabinetFloorPlacedFootprints(run, nodes, parentPosition, parentRotation, footprints) {
|
|
84
|
-
const cos = Math.cos(parentRotation);
|
|
85
|
-
const sin = Math.sin(parentRotation);
|
|
86
|
-
const runPosition = [
|
|
87
|
-
parentPosition[0] + run.position[0] * cos + run.position[2] * sin,
|
|
88
|
-
parentPosition[1] + run.position[1],
|
|
89
|
-
parentPosition[2] - run.position[0] * sin + run.position[2] * cos,
|
|
90
|
-
];
|
|
91
|
-
const runRotation = parentRotation + run.rotation;
|
|
92
|
-
const modules = cabinetModulesForRun(run, nodes);
|
|
93
|
-
if (modules.length > 0) {
|
|
94
|
-
const runCos = Math.cos(runRotation);
|
|
95
|
-
const runSin = Math.sin(runRotation);
|
|
96
|
-
for (const module of modules) {
|
|
97
|
-
const modulePosition = [
|
|
98
|
-
runPosition[0] + module.position[0] * runCos + module.position[2] * runSin,
|
|
99
|
-
runPosition[1] + module.position[1],
|
|
100
|
-
runPosition[2] - module.position[0] * runSin + module.position[2] * runCos,
|
|
101
|
-
];
|
|
102
|
-
footprints.push({
|
|
103
|
-
position: modulePosition,
|
|
104
|
-
dimensions: [module.width, cabinetModuleTotalHeight(module), module.depth],
|
|
105
|
-
rotation: [0, runRotation + module.rotation, 0],
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
footprints.push({
|
|
111
|
-
position: runPosition,
|
|
112
|
-
dimensions: [run.width, cabinetTotalHeight(run), run.depth],
|
|
113
|
-
rotation: [0, runRotation, 0],
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
for (const childId of run.children ?? []) {
|
|
117
|
-
const child = nodes[childId];
|
|
118
|
-
if (isCabinetRun(child)) {
|
|
119
|
-
appendCabinetFloorPlacedFootprints(child, nodes, runPosition, runRotation, footprints);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
export function cabinetFloorPlacedFootprints(node, nodes) {
|
|
124
|
-
if (!nodes) {
|
|
125
|
-
return [
|
|
126
|
-
{
|
|
127
|
-
position: [...node.position],
|
|
128
|
-
dimensions: [node.width, cabinetTotalHeight(node), node.depth],
|
|
129
|
-
rotation: [0, node.rotation, 0],
|
|
130
|
-
},
|
|
131
|
-
];
|
|
132
|
-
}
|
|
133
|
-
const footprints = [];
|
|
134
|
-
appendCabinetFloorPlacedFootprints(node, nodes, [0, 0, 0], 0, footprints);
|
|
135
|
-
return footprints;
|
|
136
|
-
}
|
|
137
|
-
function cabinetRunOverlapsWallOpening({ levelId, node, nodes, position, rotation, }) {
|
|
138
|
-
const parentLevelId = (levelId ??
|
|
139
|
-
findLevelAncestorId(node.id, nodes));
|
|
140
|
-
if (!parentLevelId)
|
|
141
|
-
return false;
|
|
142
|
-
const candidate = { ...node, position: [...position], rotation };
|
|
143
|
-
return cabinetFloorPlacedFootprints(candidate, nodes).some((footprint) => {
|
|
144
|
-
if (!footprint.position)
|
|
145
|
-
return false;
|
|
146
|
-
const hit = findClosestCabinetWallInPlan({
|
|
147
|
-
excludeIds: [],
|
|
148
|
-
nodes: nodes,
|
|
149
|
-
parentLevelId,
|
|
150
|
-
planPoint: [footprint.position[0], footprint.position[2]],
|
|
151
|
-
yaw: footprint.rotation[1],
|
|
152
|
-
});
|
|
153
|
-
if (!hit)
|
|
154
|
-
return false;
|
|
155
|
-
const normalScale = hit.side === 'front' ? 1 : -1;
|
|
156
|
-
const expectedPerp = resolveCabinetWallFaceOffset({
|
|
157
|
-
hit,
|
|
158
|
-
nodes: nodes,
|
|
159
|
-
parentLevelId,
|
|
160
|
-
}) +
|
|
161
|
-
normalScale * (footprint.dimensions[2] / 2);
|
|
162
|
-
if (Math.abs(hit.perpDistance - expectedPerp) > 0.12)
|
|
163
|
-
return false;
|
|
164
|
-
return (findWallOpeningConflicts({
|
|
165
|
-
bottom: footprint.position[1],
|
|
166
|
-
height: footprint.dimensions[1],
|
|
167
|
-
localX: hit.localX,
|
|
168
|
-
nodes,
|
|
169
|
-
wall: hit.wall,
|
|
170
|
-
width: footprint.dimensions[0],
|
|
171
|
-
}).length > 0);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
const SIDE_HANDLE_OFFSET = 0.18;
|
|
175
|
-
const HEIGHT_HANDLE_OFFSET = 0.22;
|
|
176
|
-
const ROTATE_CORNER_OFFSET = 0.32;
|
|
177
|
-
const ROTATE_RING_OFFSET = 0.04;
|
|
178
|
-
const MIN_CABINET_CARCASS_HEIGHT = 0.4;
|
|
179
|
-
const CABINET_ADJACENCY_EPSILON = 1e-4;
|
|
180
|
-
const CABINET_DEPTH_SNAP_THRESHOLD = 0.02;
|
|
181
|
-
const CABINET_WIDTH_SNAP_THRESHOLD = 0.08;
|
|
182
|
-
function isCabinetModule(node) {
|
|
183
|
-
return node?.type === 'cabinet-module';
|
|
184
|
-
}
|
|
185
|
-
function isCabinetRun(node) {
|
|
186
|
-
return node?.type === 'cabinet';
|
|
187
|
-
}
|
|
188
|
-
function hasCabinetParentId(node) {
|
|
189
|
-
const parentId = node.parentId;
|
|
190
|
-
return (typeof parentId === 'string' &&
|
|
191
|
-
(parentId.startsWith('cabinet_') || parentId.startsWith('cabinet-module_')));
|
|
192
|
-
}
|
|
193
|
-
function resolveCabinetGroupMoveSnap({ candidatePosition, candidateRotation, levelId, movingIds, node, nodes, }) {
|
|
194
|
-
if (node.type !== 'cabinet' || !levelId)
|
|
195
|
-
return null;
|
|
196
|
-
return resolveCabinetRunWallSnap({
|
|
197
|
-
cabinet: node,
|
|
198
|
-
candidatePosition,
|
|
199
|
-
candidateRotation,
|
|
200
|
-
excludeIds: movingIds,
|
|
201
|
-
gridStep: 0,
|
|
202
|
-
nodes: nodes,
|
|
203
|
-
parentLevelId: levelId,
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
function resolveCabinetMoveGridSnap({ candidatePosition, candidateRotation, gridStep, node, nodes, }) {
|
|
207
|
-
if (!isCabinetRun(node))
|
|
208
|
-
return candidatePosition;
|
|
209
|
-
const bounds = cabinetLocalBounds(node, nodes);
|
|
210
|
-
const snapped = resolveCabinetGridPosition({
|
|
211
|
-
raw: candidatePosition,
|
|
212
|
-
dimensions: bounds.size,
|
|
213
|
-
footprintOffset: [bounds.center[0], bounds.center[2]],
|
|
214
|
-
yaw: candidateRotation,
|
|
215
|
-
step: gridStep,
|
|
216
|
-
});
|
|
217
|
-
return [snapped[0], candidatePosition[1], snapped[2]];
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Wall snap for a single dragged module. `parentFrame` kinds exchange
|
|
221
|
-
* `candidatePosition` in the run's LOCAL frame with the move tool (it
|
|
222
|
-
* converts through `planToLocal` before and `localToPlan` after), so this
|
|
223
|
-
* resolver works local-in / local-out.
|
|
224
|
-
*/
|
|
225
|
-
function resolveCabinetModuleGroupMoveSnap({ candidatePosition, levelId, movingIds, node, nodes, }) {
|
|
226
|
-
if (node.type !== 'cabinet-module' || !node.parentId)
|
|
227
|
-
return null;
|
|
228
|
-
const run = nodes[node.parentId];
|
|
229
|
-
if (!isCabinetRun(run))
|
|
230
|
-
return null;
|
|
231
|
-
const parentLevelId = (levelId ?? run.parentId ?? null);
|
|
232
|
-
if (!parentLevelId)
|
|
233
|
-
return null;
|
|
234
|
-
const position = resolveCabinetModuleWallSnapLocal({
|
|
235
|
-
candidateLocal: candidatePosition,
|
|
236
|
-
excludeIds: movingIds,
|
|
237
|
-
module: node,
|
|
238
|
-
nodes: nodes,
|
|
239
|
-
parentLevelId,
|
|
240
|
-
run,
|
|
241
|
-
});
|
|
242
|
-
return position ? { position } : null;
|
|
243
|
-
}
|
|
244
|
-
function cabinetLayoutRevision(metadata) {
|
|
245
|
-
return cabinetMetadataRecord(metadata).cabinetLayoutRevision ?? null;
|
|
246
|
-
}
|
|
247
|
-
function cabinetAdjacencyRevision(metadata) {
|
|
248
|
-
return cabinetMetadataRecord(metadata).cabinetAdjacencyRevision ?? null;
|
|
249
|
-
}
|
|
250
|
-
// Margin added to each run's reach when deciding whether two sibling runs can
|
|
251
|
-
// influence each other's countertop join — generous relative to any plausible
|
|
252
|
-
// `countertopOverhang` so a run sliding away still re-keys the neighbor it
|
|
253
|
-
// just un-joined from.
|
|
254
|
-
const CABINET_NEIGHBOR_JOIN_MARGIN = 0.5;
|
|
255
|
-
export function cabinetRunFootprint(run, nodes) {
|
|
256
|
-
const bounds = cabinetLocalBounds(run, nodes);
|
|
257
|
-
return {
|
|
258
|
-
parentId: (run.parentId ?? null),
|
|
259
|
-
x: run.position[0],
|
|
260
|
-
z: run.position[2],
|
|
261
|
-
reach: Math.hypot(bounds.size[0], bounds.size[2]) / 2 +
|
|
262
|
-
Math.hypot(bounds.center[0], bounds.center[2]) +
|
|
263
|
-
CABINET_NEIGHBOR_JOIN_MARGIN,
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Re-key sibling cabinet runs whose countertop join could be affected by a
|
|
268
|
-
* run that moved / resized / re-flowed. A run's overhang trims against
|
|
269
|
-
* adjacent sibling runs (`siblingCabinetSpansInRunLocal`), but a neighbor's
|
|
270
|
-
* own `geometryKey` doesn't change when THIS run moves — marking it dirty
|
|
271
|
-
* alone would be swallowed by the geometry system's key-skip cache. Bumping
|
|
272
|
-
* `cabinetAdjacencyRevision` (folded into the run geometryKey) both dirties
|
|
273
|
-
* and re-keys it. History is paused: the counter is derived presentation
|
|
274
|
-
* state, and an undo of the triggering move re-fires the watcher anyway.
|
|
275
|
-
*/
|
|
276
|
-
export function bumpCabinetRunsNear(sceneApi, footprints, moverIds) {
|
|
277
|
-
const nodes = sceneApi.nodes();
|
|
278
|
-
const targets = new Set();
|
|
279
|
-
for (const footprint of footprints) {
|
|
280
|
-
if (!footprint.parentId)
|
|
281
|
-
continue;
|
|
282
|
-
const parent = nodes[footprint.parentId];
|
|
283
|
-
const childIds = parent?.children;
|
|
284
|
-
if (!Array.isArray(childIds))
|
|
285
|
-
continue;
|
|
286
|
-
for (const childId of childIds) {
|
|
287
|
-
if (moverIds.has(childId) || targets.has(childId))
|
|
288
|
-
continue;
|
|
289
|
-
const sibling = nodes[childId];
|
|
290
|
-
if (!isCabinetRun(sibling))
|
|
291
|
-
continue;
|
|
292
|
-
const siblingFootprint = cabinetRunFootprint(sibling, nodes);
|
|
293
|
-
const distance = Math.hypot(siblingFootprint.x - footprint.x, siblingFootprint.z - footprint.z);
|
|
294
|
-
if (distance <= siblingFootprint.reach + footprint.reach)
|
|
295
|
-
targets.add(childId);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (targets.size === 0)
|
|
299
|
-
return;
|
|
300
|
-
// A mover's own trim also depends on its offset to those neighbors, and
|
|
301
|
-
// `position` is not in its geometryKey — re-key it alongside them. Movers
|
|
302
|
-
// with no neighbors in range never reach here, keeping lone-cabinet moves
|
|
303
|
-
// rebuild-free.
|
|
304
|
-
for (const id of moverIds) {
|
|
305
|
-
if (isCabinetRun(nodes[id]))
|
|
306
|
-
targets.add(id);
|
|
307
|
-
}
|
|
308
|
-
sceneApi.pauseHistory();
|
|
309
|
-
try {
|
|
310
|
-
for (const id of targets) {
|
|
311
|
-
const run = sceneApi.get(id);
|
|
312
|
-
if (!isCabinetRun(run))
|
|
313
|
-
continue;
|
|
314
|
-
const metadataRecord = cabinetMetadataRecord(run.metadata);
|
|
315
|
-
const currentRevision = typeof metadataRecord.cabinetAdjacencyRevision === 'number'
|
|
316
|
-
? metadataRecord.cabinetAdjacencyRevision
|
|
317
|
-
: 0;
|
|
318
|
-
sceneApi.update(id, {
|
|
319
|
-
metadata: { ...metadataRecord, cabinetAdjacencyRevision: currentRevision + 1 },
|
|
320
|
-
});
|
|
321
|
-
sceneApi.markDirty(id);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
finally {
|
|
325
|
-
sceneApi.resumeHistory();
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
/** Inputs of a run that can change a NEIGHBOR's countertop join. */
|
|
329
|
-
export function cabinetRunNeighborSignature(run) {
|
|
330
|
-
return JSON.stringify([
|
|
331
|
-
run.position[0],
|
|
332
|
-
run.position[2],
|
|
333
|
-
run.rotation,
|
|
334
|
-
run.width,
|
|
335
|
-
run.depth,
|
|
336
|
-
run.carcassHeight,
|
|
337
|
-
run.runTier,
|
|
338
|
-
run.countertopOverhang,
|
|
339
|
-
(run.children ?? []).filter((id) => id.startsWith('cabinet_') || id.startsWith('cabinet-module_')),
|
|
340
|
-
cabinetLayoutRevision(run.metadata),
|
|
341
|
-
]);
|
|
342
|
-
}
|
|
343
|
-
function includeCabinetModuleBounds(module, nodes, origin, bounds) {
|
|
344
|
-
const x = origin[0] + module.position[0];
|
|
345
|
-
const y = origin[1] + module.position[1];
|
|
346
|
-
const z = origin[2] + module.position[2];
|
|
347
|
-
bounds.minX = Math.min(bounds.minX, x - module.width / 2);
|
|
348
|
-
bounds.maxX = Math.max(bounds.maxX, x + module.width / 2);
|
|
349
|
-
bounds.minY = Math.min(bounds.minY, y - (module.showPlinth ? module.plinthHeight : 0));
|
|
350
|
-
bounds.maxY = Math.max(bounds.maxY, y + cabinetModuleTotalHeight(module));
|
|
351
|
-
bounds.minZ = Math.min(bounds.minZ, z - module.depth / 2);
|
|
352
|
-
bounds.maxZ = Math.max(bounds.maxZ, z + module.depth / 2);
|
|
353
|
-
for (const childId of module.children ?? []) {
|
|
354
|
-
const child = nodes[childId];
|
|
355
|
-
if (isCabinetModule(child))
|
|
356
|
-
includeCabinetModuleBounds(child, nodes, [x, y, z], bounds);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Fold a child cabinet run (an L-corner leg parented to this run) into the
|
|
361
|
-
* parent's local bounds: take the child's own local bounds, rotate its XZ
|
|
362
|
-
* corners by the child's local rotation, and offset by its local position.
|
|
363
|
-
*/
|
|
364
|
-
function includeChildRunBounds(child, nodes, bounds) {
|
|
365
|
-
const childBounds = cabinetLocalBounds(child, nodes);
|
|
366
|
-
const cos = Math.cos(child.rotation);
|
|
367
|
-
const sin = Math.sin(child.rotation);
|
|
368
|
-
for (const [lx, lz] of [
|
|
369
|
-
[childBounds.minX, childBounds.minZ],
|
|
370
|
-
[childBounds.maxX, childBounds.minZ],
|
|
371
|
-
[childBounds.maxX, childBounds.maxZ],
|
|
372
|
-
[childBounds.minX, childBounds.maxZ],
|
|
373
|
-
]) {
|
|
374
|
-
const x = child.position[0] + lx * cos + lz * sin;
|
|
375
|
-
const z = child.position[2] - lx * sin + lz * cos;
|
|
376
|
-
bounds.minX = Math.min(bounds.minX, x);
|
|
377
|
-
bounds.maxX = Math.max(bounds.maxX, x);
|
|
378
|
-
bounds.minZ = Math.min(bounds.minZ, z);
|
|
379
|
-
bounds.maxZ = Math.max(bounds.maxZ, z);
|
|
380
|
-
}
|
|
381
|
-
bounds.minY = Math.min(bounds.minY, child.position[1] + childBounds.minY);
|
|
382
|
-
bounds.maxY = Math.max(bounds.maxY, child.position[1] + childBounds.maxY);
|
|
383
|
-
}
|
|
384
|
-
function cabinetLocalBounds(node, nodes) {
|
|
385
|
-
const bounds = {
|
|
386
|
-
minX: -node.width / 2,
|
|
387
|
-
maxX: node.width / 2,
|
|
388
|
-
minY: 0,
|
|
389
|
-
maxY: node.type === 'cabinet-module' ? cabinetModuleTotalHeight(node) : cabinetTotalHeight(node),
|
|
390
|
-
minZ: -node.depth / 2,
|
|
391
|
-
maxZ: node.depth / 2,
|
|
392
|
-
};
|
|
393
|
-
if (isCabinetRun(node) && nodes) {
|
|
394
|
-
const modules = cabinetModulesForRun(node, nodes);
|
|
395
|
-
if (modules.length > 0) {
|
|
396
|
-
bounds.minX = Number.POSITIVE_INFINITY;
|
|
397
|
-
bounds.maxX = Number.NEGATIVE_INFINITY;
|
|
398
|
-
bounds.minY = 0;
|
|
399
|
-
bounds.maxY = (node.showPlinth ? node.plinthHeight : 0) + node.carcassHeight;
|
|
400
|
-
bounds.minZ = Number.POSITIVE_INFINITY;
|
|
401
|
-
bounds.maxZ = Number.NEGATIVE_INFINITY;
|
|
402
|
-
for (const module of modules) {
|
|
403
|
-
includeCabinetModuleBounds(module, nodes, [0, 0, 0], bounds);
|
|
404
|
-
}
|
|
405
|
-
bounds.maxY = Math.max(bounds.maxY, cabinetTotalHeight(node));
|
|
406
|
-
// A seating back overhang (unlike the small front/side overhang) is
|
|
407
|
-
// deep enough to matter for selection and collision.
|
|
408
|
-
if (node.withCountertop && node.barLedge?.edge !== 'back') {
|
|
409
|
-
bounds.minZ -= node.countertopBackOverhang;
|
|
410
|
-
}
|
|
411
|
-
if (node.withFinishedBack)
|
|
412
|
-
bounds.minZ -= node.boardThickness;
|
|
413
|
-
if (node.barLedge) {
|
|
414
|
-
const edge = node.barLedge.edge;
|
|
415
|
-
if (edge === 'back')
|
|
416
|
-
bounds.minZ -= node.barLedge.depth;
|
|
417
|
-
if (edge === 'left')
|
|
418
|
-
bounds.minX -= node.barLedge.depth;
|
|
419
|
-
if (edge === 'right')
|
|
420
|
-
bounds.maxX += node.barLedge.depth;
|
|
421
|
-
bounds.maxY = Math.max(bounds.maxY, node.barLedge.height);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
// L-corner leg runs are cabinet children of the source run — fold them in
|
|
425
|
-
// so the run's rotate ring / pivot / drag box covers the whole L.
|
|
426
|
-
for (const childId of node.children ?? []) {
|
|
427
|
-
const child = nodes[childId];
|
|
428
|
-
if (isCabinetRun(child))
|
|
429
|
-
includeChildRunBounds(child, nodes, bounds);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
if (isCabinetModule(node) && nodes) {
|
|
433
|
-
for (const childId of node.children ?? []) {
|
|
434
|
-
const child = nodes[childId];
|
|
435
|
-
if (isCabinetModule(child)) {
|
|
436
|
-
includeCabinetModuleBounds(child, nodes, [0, 0, 0], bounds);
|
|
437
|
-
}
|
|
438
|
-
else if (isCabinetRun(child)) {
|
|
439
|
-
includeChildRunBounds(child, nodes, bounds);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
const width = Math.max(0.01, bounds.maxX - bounds.minX);
|
|
444
|
-
const height = Math.max(0.01, bounds.maxY - bounds.minY);
|
|
445
|
-
const depth = Math.max(0.01, bounds.maxZ - bounds.minZ);
|
|
446
|
-
return {
|
|
447
|
-
...bounds,
|
|
448
|
-
size: [width, height, depth],
|
|
449
|
-
center: [
|
|
450
|
-
(bounds.minX + bounds.maxX) / 2,
|
|
451
|
-
(bounds.minY + bounds.maxY) / 2,
|
|
452
|
-
(bounds.minZ + bounds.maxZ) / 2,
|
|
453
|
-
],
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
function cabinetPlanBoundsAabb(node, nodes) {
|
|
457
|
-
const bounds = cabinetLocalBounds(node, nodes);
|
|
458
|
-
const cos = Math.cos(node.rotation);
|
|
459
|
-
const sin = Math.sin(node.rotation);
|
|
460
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
461
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
462
|
-
let minZ = Number.POSITIVE_INFINITY;
|
|
463
|
-
let maxZ = Number.NEGATIVE_INFINITY;
|
|
464
|
-
for (const [lx, lz] of [
|
|
465
|
-
[bounds.minX, bounds.minZ],
|
|
466
|
-
[bounds.maxX, bounds.minZ],
|
|
467
|
-
[bounds.maxX, bounds.maxZ],
|
|
468
|
-
[bounds.minX, bounds.maxZ],
|
|
469
|
-
]) {
|
|
470
|
-
const x = node.position[0] + lx * cos + lz * sin;
|
|
471
|
-
const z = node.position[2] - lx * sin + lz * cos;
|
|
472
|
-
minX = Math.min(minX, x);
|
|
473
|
-
maxX = Math.max(maxX, x);
|
|
474
|
-
minZ = Math.min(minZ, z);
|
|
475
|
-
maxZ = Math.max(maxZ, z);
|
|
476
|
-
}
|
|
477
|
-
return { minX, maxX, minZ, maxZ };
|
|
478
|
-
}
|
|
479
|
-
function cabinetModuleSideOpen(module, side, sceneApi) {
|
|
480
|
-
const parent = module.parentId ? sceneApi.get(module.parentId) : undefined;
|
|
481
|
-
if (!isCabinetRun(parent))
|
|
482
|
-
return true;
|
|
483
|
-
return moduleSideOpen(cabinetModulesForRun(parent, sceneApi.nodes()), module.id, side, CABINET_ADJACENCY_EPSILON);
|
|
484
|
-
}
|
|
485
|
-
function cabinetModuleConnectedNeighbor(module, side, sceneApi) {
|
|
486
|
-
const parent = module.parentId ? sceneApi.get(module.parentId) : undefined;
|
|
487
|
-
if (!isCabinetRun(parent))
|
|
488
|
-
return undefined;
|
|
489
|
-
const modules = sortRunModules(cabinetModulesForRun(parent, sceneApi.nodes()));
|
|
490
|
-
const index = modules.findIndex((entry) => entry.id === module.id);
|
|
491
|
-
if (index < 0 || cabinetModuleSideOpen(module, side, sceneApi))
|
|
492
|
-
return undefined;
|
|
493
|
-
return side === 'left' ? modules[index - 1] : modules[index + 1];
|
|
494
|
-
}
|
|
495
|
-
function cabinetWidthConnectedNeighbor(module, side, sceneApi) {
|
|
496
|
-
const parent = module.parentId ? sceneApi.get(module.parentId) : undefined;
|
|
497
|
-
if (isCabinetRun(parent))
|
|
498
|
-
return cabinetModuleConnectedNeighbor(module, side, sceneApi);
|
|
499
|
-
if (!isCabinetModule(parent))
|
|
500
|
-
return undefined;
|
|
501
|
-
if (wallChildOf(parent, sceneApi.nodes())?.id !== module.id)
|
|
502
|
-
return undefined;
|
|
503
|
-
const connectedHost = cabinetModuleConnectedNeighbor(parent, side, sceneApi);
|
|
504
|
-
if (!connectedHost || isCabinetWidthFiller(connectedHost))
|
|
505
|
-
return undefined;
|
|
506
|
-
return wallChildOf(connectedHost, sceneApi.nodes()) ?? undefined;
|
|
507
|
-
}
|
|
508
|
-
function cabinetModuleRunLocalCenterX(module, sceneApi) {
|
|
509
|
-
const parent = module.parentId ? sceneApi.get(module.parentId) : undefined;
|
|
510
|
-
if (isCabinetRun(parent))
|
|
511
|
-
return module.position[0];
|
|
512
|
-
if (!isCabinetModule(parent))
|
|
513
|
-
return null;
|
|
514
|
-
const run = parent.parentId ? sceneApi.get(parent.parentId) : undefined;
|
|
515
|
-
return isCabinetRun(run) ? parent.position[0] + module.position[0] : null;
|
|
516
|
-
}
|
|
517
|
-
function cabinetWallWidthGap(module, side, sceneApi) {
|
|
518
|
-
const parent = module.parentId ? sceneApi.get(module.parentId) : undefined;
|
|
519
|
-
const isWallModule = (isCabinetRun(parent) && parent.runTier === 'wall') ||
|
|
520
|
-
(isCabinetModule(parent) && wallChildOf(parent, sceneApi.nodes())?.id === module.id);
|
|
521
|
-
if (!isWallModule)
|
|
522
|
-
return 0;
|
|
523
|
-
const connected = cabinetWidthConnectedNeighbor(module, side, sceneApi);
|
|
524
|
-
if (!connected || isCabinetWidthFiller(connected))
|
|
525
|
-
return 0;
|
|
526
|
-
const moduleCenter = cabinetModuleRunLocalCenterX(module, sceneApi);
|
|
527
|
-
const connectedCenter = cabinetModuleRunLocalCenterX(connected, sceneApi);
|
|
528
|
-
if (moduleCenter === null || connectedCenter === null)
|
|
529
|
-
return 0;
|
|
530
|
-
const direction = side === 'right' ? 1 : -1;
|
|
531
|
-
return Math.max(0, direction * (connectedCenter - moduleCenter) - (module.width + connected.width) / 2);
|
|
532
|
-
}
|
|
533
|
-
function isCabinetWidthFiller(module) {
|
|
534
|
-
return (module.moduleKind !== 'standard' ||
|
|
535
|
-
module.name === 'Corner Filler' ||
|
|
536
|
-
module.name === 'Wall Bridge Filler' ||
|
|
537
|
-
module.name === 'Corner Wall Filler');
|
|
538
|
-
}
|
|
539
|
-
function cabinetNodeAttachedToAncestor(node, ancestorId, nodes) {
|
|
540
|
-
let current = node;
|
|
541
|
-
const visited = new Set();
|
|
542
|
-
while (current.parentId) {
|
|
543
|
-
const currentId = current.id;
|
|
544
|
-
if (visited.has(currentId))
|
|
545
|
-
return false;
|
|
546
|
-
visited.add(currentId);
|
|
547
|
-
const parent = nodes[current.parentId];
|
|
548
|
-
if (parent?.type !== 'cabinet' && parent?.type !== 'cabinet-module')
|
|
549
|
-
return false;
|
|
550
|
-
if (!(parent.children ?? []).includes(currentId))
|
|
551
|
-
return false;
|
|
552
|
-
if (parent.id === ancestorId)
|
|
553
|
-
return true;
|
|
554
|
-
current = parent;
|
|
555
|
-
}
|
|
556
|
-
return false;
|
|
557
|
-
}
|
|
558
|
-
function cabinetSubtreeHasNamedFiller(root, name, sceneApi) {
|
|
559
|
-
const pending = [...(root.children ?? [])];
|
|
560
|
-
const visited = new Set();
|
|
561
|
-
while (pending.length > 0) {
|
|
562
|
-
const id = pending.pop();
|
|
563
|
-
if (visited.has(id))
|
|
564
|
-
continue;
|
|
565
|
-
visited.add(id);
|
|
566
|
-
const node = sceneApi.get(id);
|
|
567
|
-
if (!node)
|
|
568
|
-
continue;
|
|
569
|
-
if (node.type === 'cabinet-module' && isCabinetWidthFiller(node) && node.name === name) {
|
|
570
|
-
return true;
|
|
571
|
-
}
|
|
572
|
-
if (node.type === 'cabinet' || node.type === 'cabinet-module') {
|
|
573
|
-
pending.push(...(node.children ?? []));
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
return false;
|
|
577
|
-
}
|
|
578
|
-
function wallCabinetSideHasFiller(hostModule, side, sceneApi) {
|
|
579
|
-
const hostRun = hostModule.parentId
|
|
580
|
-
? sceneApi.get(hostModule.parentId)
|
|
581
|
-
: undefined;
|
|
582
|
-
if (!hostRun || !isCabinetRun(hostRun))
|
|
583
|
-
return false;
|
|
584
|
-
const connected = cabinetModuleConnectedNeighbor(hostModule, side, sceneApi);
|
|
585
|
-
if (connected &&
|
|
586
|
-
isCabinetWidthFiller(connected) &&
|
|
587
|
-
cabinetSubtreeHasNamedFiller(connected, 'Corner Wall Filler', sceneApi)) {
|
|
588
|
-
return true;
|
|
589
|
-
}
|
|
590
|
-
const nodes = sceneApi.nodes();
|
|
591
|
-
for (const candidate of Object.values(nodes)) {
|
|
592
|
-
if (candidate?.type !== 'cabinet')
|
|
593
|
-
continue;
|
|
594
|
-
const derived = cabinetMetadataRecord(candidate.metadata).cabinetCornerDerivedRun;
|
|
595
|
-
if (!derived || typeof derived !== 'object' || Array.isArray(derived))
|
|
596
|
-
continue;
|
|
597
|
-
if (derived.role !== 'bridge' ||
|
|
598
|
-
derived.side !== side ||
|
|
599
|
-
derived.sourceModuleId !== hostModule.id ||
|
|
600
|
-
derived.sourceRunId !== hostRun.id ||
|
|
601
|
-
!cabinetNodeAttachedToAncestor(candidate, hostRun.id, nodes)) {
|
|
602
|
-
continue;
|
|
603
|
-
}
|
|
604
|
-
if (cabinetModulesForRun(candidate, nodes).some((entry) => entry.name === 'Wall Bridge Filler')) {
|
|
605
|
-
return true;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
return false;
|
|
609
|
-
}
|
|
610
|
-
function cabinetModuleSideHasCornerFiller(module, side, sceneApi) {
|
|
611
|
-
const parent = module.parentId ? sceneApi.get(module.parentId) : undefined;
|
|
612
|
-
if (isCabinetModule(parent)) {
|
|
613
|
-
return wallCabinetSideHasFiller(parent, side, sceneApi);
|
|
614
|
-
}
|
|
615
|
-
if (!isCabinetRun(parent))
|
|
616
|
-
return false;
|
|
617
|
-
const connected = cabinetModuleConnectedNeighbor(module, side, sceneApi);
|
|
618
|
-
if (connected && isCabinetWidthFiller(connected)) {
|
|
619
|
-
return true;
|
|
620
|
-
}
|
|
621
|
-
for (const candidate of Object.values(sceneApi.nodes())) {
|
|
622
|
-
if (candidate?.type !== 'cabinet')
|
|
623
|
-
continue;
|
|
624
|
-
const derived = cabinetMetadataRecord(candidate.metadata).cabinetCornerDerivedRun;
|
|
625
|
-
if (!derived || typeof derived !== 'object' || Array.isArray(derived))
|
|
626
|
-
continue;
|
|
627
|
-
if (candidate.parentId !== parent.id ||
|
|
628
|
-
!(parent.children ?? []).includes(candidate.id) ||
|
|
629
|
-
derived.role !== 'base-leg' ||
|
|
630
|
-
derived.side !== side ||
|
|
631
|
-
derived.sourceModuleId !== module.id ||
|
|
632
|
-
derived.sourceRunId !== parent.id) {
|
|
633
|
-
continue;
|
|
634
|
-
}
|
|
635
|
-
if (cabinetModulesForRun(candidate, sceneApi.nodes()).some((entry) => entry.moduleKind === 'corner-filler')) {
|
|
636
|
-
return true;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
return false;
|
|
640
|
-
}
|
|
641
|
-
function connectedCabinetWidthResize(module, side, delta, sceneApi) {
|
|
642
|
-
const connected = cabinetWidthConnectedNeighbor(module, side, sceneApi);
|
|
643
|
-
if (!connected || isCabinetWidthFiller(connected))
|
|
644
|
-
return null;
|
|
645
|
-
const direction = side === 'right' ? 1 : -1;
|
|
646
|
-
return {
|
|
647
|
-
module: connected,
|
|
648
|
-
patch: {
|
|
649
|
-
width: connected.width - delta,
|
|
650
|
-
position: [
|
|
651
|
-
connected.position[0] + (direction * delta) / 2,
|
|
652
|
-
connected.position[1],
|
|
653
|
-
connected.position[2],
|
|
654
|
-
],
|
|
655
|
-
},
|
|
656
|
-
};
|
|
657
|
-
}
|
|
658
|
-
function wallCabinetWidthOverride(module, width, sceneApi) {
|
|
659
|
-
const parent = module.parentId
|
|
660
|
-
? sceneApi.get(module.parentId)
|
|
661
|
-
: undefined;
|
|
662
|
-
if (!parent || !isCabinetRun(parent) || resolveCabinetType(module, parent) !== 'base')
|
|
663
|
-
return null;
|
|
664
|
-
const wallChild = wallChildOf(module, sceneApi.nodes());
|
|
665
|
-
return wallChild ? [wallChild.id, { width }] : null;
|
|
666
|
-
}
|
|
667
|
-
function parentRunGeometryPreviewOverride(node, sceneApi) {
|
|
668
|
-
if (!isCabinetModule(node) || !node.parentId)
|
|
669
|
-
return null;
|
|
670
|
-
const parent = sceneApi.get(node.parentId);
|
|
671
|
-
if (isCabinetRun(parent))
|
|
672
|
-
return [parent.id, {}];
|
|
673
|
-
if (!isCabinetModule(parent) || wallChildOf(parent, sceneApi.nodes())?.id !== node.id)
|
|
674
|
-
return null;
|
|
675
|
-
const run = parent.parentId ? sceneApi.get(parent.parentId) : undefined;
|
|
676
|
-
return isCabinetRun(run) ? [run.id, {}] : null;
|
|
677
|
-
}
|
|
678
|
-
function sharedDepthBounds(referenceDepth, targets, nodes) {
|
|
679
|
-
const depthOwners = targets.flatMap((target) => {
|
|
680
|
-
if (!isCabinetRun(target))
|
|
681
|
-
return [target];
|
|
682
|
-
const modules = cabinetModulesForRun(target, nodes);
|
|
683
|
-
return modules.length > 0 ? [target, ...modules] : [target];
|
|
684
|
-
});
|
|
685
|
-
const minDelta = Math.max(...depthOwners.map((target) => MIN_CABINET_DEPTH - target.depth));
|
|
686
|
-
const maxDelta = Math.min(...depthOwners.map((target) => cabinetResizeUpperBound(target.depth, MAX_CABINET_DEPTH) - target.depth));
|
|
687
|
-
return {
|
|
688
|
-
min: referenceDepth + minDelta,
|
|
689
|
-
max: referenceDepth + maxDelta,
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
function depthDeltaRunOverrides(run, nodes, depthDelta) {
|
|
693
|
-
const overrides = [];
|
|
694
|
-
for (const module of cabinetModulesForRun(run, nodes)) {
|
|
695
|
-
const depth = module.depth + depthDelta;
|
|
696
|
-
const positionZ = backAnchoredModuleZ(module.position[2], module.depth, depth);
|
|
697
|
-
const parentShiftZ = positionZ - module.position[2];
|
|
698
|
-
overrides.push([
|
|
699
|
-
module.id,
|
|
700
|
-
{
|
|
701
|
-
depth,
|
|
702
|
-
position: [module.position[0], module.position[1], positionZ],
|
|
703
|
-
},
|
|
704
|
-
]);
|
|
705
|
-
for (const childId of module.children ?? []) {
|
|
706
|
-
const child = nodes[childId];
|
|
707
|
-
if (child?.type !== 'cabinet')
|
|
708
|
-
continue;
|
|
709
|
-
overrides.push([
|
|
710
|
-
child.id,
|
|
711
|
-
{
|
|
712
|
-
position: [child.position[0], child.position[1], child.position[2] - parentShiftZ],
|
|
713
|
-
},
|
|
714
|
-
]);
|
|
715
|
-
}
|
|
716
|
-
const wallChild = wallChildOf(module, nodes);
|
|
717
|
-
if (wallChild) {
|
|
718
|
-
overrides.push([
|
|
719
|
-
wallChild.id,
|
|
720
|
-
{
|
|
721
|
-
position: [
|
|
722
|
-
wallChild.position[0],
|
|
723
|
-
wallChild.position[1],
|
|
724
|
-
backAlignZ(depth, wallChild.depth),
|
|
725
|
-
],
|
|
726
|
-
},
|
|
727
|
-
]);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
return overrides;
|
|
731
|
-
}
|
|
732
|
-
function commitRunResize(run, patch, sceneApi, options = {}) {
|
|
733
|
-
sceneApi.update(run.id, patch);
|
|
734
|
-
const nextRun = { ...run, ...patch };
|
|
735
|
-
const syncDepth = typeof patch.depth === 'number';
|
|
736
|
-
const syncHeight = typeof patch.carcassHeight === 'number';
|
|
737
|
-
const syncPosition = patch.showPlinth !== undefined || typeof patch.plinthHeight === 'number';
|
|
738
|
-
if (syncDepth || syncHeight || syncPosition) {
|
|
739
|
-
const depthOverrides = new Map(syncDepth ? backAlignedRunDepthOverrides(run, sceneApi.nodes(), nextRun.depth) : []);
|
|
740
|
-
for (const module of cabinetModulesForRun(run, sceneApi.nodes())) {
|
|
741
|
-
const modulePatch = {};
|
|
742
|
-
if (syncDepth) {
|
|
743
|
-
Object.assign(modulePatch, depthOverrides.get(module.id));
|
|
744
|
-
}
|
|
745
|
-
if (syncHeight) {
|
|
746
|
-
modulePatch.carcassHeight = Math.max(nextRun.carcassHeight, minCabinetCarcassHeightForStack(module));
|
|
747
|
-
}
|
|
748
|
-
if (syncPosition) {
|
|
749
|
-
modulePatch.position = [
|
|
750
|
-
modulePatch.position?.[0] ?? module.position[0],
|
|
751
|
-
runModuleBaseY(nextRun),
|
|
752
|
-
modulePatch.position?.[2] ?? module.position[2],
|
|
753
|
-
];
|
|
754
|
-
}
|
|
755
|
-
if (Object.keys(modulePatch).length > 0) {
|
|
756
|
-
sceneApi.update(module.id, modulePatch);
|
|
757
|
-
const wallChild = wallChildOf(module, sceneApi.nodes());
|
|
758
|
-
if (wallChild && typeof modulePatch.depth === 'number') {
|
|
759
|
-
sceneApi.update(wallChild.id, {
|
|
760
|
-
position: [
|
|
761
|
-
wallChild.position[0],
|
|
762
|
-
wallChild.position[1],
|
|
763
|
-
backAlignZ(modulePatch.depth, wallChild.depth),
|
|
764
|
-
],
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
if (syncDepth) {
|
|
770
|
-
for (const [id, depthPatch] of depthOverrides) {
|
|
771
|
-
if (sceneApi.get(id)?.type !== 'cabinet')
|
|
772
|
-
continue;
|
|
773
|
-
sceneApi.update(id, depthPatch);
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
if (syncDepth || syncHeight || syncPosition) {
|
|
778
|
-
bumpCabinetRunLayoutRevision(sceneApi, nextRun);
|
|
779
|
-
syncCornerRunsFromRunSources({
|
|
780
|
-
baseLayout: options.cornerSync ?? 'full',
|
|
781
|
-
run: nextRun,
|
|
782
|
-
sceneApi,
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
function commitRunDepthDelta(run, depth, sceneApi, options = {}) {
|
|
787
|
-
const depthDelta = depth - run.depth;
|
|
788
|
-
for (const [id, patch] of depthDeltaRunOverrides(run, sceneApi.nodes(), depthDelta)) {
|
|
789
|
-
sceneApi.update(id, patch);
|
|
790
|
-
}
|
|
791
|
-
sceneApi.update(run.id, { depth });
|
|
792
|
-
const nextRun = { ...run, depth };
|
|
793
|
-
bumpCabinetRunLayoutRevision(sceneApi, nextRun);
|
|
794
|
-
syncCornerRunsFromRunSources({
|
|
795
|
-
baseLayout: options.cornerSync ?? 'full',
|
|
796
|
-
run: nextRun,
|
|
797
|
-
sceneApi,
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
function commitModuleResize(module, patch, sceneApi) {
|
|
801
|
-
const nodes = sceneApi.nodes();
|
|
802
|
-
const parent = module.parentId ? nodes[module.parentId] : undefined;
|
|
803
|
-
const parentRun = isCabinetRun(parent) ? parent : undefined;
|
|
804
|
-
if (!parentRun) {
|
|
805
|
-
sceneApi.update(module.id, patch);
|
|
806
|
-
const parentModule = isCabinetModule(parent) ? parent : undefined;
|
|
807
|
-
if (parentModule)
|
|
808
|
-
sceneApi.markDirty(parentModule.id);
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
if (typeof patch.width === 'number') {
|
|
812
|
-
const previousModule = module;
|
|
813
|
-
sceneApi.update(module.id, patch);
|
|
814
|
-
if (resolveCabinetType(module, parentRun) === 'base') {
|
|
815
|
-
const wallChild = wallChildOf(module, sceneApi.nodes());
|
|
816
|
-
if (wallChild) {
|
|
817
|
-
sceneApi.update(wallChild.id, { width: patch.width });
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
bumpCabinetRunLayoutRevision(sceneApi, parentRun);
|
|
821
|
-
syncCornerRunsFromSourceModule({
|
|
822
|
-
module: sceneApi.get(module.id) ?? module,
|
|
823
|
-
previousModule,
|
|
824
|
-
run: sceneApi.get(parentRun.id) ?? parentRun,
|
|
825
|
-
sceneApi,
|
|
826
|
-
});
|
|
827
|
-
return;
|
|
828
|
-
}
|
|
829
|
-
const modulePatch = { ...patch };
|
|
830
|
-
if (typeof patch.depth === 'number') {
|
|
831
|
-
modulePatch.position = [
|
|
832
|
-
patch.position?.[0] ?? module.position[0],
|
|
833
|
-
patch.position?.[1] ?? module.position[1],
|
|
834
|
-
backAnchoredModuleZ(module.position[2], module.depth, patch.depth),
|
|
835
|
-
];
|
|
836
|
-
}
|
|
837
|
-
sceneApi.update(module.id, modulePatch);
|
|
838
|
-
if (resolveCabinetType(module, parentRun) === 'base') {
|
|
839
|
-
const runPatch = {};
|
|
840
|
-
if (typeof patch.carcassHeight === 'number') {
|
|
841
|
-
runPatch.carcassHeight = patch.carcassHeight;
|
|
842
|
-
}
|
|
843
|
-
if (Object.keys(runPatch).length > 0) {
|
|
844
|
-
commitRunResize(parentRun, runPatch, sceneApi);
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
847
|
-
bumpCabinetRunLayoutRevision(sceneApi, parentRun);
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
else {
|
|
851
|
-
bumpCabinetRunLayoutRevision(sceneApi, parentRun);
|
|
852
|
-
}
|
|
853
|
-
syncCornerRunsFromSourceModule({
|
|
854
|
-
module: sceneApi.get(module.id) ?? module,
|
|
855
|
-
previousModule: module,
|
|
856
|
-
run: sceneApi.get(parentRun.id) ?? parentRun,
|
|
857
|
-
sceneApi,
|
|
858
|
-
});
|
|
859
|
-
const wallChild = wallChildOf(module, sceneApi.nodes());
|
|
860
|
-
if (wallChild && typeof modulePatch.depth === 'number') {
|
|
861
|
-
sceneApi.update(wallChild.id, {
|
|
862
|
-
position: [
|
|
863
|
-
wallChild.position[0],
|
|
864
|
-
wallChild.position[1],
|
|
865
|
-
backAlignZ(modulePatch.depth, wallChild.depth),
|
|
866
|
-
],
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
function commitCabinetResize(node, patch, sceneApi) {
|
|
871
|
-
const liveNode = sceneApi.get(node.id) ?? node;
|
|
872
|
-
if (isCabinetRun(liveNode)) {
|
|
873
|
-
commitRunResize(liveNode, patch, sceneApi);
|
|
874
|
-
return;
|
|
875
|
-
}
|
|
876
|
-
if (isCabinetModule(liveNode)) {
|
|
877
|
-
commitModuleResize(liveNode, patch, sceneApi);
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
sceneApi.update(node.id, patch);
|
|
881
|
-
}
|
|
882
|
-
function cabinetManualWidthContext(node, sceneApi) {
|
|
883
|
-
const parent = node.parentId ? sceneApi.get(node.parentId) : undefined;
|
|
884
|
-
if (isCabinetRun(parent)) {
|
|
885
|
-
return { run: parent, selected: node, modules: cabinetModulesForRun(parent, sceneApi.nodes()) };
|
|
886
|
-
}
|
|
887
|
-
if (!isCabinetModule(parent))
|
|
888
|
-
return null;
|
|
889
|
-
const run = parent.parentId ? sceneApi.get(parent.parentId) : undefined;
|
|
890
|
-
if (!isCabinetRun(run) || wallChildOf(parent, sceneApi.nodes())?.id !== node.id)
|
|
891
|
-
return null;
|
|
892
|
-
return { run, selected: parent, modules: cabinetModulesForRun(run, sceneApi.nodes()) };
|
|
893
|
-
}
|
|
894
|
-
function cabinetWidthIsNestedModule(node, sceneApi) {
|
|
895
|
-
const context = cabinetManualWidthContext(node, sceneApi);
|
|
896
|
-
return context !== null && context.selected.id !== node.id;
|
|
897
|
-
}
|
|
898
|
-
function snapCabinetWidth(node, width, side, sceneApi) {
|
|
899
|
-
const context = cabinetManualWidthContext(node, sceneApi);
|
|
900
|
-
if (!context)
|
|
901
|
-
return width;
|
|
902
|
-
const sorted = sortRunModules(context.modules);
|
|
903
|
-
const selected = context.selected;
|
|
904
|
-
const selectedIndex = sorted.findIndex((module) => module.id === selected.id);
|
|
905
|
-
const neighborHost = sorted[side === 'right' ? selectedIndex + 1 : selectedIndex - 1];
|
|
906
|
-
if (!neighborHost)
|
|
907
|
-
return width;
|
|
908
|
-
const nested = selected.id !== node.id;
|
|
909
|
-
const snapTarget = nested ? wallChildOf(neighborHost, sceneApi.nodes()) : neighborHost;
|
|
910
|
-
if (!snapTarget)
|
|
911
|
-
return width;
|
|
912
|
-
const selectedCenter = nested
|
|
913
|
-
? cabinetModuleRunLocalCenterX(node, sceneApi)
|
|
914
|
-
: selected.position[0];
|
|
915
|
-
const targetCenter = nested
|
|
916
|
-
? cabinetModuleRunLocalCenterX(snapTarget, sceneApi)
|
|
917
|
-
: snapTarget.position[0];
|
|
918
|
-
if (selectedCenter === null || targetCenter === null)
|
|
919
|
-
return width;
|
|
920
|
-
const selectedEdge = selectedCenter + (side === 'right' ? node.width / 2 : -node.width / 2);
|
|
921
|
-
const neighborEdge = targetCenter + (side === 'right' ? -snapTarget.width / 2 : snapTarget.width / 2);
|
|
922
|
-
const gap = side === 'right' ? neighborEdge - selectedEdge : selectedEdge - neighborEdge;
|
|
923
|
-
if (gap <= CABINET_ADJACENCY_EPSILON)
|
|
924
|
-
return width;
|
|
925
|
-
const targetWidth = node.width + gap - (nested ? 0 : cabinetWallWidthGap(node, side, sceneApi));
|
|
926
|
-
return targetWidth > node.width && Math.abs(width - targetWidth) <= CABINET_WIDTH_SNAP_THRESHOLD
|
|
927
|
-
? targetWidth
|
|
928
|
-
: width;
|
|
929
|
-
}
|
|
930
|
-
function cabinetIndependentWidthPatch(node, width, side, sceneApi) {
|
|
931
|
-
const sign = side === 'right' ? 1 : -1;
|
|
932
|
-
const gap = cabinetWallWidthGap(node, side, sceneApi);
|
|
933
|
-
const effectiveWidth = width + gap;
|
|
934
|
-
return {
|
|
935
|
-
width: effectiveWidth,
|
|
936
|
-
position: [
|
|
937
|
-
node.position[0] + (sign * (effectiveWidth - node.width)) / 2,
|
|
938
|
-
node.position[1],
|
|
939
|
-
node.position[2],
|
|
940
|
-
],
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
function cabinetIndependentWidthPreviewOverrides(node, width, side, sceneApi) {
|
|
944
|
-
const overrides = [];
|
|
945
|
-
overrides.push([
|
|
946
|
-
node.id,
|
|
947
|
-
cabinetIndependentWidthPatch(node, width, side, sceneApi),
|
|
948
|
-
]);
|
|
949
|
-
const parentRunOverride = parentRunGeometryPreviewOverride(node, sceneApi);
|
|
950
|
-
if (parentRunOverride)
|
|
951
|
-
overrides.push(parentRunOverride);
|
|
952
|
-
const gap = cabinetWallWidthGap(node, side, sceneApi);
|
|
953
|
-
const selectedWallOverride = wallCabinetWidthOverride(node, width + gap, sceneApi);
|
|
954
|
-
if (selectedWallOverride)
|
|
955
|
-
overrides.push(selectedWallOverride);
|
|
956
|
-
return overrides;
|
|
957
|
-
}
|
|
958
|
-
function previewCabinetCornerWidthOverrides(node, initialOverrides, sceneApi) {
|
|
959
|
-
const parent = node.parentId
|
|
960
|
-
? sceneApi.get(node.parentId)
|
|
961
|
-
: undefined;
|
|
962
|
-
if (!parent || !isCabinetRun(parent))
|
|
963
|
-
return initialOverrides;
|
|
964
|
-
return previewCornerRunsFromRunSources({
|
|
965
|
-
baseLayout: 'width-only',
|
|
966
|
-
initialOverrides,
|
|
967
|
-
previousModules: cabinetModulesForRun(parent, sceneApi.nodes()),
|
|
968
|
-
run: parent,
|
|
969
|
-
sceneApi,
|
|
970
|
-
});
|
|
971
|
-
}
|
|
972
|
-
function cabinetManualWidthReflow(node, width, side, sceneApi) {
|
|
973
|
-
const context = cabinetManualWidthContext(node, sceneApi);
|
|
974
|
-
if (!context)
|
|
975
|
-
return null;
|
|
976
|
-
const wallGap = cabinetWallWidthGap(node, side, sceneApi);
|
|
977
|
-
const selectedWidth = width + wallGap;
|
|
978
|
-
const runConstraints = runWallConstraints(context.run, context.modules, sceneApi.nodes(), { widthGrowth: Math.max(0, selectedWidth - context.selected.width) });
|
|
979
|
-
const draggedEnd = side === 'right' ? runConstraints.right : runConstraints.left;
|
|
980
|
-
const clampedSelectedWidth = selectedWidth > context.selected.width && draggedEnd.constrained
|
|
981
|
-
? Math.min(selectedWidth, context.selected.width + draggedEnd.slack)
|
|
982
|
-
: selectedWidth;
|
|
983
|
-
const reflowed = reflowCabinetRunModules(context.modules, context.selected.id, clampedSelectedWidth, {
|
|
984
|
-
resizeSide: side,
|
|
985
|
-
consumeAdjacentGap: true,
|
|
986
|
-
eligibleDonorIds: new Set(),
|
|
987
|
-
maximumWidth: MAX_CABINET_WIDTH,
|
|
988
|
-
});
|
|
989
|
-
return reflowed.length > 0 ? { ...context, reflowed, wallGap } : null;
|
|
990
|
-
}
|
|
991
|
-
function commitCabinetManualWidth(node, width, side, sceneApi) {
|
|
992
|
-
const reflow = cabinetManualWidthReflow(node, width, side, sceneApi);
|
|
993
|
-
if (!reflow)
|
|
994
|
-
return;
|
|
995
|
-
const reflowById = new Map(reflow.reflowed.map((entry) => [entry.id, entry]));
|
|
996
|
-
for (const module of reflow.modules) {
|
|
997
|
-
const next = reflowById.get(module.id);
|
|
998
|
-
if (!next)
|
|
999
|
-
continue;
|
|
1000
|
-
const isSelected = module.id === reflow.selected.id;
|
|
1001
|
-
const modulePatch = {
|
|
1002
|
-
width: next.width,
|
|
1003
|
-
position: next.position,
|
|
1004
|
-
};
|
|
1005
|
-
if (isSelected) {
|
|
1006
|
-
modulePatch.metadata = metadataForSelectedWidth(module, next.width);
|
|
1007
|
-
}
|
|
1008
|
-
else if (Math.abs(next.width - module.width) > 1e-4) {
|
|
1009
|
-
modulePatch.metadata = metadataWithPresetWidthDebt(module, reflow.selected.id, next.width - module.width);
|
|
1010
|
-
}
|
|
1011
|
-
const nestedCornerOverrides = nestedCornerRunPositionOverrides(module, next.position, sceneApi.nodes());
|
|
1012
|
-
sceneApi.update(module.id, modulePatch);
|
|
1013
|
-
for (const [id, override] of nestedCornerOverrides) {
|
|
1014
|
-
sceneApi.update(id, override);
|
|
1015
|
-
}
|
|
1016
|
-
const wallChild = wallChildOf(module, sceneApi.nodes());
|
|
1017
|
-
if (wallChild) {
|
|
1018
|
-
sceneApi.update(wallChild.id, {
|
|
1019
|
-
width: next.width,
|
|
1020
|
-
position: [0, wallChild.position[1], backAlignZ(module.depth, wallChild.depth)],
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
syncCornerRunsFromRunSources({
|
|
1025
|
-
baseLayout: 'width-only',
|
|
1026
|
-
previousModules: reflow.modules,
|
|
1027
|
-
run: sceneApi.get(reflow.run.id) ?? reflow.run,
|
|
1028
|
-
sceneApi,
|
|
1029
|
-
});
|
|
1030
|
-
bumpCabinetRunLayoutRevision(sceneApi, reflow.run);
|
|
1031
|
-
}
|
|
1032
|
-
function cabinetWidthHandle(side) {
|
|
1033
|
-
const sign = side === 'right' ? 1 : -1;
|
|
1034
|
-
return {
|
|
1035
|
-
kind: 'linear-resize',
|
|
1036
|
-
axis: 'x',
|
|
1037
|
-
anchor: side === 'right' ? 'min' : 'max',
|
|
1038
|
-
min: (node, sceneApi) => {
|
|
1039
|
-
if (!isCabinetModule(node))
|
|
1040
|
-
return MIN_CABINET_WIDTH;
|
|
1041
|
-
const gap = cabinetWidthIsNestedModule(node, sceneApi)
|
|
1042
|
-
? 0
|
|
1043
|
-
: cabinetWallWidthGap(node, side, sceneApi);
|
|
1044
|
-
return MIN_CABINET_WIDTH - gap;
|
|
1045
|
-
},
|
|
1046
|
-
max: (node, sceneApi) => {
|
|
1047
|
-
const ownMax = cabinetResizeUpperBound(node.width, MAX_CABINET_WIDTH);
|
|
1048
|
-
if (!isCabinetModule(node))
|
|
1049
|
-
return ownMax;
|
|
1050
|
-
const gap = cabinetWidthIsNestedModule(node, sceneApi)
|
|
1051
|
-
? 0
|
|
1052
|
-
: cabinetWallWidthGap(node, side, sceneApi);
|
|
1053
|
-
return ownMax - gap;
|
|
1054
|
-
},
|
|
1055
|
-
magneticSnap: (node, width, sceneApi) => isCabinetModule(node) ? snapCabinetWidth(node, width, side, sceneApi) : width,
|
|
1056
|
-
currentValue: (node) => node.width,
|
|
1057
|
-
apply: (node, width, sceneApi, modifiers) => {
|
|
1058
|
-
if (isCabinetModule(node) && modifiers?.altKey) {
|
|
1059
|
-
return cabinetIndependentWidthPatch(node, width, side, sceneApi);
|
|
1060
|
-
}
|
|
1061
|
-
if (isCabinetModule(node) &&
|
|
1062
|
-
cabinetManualWidthContext(node, sceneApi) &&
|
|
1063
|
-
!cabinetWidthIsNestedModule(node, sceneApi)) {
|
|
1064
|
-
const reflow = cabinetManualWidthReflow(node, width, side, sceneApi);
|
|
1065
|
-
if (reflow) {
|
|
1066
|
-
const selected = reflow.reflowed.find((entry) => entry.id === reflow.selected.id);
|
|
1067
|
-
if (selected)
|
|
1068
|
-
return { width: selected.width, position: selected.position };
|
|
1069
|
-
}
|
|
1070
|
-
return { width: node.width, position: node.position };
|
|
1071
|
-
}
|
|
1072
|
-
const gap = isCabinetModule(node) && !cabinetWidthIsNestedModule(node, sceneApi)
|
|
1073
|
-
? cabinetWallWidthGap(node, side, sceneApi)
|
|
1074
|
-
: 0;
|
|
1075
|
-
const effectiveWidth = width + gap;
|
|
1076
|
-
return {
|
|
1077
|
-
width: effectiveWidth,
|
|
1078
|
-
position: [
|
|
1079
|
-
node.position[0] + (sign * (effectiveWidth - node.width)) / 2,
|
|
1080
|
-
node.position[1],
|
|
1081
|
-
node.position[2],
|
|
1082
|
-
],
|
|
1083
|
-
};
|
|
1084
|
-
},
|
|
1085
|
-
previewOverrides: (node, width, sceneApi, modifiers) => {
|
|
1086
|
-
if (!isCabinetModule(node))
|
|
1087
|
-
return [];
|
|
1088
|
-
if (modifiers?.altKey) {
|
|
1089
|
-
return previewCabinetCornerWidthOverrides(node, cabinetIndependentWidthPreviewOverrides(node, width, side, sceneApi), sceneApi);
|
|
1090
|
-
}
|
|
1091
|
-
if (cabinetWidthIsNestedModule(node, sceneApi)) {
|
|
1092
|
-
const parentRunOverride = parentRunGeometryPreviewOverride(node, sceneApi);
|
|
1093
|
-
return parentRunOverride ? [parentRunOverride] : [];
|
|
1094
|
-
}
|
|
1095
|
-
const reflow = cabinetManualWidthReflow(node, width, side, sceneApi);
|
|
1096
|
-
if (reflow) {
|
|
1097
|
-
const overrides = [];
|
|
1098
|
-
const parentRunOverride = parentRunGeometryPreviewOverride(node, sceneApi);
|
|
1099
|
-
if (parentRunOverride)
|
|
1100
|
-
overrides.push(parentRunOverride);
|
|
1101
|
-
for (const entry of reflow.reflowed) {
|
|
1102
|
-
const module = reflow.modules.find((candidate) => candidate.id === entry.id);
|
|
1103
|
-
if (!module)
|
|
1104
|
-
continue;
|
|
1105
|
-
overrides.push([
|
|
1106
|
-
module.id,
|
|
1107
|
-
{ width: entry.width, position: entry.position },
|
|
1108
|
-
]);
|
|
1109
|
-
overrides.push(...nestedCornerRunPositionOverrides(module, entry.position, sceneApi.nodes()));
|
|
1110
|
-
const wallChild = wallChildOf(module, sceneApi.nodes());
|
|
1111
|
-
if (wallChild) {
|
|
1112
|
-
overrides.push([
|
|
1113
|
-
wallChild.id,
|
|
1114
|
-
{
|
|
1115
|
-
width: entry.width,
|
|
1116
|
-
position: [0, wallChild.position[1], backAlignZ(module.depth, wallChild.depth)],
|
|
1117
|
-
},
|
|
1118
|
-
]);
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
return previewCabinetCornerWidthOverrides(node, overrides, sceneApi);
|
|
1122
|
-
}
|
|
1123
|
-
if (cabinetManualWidthContext(node, sceneApi)) {
|
|
1124
|
-
const parentRunOverride = parentRunGeometryPreviewOverride(node, sceneApi);
|
|
1125
|
-
return parentRunOverride ? [parentRunOverride] : [];
|
|
1126
|
-
}
|
|
1127
|
-
const overrides = [];
|
|
1128
|
-
const parentRunOverride = parentRunGeometryPreviewOverride(node, sceneApi);
|
|
1129
|
-
if (parentRunOverride)
|
|
1130
|
-
overrides.push(parentRunOverride);
|
|
1131
|
-
const gap = cabinetWallWidthGap(node, side, sceneApi);
|
|
1132
|
-
const effectiveWidth = width + gap;
|
|
1133
|
-
const selectedPosition = [
|
|
1134
|
-
node.position[0] + (sign * (effectiveWidth - node.width)) / 2,
|
|
1135
|
-
node.position[1],
|
|
1136
|
-
node.position[2],
|
|
1137
|
-
];
|
|
1138
|
-
overrides.push([
|
|
1139
|
-
node.id,
|
|
1140
|
-
{
|
|
1141
|
-
width: effectiveWidth,
|
|
1142
|
-
position: selectedPosition,
|
|
1143
|
-
},
|
|
1144
|
-
]);
|
|
1145
|
-
overrides.push(...nestedCornerRunPositionOverrides(node, selectedPosition, sceneApi.nodes()));
|
|
1146
|
-
const selectedWallOverride = wallCabinetWidthOverride(node, width + gap, sceneApi);
|
|
1147
|
-
if (selectedWallOverride)
|
|
1148
|
-
overrides.push(selectedWallOverride);
|
|
1149
|
-
const connectedResize = connectedCabinetWidthResize(node, side, width - node.width, sceneApi);
|
|
1150
|
-
if (connectedResize) {
|
|
1151
|
-
overrides.push([
|
|
1152
|
-
connectedResize.module.id,
|
|
1153
|
-
connectedResize.patch,
|
|
1154
|
-
]);
|
|
1155
|
-
overrides.push(...nestedCornerRunPositionOverrides(connectedResize.module, connectedResize.patch.position, sceneApi.nodes()));
|
|
1156
|
-
const connectedWallOverride = wallCabinetWidthOverride(connectedResize.module, connectedResize.patch.width, sceneApi);
|
|
1157
|
-
if (connectedWallOverride)
|
|
1158
|
-
overrides.push(connectedWallOverride);
|
|
1159
|
-
}
|
|
1160
|
-
return previewCabinetCornerWidthOverrides(node, overrides, sceneApi);
|
|
1161
|
-
},
|
|
1162
|
-
commit: (node, patch, sceneApi, modifiers) => {
|
|
1163
|
-
if (isCabinetModule(node) && typeof patch.width === 'number' && modifiers?.altKey) {
|
|
1164
|
-
commitCabinetResize(node, {
|
|
1165
|
-
...patch,
|
|
1166
|
-
metadata: metadataForSelectedWidth(node, patch.width, patch.metadata),
|
|
1167
|
-
}, sceneApi);
|
|
1168
|
-
return;
|
|
1169
|
-
}
|
|
1170
|
-
if (isCabinetModule(node) && typeof patch.width === 'number') {
|
|
1171
|
-
if (cabinetWidthIsNestedModule(node, sceneApi)) {
|
|
1172
|
-
commitCabinetResize(node, patch, sceneApi);
|
|
1173
|
-
return;
|
|
1174
|
-
}
|
|
1175
|
-
commitCabinetManualWidth(node, patch.width - cabinetWallWidthGap(node, side, sceneApi), side, sceneApi);
|
|
1176
|
-
return;
|
|
1177
|
-
}
|
|
1178
|
-
const connectedResize = isCabinetModule(node) && typeof patch.width === 'number'
|
|
1179
|
-
? connectedCabinetWidthResize(node, side, patch.width - node.width - cabinetWallWidthGap(node, side, sceneApi), sceneApi)
|
|
1180
|
-
: null;
|
|
1181
|
-
const selectedPatch = isCabinetModule(node) && typeof patch.width === 'number'
|
|
1182
|
-
? {
|
|
1183
|
-
...patch,
|
|
1184
|
-
metadata: metadataForSelectedWidth(node, patch.width, patch.metadata),
|
|
1185
|
-
}
|
|
1186
|
-
: patch;
|
|
1187
|
-
commitCabinetResize(node, selectedPatch, sceneApi);
|
|
1188
|
-
if (connectedResize) {
|
|
1189
|
-
const widthDelta = connectedResize.patch.width - connectedResize.module.width;
|
|
1190
|
-
commitCabinetResize(connectedResize.module, {
|
|
1191
|
-
...connectedResize.patch,
|
|
1192
|
-
metadata: metadataWithPresetWidthDebt(connectedResize.module, node.id, widthDelta),
|
|
1193
|
-
}, sceneApi);
|
|
1194
|
-
}
|
|
1195
|
-
},
|
|
1196
|
-
visible: (node, sceneApi) => !isCabinetModule(node) || cabinetModuleSideOpen(node, side, sceneApi),
|
|
1197
|
-
placement: {
|
|
1198
|
-
position: (node) => [
|
|
1199
|
-
sign * (node.width / 2 + SIDE_HANDLE_OFFSET),
|
|
1200
|
-
cabinetTotalHeight(node) / 2,
|
|
1201
|
-
0,
|
|
1202
|
-
],
|
|
1203
|
-
rotationY: () => (side === 'left' ? Math.PI : 0),
|
|
1204
|
-
},
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
function cabinetDepthResizePatch(node, depth) {
|
|
1208
|
-
return {
|
|
1209
|
-
depth,
|
|
1210
|
-
position: [node.position[0], node.position[1], node.position[2] + (depth - node.depth) / 2],
|
|
1211
|
-
};
|
|
1212
|
-
}
|
|
1213
|
-
function snapCabinetDepth(node, requestedDepth, sceneApi) {
|
|
1214
|
-
if (!isCabinetModule(node))
|
|
1215
|
-
return requestedDepth;
|
|
1216
|
-
let snappedDepth = requestedDepth;
|
|
1217
|
-
let closestDistance = Number.POSITIVE_INFINITY;
|
|
1218
|
-
for (const side of ['left', 'right']) {
|
|
1219
|
-
const connected = cabinetWidthConnectedNeighbor(node, side, sceneApi);
|
|
1220
|
-
if (!connected || isCabinetWidthFiller(connected))
|
|
1221
|
-
continue;
|
|
1222
|
-
const distance = Math.abs(requestedDepth - connected.depth);
|
|
1223
|
-
if (distance <= CABINET_DEPTH_SNAP_THRESHOLD && distance < closestDistance) {
|
|
1224
|
-
snappedDepth = connected.depth;
|
|
1225
|
-
closestDistance = distance;
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
return snappedDepth;
|
|
1229
|
-
}
|
|
1230
|
-
function cabinetDepthHandle() {
|
|
1231
|
-
return {
|
|
1232
|
-
kind: 'linear-resize',
|
|
1233
|
-
axis: 'z',
|
|
1234
|
-
anchor: 'min',
|
|
1235
|
-
min: MIN_CABINET_DEPTH,
|
|
1236
|
-
max: (node) => cabinetResizeUpperBound(node.depth, MAX_CABINET_DEPTH),
|
|
1237
|
-
currentValue: (node) => node.depth,
|
|
1238
|
-
apply: cabinetDepthResizePatch,
|
|
1239
|
-
magneticSnap: snapCabinetDepth,
|
|
1240
|
-
previewOverrides: (node, _depth, sceneApi) => {
|
|
1241
|
-
const parentRunOverride = parentRunGeometryPreviewOverride(node, sceneApi);
|
|
1242
|
-
return parentRunOverride ? [parentRunOverride] : [];
|
|
1243
|
-
},
|
|
1244
|
-
commit: commitCabinetResize,
|
|
1245
|
-
placement: {
|
|
1246
|
-
position: (node) => [0, cabinetTotalHeight(node) / 2, node.depth / 2 + SIDE_HANDLE_OFFSET],
|
|
1247
|
-
},
|
|
1248
|
-
};
|
|
1249
|
-
}
|
|
1250
|
-
function cornerBaseSourceRunId(node) {
|
|
1251
|
-
const value = cabinetMetadataRecord(node.metadata).cabinetCornerDerivedRun;
|
|
1252
|
-
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
1253
|
-
return null;
|
|
1254
|
-
const role = value.role;
|
|
1255
|
-
const sourceRunId = value.sourceRunId;
|
|
1256
|
-
return role === 'base-leg' && typeof sourceRunId === 'string' ? sourceRunId : null;
|
|
1257
|
-
}
|
|
1258
|
-
function connectedBaseRuns(node, sceneApi) {
|
|
1259
|
-
const runs = new Map();
|
|
1260
|
-
for (const candidate of Object.values(sceneApi.nodes())) {
|
|
1261
|
-
if (isCabinetRun(candidate) && candidate.runTier === 'base') {
|
|
1262
|
-
runs.set(candidate.id, candidate);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
runs.set(node.id, node);
|
|
1266
|
-
const neighbors = new Map();
|
|
1267
|
-
const connect = (a, b) => {
|
|
1268
|
-
const aNeighbors = neighbors.get(a) ?? new Set();
|
|
1269
|
-
const bNeighbors = neighbors.get(b) ?? new Set();
|
|
1270
|
-
aNeighbors.add(b);
|
|
1271
|
-
bNeighbors.add(a);
|
|
1272
|
-
neighbors.set(a, aNeighbors);
|
|
1273
|
-
neighbors.set(b, bNeighbors);
|
|
1274
|
-
};
|
|
1275
|
-
for (const run of runs.values()) {
|
|
1276
|
-
const sourceRunId = cornerBaseSourceRunId(run);
|
|
1277
|
-
if (sourceRunId && runs.has(sourceRunId))
|
|
1278
|
-
connect(sourceRunId, run.id);
|
|
1279
|
-
}
|
|
1280
|
-
const connected = [];
|
|
1281
|
-
const pending = [node.id];
|
|
1282
|
-
const visited = new Set();
|
|
1283
|
-
while (pending.length > 0) {
|
|
1284
|
-
const id = pending.shift();
|
|
1285
|
-
if (visited.has(id))
|
|
1286
|
-
continue;
|
|
1287
|
-
visited.add(id);
|
|
1288
|
-
const run = runs.get(id);
|
|
1289
|
-
if (run)
|
|
1290
|
-
connected.push(run);
|
|
1291
|
-
for (const neighbor of neighbors.get(id) ?? [])
|
|
1292
|
-
pending.push(neighbor);
|
|
1293
|
-
}
|
|
1294
|
-
return connected;
|
|
1295
|
-
}
|
|
1296
|
-
function cabinetRunFrontCenter(run, sceneApi) {
|
|
1297
|
-
const modules = cabinetModulesForRun(run, sceneApi.nodes());
|
|
1298
|
-
if (modules.length === 0) {
|
|
1299
|
-
return [0, cabinetTotalHeight(run) / 2, run.depth / 2 + SIDE_HANDLE_OFFSET];
|
|
1300
|
-
}
|
|
1301
|
-
const minX = Math.min(...modules.map((module) => module.position[0] - module.width / 2));
|
|
1302
|
-
const maxX = Math.max(...modules.map((module) => module.position[0] + module.width / 2));
|
|
1303
|
-
const maxZ = Math.max(...modules.map((module) => module.position[2] + module.depth / 2));
|
|
1304
|
-
return [(minX + maxX) / 2, cabinetTotalHeight(run) / 2, maxZ + SIDE_HANDLE_OFFSET];
|
|
1305
|
-
}
|
|
1306
|
-
function cabinetRunPointInSelectedFrame(selected, target, point, sceneApi) {
|
|
1307
|
-
const nodes = sceneApi.nodes();
|
|
1308
|
-
const selectedWorld = cabinetDuplicateWorldPose(selected, nodes);
|
|
1309
|
-
const targetWorld = cabinetDuplicateWorldPose(target, nodes);
|
|
1310
|
-
if (!selectedWorld || !targetWorld)
|
|
1311
|
-
return [point[0], point[1], point[2]];
|
|
1312
|
-
const worldPoint = composeCabinetDuplicatePose(targetWorld.position, targetWorld.rotation, point, 0).position;
|
|
1313
|
-
const dx = worldPoint[0] - selectedWorld.position[0];
|
|
1314
|
-
const dz = worldPoint[2] - selectedWorld.position[2];
|
|
1315
|
-
const cos = Math.cos(selectedWorld.rotation);
|
|
1316
|
-
const sin = Math.sin(selectedWorld.rotation);
|
|
1317
|
-
return [cos * dx - sin * dz, worldPoint[1] - selectedWorld.position[1], sin * dx + cos * dz];
|
|
1318
|
-
}
|
|
1319
|
-
function cabinetRootRun(node, sceneApi) {
|
|
1320
|
-
let current = node;
|
|
1321
|
-
let root = isCabinetRun(current) ? current : null;
|
|
1322
|
-
const visited = new Set();
|
|
1323
|
-
while (current.parentId && !visited.has(current.parentId)) {
|
|
1324
|
-
visited.add(current.parentId);
|
|
1325
|
-
const parent = sceneApi.get(current.parentId);
|
|
1326
|
-
if (!isCabinetRun(parent) && !isCabinetModule(parent))
|
|
1327
|
-
break;
|
|
1328
|
-
current = parent;
|
|
1329
|
-
if (isCabinetRun(current))
|
|
1330
|
-
root = current;
|
|
1331
|
-
}
|
|
1332
|
-
return root;
|
|
1333
|
-
}
|
|
1334
|
-
function cabinetWallTargets(node, sceneApi) {
|
|
1335
|
-
const root = cabinetRootRun(node, sceneApi);
|
|
1336
|
-
if (!root)
|
|
1337
|
-
return [];
|
|
1338
|
-
const targets = [];
|
|
1339
|
-
const visited = new Set();
|
|
1340
|
-
const visit = (current) => {
|
|
1341
|
-
if (visited.has(current.id))
|
|
1342
|
-
return;
|
|
1343
|
-
visited.add(current.id);
|
|
1344
|
-
if (isCabinetRun(current) && current.runTier === 'wall') {
|
|
1345
|
-
targets.push(current);
|
|
1346
|
-
return;
|
|
1347
|
-
}
|
|
1348
|
-
const parent = current.parentId ? sceneApi.get(current.parentId) : undefined;
|
|
1349
|
-
if (isCabinetModule(current) && isCabinetModule(parent)) {
|
|
1350
|
-
if (!isHoodOnlyCabinet(current))
|
|
1351
|
-
targets.push(current);
|
|
1352
|
-
return;
|
|
1353
|
-
}
|
|
1354
|
-
for (const childId of current.children ?? []) {
|
|
1355
|
-
const child = sceneApi.get(childId);
|
|
1356
|
-
if (isCabinetRun(child) || isCabinetModule(child))
|
|
1357
|
-
visit(child);
|
|
1358
|
-
}
|
|
1359
|
-
};
|
|
1360
|
-
visit(root);
|
|
1361
|
-
return targets;
|
|
1362
|
-
}
|
|
1363
|
-
function cabinetWallDepthPreview(targets, depth, sceneApi, adjustCornerWidths, widthMode, cornerIndex) {
|
|
1364
|
-
const overrides = new Map();
|
|
1365
|
-
const liveTargets = targets.map((target) => sceneApi.get(target.id) ?? target);
|
|
1366
|
-
const depthDelta = depth - (liveTargets[0]?.depth ?? depth);
|
|
1367
|
-
for (const live of liveTargets) {
|
|
1368
|
-
const nextDepth = live.depth + depthDelta;
|
|
1369
|
-
if (isCabinetRun(live)) {
|
|
1370
|
-
overrides.set(live.id, { depth: nextDepth });
|
|
1371
|
-
for (const [id, patch] of depthDeltaRunOverrides(live, sceneApi.nodes(), depthDelta)) {
|
|
1372
|
-
overrides.set(id, { ...(overrides.get(id) ?? {}), ...patch });
|
|
1373
|
-
}
|
|
1374
|
-
continue;
|
|
1375
|
-
}
|
|
1376
|
-
overrides.set(live.id, cabinetDepthResizePatch(live, nextDepth));
|
|
1377
|
-
}
|
|
1378
|
-
if (adjustCornerWidths) {
|
|
1379
|
-
for (const [id, patch] of wallCornerWidthOverridesForDepthTargets({
|
|
1380
|
-
cornerIndex,
|
|
1381
|
-
depth,
|
|
1382
|
-
nodes: sceneApi.nodes(),
|
|
1383
|
-
targets: liveTargets,
|
|
1384
|
-
widthMode,
|
|
1385
|
-
})) {
|
|
1386
|
-
const existing = overrides.get(id);
|
|
1387
|
-
const cornerPatch = patch;
|
|
1388
|
-
const merged = { ...(existing ?? {}), ...cornerPatch };
|
|
1389
|
-
if (existing?.position && cornerPatch.position) {
|
|
1390
|
-
merged.position = [cornerPatch.position[0], cornerPatch.position[1], existing.position[2]];
|
|
1391
|
-
}
|
|
1392
|
-
overrides.set(id, merged);
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
return [...overrides];
|
|
1396
|
-
}
|
|
1397
|
-
function commitCabinetWallDepth(targets, depth, sceneApi, adjustCornerWidths, widthMode, cornerIndex) {
|
|
1398
|
-
const preview = cabinetWallDepthPreview(targets, depth, sceneApi, adjustCornerWidths, widthMode, cornerIndex);
|
|
1399
|
-
for (const [id, patch] of preview) {
|
|
1400
|
-
sceneApi.update(id, patch);
|
|
1401
|
-
}
|
|
1402
|
-
const bumpedRuns = new Set();
|
|
1403
|
-
for (const [id] of preview) {
|
|
1404
|
-
const live = sceneApi.get(id);
|
|
1405
|
-
if (isCabinetRun(live)) {
|
|
1406
|
-
if (!bumpedRuns.has(live.id)) {
|
|
1407
|
-
bumpedRuns.add(live.id);
|
|
1408
|
-
bumpCabinetRunLayoutRevision(sceneApi, live);
|
|
1409
|
-
}
|
|
1410
|
-
continue;
|
|
1411
|
-
}
|
|
1412
|
-
const parent = live?.parentId ? sceneApi.get(live.parentId) : undefined;
|
|
1413
|
-
if (isCabinetRun(parent) && !bumpedRuns.has(parent.id)) {
|
|
1414
|
-
bumpedRuns.add(parent.id);
|
|
1415
|
-
bumpCabinetRunLayoutRevision(sceneApi, parent);
|
|
1416
|
-
}
|
|
1417
|
-
else if (isCabinetModule(parent)) {
|
|
1418
|
-
sceneApi.markDirty(parent.id);
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
function cabinetWallDepthBounds(targets, sceneApi, adjustCornerWidths, widthMode, cornerIndex) {
|
|
1423
|
-
const liveTargets = targets.map((target) => sceneApi.get(target.id) ?? target);
|
|
1424
|
-
const currentDepth = liveTargets[0]?.depth ?? MIN_CABINET_DEPTH;
|
|
1425
|
-
const sharedBounds = sharedDepthBounds(currentDepth, liveTargets, sceneApi.nodes());
|
|
1426
|
-
let min = sharedBounds.min;
|
|
1427
|
-
let max = sharedBounds.max;
|
|
1428
|
-
if (!adjustCornerWidths)
|
|
1429
|
-
return { min, max };
|
|
1430
|
-
const baselineAdjustments = new Map(wallCornerWidthOverridesForDepthTargets({
|
|
1431
|
-
clampWidths: false,
|
|
1432
|
-
cornerIndex,
|
|
1433
|
-
depth: currentDepth,
|
|
1434
|
-
nodes: sceneApi.nodes(),
|
|
1435
|
-
targets: liveTargets,
|
|
1436
|
-
widthMode,
|
|
1437
|
-
}));
|
|
1438
|
-
const unitAdjustments = wallCornerWidthOverridesForDepthTargets({
|
|
1439
|
-
clampWidths: false,
|
|
1440
|
-
cornerIndex,
|
|
1441
|
-
depth: currentDepth + 1,
|
|
1442
|
-
nodes: sceneApi.nodes(),
|
|
1443
|
-
targets: liveTargets,
|
|
1444
|
-
widthMode,
|
|
1445
|
-
});
|
|
1446
|
-
for (const [id, patch] of unitAdjustments) {
|
|
1447
|
-
const cabinetPatch = patch;
|
|
1448
|
-
if (typeof cabinetPatch.width !== 'number')
|
|
1449
|
-
continue;
|
|
1450
|
-
const node = sceneApi.get(id);
|
|
1451
|
-
if (!isCabinetModule(node))
|
|
1452
|
-
continue;
|
|
1453
|
-
const baselinePatch = baselineAdjustments.get(id);
|
|
1454
|
-
const baselineWidth = typeof baselinePatch?.width === 'number' ? baselinePatch.width : node.width;
|
|
1455
|
-
const factor = cabinetPatch.width - baselineWidth;
|
|
1456
|
-
if (Math.abs(factor) <= CABINET_ADJACENCY_EPSILON)
|
|
1457
|
-
continue;
|
|
1458
|
-
const minWidth = node.name === 'Wall Bridge Filler'
|
|
1459
|
-
? 0
|
|
1460
|
-
: node.name?.includes('Filler')
|
|
1461
|
-
? 0.05
|
|
1462
|
-
: MIN_CABINET_WIDTH;
|
|
1463
|
-
const maxWidth = cabinetResizeUpperBound(baselineWidth, MAX_CABINET_WIDTH);
|
|
1464
|
-
const firstDepth = currentDepth + (minWidth - baselineWidth) / factor;
|
|
1465
|
-
const secondDepth = currentDepth + (maxWidth - baselineWidth) / factor;
|
|
1466
|
-
min = Math.max(min, Math.min(firstDepth, secondDepth));
|
|
1467
|
-
max = Math.min(max, Math.max(firstDepth, secondDepth));
|
|
1468
|
-
}
|
|
1469
|
-
return {
|
|
1470
|
-
min: Math.min(currentDepth, min),
|
|
1471
|
-
max: Math.max(currentDepth, max),
|
|
1472
|
-
};
|
|
1473
|
-
}
|
|
1474
|
-
function cabinetWallGroupDepthHandles(selected, sceneApi) {
|
|
1475
|
-
const targets = cabinetWallTargets(selected, sceneApi);
|
|
1476
|
-
if (targets.length < 2)
|
|
1477
|
-
return [];
|
|
1478
|
-
const cornerIndex = buildWallCornerDepthIndex(sceneApi.nodes());
|
|
1479
|
-
const groups = [];
|
|
1480
|
-
for (const target of targets) {
|
|
1481
|
-
const rotation = cabinetDuplicateWorldPose(target, sceneApi.nodes())?.rotation ?? target.rotation;
|
|
1482
|
-
const group = groups.find((candidate) => Math.abs(Math.atan2(Math.sin(rotation - candidate.rotation), Math.cos(rotation - candidate.rotation))) < 1e-3);
|
|
1483
|
-
if (group)
|
|
1484
|
-
group.targets.push(target);
|
|
1485
|
-
else
|
|
1486
|
-
groups.push({ rotation, targets: [target] });
|
|
1487
|
-
}
|
|
1488
|
-
const selectedRotation = cabinetDuplicateWorldPose(selected, sceneApi.nodes())?.rotation ?? 0;
|
|
1489
|
-
return groups.map((group) => {
|
|
1490
|
-
const representative = group.targets[0];
|
|
1491
|
-
const relativeRotation = group.rotation - selectedRotation;
|
|
1492
|
-
const frontX = Math.sin(relativeRotation);
|
|
1493
|
-
const frontZ = Math.cos(relativeRotation);
|
|
1494
|
-
const axis = Math.abs(frontX) > Math.abs(frontZ) ? 'x' : 'z';
|
|
1495
|
-
const positive = axis === 'x' ? frontX >= 0 : frontZ >= 0;
|
|
1496
|
-
const adjustCornerWidths = true;
|
|
1497
|
-
const widthMode = Math.abs(frontX) < 1e-3 && frontZ > 0 ? 'corner-pair' : 'bridge';
|
|
1498
|
-
const depthBounds = () => cabinetWallDepthBounds(group.targets, sceneApi, adjustCornerWidths, widthMode, cornerIndex);
|
|
1499
|
-
const clampedDepth = (requestedDepth, liveSceneApi) => {
|
|
1500
|
-
const bounds = cabinetWallDepthBounds(group.targets, liveSceneApi, adjustCornerWidths, widthMode, cornerIndex);
|
|
1501
|
-
return Math.min(bounds.max, Math.max(bounds.min, requestedDepth));
|
|
1502
|
-
};
|
|
1503
|
-
return {
|
|
1504
|
-
kind: 'linear-resize',
|
|
1505
|
-
axis,
|
|
1506
|
-
anchor: positive ? 'min' : 'max',
|
|
1507
|
-
min: () => depthBounds().min,
|
|
1508
|
-
max: () => depthBounds().max,
|
|
1509
|
-
currentValue: () => sceneApi.get(representative.id)?.depth ??
|
|
1510
|
-
representative.depth,
|
|
1511
|
-
overrideTarget: () => representative.id,
|
|
1512
|
-
apply: (_node, depth) => ({ depth }),
|
|
1513
|
-
previewOverrides: (_node, depth, liveSceneApi) => cabinetWallDepthPreview(group.targets, clampedDepth(depth, liveSceneApi), liveSceneApi, adjustCornerWidths, widthMode, cornerIndex),
|
|
1514
|
-
commit: (_node, patch, liveSceneApi) => {
|
|
1515
|
-
if (typeof patch.depth === 'number') {
|
|
1516
|
-
commitCabinetWallDepth(group.targets, clampedDepth(patch.depth, liveSceneApi), liveSceneApi, adjustCornerWidths, widthMode, cornerIndex);
|
|
1517
|
-
}
|
|
1518
|
-
},
|
|
1519
|
-
placement: {
|
|
1520
|
-
position: (node, liveSceneApi) => {
|
|
1521
|
-
const points = group.targets.map((target) => {
|
|
1522
|
-
const liveTarget = liveSceneApi.get(target.id) ?? target;
|
|
1523
|
-
const point = isCabinetRun(liveTarget)
|
|
1524
|
-
? cabinetRunFrontCenter(liveTarget, liveSceneApi)
|
|
1525
|
-
: [
|
|
1526
|
-
0,
|
|
1527
|
-
cabinetTotalHeight(liveTarget) / 2,
|
|
1528
|
-
liveTarget.depth / 2 + SIDE_HANDLE_OFFSET,
|
|
1529
|
-
];
|
|
1530
|
-
return cabinetRunPointInSelectedFrame(node, liveTarget, point, liveSceneApi);
|
|
1531
|
-
});
|
|
1532
|
-
return [
|
|
1533
|
-
points.reduce((sum, point) => sum + point[0], 0) / points.length,
|
|
1534
|
-
points.reduce((sum, point) => sum + point[1], 0) / points.length,
|
|
1535
|
-
points.reduce((sum, point) => sum + point[2], 0) / points.length,
|
|
1536
|
-
];
|
|
1537
|
-
},
|
|
1538
|
-
rotationY: () => (axis === 'x' ? relativeRotation - Math.PI / 2 : relativeRotation),
|
|
1539
|
-
},
|
|
1540
|
-
};
|
|
1541
|
-
});
|
|
1542
|
-
}
|
|
1543
|
-
function cabinetConnectedRunDepthHandle(selected, target, sceneApi) {
|
|
1544
|
-
const nodes = sceneApi.nodes();
|
|
1545
|
-
const selectedWorld = cabinetDuplicateWorldPose(selected, nodes);
|
|
1546
|
-
const targetWorld = cabinetDuplicateWorldPose(target, nodes);
|
|
1547
|
-
const relativeRotation = (targetWorld?.rotation ?? 0) - (selectedWorld?.rotation ?? 0);
|
|
1548
|
-
const frontX = Math.sin(relativeRotation);
|
|
1549
|
-
const frontZ = Math.cos(relativeRotation);
|
|
1550
|
-
const axis = Math.abs(frontX) > Math.abs(frontZ) ? 'x' : 'z';
|
|
1551
|
-
const positive = axis === 'x' ? frontX >= 0 : frontZ >= 0;
|
|
1552
|
-
const targetDepthBounds = (liveSceneApi) => {
|
|
1553
|
-
const liveTarget = liveSceneApi.get(target.id) ?? target;
|
|
1554
|
-
const compensatedWidths = [];
|
|
1555
|
-
const derived = cabinetMetadataRecord(liveTarget.metadata).cabinetCornerDerivedRun;
|
|
1556
|
-
if (derived && typeof derived === 'object' && !Array.isArray(derived)) {
|
|
1557
|
-
const role = derived.role;
|
|
1558
|
-
const side = derived.side;
|
|
1559
|
-
const turnSide = derived.turnSide;
|
|
1560
|
-
const sourceModuleId = derived.sourceModuleId;
|
|
1561
|
-
const sourceModule = role === 'base-leg' &&
|
|
1562
|
-
(turnSide === side || (turnSide !== 'left' && turnSide !== 'right')) &&
|
|
1563
|
-
typeof sourceModuleId === 'string'
|
|
1564
|
-
? liveSceneApi.get(sourceModuleId)
|
|
1565
|
-
: undefined;
|
|
1566
|
-
if (sourceModule?.type === 'cabinet-module') {
|
|
1567
|
-
compensatedWidths.push(sourceModule.width);
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
for (const childId of liveTarget.children ?? []) {
|
|
1571
|
-
const child = liveSceneApi.get(childId);
|
|
1572
|
-
if (child?.type !== 'cabinet')
|
|
1573
|
-
continue;
|
|
1574
|
-
const childDerived = cabinetMetadataRecord(child.metadata).cabinetCornerDerivedRun;
|
|
1575
|
-
if (!childDerived || typeof childDerived !== 'object' || Array.isArray(childDerived))
|
|
1576
|
-
continue;
|
|
1577
|
-
if (childDerived.role !== 'base-leg' ||
|
|
1578
|
-
childDerived.sourceRunId !== target.id) {
|
|
1579
|
-
continue;
|
|
1580
|
-
}
|
|
1581
|
-
const connectedModule = cabinetModulesForRun(child, liveSceneApi.nodes()).find((module) => module.name === 'Base Cabinet');
|
|
1582
|
-
if (connectedModule)
|
|
1583
|
-
compensatedWidths.push(connectedModule.width);
|
|
1584
|
-
}
|
|
1585
|
-
const connectedBounds = cabinetConnectedDepthBounds(liveTarget.depth, compensatedWidths);
|
|
1586
|
-
const deltaBounds = sharedDepthBounds(liveTarget.depth, [liveTarget], liveSceneApi.nodes());
|
|
1587
|
-
return {
|
|
1588
|
-
min: Math.max(connectedBounds.min, deltaBounds.min),
|
|
1589
|
-
max: Math.min(connectedBounds.max, deltaBounds.max),
|
|
1590
|
-
};
|
|
1591
|
-
};
|
|
1592
|
-
const clampedDepth = (depth, liveSceneApi) => {
|
|
1593
|
-
const bounds = targetDepthBounds(liveSceneApi);
|
|
1594
|
-
return Math.min(bounds.max, Math.max(bounds.min, depth));
|
|
1595
|
-
};
|
|
1596
|
-
return {
|
|
1597
|
-
kind: 'linear-resize',
|
|
1598
|
-
axis,
|
|
1599
|
-
anchor: positive ? 'min' : 'max',
|
|
1600
|
-
min: (_node, liveSceneApi) => targetDepthBounds(liveSceneApi).min,
|
|
1601
|
-
max: (_node, liveSceneApi) => targetDepthBounds(liveSceneApi).max,
|
|
1602
|
-
currentValue: (node) => node.id === target.id
|
|
1603
|
-
? node.depth
|
|
1604
|
-
: (sceneApi.get(target.id)?.depth ?? target.depth),
|
|
1605
|
-
overrideTarget: () => target.id,
|
|
1606
|
-
apply: (_node, depth) => ({ depth }),
|
|
1607
|
-
previewOverrides: (_node, depth, liveSceneApi) => {
|
|
1608
|
-
const liveTarget = liveSceneApi.get(target.id) ?? target;
|
|
1609
|
-
const nextDepth = clampedDepth(depth, liveSceneApi);
|
|
1610
|
-
const moduleOverrides = depthDeltaRunOverrides(liveTarget, liveSceneApi.nodes(), nextDepth - liveTarget.depth);
|
|
1611
|
-
const sourceOverrides = cornerSourceWidthOverridesForDerivedDepth(liveTarget, liveSceneApi.nodes(), nextDepth);
|
|
1612
|
-
return previewCornerRunsFromRunSources({
|
|
1613
|
-
baseLayout: 'width-only',
|
|
1614
|
-
initialOverrides: [...moduleOverrides, ...sourceOverrides],
|
|
1615
|
-
run: { ...liveTarget, depth: nextDepth },
|
|
1616
|
-
sceneApi: liveSceneApi,
|
|
1617
|
-
});
|
|
1618
|
-
},
|
|
1619
|
-
commit: (_node, patch, liveSceneApi) => {
|
|
1620
|
-
if (typeof patch.depth !== 'number')
|
|
1621
|
-
return;
|
|
1622
|
-
const liveTarget = liveSceneApi.get(target.id) ?? target;
|
|
1623
|
-
const nextDepth = clampedDepth(patch.depth, liveSceneApi);
|
|
1624
|
-
for (const [id, sourcePatch] of cornerSourceWidthOverridesForDerivedDepth(liveTarget, liveSceneApi.nodes(), nextDepth)) {
|
|
1625
|
-
liveSceneApi.update(id, sourcePatch);
|
|
1626
|
-
}
|
|
1627
|
-
commitRunDepthDelta(liveTarget, nextDepth, liveSceneApi, {
|
|
1628
|
-
cornerSync: 'width-only',
|
|
1629
|
-
});
|
|
1630
|
-
},
|
|
1631
|
-
placement: {
|
|
1632
|
-
position: (node, liveSceneApi) => {
|
|
1633
|
-
const liveTarget = liveSceneApi.get(target.id) ?? target;
|
|
1634
|
-
return cabinetRunPointInSelectedFrame(node, liveTarget, cabinetRunFrontCenter(liveTarget, liveSceneApi), liveSceneApi);
|
|
1635
|
-
},
|
|
1636
|
-
rotationY: () => (axis === 'x' ? relativeRotation - Math.PI / 2 : relativeRotation),
|
|
1637
|
-
},
|
|
1638
|
-
};
|
|
1639
|
-
}
|
|
1640
|
-
function cabinetHeightHandle() {
|
|
1641
|
-
return {
|
|
1642
|
-
kind: 'linear-resize',
|
|
1643
|
-
axis: 'y',
|
|
1644
|
-
anchor: 'min',
|
|
1645
|
-
min: MIN_CABINET_CARCASS_HEIGHT,
|
|
1646
|
-
currentValue: (node) => node.carcassHeight,
|
|
1647
|
-
apply: (_node, carcassHeight) => ({ carcassHeight }),
|
|
1648
|
-
commit: commitCabinetResize,
|
|
1649
|
-
placement: {
|
|
1650
|
-
position: (node, sceneApi) => [
|
|
1651
|
-
0,
|
|
1652
|
-
cabinetLocalBounds(node, sceneApi.nodes()).maxY + HEIGHT_HANDLE_OFFSET,
|
|
1653
|
-
0,
|
|
1654
|
-
],
|
|
1655
|
-
},
|
|
1656
|
-
};
|
|
1657
|
-
}
|
|
1658
|
-
function cabinetRotateHandle() {
|
|
1659
|
-
return {
|
|
1660
|
-
kind: 'arc-resize',
|
|
1661
|
-
axis: 'angular',
|
|
1662
|
-
shape: 'rotate',
|
|
1663
|
-
apply: (initial, delta, sceneApi) => {
|
|
1664
|
-
const rotation = (initial.rotation ?? 0) - delta;
|
|
1665
|
-
const bounds = cabinetLocalBounds(initial, sceneApi.nodes());
|
|
1666
|
-
const [centerX, , centerZ] = bounds.center;
|
|
1667
|
-
const previousRotation = initial.rotation ?? 0;
|
|
1668
|
-
const previousCos = Math.cos(previousRotation);
|
|
1669
|
-
const previousSin = Math.sin(previousRotation);
|
|
1670
|
-
const nextCos = Math.cos(rotation);
|
|
1671
|
-
const nextSin = Math.sin(rotation);
|
|
1672
|
-
const pivotWorldX = initial.position[0] + centerX * previousCos + centerZ * previousSin;
|
|
1673
|
-
const pivotWorldZ = initial.position[2] - centerX * previousSin + centerZ * previousCos;
|
|
1674
|
-
return {
|
|
1675
|
-
rotation,
|
|
1676
|
-
position: [
|
|
1677
|
-
pivotWorldX - centerX * nextCos - centerZ * nextSin,
|
|
1678
|
-
initial.position[1],
|
|
1679
|
-
pivotWorldZ + centerX * nextSin - centerZ * nextCos,
|
|
1680
|
-
],
|
|
1681
|
-
};
|
|
1682
|
-
},
|
|
1683
|
-
placement: {
|
|
1684
|
-
position: (node, sceneApi) => {
|
|
1685
|
-
const bounds = cabinetLocalBounds(node, sceneApi.nodes());
|
|
1686
|
-
return [bounds.maxX, bounds.center[1], bounds.maxZ + ROTATE_CORNER_OFFSET];
|
|
1687
|
-
},
|
|
1688
|
-
rotationY: () => -Math.PI / 4,
|
|
1689
|
-
},
|
|
1690
|
-
rotationCenter: (node, sceneApi) => cabinetLocalBounds(node, sceneApi.nodes()).center,
|
|
1691
|
-
decoration: {
|
|
1692
|
-
kind: 'ring',
|
|
1693
|
-
radius: (node, sceneApi) => {
|
|
1694
|
-
const bounds = cabinetLocalBounds(node, sceneApi.nodes());
|
|
1695
|
-
return Math.hypot(bounds.size[0] / 2, bounds.size[2] / 2) + ROTATE_RING_OFFSET;
|
|
1696
|
-
},
|
|
1697
|
-
y: (node) => cabinetTotalHeight(node) / 2,
|
|
1698
|
-
center: (node, sceneApi) => cabinetLocalBounds(node, sceneApi.nodes()).center,
|
|
1699
|
-
},
|
|
1700
|
-
};
|
|
1701
|
-
}
|
|
1702
|
-
function cabinetHandles(node, sceneApi) {
|
|
1703
|
-
const structuralChildren = (node.children ?? []).filter((id) => id.startsWith('cabinet_') || id.startsWith('cabinet-module_'));
|
|
1704
|
-
if (structuralChildren.length > 0) {
|
|
1705
|
-
const connectedRuns = sceneApi && node.runTier === 'base' ? connectedBaseRuns(node, sceneApi) : [];
|
|
1706
|
-
const depthHandles = sceneApi
|
|
1707
|
-
? connectedRuns.map((run) => cabinetConnectedRunDepthHandle(node, run, sceneApi))
|
|
1708
|
-
: [];
|
|
1709
|
-
const wallDepthHandles = sceneApi ? cabinetWallGroupDepthHandles(node, sceneApi) : [];
|
|
1710
|
-
return [
|
|
1711
|
-
...depthHandles,
|
|
1712
|
-
...wallDepthHandles,
|
|
1713
|
-
cabinetRotateHandle(),
|
|
1714
|
-
];
|
|
1715
|
-
}
|
|
1716
|
-
const handles = [
|
|
1717
|
-
cabinetDepthHandle(),
|
|
1718
|
-
cabinetHeightHandle(),
|
|
1719
|
-
cabinetRotateHandle(),
|
|
1720
|
-
];
|
|
1721
|
-
if (structuralChildren.length === 0) {
|
|
1722
|
-
handles.unshift(cabinetWidthHandle('left'), cabinetWidthHandle('right'));
|
|
1723
|
-
}
|
|
1724
|
-
return handles;
|
|
1725
|
-
}
|
|
1726
|
-
function isHoodOnlyCabinet(node) {
|
|
1727
|
-
const stack = stackForCabinet(node);
|
|
1728
|
-
return stack.length > 0 && stack.every((compartment) => isHoodCompartmentType(compartment.type));
|
|
1729
|
-
}
|
|
1730
|
-
function cabinetModuleHeightHandleVisible(node, sceneApi) {
|
|
1731
|
-
const parent = node.parentId ? sceneApi.get(node.parentId) : undefined;
|
|
1732
|
-
if (isCabinetRun(parent)) {
|
|
1733
|
-
return parent.runTier === 'wall' || resolveCabinetType(node, parent) === 'tall';
|
|
1734
|
-
}
|
|
1735
|
-
return isCabinetModule(parent) && wallChildOf(parent, sceneApi.nodes())?.id === node.id;
|
|
1736
|
-
}
|
|
1737
|
-
function cabinetModuleHandles() {
|
|
1738
|
-
return [
|
|
1739
|
-
{
|
|
1740
|
-
...cabinetWidthHandle('left'),
|
|
1741
|
-
visible: (node, sceneApi) => !isCabinetWidthFiller(node) &&
|
|
1742
|
-
!cabinetModuleUsesFixedApplianceWidth(node) &&
|
|
1743
|
-
!cabinetModuleSideHasCornerFiller(node, 'left', sceneApi),
|
|
1744
|
-
},
|
|
1745
|
-
{
|
|
1746
|
-
...cabinetWidthHandle('right'),
|
|
1747
|
-
visible: (node, sceneApi) => !isCabinetWidthFiller(node) &&
|
|
1748
|
-
!cabinetModuleUsesFixedApplianceWidth(node) &&
|
|
1749
|
-
!cabinetModuleSideHasCornerFiller(node, 'right', sceneApi),
|
|
1750
|
-
},
|
|
1751
|
-
{
|
|
1752
|
-
...cabinetDepthHandle(),
|
|
1753
|
-
visible: (node) => !isCabinetWidthFiller(node),
|
|
1754
|
-
},
|
|
1755
|
-
{
|
|
1756
|
-
...cabinetHeightHandle(),
|
|
1757
|
-
visible: cabinetModuleHeightHandleVisible,
|
|
1758
|
-
},
|
|
1759
|
-
];
|
|
1760
|
-
}
|
|
1761
|
-
export const cabinetDefinition = {
|
|
1762
|
-
kind: 'cabinet',
|
|
1763
|
-
schemaVersion: 8,
|
|
1764
|
-
schema: CabinetNode,
|
|
1765
|
-
category: 'furnish',
|
|
1766
|
-
surfaceRole: 'joinery',
|
|
1767
|
-
snapProfile: 'item',
|
|
1768
|
-
facingIndicator: true,
|
|
1769
|
-
defaults: () => ({
|
|
1770
|
-
object: 'node',
|
|
1771
|
-
parentId: null,
|
|
1772
|
-
visible: true,
|
|
1773
|
-
metadata: {},
|
|
1774
|
-
position: [0, 0, 0],
|
|
1775
|
-
rotation: 0,
|
|
1776
|
-
runTier: 'base',
|
|
1777
|
-
children: [],
|
|
1778
|
-
width: 0.5,
|
|
1779
|
-
depth: CABINET_METRIC_DEFAULTS.depth,
|
|
1780
|
-
carcassHeight: CABINET_METRIC_DEFAULTS.carcassHeight,
|
|
1781
|
-
operationState: 0,
|
|
1782
|
-
plinthHeight: CABINET_METRIC_DEFAULTS.plinthHeight,
|
|
1783
|
-
toeKickDepth: 0.075,
|
|
1784
|
-
boardThickness: 0.018,
|
|
1785
|
-
countertopThickness: CABINET_METRIC_DEFAULTS.countertopThickness,
|
|
1786
|
-
countertopOverhang: 0.02,
|
|
1787
|
-
countertopBackOverhang: 0,
|
|
1788
|
-
withFinishedBack: false,
|
|
1789
|
-
withWaterfall: false,
|
|
1790
|
-
withFinishedEnds: false,
|
|
1791
|
-
frontThickness: 0.018,
|
|
1792
|
-
frontGap: 0.003,
|
|
1793
|
-
frontStyle: 'slab',
|
|
1794
|
-
panelReady: false,
|
|
1795
|
-
handleStyle: 'bar',
|
|
1796
|
-
handlePosition: 'auto',
|
|
1797
|
-
frontOverlay: 'full',
|
|
1798
|
-
withBottomPanel: true,
|
|
1799
|
-
showPlinth: true,
|
|
1800
|
-
withCountertop: true,
|
|
1801
|
-
// material / materialPreset left undefined — paint mode writes slot refs.
|
|
1802
|
-
}),
|
|
1803
|
-
capabilities: {
|
|
1804
|
-
reveal: { phase: 'furnishing', style: 'drop', height: 0.3 },
|
|
1805
|
-
revealOnEdit: ['width', 'depth', 'carcassHeight', 'plinthHeight'],
|
|
1806
|
-
surfacePlacement: 'floor-only',
|
|
1807
|
-
selectable: { hitVolume: 'bbox' },
|
|
1808
|
-
movable: {
|
|
1809
|
-
axes: ['x', 'z'],
|
|
1810
|
-
directDrag: true,
|
|
1811
|
-
gridSnap: true,
|
|
1812
|
-
gridSnapPosition: resolveCabinetMoveGridSnap,
|
|
1813
|
-
groupMoveSnapPose: resolveCabinetGroupMoveSnap,
|
|
1814
|
-
isValidPosition: ({ node, position, rotation, levelId, nodes }) => node.type !== 'cabinet' ||
|
|
1815
|
-
!cabinetRunOverlapsWallOpening({
|
|
1816
|
-
levelId,
|
|
1817
|
-
node: node,
|
|
1818
|
-
nodes: nodes,
|
|
1819
|
-
position,
|
|
1820
|
-
rotation,
|
|
1821
|
-
}),
|
|
1822
|
-
override: ({ node }) => selectionProxyIdFromMetadata(node.metadata)
|
|
1823
|
-
? { axes: [], gridSnap: false }
|
|
1824
|
-
: null,
|
|
1825
|
-
},
|
|
1826
|
-
rotatable: { axes: ['y'], snapAngles: [Math.PI / 4] },
|
|
1827
|
-
duplicable: { subtree: true, prepareSubtreeClone: prepareCabinetSubtreeClone },
|
|
1828
|
-
deletable: true,
|
|
1829
|
-
surfaces: {
|
|
1830
|
-
hosting: cabinetSurfaceProvider,
|
|
1831
|
-
top: {
|
|
1832
|
-
height: (node, context) => cabinetLocalBounds(node, context.nodes).maxY,
|
|
1833
|
-
},
|
|
1834
|
-
},
|
|
1835
|
-
floorPlaced: {
|
|
1836
|
-
applies: (node) => !hasCabinetParentId(node),
|
|
1837
|
-
footprints: (node, ctx) => cabinetFloorPlacedFootprints(node, ctx?.nodes),
|
|
1838
|
-
collides: true,
|
|
1839
|
-
},
|
|
1840
|
-
alignmentFootprint: (node, nodes) => {
|
|
1841
|
-
const n = node;
|
|
1842
|
-
return { shape: 'aabb', ...cabinetPlanBoundsAabb(n, nodes) };
|
|
1843
|
-
},
|
|
1844
|
-
dragBounds: (node, nodes) => {
|
|
1845
|
-
const bounds = cabinetLocalBounds(node, nodes);
|
|
1846
|
-
return { size: bounds.size, center: bounds.center };
|
|
1847
|
-
},
|
|
1848
|
-
paint: cabinetPaint,
|
|
1849
|
-
sceneAction: cabinetSceneAction,
|
|
1850
|
-
slots: () => cabinetSlots(),
|
|
1851
|
-
},
|
|
1852
|
-
// Dirty-cascade: a dirtied run re-marks its hosted modules so their
|
|
1853
|
-
// composite geometry re-flows with the run (see `cascadeDirty`).
|
|
1854
|
-
relations: {
|
|
1855
|
-
hosts: ['cabinet', 'cabinet-module', 'item', 'procedural-item'],
|
|
1856
|
-
},
|
|
1857
|
-
parametrics: cabinetParametrics,
|
|
1858
|
-
handles: (node, sceneApi) => cabinetHandles(node, sceneApi).map(withCabinetHostedChildren),
|
|
1859
|
-
placementNotice: cabinetPlacementNotice,
|
|
1860
|
-
geometry: buildCabinetGeometry,
|
|
1861
|
-
exportAnimation: ({ node, object }) => bakeCabinetAnimationClip(node, object),
|
|
1862
|
-
system: {
|
|
1863
|
-
module: () => import('./system.js'),
|
|
1864
|
-
priority: 2,
|
|
1865
|
-
},
|
|
1866
|
-
// `operationState` is deliberately absent — door/drawer poses are applied
|
|
1867
|
-
// per-frame by the cabinet animation system, not by geometry rebuilds.
|
|
1868
|
-
geometryChildTypes: ['cabinet', 'cabinet-module'],
|
|
1869
|
-
geometryKey: (n) => JSON.stringify([
|
|
1870
|
-
n.width,
|
|
1871
|
-
n.depth,
|
|
1872
|
-
n.carcassHeight,
|
|
1873
|
-
n.runTier,
|
|
1874
|
-
n.plinthHeight,
|
|
1875
|
-
n.toeKickDepth,
|
|
1876
|
-
n.boardThickness,
|
|
1877
|
-
n.countertopThickness,
|
|
1878
|
-
n.countertopOverhang,
|
|
1879
|
-
n.countertopBackOverhang,
|
|
1880
|
-
n.withFinishedBack,
|
|
1881
|
-
n.withWaterfall,
|
|
1882
|
-
n.withFinishedEnds,
|
|
1883
|
-
JSON.stringify(n.barLedge ?? null),
|
|
1884
|
-
n.frontThickness,
|
|
1885
|
-
n.frontGap,
|
|
1886
|
-
n.frontStyle,
|
|
1887
|
-
n.panelReady,
|
|
1888
|
-
n.handleStyle,
|
|
1889
|
-
n.handlePosition,
|
|
1890
|
-
n.frontOverlay,
|
|
1891
|
-
n.withBottomPanel,
|
|
1892
|
-
n.showPlinth,
|
|
1893
|
-
n.withCountertop,
|
|
1894
|
-
JSON.stringify(n.material ?? null),
|
|
1895
|
-
JSON.stringify(n.materialPreset ?? null),
|
|
1896
|
-
JSON.stringify(n.slots ?? null),
|
|
1897
|
-
JSON.stringify(cabinetLayoutRevision(n.metadata)),
|
|
1898
|
-
// Bumped when a sibling run moves/resizes nearby, so the countertop
|
|
1899
|
-
// overhang re-trims against the neighbor's new spans (the neighbor's
|
|
1900
|
-
// own fields never appear in this key).
|
|
1901
|
-
JSON.stringify(cabinetAdjacencyRevision(n.metadata)),
|
|
1902
|
-
JSON.stringify((n.children ?? []).filter((id) => id.startsWith('cabinet_') || id.startsWith('cabinet-module_'))),
|
|
1903
|
-
JSON.stringify(n.stack ?? null),
|
|
1904
|
-
]),
|
|
1905
|
-
floorplan: buildCabinetFloorplan,
|
|
1906
|
-
floorplanSiblingOverrides: cabinetFloorplanSiblingOverrides,
|
|
1907
|
-
floorplanAffectedIds: cabinetFloorplanAffectedIds,
|
|
1908
|
-
quickActionNodeScope: 'level',
|
|
1909
|
-
quickActions: cabinetQuickActions,
|
|
1910
|
-
// Corner-derived leg runs hide their own tree rows; their modules are
|
|
1911
|
-
// flattened into the source run's hierarchy.
|
|
1912
|
-
tree: {
|
|
1913
|
-
label: cabinetTreeLabel,
|
|
1914
|
-
hidden: cabinetTreeHidden,
|
|
1915
|
-
childIds: cabinetTreeChildIds,
|
|
1916
|
-
},
|
|
1917
|
-
// E operates the run: every child module's doors/drawers swing together.
|
|
1918
|
-
keyboardActions: {
|
|
1919
|
-
e: {
|
|
1920
|
-
appliesTo: (node) => node.type === 'cabinet',
|
|
1921
|
-
run: (node) => toggleCabinetOperationState(node.id),
|
|
1922
|
-
},
|
|
1923
|
-
},
|
|
1924
|
-
tool: () => import('./tool.js'),
|
|
1925
|
-
toolHints: [
|
|
1926
|
-
{ key: 'Click', label: 'Place cabinet' },
|
|
1927
|
-
{
|
|
1928
|
-
key: 'I',
|
|
1929
|
-
label: 'Placement type',
|
|
1930
|
-
chip: {
|
|
1931
|
-
subscribe: (onChange) => useCabinetPlacementType.subscribe(onChange),
|
|
1932
|
-
value: () => useCabinetPlacementType.getState().type,
|
|
1933
|
-
cycle: () => void useCabinetPlacementType.getState().cycleType(),
|
|
1934
|
-
labels: { cabinet: 'Type: Cabinet', island: 'Type: Island' },
|
|
1935
|
-
icons: { cabinet: 'lucide:rectangle-horizontal', island: 'lucide:table-2' },
|
|
1936
|
-
tooltip: 'Placement type — click or press I to toggle',
|
|
1937
|
-
},
|
|
1938
|
-
},
|
|
1939
|
-
{ key: 'Alt', label: 'Force place' },
|
|
1940
|
-
{ key: 'R / T', label: 'Rotate' },
|
|
1941
|
-
{ key: 'Esc', label: 'Cancel run / exit' },
|
|
1942
|
-
],
|
|
1943
|
-
presentation: {
|
|
1944
|
-
label: 'Modular Cabinet',
|
|
1945
|
-
description: 'A configurable parametric base cabinet.',
|
|
1946
|
-
icon: { kind: 'url', src: '/icons/item.webp' },
|
|
1947
|
-
paletteSection: 'furnish',
|
|
1948
|
-
paletteOrder: 34,
|
|
1949
|
-
},
|
|
1950
|
-
mcp: {
|
|
1951
|
-
description: 'A configurable parametric base cabinet with plinth, carcass, front panels, optional countertop, and editable dimensions.',
|
|
1952
|
-
},
|
|
1953
|
-
};
|
|
1954
|
-
export const cabinetModuleDefinition = {
|
|
1955
|
-
kind: 'cabinet-module',
|
|
1956
|
-
schemaVersion: 5,
|
|
1957
|
-
schema: CabinetModuleNode,
|
|
1958
|
-
category: 'furnish',
|
|
1959
|
-
surfaceRole: 'joinery',
|
|
1960
|
-
snapProfile: 'item',
|
|
1961
|
-
facingIndicator: true,
|
|
1962
|
-
defaults: () => ({
|
|
1963
|
-
object: 'node',
|
|
1964
|
-
parentId: null,
|
|
1965
|
-
visible: true,
|
|
1966
|
-
metadata: {},
|
|
1967
|
-
position: [0, 0, 0],
|
|
1968
|
-
rotation: 0,
|
|
1969
|
-
children: [],
|
|
1970
|
-
cabinetType: 'base',
|
|
1971
|
-
width: 0.5,
|
|
1972
|
-
depth: CABINET_METRIC_DEFAULTS.depth,
|
|
1973
|
-
carcassHeight: CABINET_METRIC_DEFAULTS.carcassHeight,
|
|
1974
|
-
operationState: 0,
|
|
1975
|
-
plinthHeight: 0,
|
|
1976
|
-
toeKickDepth: 0.075,
|
|
1977
|
-
boardThickness: 0.018,
|
|
1978
|
-
countertopThickness: 0,
|
|
1979
|
-
countertopOverhang: 0.02,
|
|
1980
|
-
countertopBackOverhang: 0,
|
|
1981
|
-
withFinishedBack: false,
|
|
1982
|
-
frontThickness: 0.018,
|
|
1983
|
-
frontGap: 0.003,
|
|
1984
|
-
moduleKind: 'standard',
|
|
1985
|
-
openSide: undefined,
|
|
1986
|
-
cornerShelf: false,
|
|
1987
|
-
topFinish: 'none',
|
|
1988
|
-
topFinishHeight: CabinetModuleNode.parse({}).topFinishHeight,
|
|
1989
|
-
topFinishDepth: 0.32,
|
|
1990
|
-
frontStyle: 'slab',
|
|
1991
|
-
panelReady: false,
|
|
1992
|
-
handleStyle: 'bar',
|
|
1993
|
-
handlePosition: 'auto',
|
|
1994
|
-
frontOverlay: 'full',
|
|
1995
|
-
withBottomPanel: true,
|
|
1996
|
-
showPlinth: false,
|
|
1997
|
-
withCountertop: false,
|
|
1998
|
-
// material / materialPreset left undefined — paint mode writes slot refs.
|
|
1999
|
-
}),
|
|
2000
|
-
capabilities: {
|
|
2001
|
-
selectable: { hitVolume: 'bbox' },
|
|
2002
|
-
surfaces: { hosting: cabinetModuleSurfaceProvider },
|
|
2003
|
-
movable: {
|
|
2004
|
-
axes: ['x', 'z'],
|
|
2005
|
-
directDrag: true,
|
|
2006
|
-
gridSnap: true,
|
|
2007
|
-
parentFrame: cabinetModuleParentFrame,
|
|
2008
|
-
groupMoveSnapPose: resolveCabinetModuleGroupMoveSnap,
|
|
2009
|
-
override: ({ node }) => selectionProxyIdFromMetadata(node.metadata)
|
|
2010
|
-
? { axes: [], gridSnap: false }
|
|
2011
|
-
: null,
|
|
2012
|
-
},
|
|
2013
|
-
rotatable: { axes: ['y'], snapAngles: [Math.PI / 4] },
|
|
2014
|
-
duplicable: { subtree: true, prepareSubtreeClone: prepareCabinetSubtreeClone },
|
|
2015
|
-
deletable: true,
|
|
2016
|
-
floorPlaced: {
|
|
2017
|
-
applies: (node) => !hasCabinetParentId(node),
|
|
2018
|
-
footprint: (node) => {
|
|
2019
|
-
const n = node;
|
|
2020
|
-
return {
|
|
2021
|
-
dimensions: [n.width, cabinetModuleTotalHeight(n), n.depth],
|
|
2022
|
-
rotation: [0, n.rotation, 0],
|
|
2023
|
-
};
|
|
2024
|
-
},
|
|
2025
|
-
collides: true,
|
|
2026
|
-
},
|
|
2027
|
-
dragBounds: (node, nodes) => {
|
|
2028
|
-
const bounds = cabinetLocalBounds(node, nodes);
|
|
2029
|
-
return { size: bounds.size, center: bounds.center };
|
|
2030
|
-
},
|
|
2031
|
-
paint: cabinetPaint,
|
|
2032
|
-
sceneAction: cabinetSceneAction,
|
|
2033
|
-
slots: () => cabinetSlots(),
|
|
2034
|
-
},
|
|
2035
|
-
relations: { hosts: ['cabinet', 'cabinet-module', 'item', 'procedural-item'] },
|
|
2036
|
-
parametrics: cabinetModuleParametrics,
|
|
2037
|
-
handles: () => cabinetModuleHandles().map(withCabinetHostedChildren),
|
|
2038
|
-
placementNotice: cabinetPlacementNotice,
|
|
2039
|
-
geometry: buildCabinetGeometry,
|
|
2040
|
-
exportAnimation: ({ node, object }) => bakeCabinetAnimationClip(node, object),
|
|
2041
|
-
// `operationState` is deliberately absent — see cabinetDefinition.geometryKey.
|
|
2042
|
-
geometryChildTypes: ['cabinet', 'cabinet-module'],
|
|
2043
|
-
geometryKey: (n) => JSON.stringify([
|
|
2044
|
-
n.cabinetType,
|
|
2045
|
-
n.moduleKind,
|
|
2046
|
-
n.width,
|
|
2047
|
-
n.depth,
|
|
2048
|
-
n.carcassHeight,
|
|
2049
|
-
n.plinthHeight,
|
|
2050
|
-
n.toeKickDepth,
|
|
2051
|
-
n.boardThickness,
|
|
2052
|
-
n.countertopThickness,
|
|
2053
|
-
n.countertopOverhang,
|
|
2054
|
-
n.frontThickness,
|
|
2055
|
-
n.frontGap,
|
|
2056
|
-
n.frontStyle,
|
|
2057
|
-
n.panelReady,
|
|
2058
|
-
n.handleStyle,
|
|
2059
|
-
n.handlePosition,
|
|
2060
|
-
n.frontOverlay,
|
|
2061
|
-
n.withBottomPanel,
|
|
2062
|
-
n.showPlinth,
|
|
2063
|
-
n.withCountertop,
|
|
2064
|
-
n.openSide ?? null,
|
|
2065
|
-
n.cornerShelf ?? false,
|
|
2066
|
-
n.topFinish,
|
|
2067
|
-
n.topFinishHeight,
|
|
2068
|
-
n.topFinishDepth,
|
|
2069
|
-
JSON.stringify(n.material ?? null),
|
|
2070
|
-
JSON.stringify(n.materialPreset ?? null),
|
|
2071
|
-
JSON.stringify(n.slots ?? null),
|
|
2072
|
-
JSON.stringify((n.children ?? []).filter((id) => id.startsWith('cabinet_') || id.startsWith('cabinet-module_'))),
|
|
2073
|
-
JSON.stringify(n.stack ?? null),
|
|
2074
|
-
]),
|
|
2075
|
-
floorplan: buildCabinetModuleFloorplan,
|
|
2076
|
-
floorplanSiblingOverrides: cabinetFloorplanSiblingOverrides,
|
|
2077
|
-
floorplanAffectedIds: cabinetFloorplanAffectedIds,
|
|
2078
|
-
// 2D ↔ 3D parity: module position is run-local, so the generic overlay's
|
|
2079
|
-
// plan-space translate would corrupt it on any rotated / offset run.
|
|
2080
|
-
floorplanMoveTarget: cabinetModuleFloorplanMoveTarget,
|
|
2081
|
-
quickActionNodeScope: 'level',
|
|
2082
|
-
quickActions: cabinetQuickActions,
|
|
2083
|
-
tree: {
|
|
2084
|
-
label: cabinetTreeLabel,
|
|
2085
|
-
childIds: cabinetTreeChildIds,
|
|
2086
|
-
},
|
|
2087
|
-
// Corner-generated modules keep a proxy so grouped move/rotate
|
|
2088
|
-
// affordances can still key off the run, but a direct body click should
|
|
2089
|
-
// stay on the clicked module so added legs / wall cabinets remain
|
|
2090
|
-
// individually selectable.
|
|
2091
|
-
selectionProxy: {
|
|
2092
|
-
bypassDirectPick: (node, proxyTarget) => node.type === 'cabinet-module' && proxyTarget.type === 'cabinet',
|
|
2093
|
-
},
|
|
2094
|
-
// E animates this module's doors/drawers open ↔ closed (hood-only
|
|
2095
|
-
// modules have nothing to operate).
|
|
2096
|
-
keyboardActions: {
|
|
2097
|
-
e: {
|
|
2098
|
-
appliesTo: (node) => node.type === 'cabinet-module' && !isHoodOnlyCabinet(node),
|
|
2099
|
-
run: (node) => toggleCabinetOperationState(node.id),
|
|
2100
|
-
},
|
|
2101
|
-
},
|
|
2102
|
-
presentation: {
|
|
2103
|
-
label: 'Cabinet Module',
|
|
2104
|
-
description: 'An editable module inside a modular cabinet run.',
|
|
2105
|
-
icon: { kind: 'url', src: '/icons/item.webp' },
|
|
2106
|
-
paletteSection: 'furnish',
|
|
2107
|
-
paletteOrder: 35,
|
|
2108
|
-
},
|
|
2109
|
-
mcp: {
|
|
2110
|
-
description: 'A single editable cabinet module inside a modular cabinet run.',
|
|
2111
|
-
},
|
|
2112
|
-
};
|
|
1
|
+
import { composeNodeDefinition } from '../definition-contributions.js';
|
|
2
|
+
import { cabinetEditContribution, cabinetModuleEditContribution } from './definition.edit.js';
|
|
3
|
+
import { cabinetModuleRenderDefinition, cabinetRenderDefinition } from './definition.render.js';
|
|
4
|
+
export const cabinetDefinition = composeNodeDefinition(cabinetRenderDefinition, cabinetEditContribution);
|
|
5
|
+
export const cabinetModuleDefinition = composeNodeDefinition(cabinetModuleRenderDefinition, cabinetModuleEditContribution);
|
|
6
|
+
export { bumpCabinetRunsNear, cabinetFloorPlacedFootprints, cabinetRunFootprint, cabinetRunNeighborSignature, } from './definition.render.js';
|