@pascal-app/nodes 1.0.6 → 1.0.7
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 +1 -0
- 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 +14 -0
- package/dist/beam/definition.d.ts.map +1 -0
- package/dist/beam/definition.js +173 -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/box-vent/panel.d.ts.map +1 -1
- package/dist/box-vent/panel.js +8 -7
- 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.map +1 -1
- package/dist/cabinet/definition.js +3 -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 +107 -14
- 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/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/tool.d.ts.map +1 -1
- package/dist/cabinet/tool.js +8 -5
- 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.map +1 -1
- package/dist/ceiling/definition.js +3 -1
- 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/panel.d.ts.map +1 -1
- package/dist/chimney/panel.js +113 -41
- package/dist/column/definition.d.ts.map +1 -1
- package/dist/column/definition.js +3 -0
- package/dist/column/floorplan.d.ts.map +1 -1
- package/dist/column/floorplan.js +17 -0
- package/dist/column/hosted-resize.d.ts +28 -1
- package/dist/column/hosted-resize.d.ts.map +1 -1
- package/dist/column/panel.d.ts.map +1 -1
- package/dist/column/panel.js +125 -37
- 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/tool.d.ts +3 -10
- package/dist/column/tool.d.ts.map +1 -1
- package/dist/column/tool.js +13 -1
- package/dist/cupola/panel.d.ts.map +1 -1
- package/dist/cupola/panel.js +14 -7
- 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.map +1 -1
- package/dist/door/definition.js +34 -7
- 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 +28 -6
- 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/move-tool.d.ts.map +1 -1
- package/dist/door/move-tool.js +60 -16
- 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 +76 -29
- 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/inspector-editors.d.ts.map +1 -1
- package/dist/downspout/inspector-editors.js +3 -2
- package/dist/duct-fitting/inspector-editors.d.ts.map +1 -1
- package/dist/duct-fitting/inspector-editors.js +6 -1
- package/dist/duct-fitting/tool.d.ts.map +1 -1
- package/dist/duct-fitting/tool.js +11 -2
- package/dist/duct-terminal/tool.d.ts.map +1 -1
- package/dist/duct-terminal/tool.js +11 -2
- package/dist/elevator/panel.d.ts.map +1 -1
- package/dist/elevator/panel.js +41 -18
- package/dist/eyebrow-vent/panel.d.ts.map +1 -1
- package/dist/eyebrow-vent/panel.js +16 -6
- 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 +11 -2
- package/dist/fence/system.d.ts.map +1 -1
- package/dist/fence/system.js +13 -0
- package/dist/fence-feature/actions.d.ts.map +1 -1
- package/dist/fence-feature/actions.js +5 -2
- 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/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/gutter/downspouts-panel.d.ts.map +1 -1
- package/dist/gutter/downspouts-panel.js +14 -2
- 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/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/item/authored-params.d.ts.map +1 -1
- package/dist/item/authored-params.js +19 -4
- package/dist/item/floorplan.d.ts +1 -1
- package/dist/item/floorplan.d.ts.map +1 -1
- package/dist/item/panel.d.ts.map +1 -1
- package/dist/item/panel.js +9 -7
- package/dist/liquid-line/tool.d.ts.map +1 -1
- package/dist/liquid-line/tool.js +10 -3
- package/dist/measurement/tool.d.ts +1 -1
- package/dist/measurement/tool.d.ts.map +1 -1
- package/dist/measurement/tool.js +8 -8
- package/dist/pipe-fitting/tool.d.ts.map +1 -1
- package/dist/pipe-fitting/tool.js +3 -2
- package/dist/pipe-trap/tool.d.ts.map +1 -1
- package/dist/pipe-trap/tool.js +7 -2
- package/dist/procedural-item/renderer.d.ts.map +1 -1
- package/dist/procedural-item/renderer.js +8 -1
- 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 +7 -3
- package/dist/roof/definition.d.ts.map +1 -1
- package/dist/roof/definition.js +33 -3
- 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/glazing-controls.d.ts +2 -1
- package/dist/roof/glazing-controls.d.ts.map +1 -1
- package/dist/roof/glazing-controls.js +51 -13
- 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 +90 -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 +17 -4
- package/dist/roof/tool.d.ts.map +1 -1
- package/dist/roof/tool.js +211 -113
- 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.map +1 -1
- package/dist/roof-segment/definition.js +50 -5
- package/dist/roof-segment/floorplan-affordances.d.ts.map +1 -1
- package/dist/roof-segment/floorplan-affordances.js +68 -19
- 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 -1
- package/dist/roof-segment/paint.d.ts.map +1 -1
- package/dist/roof-segment/paint.js +43 -2
- 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 +96 -14
- package/dist/roof-segment/parametrics.d.ts.map +1 -1
- package/dist/roof-segment/parametrics.js +4 -0
- package/dist/roof-segment/renderer.d.ts.map +1 -1
- package/dist/roof-segment/renderer.js +26 -5
- package/dist/separator/definition.d.ts.map +1 -1
- package/dist/separator/definition.js +10 -12
- 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 +4 -0
- package/dist/separator/renderer.d.ts.map +1 -1
- package/dist/separator/renderer.js +21 -6
- 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/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/curtain-opening-limits.d.ts.map +1 -1
- package/dist/shared/curtain-opening-limits.js +44 -14
- 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/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 +11 -7
- 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 +11 -9
- 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/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/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-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/system-check-panel.d.ts.map +1 -1
- package/dist/shared/system-check-panel.js +94 -15
- package/dist/shared/wall-attach-target.d.ts.map +1 -1
- package/dist/shared/wall-attach-target.js +6 -3
- package/dist/shelf/definition.d.ts.map +1 -1
- package/dist/shelf/definition.js +2 -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/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 +2 -1
- package/dist/slab/definition.d.ts.map +1 -1
- package/dist/slab/definition.js +6 -1
- 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/panel.d.ts.map +1 -1
- package/dist/solar-panel/panel.js +49 -14
- 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/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 +243 -51
- 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/panel.d.ts.map +1 -1
- package/dist/stair-segment/panel.js +65 -18
- package/dist/turbine-vent/panel.d.ts.map +1 -1
- package/dist/turbine-vent/panel.js +14 -5
- 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 +104 -17
- 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 +241 -37
- package/dist/wall/curve-tool.d.ts.map +1 -1
- package/dist/wall/curve-tool.js +2 -3
- package/dist/wall/definition.d.ts.map +1 -1
- package/dist/wall/definition.js +20 -5
- 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 +62 -46
- package/dist/wall/move-endpoint-tool.d.ts.map +1 -1
- package/dist/wall/move-endpoint-tool.js +1 -0
- 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 +158 -18
- package/dist/wall/panel.d.ts +8 -0
- package/dist/wall/panel.d.ts.map +1 -1
- package/dist/wall/panel.js +228 -156
- 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/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 +79 -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 +2 -0
- 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/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 +160 -47
- package/dist/wall/treatments.d.ts +3 -0
- package/dist/wall/treatments.d.ts.map +1 -1
- package/dist/wall/treatments.js +30 -7
- 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.map +1 -1
- package/dist/window/definition.js +11 -2
- package/dist/window/floorplan-move.d.ts.map +1 -1
- package/dist/window/floorplan-move.js +5 -0
- 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 +10 -3
- 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 +19 -14
- 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 +14 -14
- 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,8 +1,12 @@
|
|
|
1
|
-
import { getActiveRoofHeight, getPitchFromActiveRoofHeight, getRoofSegmentResizePatch, RoofSegmentNode as RoofSegmentNodeSchema, } from '@pascal-app/core';
|
|
1
|
+
import { getActiveRoofHeight, getPitchFromActiveRoofHeight, getRoofSegmentResizePatch, RoofSegmentNode as RoofSegmentNodeSchema, snapScalar, } from '@pascal-app/core';
|
|
2
|
+
import { getSegmentGridStep, isGridSnapActive, isMagneticSnapActive, PANEL_MODEL_EXTENSION, } from '@pascal-app/editor';
|
|
3
|
+
import { roofFloorplanAffectedIds } from '../roof/floorplan-overrides.js';
|
|
4
|
+
import { bearingWallThickness, catchRoofSideOnWalls, roofCatchWalls, segmentWallLine, } from '../roof/wall-catch.js';
|
|
2
5
|
import { buildRoofSegmentFloorplan } from './floorplan.js';
|
|
3
6
|
import { roofSegmentMoveTarget, roofSegmentResizeAffordance, roofSegmentRotateAffordance, } from './floorplan-affordances.js';
|
|
4
7
|
import { matchRoofSegmentMeasurementFeature, roofSegmentMeasurementFeatures } from './measurement.js';
|
|
5
8
|
import { roofSegmentPaint, roofSegmentSlots } from './paint.js';
|
|
9
|
+
import { roofSegmentPanelModel } from './panel-model.js';
|
|
6
10
|
import { roofSegmentParametrics } from './parametrics.js';
|
|
7
11
|
import { RoofSegmentNode } from './schema.js';
|
|
8
12
|
const SIDE_HANDLE_OFFSET = 0.3;
|
|
@@ -33,6 +37,42 @@ function getSideResizeHandleY(n, localZ) {
|
|
|
33
37
|
const roofY = n.wallHeight + roofHeight * (1 - Math.max(0, Math.min(1, t)));
|
|
34
38
|
return Math.max(roofY, MIN_WALL_DISPLAY) + ROOF_HANDLE_CLEARANCE;
|
|
35
39
|
}
|
|
40
|
+
function roofOf(n, sceneApi) {
|
|
41
|
+
const roof = n.parentId ? sceneApi?.get(n.parentId) : undefined;
|
|
42
|
+
return roof?.type === 'roof' ? roof : undefined;
|
|
43
|
+
}
|
|
44
|
+
// A dragged side lands on a wall under it in grid and lines, ahead of the grid, as a move does.
|
|
45
|
+
// The arrows leave `gridSnap` off so the catch sees the raw size, and grid it here when nothing
|
|
46
|
+
// catches; Alt skips this hook, so the side follows the cursor.
|
|
47
|
+
function snapSideOntoWalls(axis, side) {
|
|
48
|
+
return (n, value, sceneApi) => {
|
|
49
|
+
const grid = isGridSnapActive();
|
|
50
|
+
if (!grid && !isMagneticSnapActive())
|
|
51
|
+
return value;
|
|
52
|
+
const roof = roofOf(n, sceneApi);
|
|
53
|
+
if (roof) {
|
|
54
|
+
const caught = catchRoofSideOnWalls({
|
|
55
|
+
line: segmentWallLine(roof, n),
|
|
56
|
+
axis,
|
|
57
|
+
side,
|
|
58
|
+
value,
|
|
59
|
+
walls: roofCatchWalls(sceneApi.nodes(), roof.parentId),
|
|
60
|
+
});
|
|
61
|
+
if (caught !== null)
|
|
62
|
+
return caught;
|
|
63
|
+
}
|
|
64
|
+
return grid ? snapScalar(value, getSegmentGridStep()) : value;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// Sized onto the walls under it, a segment's gable and heel walls take their thickness; off them,
|
|
68
|
+
// its own (written either way, so a drag back off the walls drops the thickness it previewed).
|
|
69
|
+
function onBearingWalls(n, patch, sceneApi) {
|
|
70
|
+
const roof = roofOf(n, sceneApi);
|
|
71
|
+
if (!(roof && sceneApi))
|
|
72
|
+
return patch;
|
|
73
|
+
const thickness = bearingWallThickness(segmentWallLine(roof, { ...n, ...patch }), roofCatchWalls(sceneApi.nodes(), roof.parentId));
|
|
74
|
+
return { ...patch, wallThickness: thickness ?? n.wallThickness };
|
|
75
|
+
}
|
|
36
76
|
// Width arrow on the +X (right) or -X (left) side. Asymmetric resize:
|
|
37
77
|
// dragging one arrow grows the segment outward from its own edge while
|
|
38
78
|
// the opposite edge stays world-fixed — the same pattern doors use
|
|
@@ -54,9 +94,9 @@ function roofSegmentWidthHandle(side) {
|
|
|
54
94
|
// 'max' = +X edge anchored (left arrow grows the -X edge outward).
|
|
55
95
|
anchor: side === 'right' ? 'min' : 'max',
|
|
56
96
|
min: MIN_ROOF_DIM,
|
|
57
|
-
|
|
97
|
+
connectionSnap: snapSideOntoWalls('x', sign),
|
|
58
98
|
currentValue: (n) => n.width,
|
|
59
|
-
apply: (initial, newWidth) => getRoofSegmentResizePatch(initial, 'x', sign, newWidth),
|
|
99
|
+
apply: (initial, newWidth, sceneApi) => onBearingWalls(initial, getRoofSegmentResizePatch(initial, 'x', sign, newWidth), sceneApi),
|
|
60
100
|
placement: {
|
|
61
101
|
position: (n) => [sign * (n.width / 2 + SIDE_HANDLE_OFFSET), getSideResizeHandleY(n, 0), 0],
|
|
62
102
|
// Flip the left chevron so it points outward toward -X. The
|
|
@@ -82,9 +122,9 @@ function roofSegmentDepthHandle(side) {
|
|
|
82
122
|
axis: 'z',
|
|
83
123
|
anchor: side === 'front' ? 'min' : 'max',
|
|
84
124
|
min: MIN_ROOF_DIM,
|
|
85
|
-
|
|
125
|
+
connectionSnap: snapSideOntoWalls('z', sign),
|
|
86
126
|
currentValue: (n) => n.depth,
|
|
87
|
-
apply: (initial, newDepth) => getRoofSegmentResizePatch(initial, 'z', sign, newDepth),
|
|
127
|
+
apply: (initial, newDepth, sceneApi) => onBearingWalls(initial, getRoofSegmentResizePatch(initial, 'z', sign, newDepth), sceneApi),
|
|
88
128
|
placement: {
|
|
89
129
|
position: (n) => [
|
|
90
130
|
0,
|
|
@@ -247,6 +287,9 @@ export const roofSegmentDefinition = {
|
|
|
247
287
|
// snapping chip and honours the active mode like every other structural
|
|
248
288
|
// move. Resize / rotate run through their own reshaping scope.
|
|
249
289
|
snapProfile: 'structural',
|
|
290
|
+
extensions: {
|
|
291
|
+
[PANEL_MODEL_EXTENSION]: roofSegmentPanelModel,
|
|
292
|
+
},
|
|
250
293
|
defaults: () => {
|
|
251
294
|
const stub = RoofSegmentNodeSchema.parse({
|
|
252
295
|
id: 'roof-segment_default',
|
|
@@ -291,6 +334,8 @@ export const roofSegmentDefinition = {
|
|
|
291
334
|
module: () => import('./renderer.js'),
|
|
292
335
|
},
|
|
293
336
|
floorplan: buildRoofSegmentFloorplan,
|
|
337
|
+
// Its roof draws the outline and creases from it: a live edit rebuilds that roof's plan.
|
|
338
|
+
floorplanAffectedIds: roofFloorplanAffectedIds,
|
|
294
339
|
measurement: {
|
|
295
340
|
features: (node, ctx) => roofSegmentMeasurementFeatures(node, ctx.parent?.type === 'roof' ? ctx.parent : null),
|
|
296
341
|
match: (node, ctx, point, maxDistance) => matchRoofSegmentMeasurementFeature(node, ctx.parent?.type === 'roof' ? ctx.parent : null, point, maxDistance),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floorplan-affordances.d.ts","sourceRoot":"","sources":["../../src/roof-segment/floorplan-affordances.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGxB,KAAK,eAAe,EAIrB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"floorplan-affordances.d.ts","sourceRoot":"","sources":["../../src/roof-segment/floorplan-affordances.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAGxB,KAAK,eAAe,EAIrB,MAAM,kBAAkB,CAAA;AA0DzB;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,eAAe,CAyG5E,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,eAAe,CA8B5E,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,eAAe,CAyEtE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getRoofSegmentResizePatch, snapScalar, useLiveNodeOverrides, useScene, } from '@pascal-app/core';
|
|
2
|
-
import { getSegmentGridStep, isAngleSnapActive, isGridSnapActive } from '@pascal-app/editor';
|
|
2
|
+
import { getSegmentGridStep, isAngleSnapActive, isGridSnapActive, isMagneticSnapActive, } from '@pascal-app/editor';
|
|
3
3
|
import { commitSeatedRoofEdit } from '../roof/roof-level-target.js';
|
|
4
|
+
import { bearingWallThickness, catchRoofOnWalls, catchRoofSideOnWalls, placeRoofOnWalls, roofCatchWalls, segmentWallLine, } from '../roof/wall-catch.js';
|
|
4
5
|
import { createFloorplanCursorResolver } from '../shared/floorplan-cursor.js';
|
|
5
6
|
import { rotateAffordanceDelta } from '../shared/rotate-affordance.js';
|
|
6
7
|
const MIN_ROOF_DIM = 1;
|
|
@@ -68,6 +69,16 @@ export const roofSegmentResizeAffordance = {
|
|
|
68
69
|
const { axis, side } = resize;
|
|
69
70
|
const initialValue = axis === 'x' ? node.width : node.depth;
|
|
70
71
|
const { effRot } = resolveSegmentFrame(node, nodes);
|
|
72
|
+
const roofId = node.parentId;
|
|
73
|
+
const roof = roofId ? nodes[roofId] : undefined;
|
|
74
|
+
const walls = roofCatchWalls(nodes, roof?.parentId);
|
|
75
|
+
const line = {
|
|
76
|
+
center: [cx, cz],
|
|
77
|
+
angle: effRot,
|
|
78
|
+
hw: node.width / 2,
|
|
79
|
+
hd: node.depth / 2,
|
|
80
|
+
wallThickness: node.wallThickness,
|
|
81
|
+
};
|
|
71
82
|
const cosEff = Math.cos(effRot);
|
|
72
83
|
const sinEff = Math.sin(effRot);
|
|
73
84
|
// Project (planPoint - center) onto the segment's local X or Z axis
|
|
@@ -80,22 +91,34 @@ export const roofSegmentResizeAffordance = {
|
|
|
80
91
|
};
|
|
81
92
|
const initialLocal = projectLocalAxis(initialPlanPoint[0], initialPlanPoint[1]);
|
|
82
93
|
let lastValue = initialValue;
|
|
94
|
+
// Sized onto the walls under it, its gable and heel walls take their thickness; off them, it
|
|
95
|
+
// keeps its own (the live override merges, so it is always written).
|
|
96
|
+
const resized = (value) => {
|
|
97
|
+
const patch = getRoofSegmentResizePatch(node, axis, side, value);
|
|
98
|
+
const thickness = bearingWallThickness(segmentWallLine(roof ?? { position: [0, 0, 0], rotation: 0 }, { ...node, ...patch }), walls);
|
|
99
|
+
return { ...patch, wallThickness: thickness ?? node.wallThickness };
|
|
100
|
+
};
|
|
83
101
|
return {
|
|
84
102
|
affectedIds: [segmentId],
|
|
85
|
-
apply({ planPoint }) {
|
|
103
|
+
apply({ planPoint, modifiers }) {
|
|
86
104
|
const currentLocal = projectLocalAxis(planPoint[0], planPoint[1]);
|
|
87
105
|
const delta = (currentLocal - initialLocal) * side;
|
|
88
106
|
const rawValue = initialValue + delta;
|
|
89
107
|
// Mode-aware grid step (0 outside grid mode, so `lines` / `off` resize
|
|
90
108
|
// freely — the "smooth" behaviour that used to need a held Shift). The
|
|
91
109
|
// reshaping scope opened by the dispatcher resolves the `polygon` set.
|
|
92
|
-
|
|
93
|
-
const
|
|
110
|
+
// Alt holds the raw cursor, as in 3D.
|
|
111
|
+
const free = modifiers.altKey;
|
|
112
|
+
const step = !free && isGridSnapActive() ? getSegmentGridStep() : 0;
|
|
113
|
+
let snappedValue = step > 0 ? snapScalar(rawValue, step) : rawValue;
|
|
114
|
+
// The dragged side lands on a wall under it in grid and lines, as a move does.
|
|
115
|
+
if (!free && (isGridSnapActive() || isMagneticSnapActive())) {
|
|
116
|
+
snappedValue =
|
|
117
|
+
catchRoofSideOnWalls({ line, axis, side, value: rawValue, walls }) ?? snappedValue;
|
|
118
|
+
}
|
|
94
119
|
const newValue = Math.max(MIN_ROOF_DIM, snappedValue);
|
|
95
120
|
lastValue = newValue;
|
|
96
|
-
useLiveNodeOverrides
|
|
97
|
-
.getState()
|
|
98
|
-
.set(segmentId, getRoofSegmentResizePatch(node, axis, side, newValue));
|
|
121
|
+
useLiveNodeOverrides.getState().set(segmentId, resized(newValue));
|
|
99
122
|
useScene.getState().markDirty(segmentId);
|
|
100
123
|
},
|
|
101
124
|
canCommit() {
|
|
@@ -103,7 +126,7 @@ export const roofSegmentResizeAffordance = {
|
|
|
103
126
|
},
|
|
104
127
|
commit() {
|
|
105
128
|
useLiveNodeOverrides.getState().clear(segmentId);
|
|
106
|
-
commitSeatedRoofEdit([{ id: segmentId, data:
|
|
129
|
+
commitSeatedRoofEdit([{ id: segmentId, data: resized(lastValue) }], segmentId);
|
|
107
130
|
},
|
|
108
131
|
};
|
|
109
132
|
},
|
|
@@ -158,7 +181,7 @@ export const roofSegmentRotateAffordance = {
|
|
|
158
181
|
export const roofSegmentMoveTarget = ({ node, nodes }) => {
|
|
159
182
|
const segmentId = node.id;
|
|
160
183
|
const initialY = node.position[1];
|
|
161
|
-
const { cx, cz,
|
|
184
|
+
const { cx, cz, effRot, cosRoof, sinRoof } = resolveSegmentFrame(node, nodes);
|
|
162
185
|
const roofId = node.parentId;
|
|
163
186
|
const roof = roofId ? nodes[roofId] : undefined;
|
|
164
187
|
const roofPosX = roof?.position[0] ?? 0;
|
|
@@ -167,26 +190,52 @@ export const roofSegmentMoveTarget = ({ node, nodes }) => {
|
|
|
167
190
|
original: [cx, cz],
|
|
168
191
|
metadata: node.metadata,
|
|
169
192
|
});
|
|
170
|
-
|
|
171
|
-
// is `[cosRoof, sinRoof; -sinRoof, cosRoof]`. Used to project world cursor
|
|
172
|
-
// back into roof-local coords.
|
|
173
|
-
void roofRot;
|
|
193
|
+
const walls = roofCatchWalls(nodes, roof?.parentId);
|
|
174
194
|
let lastLocal = [node.position[0], node.position[1], node.position[2]];
|
|
195
|
+
// Off them again, it keeps its own (the live override merges, so it is always written).
|
|
196
|
+
let lastThickness = node.wallThickness;
|
|
197
|
+
const moved = () => ({
|
|
198
|
+
position: lastLocal,
|
|
199
|
+
wallThickness: lastThickness,
|
|
200
|
+
});
|
|
175
201
|
return {
|
|
176
202
|
affectedIds: [segmentId],
|
|
177
|
-
apply({ planPoint }) {
|
|
203
|
+
apply({ planPoint, modifiers }) {
|
|
178
204
|
// Mode-aware: `getSegmentGridStep()` is 0 outside grid mode (so `lines` /
|
|
179
205
|
// `off` move freely), and the `moving` scope resolves the `polygon` set
|
|
180
|
-
// via the kind's `snapProfile` — no held-Shift bypass.
|
|
181
|
-
const
|
|
206
|
+
// via the kind's `snapProfile` — no held-Shift bypass. Alt holds the raw cursor, as in 3D.
|
|
207
|
+
const free = modifiers.altKey;
|
|
208
|
+
const step = !free && isGridSnapActive() ? getSegmentGridStep() : 0;
|
|
182
209
|
const snap = (value) => snapScalar(value, step);
|
|
183
|
-
const
|
|
210
|
+
const raw = resolveCursor(planPoint);
|
|
211
|
+
let worldPoint = resolveCursor(planPoint, { snap });
|
|
212
|
+
// Its wall line lands on the walls under it in grid and lines, its outer face on a porch's
|
|
213
|
+
// invisible walls or a deck's railings.
|
|
214
|
+
if (!free && (isGridSnapActive() || isMagneticSnapActive())) {
|
|
215
|
+
const caught = catchRoofOnWalls({
|
|
216
|
+
lines: [
|
|
217
|
+
{
|
|
218
|
+
center: raw,
|
|
219
|
+
angle: effRot,
|
|
220
|
+
hw: node.width / 2,
|
|
221
|
+
hd: node.depth / 2,
|
|
222
|
+
wallThickness: node.wallThickness,
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
walls,
|
|
226
|
+
angle: effRot,
|
|
227
|
+
});
|
|
228
|
+
worldPoint = placeRoofOnWalls(raw, worldPoint, caught, effRot);
|
|
229
|
+
}
|
|
184
230
|
const dx = worldPoint[0] - roofPosX;
|
|
185
231
|
const dz = worldPoint[1] - roofPosZ;
|
|
186
232
|
let localX = dx * cosRoof + dz * sinRoof;
|
|
187
233
|
let localZ = -dx * sinRoof + dz * cosRoof;
|
|
188
234
|
lastLocal = [localX, initialY, localZ];
|
|
189
|
-
|
|
235
|
+
// Moved onto the walls under it, its gable and heel walls take their thickness.
|
|
236
|
+
lastThickness =
|
|
237
|
+
bearingWallThickness({ center: worldPoint, angle: effRot, hw: node.width / 2, hd: node.depth / 2 }, walls) ?? node.wallThickness;
|
|
238
|
+
useLiveNodeOverrides.getState().set(segmentId, moved());
|
|
190
239
|
useScene.getState().markDirty(segmentId);
|
|
191
240
|
},
|
|
192
241
|
canCommit() {
|
|
@@ -195,7 +244,7 @@ export const roofSegmentMoveTarget = ({ node, nodes }) => {
|
|
|
195
244
|
commit() {
|
|
196
245
|
useLiveNodeOverrides.getState().clear(segmentId);
|
|
197
246
|
// Dragged onto the walls that carry it, its roof goes to the level above them.
|
|
198
|
-
commitSeatedRoofEdit([{ id: segmentId, data:
|
|
247
|
+
commitSeatedRoofEdit([{ id: segmentId, data: moved() }], segmentId);
|
|
199
248
|
},
|
|
200
249
|
};
|
|
201
250
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floorplan.d.ts","sourceRoot":"","sources":["../../src/roof-segment/floorplan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"floorplan.d.ts","sourceRoot":"","sources":["../../src/roof-segment/floorplan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EAKpB,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,eAAe,GACnB,iBAAiB,GAAG,IAAI,CAwM1B;AAED,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC9C,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE/C,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,EAAE,CAY3E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,eAAe,GAAG;IACjE,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAC7C,CA0GA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getConicalRoofCoverage, getDutchRoofMetrics, } from '@pascal-app/core';
|
|
1
|
+
import { getConicalRoofCoverage, getDutchRoofMetrics, getRoofSegmentVisibleTopBounds, } from '@pascal-app/core';
|
|
2
2
|
/**
|
|
3
3
|
* Stage C floor-plan builder for roof segment. Renders the segment as a
|
|
4
4
|
* proper architectural roof plan: the footprint outline plus the
|
|
@@ -52,7 +52,8 @@ export function buildRoofSegmentFloorplan(node, ctx) {
|
|
|
52
52
|
const palette = view?.palette;
|
|
53
53
|
const isSelected = view?.selected ?? false;
|
|
54
54
|
const isHighlighted = view?.highlighted ?? false;
|
|
55
|
-
|
|
55
|
+
// Moved too: the wall line shows whether it lands on the walls' centre lines.
|
|
56
|
+
const showSelectedChrome = isSelected || isHighlighted || (view?.moving ?? false);
|
|
56
57
|
// Black architectural outline by default; palette accent on select.
|
|
57
58
|
// Mirrors the elevator / column style so all structural elements read
|
|
58
59
|
// the same in the floor plan.
|
|
@@ -129,9 +130,8 @@ export function buildRoofSegmentFloorplan(node, ctx) {
|
|
|
129
130
|
point: [cx, cz],
|
|
130
131
|
});
|
|
131
132
|
const sideArrowOffset = 0.12;
|
|
132
|
-
const rotateCornerOffset = 0.
|
|
133
|
+
const rotateCornerOffset = 0.3;
|
|
133
134
|
const halfW = node.width / 2;
|
|
134
|
-
const halfD = node.depth / 2;
|
|
135
135
|
// Effective rotation = parent roof rotation + segment-local rotation.
|
|
136
136
|
// Reuse `cos` / `sin` from the corner computation above (they were
|
|
137
137
|
// computed for the same `rotation` value).
|
|
@@ -151,11 +151,13 @@ export function buildRoofSegmentFloorplan(node, ctx) {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
else {
|
|
154
|
+
// Past the eaves and rakes the plan outlines, so the arrows sit clear of the roof's edge.
|
|
155
|
+
const eave = getRoofSegmentVisibleTopBounds(node);
|
|
154
156
|
const sides = [
|
|
155
|
-
{ local: [
|
|
156
|
-
{ local: [-
|
|
157
|
-
{ local: [0,
|
|
158
|
-
{ local: [0, -
|
|
157
|
+
{ local: [eave.maxX + sideArrowOffset, 0], localAngle: 0, axis: 'x', side: 1 },
|
|
158
|
+
{ local: [eave.minX - sideArrowOffset, 0], localAngle: Math.PI, axis: 'x', side: -1 },
|
|
159
|
+
{ local: [0, eave.maxZ + sideArrowOffset], localAngle: Math.PI / 2, axis: 'z', side: 1 },
|
|
160
|
+
{ local: [0, eave.minZ - sideArrowOffset], localAngle: -Math.PI / 2, axis: 'z', side: -1 },
|
|
159
161
|
];
|
|
160
162
|
for (const side of sides) {
|
|
161
163
|
const [ox, oz] = rotateLocal(side.local[0], side.local[1]);
|
|
@@ -169,11 +171,12 @@ export function buildRoofSegmentFloorplan(node, ctx) {
|
|
|
169
171
|
});
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
|
-
// Rotate-arrow
|
|
173
|
-
//
|
|
174
|
-
// rotation gizmo around the
|
|
174
|
+
// Rotate-arrow off the +X / +Z corner of the eaves, clear of the plan's
|
|
175
|
+
// outline, sized to a roof. Local angle π/4 puts the curved arrow's bow
|
|
176
|
+
// on the diagonal so it reads as a rotation gizmo around the centre.
|
|
175
177
|
if (node.roofType !== 'conical') {
|
|
176
|
-
const
|
|
178
|
+
const eave = getRoofSegmentVisibleTopBounds(node);
|
|
179
|
+
const [cornerX, cornerZ] = rotateLocal(eave.maxX + rotateCornerOffset, eave.maxZ + rotateCornerOffset);
|
|
177
180
|
const [radialX, radialZ] = rotateLocal(1, 1);
|
|
178
181
|
children.push({
|
|
179
182
|
kind: 'rotate-arrow',
|
|
@@ -181,6 +184,7 @@ export function buildRoofSegmentFloorplan(node, ctx) {
|
|
|
181
184
|
angle: Math.atan2(radialZ, radialX),
|
|
182
185
|
affordance: 'roof-segment-rotate',
|
|
183
186
|
pivot: [cx, cz],
|
|
187
|
+
scale: 2,
|
|
184
188
|
});
|
|
185
189
|
}
|
|
186
190
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type PaintCapability } from '@pascal-app/core';
|
|
1
|
+
import { type PaintCapability, type RoofSegmentNode, type RoofWallBand } from '@pascal-app/core';
|
|
2
|
+
/** A heel or gable paints on its own: its own finish, cleared back to its fallback by the eraser. */
|
|
3
|
+
export declare function wallBandPatch(band: RoofWallBand, material: RoofSegmentNode['material'], materialPreset: string | undefined): Partial<RoofSegmentNode>;
|
|
2
4
|
export declare const roofSegmentPaint: PaintCapability;
|
|
3
5
|
export { roofSegmentSlots } from '@pascal-app/core';
|
|
4
6
|
//# sourceMappingURL=paint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../../src/roof-segment/paint.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../../src/roof-segment/paint.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,kBAAkB,CAAA;AAiEzB,qGAAqG;AACrG,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,EACrC,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,OAAO,CAAC,eAAe,CAAC,CAG1B;AAED,eAAO,MAAM,gBAAgB,EAAE,eAoE9B,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEffectiveRoofSurfaceMaterial, getEffectiveSegmentSurfaceMaterial, getRoofGlazing, isGlazedRoofSegment, sceneRegistry, useScene, } from '@pascal-app/core';
|
|
1
|
+
import { getEffectiveRoofSurfaceMaterial, getEffectiveSegmentSurfaceMaterial, getRoofGlazing, getRoofWallBandMaterial, isGlazedRoofSegment, roofWallBandFields, sceneRegistry, useScene, } from '@pascal-app/core';
|
|
2
2
|
import { buildRoofSegmentSurfaceMaterialPatch } from '@pascal-app/editor';
|
|
3
3
|
import { GLAZED_ROOF_SLOTS } from '../roof/glazed-materials.js';
|
|
4
4
|
import { buildSlotPreviewMaterial, createSlotPaintCapability } from '../shared/slot-paint.js';
|
|
@@ -41,9 +41,30 @@ const glazingPaint = createSlotPaintCapability({
|
|
|
41
41
|
return swapPreviewMaterial(mesh, next);
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
|
+
// Slots 4–6 are the wall bands split off the wall/trim slot (the viewer's `ROOF_HEEL_MATERIAL_INDEX`…).
|
|
45
|
+
const WALL_BAND_BY_INDEX = {
|
|
46
|
+
4: 'heel',
|
|
47
|
+
5: 'gable-left',
|
|
48
|
+
6: 'gable-right',
|
|
49
|
+
};
|
|
50
|
+
const WALL_BAND_LABELS = {
|
|
51
|
+
heel: 'Heel band',
|
|
52
|
+
'gable-left': 'Left gable',
|
|
53
|
+
'gable-right': 'Right gable',
|
|
54
|
+
};
|
|
44
55
|
function standardRole(index) {
|
|
56
|
+
if (index !== null && WALL_BAND_BY_INDEX[index])
|
|
57
|
+
return WALL_BAND_BY_INDEX[index];
|
|
45
58
|
return index === 3 ? 'top' : index === 0 ? 'edge' : index === 1 || index === 2 ? 'wall' : null;
|
|
46
59
|
}
|
|
60
|
+
function isWallBand(role) {
|
|
61
|
+
return role === 'heel' || role === 'gable-left' || role === 'gable-right';
|
|
62
|
+
}
|
|
63
|
+
/** A heel or gable paints on its own: its own finish, cleared back to its fallback by the eraser. */
|
|
64
|
+
export function wallBandPatch(band, material, materialPreset) {
|
|
65
|
+
const fields = roofWallBandFields(band);
|
|
66
|
+
return { [fields.material]: material, [fields.materialPreset]: materialPreset };
|
|
67
|
+
}
|
|
47
68
|
export const roofSegmentPaint = {
|
|
48
69
|
materialTarget: 'roof',
|
|
49
70
|
resolveRole(args) {
|
|
@@ -51,10 +72,17 @@ export const roofSegmentPaint = {
|
|
|
51
72
|
? glazingPaint.resolveRole(args)
|
|
52
73
|
: standardRole(args.materialIndex);
|
|
53
74
|
},
|
|
75
|
+
roleLabel(node, role) {
|
|
76
|
+
return isWallBand(role) && !isGlazedRoofSegment(node)
|
|
77
|
+
? WALL_BAND_LABELS[role]
|
|
78
|
+
: null;
|
|
79
|
+
},
|
|
54
80
|
buildPatch(args) {
|
|
55
81
|
if (isGlazedRoofSegment(args.node))
|
|
56
82
|
return glazingPaint.buildPatch(args);
|
|
57
83
|
const role = args.role;
|
|
84
|
+
if (isWallBand(role))
|
|
85
|
+
return wallBandPatch(role, args.material, args.materialPreset);
|
|
58
86
|
if (role !== 'top' && role !== 'edge' && role !== 'wall')
|
|
59
87
|
return {};
|
|
60
88
|
return buildRoofSegmentSurfaceMaterialPatch(args.node, role, args.material, args.materialPreset);
|
|
@@ -82,9 +110,22 @@ export const roofSegmentPaint = {
|
|
|
82
110
|
if (isGlazedRoofSegment(node))
|
|
83
111
|
return glazingPaint.getEffectiveMaterial?.(args) ?? null;
|
|
84
112
|
const role = args.role;
|
|
113
|
+
const parent = node.parentId ? args.nodes?.[node.parentId] : undefined;
|
|
114
|
+
if (isWallBand(role)) {
|
|
115
|
+
// Unpainted, a gable shows the edge role and the heel band the roof's (else the walls').
|
|
116
|
+
const own = getRoofWallBandMaterial(node, role) ??
|
|
117
|
+
(role === 'heel' && parent?.type === 'roof'
|
|
118
|
+
? getRoofWallBandMaterial(parent, 'heel')
|
|
119
|
+
: null);
|
|
120
|
+
if (own)
|
|
121
|
+
return { material: own.material, materialPreset: own.materialPreset };
|
|
122
|
+
if (role === 'heel')
|
|
123
|
+
return null;
|
|
124
|
+
const edge = getEffectiveSegmentSurfaceMaterial(node, 'edge', parent?.type === 'roof' ? getEffectiveRoofSurfaceMaterial(parent, 'edge') : undefined);
|
|
125
|
+
return { material: edge.material, materialPreset: edge.materialPreset };
|
|
126
|
+
}
|
|
85
127
|
if (role !== 'top' && role !== 'edge' && role !== 'wall')
|
|
86
128
|
return null;
|
|
87
|
-
const parent = node.parentId ? args.nodes?.[node.parentId] : undefined;
|
|
88
129
|
const spec = getEffectiveSegmentSurfaceMaterial(node, role, parent?.type === 'roof' ? getEffectiveRoofSurfaceMaterial(parent, role) : undefined);
|
|
89
130
|
return { material: spec.material, materialPreset: spec.materialPreset };
|
|
90
131
|
},
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type RoofBuildUp, type RoofSegmentNode } from '@pascal-app/core';
|
|
2
|
+
import type { NodePanelModel } from '@pascal-app/editor';
|
|
3
|
+
/** The Preset choices for the `current` value: none, the presets, and Custom while it is. */
|
|
4
|
+
export declare function roofBuildUpPresetOptions(current: string | null): {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare function roofBuildUpPresetValue(buildUp: RoofBuildUp | undefined): string;
|
|
9
|
+
/** The patch a Preset choice writes; `null` for Custom, which is no choice. */
|
|
10
|
+
export declare function roofBuildUpPresetPatch(id: string): Partial<RoofSegmentNode> | null;
|
|
11
|
+
export { roofBuildUpOfDeck } from '@pascal-app/core';
|
|
12
|
+
/** A layer with `name`, trimmed; empty takes the name off, the kind's own name standing for it. */
|
|
13
|
+
export declare function namedLayer<T extends {
|
|
14
|
+
name?: string;
|
|
15
|
+
}>(layer: T, name: string): T;
|
|
16
|
+
/** `next` keeps `previous`'s name while it is the same kind of material (a new thickness, say). */
|
|
17
|
+
export declare function keptName<T extends {
|
|
18
|
+
kind: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
}>(previous: T | undefined, next: T | undefined): T | undefined;
|
|
21
|
+
/** Multi-selected planes take one layers preset together, in one undo step. */
|
|
22
|
+
export declare const roofSegmentPanelModel: NodePanelModel<RoofSegmentNode>;
|
|
23
|
+
//# sourceMappingURL=panel-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-model.d.ts","sourceRoot":"","sources":["../../src/roof-segment/panel-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,eAAe,EAIrB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAKxD,6FAA6F;AAC7F,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;;;IAM9D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAE/E;AAED,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAIlF;AAGD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,mGAAmG;AACnG,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAIjF;AAED,mGAAmG;AACnG,wBAAgB,QAAQ,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAChE,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,IAAI,EAAE,CAAC,GAAG,SAAS,GAClB,CAAC,GAAG,SAAS,CAGf;AAED,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,eAAe,CA2BjE,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { isGlazedRoofSegment, ROOF_BUILD_UP_PRESETS, roofBuildUpPatch, runAsSingleSceneHistoryStep, useScene, } from '@pascal-app/core';
|
|
2
|
+
const NONE = 'none';
|
|
3
|
+
const CUSTOM = 'custom';
|
|
4
|
+
/** The Preset choices for the `current` value: none, the presets, and Custom while it is. */
|
|
5
|
+
export function roofBuildUpPresetOptions(current) {
|
|
6
|
+
return [
|
|
7
|
+
{ label: 'None (deck and shingle)', value: NONE },
|
|
8
|
+
...(current === CUSTOM ? [{ label: 'Custom', value: CUSTOM }] : []),
|
|
9
|
+
...ROOF_BUILD_UP_PRESETS.map((preset) => ({ label: preset.label, value: preset.id })),
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
export function roofBuildUpPresetValue(buildUp) {
|
|
13
|
+
return buildUp ? (buildUp.presetId ?? CUSTOM) : NONE;
|
|
14
|
+
}
|
|
15
|
+
/** The patch a Preset choice writes; `null` for Custom, which is no choice. */
|
|
16
|
+
export function roofBuildUpPresetPatch(id) {
|
|
17
|
+
if (id === NONE)
|
|
18
|
+
return { buildUp: undefined };
|
|
19
|
+
const preset = ROOF_BUILD_UP_PRESETS.find((entry) => entry.id === id);
|
|
20
|
+
return preset ? roofBuildUpPatch(preset.buildUp) : null;
|
|
21
|
+
}
|
|
22
|
+
// The layers a plane without any is drawn as live in core, where Bones frames such a plane by them.
|
|
23
|
+
export { roofBuildUpOfDeck } from '@pascal-app/core';
|
|
24
|
+
/** A layer with `name`, trimmed; empty takes the name off, the kind's own name standing for it. */
|
|
25
|
+
export function namedLayer(layer, name) {
|
|
26
|
+
const { name: _name, ...rest } = layer;
|
|
27
|
+
const trimmed = name.trim().slice(0, 60);
|
|
28
|
+
return (trimmed ? { ...rest, name: trimmed } : rest);
|
|
29
|
+
}
|
|
30
|
+
/** `next` keeps `previous`'s name while it is the same kind of material (a new thickness, say). */
|
|
31
|
+
export function keptName(previous, next) {
|
|
32
|
+
if (!next || next.name !== undefined || previous?.name === undefined)
|
|
33
|
+
return next;
|
|
34
|
+
return next.kind === previous.kind ? { ...next, name: previous.name } : next;
|
|
35
|
+
}
|
|
36
|
+
/** Multi-selected planes take one layers preset together, in one undo step. */
|
|
37
|
+
export const roofSegmentPanelModel = {
|
|
38
|
+
rows: () => [],
|
|
39
|
+
multiControls: ({ selection }) => {
|
|
40
|
+
const planes = selection.filter((plane) => !isGlazedRoofSegment(plane));
|
|
41
|
+
if (planes.length === 0)
|
|
42
|
+
return [];
|
|
43
|
+
const values = planes.map((plane) => roofBuildUpPresetValue(plane.buildUp));
|
|
44
|
+
const value = values.every((entry) => entry === values[0]) ? values[0] : null;
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
id: 'roof-segment-layers-preset',
|
|
48
|
+
kind: 'select',
|
|
49
|
+
section: 'Layers',
|
|
50
|
+
label: 'Preset',
|
|
51
|
+
options: roofBuildUpPresetOptions(value),
|
|
52
|
+
value,
|
|
53
|
+
onChange: (id) => {
|
|
54
|
+
const patch = roofBuildUpPresetPatch(id);
|
|
55
|
+
if (!patch)
|
|
56
|
+
return;
|
|
57
|
+
runAsSingleSceneHistoryStep(useScene, () => useScene
|
|
58
|
+
.getState()
|
|
59
|
+
.updateNodes(planes.map((plane) => ({ id: plane.id, data: patch }))));
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/roof-segment/panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/roof-segment/panel.tsx"],"names":[],"mappings":"AAiJA,MAAM,CAAC,OAAO,UAAU,gBAAgB,uCAgxBvC"}
|