@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,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { canPlaceFenceFeature, FenceStyle, fenceFeatureData, fenceWithFeatures, getFenceCenterlineLength, useScene, } from '@pascal-app/core';
|
|
3
|
+
import { canPlaceFenceFeature, FenceStyle, fenceFeatureData, fenceWithFeatures, getFenceCenterlineLength, usePascalI18n, useScene, } from '@pascal-app/core';
|
|
4
4
|
import { ActionButton, SliderControl, ToggleControl } from '@pascal-app/editor';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { useShallow } from 'zustand/react/shallow';
|
|
7
7
|
import { getFenceFeatureDimensions } from '../fence/geometry-parts.js';
|
|
8
8
|
export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
9
|
-
const
|
|
9
|
+
const i18n = usePascalI18n();
|
|
10
|
+
const [blocked, setBlocked] = useState(false);
|
|
10
11
|
const parentId = child.parentId;
|
|
11
12
|
const parent = useScene((s) => (parentId ? s.nodes[parentId] : undefined));
|
|
12
13
|
const siblings = useScene(useShallow((s) => {
|
|
@@ -16,7 +17,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
16
17
|
: [];
|
|
17
18
|
}));
|
|
18
19
|
if (parent?.type !== 'fence')
|
|
19
|
-
return _jsx("p", { children:
|
|
20
|
+
return (_jsx("p", { children: i18n._({
|
|
21
|
+
id: 'node.fenceFeature.inspector.fenceUnavailable',
|
|
22
|
+
message: 'Fence unavailable.',
|
|
23
|
+
}) }));
|
|
20
24
|
const node = fenceWithFeatures(parent, siblings);
|
|
21
25
|
const features = [fenceFeatureData(child)];
|
|
22
26
|
const length = getFenceCenterlineLength(node);
|
|
@@ -27,13 +31,16 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
27
31
|
const next = { ...original, ...patch };
|
|
28
32
|
if ((patch.width !== undefined || patch.center !== undefined) &&
|
|
29
33
|
!canPlaceFenceFeature(node, next)) {
|
|
30
|
-
|
|
34
|
+
setBlocked(true);
|
|
31
35
|
return;
|
|
32
36
|
}
|
|
33
|
-
|
|
37
|
+
setBlocked(false);
|
|
34
38
|
onUpdate(patch);
|
|
35
39
|
};
|
|
36
|
-
return (_jsxs("div", { className: "space-y-2 text-xs", children: [
|
|
40
|
+
return (_jsxs("div", { className: "space-y-2 text-xs", children: [blocked && (_jsx("p", { role: "status", className: "text-amber-500", children: i18n._({
|
|
41
|
+
id: 'node.fenceFeature.inspector.keepTheOpeningInsideTheFence',
|
|
42
|
+
message: 'Keep the opening inside the fence and clear of other gates or passages.',
|
|
43
|
+
}) })), features.map((feature) => {
|
|
37
44
|
const gate = feature.kind === 'gate';
|
|
38
45
|
const { height, bottom } = getFenceFeatureDimensions(node, feature);
|
|
39
46
|
const selects = [
|
|
@@ -41,39 +48,87 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
41
48
|
? [
|
|
42
49
|
{
|
|
43
50
|
key: 'leafType',
|
|
44
|
-
label: 'Leaves',
|
|
51
|
+
label: i18n._({ id: 'node.fenceFeature.inspector.leaves', message: 'Leaves' }),
|
|
45
52
|
value: feature.leafType ?? 'single',
|
|
46
53
|
options: [
|
|
47
|
-
[
|
|
48
|
-
|
|
54
|
+
[
|
|
55
|
+
'single',
|
|
56
|
+
i18n._({
|
|
57
|
+
id: 'node.fenceFeature.inspector.option.singleGate',
|
|
58
|
+
message: 'Single gate',
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
'double',
|
|
63
|
+
i18n._({
|
|
64
|
+
id: 'node.fenceFeature.inspector.option.doubleGate',
|
|
65
|
+
message: 'Double gate',
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
49
68
|
],
|
|
50
69
|
},
|
|
51
70
|
{
|
|
52
71
|
key: 'hinge',
|
|
53
|
-
label:
|
|
72
|
+
label: i18n._({
|
|
73
|
+
id: 'node.fenceFeature.inspector.hingeSide',
|
|
74
|
+
message: 'Hinge side',
|
|
75
|
+
}),
|
|
54
76
|
value: feature.hinge ?? 'left',
|
|
55
77
|
options: [
|
|
56
|
-
[
|
|
57
|
-
|
|
78
|
+
[
|
|
79
|
+
'left',
|
|
80
|
+
i18n._({ id: 'node.fenceFeature.inspector.option.left', message: 'Left' }),
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
'right',
|
|
84
|
+
i18n._({ id: 'node.fenceFeature.inspector.option.right', message: 'Right' }),
|
|
85
|
+
],
|
|
58
86
|
],
|
|
59
87
|
},
|
|
60
88
|
{
|
|
61
89
|
key: 'swing',
|
|
62
|
-
label:
|
|
90
|
+
label: i18n._({
|
|
91
|
+
id: 'node.fenceFeature.inspector.swingDirection',
|
|
92
|
+
message: 'Swing direction',
|
|
93
|
+
}),
|
|
63
94
|
value: feature.swing ?? 'inward',
|
|
64
95
|
options: [
|
|
65
|
-
[
|
|
66
|
-
|
|
96
|
+
[
|
|
97
|
+
'inward',
|
|
98
|
+
i18n._({
|
|
99
|
+
id: 'node.fenceFeature.inspector.option.inward',
|
|
100
|
+
message: 'Inward',
|
|
101
|
+
}),
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
'outward',
|
|
105
|
+
i18n._({
|
|
106
|
+
id: 'node.fenceFeature.inspector.option.outward',
|
|
107
|
+
message: 'Outward',
|
|
108
|
+
}),
|
|
109
|
+
],
|
|
67
110
|
],
|
|
68
111
|
},
|
|
69
112
|
{
|
|
70
113
|
key: 'brace',
|
|
71
|
-
label: 'Bracing',
|
|
114
|
+
label: i18n._({ id: 'node.fenceFeature.inspector.bracing', message: 'Bracing' }),
|
|
72
115
|
value: feature.brace ?? 'none',
|
|
73
116
|
options: [
|
|
74
|
-
[
|
|
75
|
-
|
|
76
|
-
|
|
117
|
+
[
|
|
118
|
+
'none',
|
|
119
|
+
i18n._({ id: 'node.fenceFeature.inspector.option.none', message: 'None' }),
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
'diagonal',
|
|
123
|
+
i18n._({
|
|
124
|
+
id: 'node.fenceFeature.inspector.option.diagonal',
|
|
125
|
+
message: 'Diagonal',
|
|
126
|
+
}),
|
|
127
|
+
],
|
|
128
|
+
[
|
|
129
|
+
'cross',
|
|
130
|
+
i18n._({ id: 'node.fenceFeature.inspector.option.cross', message: 'Cross' }),
|
|
131
|
+
],
|
|
77
132
|
],
|
|
78
133
|
},
|
|
79
134
|
]
|
|
@@ -82,7 +137,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
82
137
|
const numbers = [
|
|
83
138
|
{
|
|
84
139
|
key: 'center',
|
|
85
|
-
label:
|
|
140
|
+
label: i18n._({
|
|
141
|
+
id: 'node.fenceFeature.inspector.distanceFromStart',
|
|
142
|
+
message: 'Distance from start',
|
|
143
|
+
}),
|
|
86
144
|
value: feature.center,
|
|
87
145
|
min: 0,
|
|
88
146
|
max: length,
|
|
@@ -91,7 +149,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
91
149
|
},
|
|
92
150
|
{
|
|
93
151
|
key: 'width',
|
|
94
|
-
label:
|
|
152
|
+
label: i18n._({
|
|
153
|
+
id: 'node.fenceFeature.inspector.openingWidth',
|
|
154
|
+
message: 'Opening width',
|
|
155
|
+
}),
|
|
95
156
|
value: feature.width,
|
|
96
157
|
min: 0.35,
|
|
97
158
|
max: length,
|
|
@@ -100,7 +161,9 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
100
161
|
},
|
|
101
162
|
{
|
|
102
163
|
key: 'height',
|
|
103
|
-
label: gate
|
|
164
|
+
label: gate
|
|
165
|
+
? i18n._({ id: 'node.fenceFeature.inspector.gateHeight', message: 'Gate height' })
|
|
166
|
+
: i18n._({ id: 'node.fenceFeature.inspector.postHeight', message: 'Post height' }),
|
|
104
167
|
value: height,
|
|
105
168
|
min: 0.3,
|
|
106
169
|
max: 1000,
|
|
@@ -111,7 +174,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
111
174
|
? [
|
|
112
175
|
{
|
|
113
176
|
key: 'clearance',
|
|
114
|
-
label:
|
|
177
|
+
label: i18n._({
|
|
178
|
+
id: 'node.fenceFeature.inspector.groundClearance',
|
|
179
|
+
message: 'Ground clearance',
|
|
180
|
+
}),
|
|
115
181
|
value: bottom,
|
|
116
182
|
min: 0,
|
|
117
183
|
max: 1000,
|
|
@@ -120,7 +186,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
120
186
|
},
|
|
121
187
|
{
|
|
122
188
|
key: 'openAngle',
|
|
123
|
-
label:
|
|
189
|
+
label: i18n._({
|
|
190
|
+
id: 'node.fenceFeature.inspector.openingAngle',
|
|
191
|
+
message: 'Opening angle',
|
|
192
|
+
}),
|
|
124
193
|
value: feature.openAngle ?? 0,
|
|
125
194
|
min: 0,
|
|
126
195
|
max: 170,
|
|
@@ -129,7 +198,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
129
198
|
},
|
|
130
199
|
{
|
|
131
200
|
key: 'thickness',
|
|
132
|
-
label:
|
|
201
|
+
label: i18n._({
|
|
202
|
+
id: 'node.fenceFeature.inspector.leafThickness',
|
|
203
|
+
message: 'Leaf thickness',
|
|
204
|
+
}),
|
|
133
205
|
value: feature.thickness ?? 0.06,
|
|
134
206
|
min: 0.02,
|
|
135
207
|
max: 0.3,
|
|
@@ -138,7 +210,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
138
210
|
},
|
|
139
211
|
{
|
|
140
212
|
key: 'frameWidth',
|
|
141
|
-
label:
|
|
213
|
+
label: i18n._({
|
|
214
|
+
id: 'node.fenceFeature.inspector.frameWidth',
|
|
215
|
+
message: 'Frame width',
|
|
216
|
+
}),
|
|
142
217
|
value: feature.frameWidth ?? 0.055,
|
|
143
218
|
min: 0.025,
|
|
144
219
|
max: 0.2,
|
|
@@ -147,7 +222,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
147
222
|
},
|
|
148
223
|
{
|
|
149
224
|
key: 'spacing',
|
|
150
|
-
label:
|
|
225
|
+
label: i18n._({
|
|
226
|
+
id: 'node.fenceFeature.inspector.infillSpacing',
|
|
227
|
+
message: 'Infill spacing',
|
|
228
|
+
}),
|
|
151
229
|
value: feature.spacing ?? 0.15,
|
|
152
230
|
min: 0.04,
|
|
153
231
|
max: 1000,
|
|
@@ -156,7 +234,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
156
234
|
},
|
|
157
235
|
{
|
|
158
236
|
key: 'boardWidth',
|
|
159
|
-
label:
|
|
237
|
+
label: i18n._({
|
|
238
|
+
id: 'node.fenceFeature.inspector.boardWidth',
|
|
239
|
+
message: 'Board width',
|
|
240
|
+
}),
|
|
160
241
|
value: feature.boardWidth ?? 0.055,
|
|
161
242
|
min: 0.02,
|
|
162
243
|
max: 0.3,
|
|
@@ -167,7 +248,10 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
167
248
|
? [
|
|
168
249
|
{
|
|
169
250
|
key: 'leafSplit',
|
|
170
|
-
label:
|
|
251
|
+
label: i18n._({
|
|
252
|
+
id: 'node.fenceFeature.inspector.leftLeafProportion',
|
|
253
|
+
message: 'Left leaf proportion',
|
|
254
|
+
}),
|
|
171
255
|
value: feature.leafSplit ?? 0.5,
|
|
172
256
|
min: 0.2,
|
|
173
257
|
max: 0.8,
|
|
@@ -179,20 +263,38 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
179
263
|
]
|
|
180
264
|
: []),
|
|
181
265
|
];
|
|
182
|
-
return (_jsx("div", { children: _jsxs("div", { className: "mt-2 space-y-2", children: [_jsx(ToggleControl, { label:
|
|
266
|
+
return (_jsx("div", { children: _jsxs("div", { className: "mt-2 space-y-2", children: [_jsx(ToggleControl, { label: i18n._({
|
|
267
|
+
id: 'node.fenceFeature.inspector.matchFenceStyle',
|
|
268
|
+
message: 'Match fence style',
|
|
269
|
+
}), checked: feature.matchFenceStyle !== false, onChange: (checked) => update(feature.id, {
|
|
183
270
|
matchFenceStyle: checked,
|
|
184
271
|
...(checked
|
|
185
272
|
? { matchFenceHeight: true }
|
|
186
273
|
: { style: feature.style === 'match' ? 'picket' : feature.style }),
|
|
187
|
-
}) }), _jsx(ToggleControl, { label:
|
|
274
|
+
}) }), _jsx(ToggleControl, { label: i18n._({
|
|
275
|
+
id: 'node.fenceFeature.inspector.matchFenceHeight',
|
|
276
|
+
message: 'Match fence height',
|
|
277
|
+
}), checked: feature.matchFenceHeight ?? feature.matchFenceStyle !== false, onChange: (checked) => update(feature.id, {
|
|
188
278
|
matchFenceHeight: checked,
|
|
189
279
|
height,
|
|
190
280
|
...(gate ? { clearance: bottom } : {}),
|
|
191
|
-
}) }), gate && feature.matchFenceStyle === false && (_jsxs("label", { className: "flex min-h-9 items-center justify-between gap-3 text-xs text-muted-foreground", children: [
|
|
281
|
+
}) }), gate && feature.matchFenceStyle === false && (_jsxs("label", { className: "flex min-h-9 items-center justify-between gap-3 text-xs text-muted-foreground", children: [i18n._({ id: 'node.fenceFeature.inspector.gateStyle', message: 'Gate style' }), _jsxs("select", { className: "h-8 min-w-0 max-w-40 rounded-lg border border-border/50 bg-black/4 dark:bg-[#2C2C2E] px-2 text-xs text-foreground outline-none transition-colors hover:bg-black/8 dark:hover:bg-[#3e3e3e] focus-visible:ring-2 focus-visible:ring-ring", value: feature.style && feature.style !== 'match' ? feature.style : 'picket', onChange: (event) => {
|
|
192
282
|
const style = FenceStyle.safeParse(event.currentTarget.value);
|
|
193
283
|
if (style.success)
|
|
194
284
|
update(feature.id, { style: style.data });
|
|
195
|
-
}, children: [_jsx("option", { value: "picket", children:
|
|
285
|
+
}, children: [_jsx("option", { value: "picket", children: i18n._({ id: 'node.fenceFeature.inspector.picket', message: 'Picket' }) }), _jsx("option", { value: "slat", children: i18n._({
|
|
286
|
+
id: 'node.fenceFeature.inspector.verticalSlats',
|
|
287
|
+
message: 'Vertical slats',
|
|
288
|
+
}) }), _jsx("option", { value: "horizontal", children: i18n._({
|
|
289
|
+
id: 'node.fenceFeature.inspector.horizontalBoards',
|
|
290
|
+
message: 'Horizontal boards',
|
|
291
|
+
}) }), _jsx("option", { value: "privacy", children: i18n._({
|
|
292
|
+
id: 'node.fenceFeature.inspector.solidPrivacy',
|
|
293
|
+
message: 'Solid privacy',
|
|
294
|
+
}) }), _jsx("option", { value: "rail", children: i18n._({
|
|
295
|
+
id: 'node.fenceFeature.inspector.openRails',
|
|
296
|
+
message: 'Open rails',
|
|
297
|
+
}) })] })] })), selects
|
|
196
298
|
.filter((field) => field.key !== 'hinge' || feature.leafType !== 'double')
|
|
197
299
|
.map((field) => (_jsxs("label", { className: "flex min-h-9 items-center justify-between gap-3 text-xs text-muted-foreground", children: [field.label, _jsx("select", { className: "h-8 min-w-0 max-w-40 rounded-lg border border-border/50 bg-black/4 dark:bg-[#2C2C2E] px-2 text-xs text-foreground outline-none transition-colors hover:bg-black/8 dark:hover:bg-[#3e3e3e] focus-visible:ring-2 focus-visible:ring-ring", value: field.value, onChange: (event) => update(feature.id, { [field.key]: event.target.value }), children: field.options.map(([value, label]) => (_jsx("option", { value: value, children: label }, value))) })] }, field.key))), numbers
|
|
198
300
|
.filter((field) => feature.matchFenceStyle === false ||
|
|
@@ -209,6 +311,20 @@ export function FenceFeatureEditor({ node: child, onUpdate, }) {
|
|
|
209
311
|
: {}),
|
|
210
312
|
}
|
|
211
313
|
: {}),
|
|
212
|
-
}) }, field.key))), _jsx(ToggleControl, { label:
|
|
314
|
+
}) }, field.key))), _jsx(ToggleControl, { label: i18n._({
|
|
315
|
+
id: 'node.fenceFeature.inspector.jambPosts',
|
|
316
|
+
message: 'Jamb posts',
|
|
317
|
+
}), checked: feature.showPosts !== false, onChange: (checked) => update(feature.id, { showPosts: checked }) }), gate && (_jsx(ToggleControl, { label: i18n._({
|
|
318
|
+
id: 'node.fenceFeature.inspector.hingesAndLatch',
|
|
319
|
+
message: 'Hinges and latch',
|
|
320
|
+
}), checked: feature.showHardware !== false, onChange: (checked) => update(feature.id, { showHardware: checked }) })), _jsx(ActionButton, { type: "button", label: gate
|
|
321
|
+
? i18n._({
|
|
322
|
+
id: 'node.fenceFeature.inspector.removeGate',
|
|
323
|
+
message: 'Remove gate',
|
|
324
|
+
})
|
|
325
|
+
: i18n._({
|
|
326
|
+
id: 'node.fenceFeature.inspector.removeOpening',
|
|
327
|
+
message: 'Remove opening',
|
|
328
|
+
}), className: "w-full text-destructive hover:text-destructive", onClick: () => useScene.getState().deleteNode(child.id) })] }) }, feature.id));
|
|
213
329
|
})] }));
|
|
214
330
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AnyNodeId, type FenceFeatureNode, type FenceNode, type GridEvent, type SceneApi } from '@pascal-app/core';
|
|
2
2
|
export declare function createFenceFeatureMoveSession(node: FenceFeatureNode, sceneApi: SceneApi, levelId: AnyNodeId | null, selectNode: (id: AnyNodeId) => void): {
|
|
3
|
-
affectedIds: (`block_${string}` | `building_${string}` | `bvent_${string}` | `cabinet-module_${string}` | `cabinet_${string}` | `ceiling_${string}` | `chimney_${string}` | `column_${string}` | `construction-dimension_${string}` | `cupola_${string}` | `door_${string}` | `dormer_${string}` | `downspout_${string}` | `duct-fitting_${string}` | `duct-segment_${string}` | `duct-terminal_${string}` | `elevator_${string}` | `eyebrow-vent_${string}` | `fence-gate_${string}` | `fence-opening_${string}` | `fence_${string}` | `floor-opening_${string}` | `guide_${string}` | `gutter_${string}` | `hvac-equipment_${string}` | `imesh_${string}` | `item_${string}` | `leanto_${string}` | `level_${string}` | `lineset_${string}` | `liquid-line_${string}` | `measurement_${string}` | `pipe-fitting_${string}` | `pipe-segment_${string}` | `pipe-trap_${string}` | `procedural-item_${string}` | `roof_${string}` | `rseg_${string}` | `rvent_${string}` | `scan_${string}` | `separator_${string}` | `shelf_${string}` | `site_${string}` | `skylight_${string}` | `slab_${string}` | `solarpanel_${string}` | `spawn_${string}` | `sseg_${string}` | `stair_${string}` | `structural-grid_${string}` | `tvent_${string}` | `unit_${string}` | `wall_${string}` | `window_${string}` | `zone_${string}`)[];
|
|
3
|
+
affectedIds: (`beam_${string}` | `block_${string}` | `building_${string}` | `bvent_${string}` | `cabinet-module_${string}` | `cabinet_${string}` | `ceiling_${string}` | `chimney_${string}` | `column_${string}` | `construction-dimension_${string}` | `cupola_${string}` | `door_${string}` | `dormer_${string}` | `downspout_${string}` | `duct-fitting_${string}` | `duct-segment_${string}` | `duct-terminal_${string}` | `elevator_${string}` | `eyebrow-vent_${string}` | `fence-gate_${string}` | `fence-opening_${string}` | `fence_${string}` | `floor-opening_${string}` | `guide_${string}` | `gutter_${string}` | `hvac-equipment_${string}` | `imesh_${string}` | `item_${string}` | `leanto_${string}` | `level_${string}` | `lineset_${string}` | `liquid-line_${string}` | `measurement_${string}` | `pipe-fitting_${string}` | `pipe-segment_${string}` | `pipe-trap_${string}` | `procedural-item_${string}` | `roof_${string}` | `rseg_${string}` | `rvent_${string}` | `scan_${string}` | `separator_${string}` | `shelf_${string}` | `site_${string}` | `skylight_${string}` | `slab_${string}` | `solarpanel_${string}` | `spawn_${string}` | `sseg_${string}` | `stair_${string}` | `structural-grid_${string}` | `tvent_${string}` | `unit_${string}` | `wall_${string}` | `window_${string}` | `zone_${string}`)[];
|
|
4
4
|
clear: () => void;
|
|
5
5
|
update(point: readonly [number, number], host?: FenceNode, ray?: GridEvent['localRay']): void;
|
|
6
6
|
canCommit: () => boolean;
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FloorOpeningNode, type FloorplanAffordance, type FloorplanGeometry, type GeometryContext } from '@pascal-app/core';
|
|
2
|
+
type Ring = [number, number][];
|
|
3
|
+
/**
|
|
4
|
+
* A stair's opening: a box its stair cut, resized as a box. An elevator's opening keeps the free
|
|
5
|
+
* polygon handles: its cut comes from the car, so a drawn shape would not stick.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isOwnedOpening(node: FloorOpeningNode): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The square-cornered rectangle an owned opening is edited as: the ring itself when it already is
|
|
10
|
+
* one, otherwise (an opening cut with rounded corners before they were square) the box around it,
|
|
11
|
+
* aligned with its longest side.
|
|
12
|
+
*/
|
|
13
|
+
export declare function openingRectangle(polygon: ReadonlyArray<readonly [number, number]>): Ring;
|
|
14
|
+
/**
|
|
15
|
+
* `rectangle` with corner `index` dragged to `point`: the opposite corner stays, the two sides
|
|
16
|
+
* through the dragged corner keep their directions, so the box stays a box.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resizeRectangleCorner(rectangle: Ring, index: number, point: readonly [number, number]): Ring;
|
|
19
|
+
/** `rectangle` with side `edgeIndex` moved parallel by `distance` along its outward normal. */
|
|
20
|
+
export declare function moveRectangleEdge(rectangle: Ring, edgeIndex: number, distance: number): Ring;
|
|
2
21
|
/**
|
|
3
22
|
* A floor opening on the plan: a dashed amber outline (the void the surfaces
|
|
4
23
|
* around it show), and — while selected — the same corner, midpoint and edge
|
|
5
|
-
* handles slabs and zones use.
|
|
24
|
+
* handles slabs and zones use. A stair's opening is a box: its
|
|
25
|
+
* selected outline is solid, its sides carry a grip each to move them
|
|
26
|
+
* parallel and its corners resize it, all at a fixed screen size; it has no
|
|
27
|
+
* midpoint handles to add a vertex.
|
|
6
28
|
*/
|
|
7
29
|
export declare function buildFloorOpeningFloorplan(node: FloorOpeningNode, ctx: GeometryContext): FloorplanGeometry | null;
|
|
8
|
-
export declare const floorOpeningMoveVertexAffordance:
|
|
30
|
+
export declare const floorOpeningMoveVertexAffordance: FloorplanAffordance<{
|
|
9
31
|
object: "node";
|
|
10
32
|
name?: string | undefined;
|
|
11
33
|
parentId: string | null;
|
|
@@ -42,7 +64,7 @@ export declare const floorOpeningMoveVertexAffordance: import("@pascal-app/core"
|
|
|
42
64
|
cutsPrimary: boolean;
|
|
43
65
|
cutsAdjacent: boolean;
|
|
44
66
|
}>;
|
|
45
|
-
export declare const floorOpeningAddVertexAffordance:
|
|
67
|
+
export declare const floorOpeningAddVertexAffordance: FloorplanAffordance<{
|
|
46
68
|
object: "node";
|
|
47
69
|
name?: string | undefined;
|
|
48
70
|
parentId: string | null;
|
|
@@ -79,7 +101,7 @@ export declare const floorOpeningAddVertexAffordance: import("@pascal-app/core")
|
|
|
79
101
|
cutsPrimary: boolean;
|
|
80
102
|
cutsAdjacent: boolean;
|
|
81
103
|
}>;
|
|
82
|
-
export declare const floorOpeningMoveEdgeAffordance:
|
|
104
|
+
export declare const floorOpeningMoveEdgeAffordance: FloorplanAffordance<{
|
|
83
105
|
object: "node";
|
|
84
106
|
name?: string | undefined;
|
|
85
107
|
parentId: string | null;
|
|
@@ -116,7 +138,7 @@ export declare const floorOpeningMoveEdgeAffordance: import("@pascal-app/core").
|
|
|
116
138
|
cutsPrimary: boolean;
|
|
117
139
|
cutsAdjacent: boolean;
|
|
118
140
|
}>;
|
|
119
|
-
export declare const floorOpeningDeleteVertexAffordance:
|
|
141
|
+
export declare const floorOpeningDeleteVertexAffordance: FloorplanAffordance<{
|
|
120
142
|
object: "node";
|
|
121
143
|
name?: string | undefined;
|
|
122
144
|
parentId: string | null;
|
|
@@ -153,4 +175,5 @@ export declare const floorOpeningDeleteVertexAffordance: import("@pascal-app/cor
|
|
|
153
175
|
cutsPrimary: boolean;
|
|
154
176
|
cutsAdjacent: boolean;
|
|
155
177
|
}>;
|
|
178
|
+
export {};
|
|
156
179
|
//# sourceMappingURL=floorplan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floorplan.d.ts","sourceRoot":"","sources":["../../src/floor-opening/floorplan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"floorplan.d.ts","sourceRoot":"","sources":["../../src/floor-opening/floorplan.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAExB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAA;AAazB,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;AAE9B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CA0BxF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,IAAI,CAoBN;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAgB5F;AA2DD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,eAAe,GACnB,iBAAiB,GAAG,IAAI,CAgE1B;AAED,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASuB,CAAA;AACpE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3C,CAAA;AACD,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB2B,CAAA;AACtE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9C,CAAA"}
|
|
@@ -1,12 +1,142 @@
|
|
|
1
|
+
import { authorStairOpeningPatches, useLiveNodeOverrides, useScene, } from '@pascal-app/core';
|
|
2
|
+
import { getSegmentGridStep, snapPointToGrid, snapScalarToGrid } from '@pascal-app/editor';
|
|
1
3
|
import { createPolygonAddVertexAffordance, createPolygonDeleteVertexAffordance, createPolygonMoveEdgeAffordance, createPolygonVertexAffordance, } from '../shared/polygon-vertex-affordance.js';
|
|
2
4
|
const COLOR = '#f59e0b';
|
|
5
|
+
/** A side of a stair opening never shrinks below this (metres). */
|
|
6
|
+
const MIN_OPENING_SIDE = 0.2;
|
|
7
|
+
/**
|
|
8
|
+
* A stair's opening: a box its stair cut, resized as a box. An elevator's opening keeps the free
|
|
9
|
+
* polygon handles: its cut comes from the car, so a drawn shape would not stick.
|
|
10
|
+
*/
|
|
11
|
+
export function isOwnedOpening(node) {
|
|
12
|
+
return node.source === 'stair' && !!node.ownerId;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The square-cornered rectangle an owned opening is edited as: the ring itself when it already is
|
|
16
|
+
* one, otherwise (an opening cut with rounded corners before they were square) the box around it,
|
|
17
|
+
* aligned with its longest side.
|
|
18
|
+
*/
|
|
19
|
+
export function openingRectangle(polygon) {
|
|
20
|
+
const ring = polygon.map(([x, z]) => [x, z]);
|
|
21
|
+
let longest = 0;
|
|
22
|
+
let axis = [1, 0];
|
|
23
|
+
for (const [i, a] of ring.entries()) {
|
|
24
|
+
const b = ring[(i + 1) % ring.length];
|
|
25
|
+
const length = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
26
|
+
if (length > longest) {
|
|
27
|
+
longest = length;
|
|
28
|
+
axis = [(b[0] - a[0]) / length, (b[1] - a[1]) / length];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const normal = [-axis[1], axis[0]];
|
|
32
|
+
const along = ring.map(([x, z]) => x * axis[0] + z * axis[1]);
|
|
33
|
+
const across = ring.map(([x, z]) => x * normal[0] + z * normal[1]);
|
|
34
|
+
const [u0, u1, v0, v1] = [
|
|
35
|
+
Math.min(...along),
|
|
36
|
+
Math.max(...along),
|
|
37
|
+
Math.min(...across),
|
|
38
|
+
Math.max(...across),
|
|
39
|
+
];
|
|
40
|
+
const at = (u, v) => [
|
|
41
|
+
u * axis[0] + v * normal[0],
|
|
42
|
+
u * axis[1] + v * normal[1],
|
|
43
|
+
];
|
|
44
|
+
return [at(u0, v0), at(u1, v0), at(u1, v1), at(u0, v1)];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `rectangle` with corner `index` dragged to `point`: the opposite corner stays, the two sides
|
|
48
|
+
* through the dragged corner keep their directions, so the box stays a box.
|
|
49
|
+
*/
|
|
50
|
+
export function resizeRectangleCorner(rectangle, index, point) {
|
|
51
|
+
const at = (offset) => rectangle[(index + offset) % 4];
|
|
52
|
+
const origin = at(2);
|
|
53
|
+
const unit = (to) => {
|
|
54
|
+
const dx = to[0] - origin[0];
|
|
55
|
+
const dz = to[1] - origin[1];
|
|
56
|
+
const length = Math.hypot(dx, dz) || 1;
|
|
57
|
+
return [dx / length, dz / length];
|
|
58
|
+
};
|
|
59
|
+
const a = unit(at(1));
|
|
60
|
+
const b = unit(at(3));
|
|
61
|
+
const dx = point[0] - origin[0];
|
|
62
|
+
const dz = point[1] - origin[1];
|
|
63
|
+
const sideA = Math.max(MIN_OPENING_SIDE, dx * a[0] + dz * a[1]);
|
|
64
|
+
const sideB = Math.max(MIN_OPENING_SIDE, dx * b[0] + dz * b[1]);
|
|
65
|
+
const next = [...rectangle];
|
|
66
|
+
next[(index + 1) % 4] = [origin[0] + a[0] * sideA, origin[1] + a[1] * sideA];
|
|
67
|
+
next[(index + 3) % 4] = [origin[0] + b[0] * sideB, origin[1] + b[1] * sideB];
|
|
68
|
+
next[index] = [origin[0] + a[0] * sideA + b[0] * sideB, origin[1] + a[1] * sideA + b[1] * sideB];
|
|
69
|
+
return next;
|
|
70
|
+
}
|
|
71
|
+
/** `rectangle` with side `edgeIndex` moved parallel by `distance` along its outward normal. */
|
|
72
|
+
export function moveRectangleEdge(rectangle, edgeIndex, distance) {
|
|
73
|
+
const start = rectangle[edgeIndex];
|
|
74
|
+
const end = rectangle[(edgeIndex + 1) % 4];
|
|
75
|
+
const opposite = rectangle[(edgeIndex + 2) % 4];
|
|
76
|
+
const length = Math.hypot(end[0] - start[0], end[1] - start[1]) || 1;
|
|
77
|
+
let normal = [-(end[1] - start[1]) / length, (end[0] - start[0]) / length];
|
|
78
|
+
// Point the normal away from the box, whichever way the ring winds.
|
|
79
|
+
if ((opposite[0] - start[0]) * normal[0] + (opposite[1] - start[1]) * normal[1] > 0)
|
|
80
|
+
normal = [-normal[0], -normal[1]];
|
|
81
|
+
const depth = (opposite[0] - start[0]) * -normal[0] + (opposite[1] - start[1]) * -normal[1];
|
|
82
|
+
const travel = Math.max(MIN_OPENING_SIDE - depth, distance);
|
|
83
|
+
return rectangle.map((point, i) => i === edgeIndex || i === (edgeIndex + 1) % 4
|
|
84
|
+
? [point[0] + normal[0] * travel, point[1] + normal[1] * travel]
|
|
85
|
+
: point);
|
|
86
|
+
}
|
|
87
|
+
/** Every write for `ring` on a stair's opening: its floor and ceiling cuts take it as drawn. */
|
|
88
|
+
function ownedOpeningUpdates(id, ring) {
|
|
89
|
+
const authored = authorStairOpeningPatches(useScene.getState().nodes, id, ring);
|
|
90
|
+
return authored.length ? authored : [{ id, data: { polygon: ring } }];
|
|
91
|
+
}
|
|
92
|
+
function ownedOpeningSession(node, next) {
|
|
93
|
+
const rectangle = openingRectangle(node.polygon);
|
|
94
|
+
const affectedIds = [
|
|
95
|
+
...new Set([
|
|
96
|
+
node.id,
|
|
97
|
+
...authorStairOpeningPatches(useScene.getState().nodes, node.id, rectangle).map((patch) => patch.id),
|
|
98
|
+
]),
|
|
99
|
+
];
|
|
100
|
+
let ring = null;
|
|
101
|
+
// The drag previews through live overrides; the scene is written once, on release.
|
|
102
|
+
return {
|
|
103
|
+
affectedIds,
|
|
104
|
+
apply({ planPoint }) {
|
|
105
|
+
ring = next(rectangle, planPoint);
|
|
106
|
+
useLiveNodeOverrides
|
|
107
|
+
.getState()
|
|
108
|
+
.setMany(ownedOpeningUpdates(node.id, ring).map(({ id, data }) => [id, data]));
|
|
109
|
+
},
|
|
110
|
+
canCommit: () => ring !== null,
|
|
111
|
+
commit() {
|
|
112
|
+
const overrides = useLiveNodeOverrides.getState();
|
|
113
|
+
if (ring)
|
|
114
|
+
useScene.getState().updateNodes(ownedOpeningUpdates(node.id, ring));
|
|
115
|
+
for (const id of affectedIds)
|
|
116
|
+
overrides.clear(id);
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Owned openings resize as a box; every other opening keeps the free polygon handles. */
|
|
121
|
+
function ownedOr(owned, free) {
|
|
122
|
+
return { start: (args) => (isOwnedOpening(args.node) ? owned(args) : free.start(args)) };
|
|
123
|
+
}
|
|
124
|
+
const inert = (node) => ({
|
|
125
|
+
affectedIds: [node.id],
|
|
126
|
+
apply() { },
|
|
127
|
+
canCommit: () => false,
|
|
128
|
+
});
|
|
3
129
|
/**
|
|
4
130
|
* A floor opening on the plan: a dashed amber outline (the void the surfaces
|
|
5
131
|
* around it show), and — while selected — the same corner, midpoint and edge
|
|
6
|
-
* handles slabs and zones use.
|
|
132
|
+
* handles slabs and zones use. A stair's opening is a box: its
|
|
133
|
+
* selected outline is solid, its sides carry a grip each to move them
|
|
134
|
+
* parallel and its corners resize it, all at a fixed screen size; it has no
|
|
135
|
+
* midpoint handles to add a vertex.
|
|
7
136
|
*/
|
|
8
137
|
export function buildFloorOpeningFloorplan(node, ctx) {
|
|
9
|
-
const
|
|
138
|
+
const owned = isOwnedOpening(node);
|
|
139
|
+
const polygon = owned && ctx.viewState?.selected ? openingRectangle(node.polygon) : node.polygon;
|
|
10
140
|
if (polygon.length < 3)
|
|
11
141
|
return null;
|
|
12
142
|
const selected = ctx.viewState?.selected ?? false;
|
|
@@ -18,9 +148,9 @@ export function buildFloorOpeningFloorplan(node, ctx) {
|
|
|
18
148
|
fill: COLOR,
|
|
19
149
|
fillOpacity: selected ? 0.22 : 0.1,
|
|
20
150
|
stroke: COLOR,
|
|
21
|
-
strokeWidth: selected ? 0.04 : 0.03,
|
|
151
|
+
strokeWidth: selected ? (owned ? 0.06 : 0.04) : 0.03,
|
|
22
152
|
strokeOpacity: 0.95,
|
|
23
|
-
strokeDasharray: '0.12 0.08',
|
|
153
|
+
...(selected && owned ? {} : { strokeDasharray: '0.12 0.08' }),
|
|
24
154
|
},
|
|
25
155
|
];
|
|
26
156
|
if (selected) {
|
|
@@ -38,18 +168,29 @@ export function buildFloorOpeningFloorplan(node, ctx) {
|
|
|
38
168
|
});
|
|
39
169
|
polygon.forEach((a, i) => {
|
|
40
170
|
const b = polygon[(i + 1) % polygon.length];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
171
|
+
const point = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
|
|
172
|
+
children.push(owned
|
|
173
|
+
? {
|
|
174
|
+
kind: 'endpoint-handle',
|
|
175
|
+
point,
|
|
176
|
+
state: 'idle',
|
|
177
|
+
screenSized: true,
|
|
178
|
+
affordance: 'move-edge',
|
|
179
|
+
payload: { edgeIndex: i },
|
|
180
|
+
}
|
|
181
|
+
: {
|
|
182
|
+
kind: 'midpoint-handle',
|
|
183
|
+
point,
|
|
184
|
+
affordance: 'add-vertex',
|
|
185
|
+
payload: { edgeIndex: i },
|
|
186
|
+
});
|
|
47
187
|
});
|
|
48
188
|
polygon.forEach(([x, z], i) => {
|
|
49
189
|
children.push({
|
|
50
190
|
kind: 'endpoint-handle',
|
|
51
191
|
point: [x, z],
|
|
52
192
|
state: 'idle',
|
|
193
|
+
...(owned ? { screenSized: true } : {}),
|
|
53
194
|
affordance: 'move-vertex',
|
|
54
195
|
payload: { vertexIndex: i },
|
|
55
196
|
});
|
|
@@ -57,7 +198,24 @@ export function buildFloorOpeningFloorplan(node, ctx) {
|
|
|
57
198
|
}
|
|
58
199
|
return { kind: 'group', children };
|
|
59
200
|
}
|
|
60
|
-
export const floorOpeningMoveVertexAffordance =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
201
|
+
export const floorOpeningMoveVertexAffordance = ownedOr(({ node, payload }) => {
|
|
202
|
+
const { vertexIndex } = payload;
|
|
203
|
+
return ownedOpeningSession(node, (rectangle, planPoint) => resizeRectangleCorner(rectangle, vertexIndex % 4, snapPointToGrid([planPoint[0], planPoint[1]], getSegmentGridStep())));
|
|
204
|
+
}, createPolygonVertexAffordance('floor-opening'));
|
|
205
|
+
export const floorOpeningAddVertexAffordance = ownedOr(({ node }) => inert(node), createPolygonAddVertexAffordance('floor-opening'));
|
|
206
|
+
export const floorOpeningMoveEdgeAffordance = ownedOr(({ node, payload, initialPlanPoint }) => {
|
|
207
|
+
const { edgeIndex } = payload;
|
|
208
|
+
return ownedOpeningSession(node, (rectangle, planPoint) => {
|
|
209
|
+
const start = rectangle[edgeIndex % 4];
|
|
210
|
+
const end = rectangle[(edgeIndex + 1) % 4];
|
|
211
|
+
const opposite = rectangle[(edgeIndex + 2) % 4];
|
|
212
|
+
const length = Math.hypot(end[0] - start[0], end[1] - start[1]) || 1;
|
|
213
|
+
let normal = [-(end[1] - start[1]) / length, (end[0] - start[0]) / length];
|
|
214
|
+
if ((opposite[0] - start[0]) * normal[0] + (opposite[1] - start[1]) * normal[1] > 0)
|
|
215
|
+
normal = [-normal[0], -normal[1]];
|
|
216
|
+
const distance = snapScalarToGrid((planPoint[0] - initialPlanPoint[0]) * normal[0] +
|
|
217
|
+
(planPoint[1] - initialPlanPoint[1]) * normal[1], getSegmentGridStep());
|
|
218
|
+
return moveRectangleEdge(rectangle, edgeIndex % 4, distance);
|
|
219
|
+
});
|
|
220
|
+
}, createPolygonMoveEdgeAffordance('floor-opening'));
|
|
221
|
+
export const floorOpeningDeleteVertexAffordance = ownedOr(({ node }) => inert(node), createPolygonDeleteVertexAffordance('floor-opening'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downspouts-panel.d.ts","sourceRoot":"","sources":["../../src/gutter/downspouts-panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"downspouts-panel.d.ts","sourceRoot":"","sources":["../../src/gutter/downspouts-panel.tsx"],"names":[],"mappings":"AAoDA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,uCAwHtC"}
|