@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type AnyNode, type AnyNodeId, type RoofNode, type RoofSegmentNode, type WallNode } from '@pascal-app/core';
|
|
2
|
+
type Pt = readonly [number, number];
|
|
3
|
+
/** How near a roof's wall line comes to a wall's centre line before it catches on it (metres). */
|
|
4
|
+
export declare const ROOF_WALL_CATCH_M = 0.25;
|
|
5
|
+
/**
|
|
6
|
+
* A side drawn or picked this near a room's edge stands on it (metres): as near as a drawn corner
|
|
7
|
+
* sticks to a wall in grid (the wall snap's connect radius), so one drawn on a railing's centre
|
|
8
|
+
* line, a grid point, still takes its outside face.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ROOF_EDGE_ON_M = 0.05;
|
|
11
|
+
/**
|
|
12
|
+
* A segment's footprint at its wall centre lines, in its level's plan: its centre, the plan angle
|
|
13
|
+
* of its own x axis (the floor plan's `-(roof.rotation + segment.rotation)`), and its own walls'
|
|
14
|
+
* thickness, their outer faces half of it outside the line (absent, none).
|
|
15
|
+
*/
|
|
16
|
+
export type RoofWallLine = {
|
|
17
|
+
center: Pt;
|
|
18
|
+
angle: number;
|
|
19
|
+
hw: number;
|
|
20
|
+
hd: number;
|
|
21
|
+
wallThickness?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A room's edge a roof lines up with but does not stand on: an invisible wall (its line, no
|
|
25
|
+
* thickness), or a railing (a guard round a deck or a porch, its faces half its thickness either
|
|
26
|
+
* side of its line). A wall takes a roof's wall line on its centre line, the roof's walls as thick
|
|
27
|
+
* as it, so their outer faces meet its outside face; an edge takes the roof's outer face itself,
|
|
28
|
+
* on the edge's face on the roof's outer side, so the roof reaches the room's edge as it reaches
|
|
29
|
+
* the house's walls' outside faces.
|
|
30
|
+
*/
|
|
31
|
+
export type RoofEdgeLine = {
|
|
32
|
+
type: 'roof-edge';
|
|
33
|
+
id: string;
|
|
34
|
+
start: Pt;
|
|
35
|
+
end: Pt;
|
|
36
|
+
thickness: number;
|
|
37
|
+
};
|
|
38
|
+
/** A line a roof catches on: a wall's centre line, or a room's edge (`RoofEdgeLine`). */
|
|
39
|
+
export type RoofCatchLine = WallNode | RoofEdgeLine;
|
|
40
|
+
/** Which axes of the dragged frame caught on a wall, and the plan shift that lays them there. */
|
|
41
|
+
export type RoofWallCatch = {
|
|
42
|
+
shift: [number, number];
|
|
43
|
+
u: boolean;
|
|
44
|
+
v: boolean;
|
|
45
|
+
};
|
|
46
|
+
/** A segment's wall line with its roof at `roof`'s place, which a drag may be proposing. */
|
|
47
|
+
export declare function segmentWallLine(roof: Pick<RoofNode, 'position' | 'rotation'>, segment: Pick<RoofSegmentNode, 'position' | 'rotation' | 'width' | 'depth'> & Partial<Pick<RoofSegmentNode, 'wallThickness'>>): RoofWallLine;
|
|
48
|
+
/**
|
|
49
|
+
* What a roof on `levelId` catches on, on its own level and the storey below, which the roof plan
|
|
50
|
+
* draws dashed: the walls it sits on, and the rooms' edges there, their invisible walls and
|
|
51
|
+
* railings (`RoofEdgeLine`): a porch's, a deck's, a patio's. Curved walls have no straight line to
|
|
52
|
+
* catch on.
|
|
53
|
+
*/
|
|
54
|
+
export declare function roofCatchWalls(nodes: Readonly<Record<AnyNodeId, AnyNode>>, levelId: string | null | undefined): RoofCatchLine[];
|
|
55
|
+
/**
|
|
56
|
+
* Where a dragged roof's wall lines catch on the walls under it. Along each axis of the frame at
|
|
57
|
+
* `angle` (the dragged segment's or roof's x and z), the edge nearest the centre line of a wall
|
|
58
|
+
* that runs alongside it, parallel and within `threshold`, sets the shift onto that wall; one
|
|
59
|
+
* nearest a room's edge (`RoofEdgeLine`) stands the outer face of the walls the segment takes
|
|
60
|
+
* there on it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function catchRoofOnWalls(args: {
|
|
63
|
+
lines: readonly RoofWallLine[];
|
|
64
|
+
walls: readonly RoofCatchLine[];
|
|
65
|
+
angle: number;
|
|
66
|
+
threshold?: number;
|
|
67
|
+
}): RoofWallCatch;
|
|
68
|
+
/**
|
|
69
|
+
* A dragged roof's place: along an axis its wall line caught on, the raw place shifted onto the
|
|
70
|
+
* wall; along the other, the snapped place (the grid's, or the raw cursor's with no grid).
|
|
71
|
+
*/
|
|
72
|
+
export declare function placeRoofOnWalls(raw: Pt, snapped: Pt, caught: RoofWallCatch, angle: number): [number, number];
|
|
73
|
+
/**
|
|
74
|
+
* A side dragged out from `line` (the segment's wall line before the drag), its opposite side held:
|
|
75
|
+
* the size along `axis` that lays the dragged side on the centre line of a wall alongside it, or
|
|
76
|
+
* stands its outer face on a room's edge there (`RoofEdgeLine`); null when neither is within
|
|
77
|
+
* `threshold` of `value`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function catchRoofSideOnWalls(args: {
|
|
80
|
+
line: RoofWallLine;
|
|
81
|
+
axis: 'x' | 'z';
|
|
82
|
+
side: 1 | -1;
|
|
83
|
+
value: number;
|
|
84
|
+
walls: readonly RoofCatchLine[];
|
|
85
|
+
threshold?: number;
|
|
86
|
+
}): number | null;
|
|
87
|
+
/**
|
|
88
|
+
* The thickness a segment's walls take to stand flush on the walls under it: the thickest wall
|
|
89
|
+
* whose centre line runs along an edge of its wall line, within `threshold`. A room's edge (an
|
|
90
|
+
* invisible wall, a railing) carries no roof and gives none. Null when no wall does.
|
|
91
|
+
*/
|
|
92
|
+
export declare function bearingWallThickness(line: RoofWallLine, walls: readonly RoofCatchLine[], threshold?: number): number | null;
|
|
93
|
+
/**
|
|
94
|
+
* A wall line drawn or picked out to a room's edges (`RoofEdgeLine`): each side lying on one,
|
|
95
|
+
* within `tolerance`, moved in so the outer face of its walls, `thickness` thick, stands there, as
|
|
96
|
+
* the house's roof stands its walls' outer faces on the walls' outside faces. A side on a wall's
|
|
97
|
+
* centre line, or on nothing, stays.
|
|
98
|
+
*/
|
|
99
|
+
export declare function settleRoofOnEdges(line: RoofWallLine, walls: readonly RoofCatchLine[], thickness: number, tolerance?: number): RoofWallLine;
|
|
100
|
+
/**
|
|
101
|
+
* A segment drawn or picked out to a room's edges, in its roof at `roof`'s place: its size and
|
|
102
|
+
* place in its roof with its walls' outer faces on them (`settleRoofOnEdges`).
|
|
103
|
+
*/
|
|
104
|
+
export declare function settleSegmentOnEdges(roof: Pick<RoofNode, 'position' | 'rotation'>, segment: Pick<RoofSegmentNode, 'position' | 'rotation' | 'width' | 'depth' | 'wallThickness'>, walls: readonly RoofCatchLine[]): Pick<RoofSegmentNode, 'position' | 'width' | 'depth'>;
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=wall-catch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wall-catch.d.ts","sourceRoot":"","sources":["../../src/roof/wall-catch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EAMd,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAA;AAEzB,KAAK,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEnC,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,OAAO,CAAA;AAErC;;;;GAIG;AACH,eAAO,MAAM,cAAc,OAAO,CAAA;AAKlC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,EAAE,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,EAAE,CAAC;IAAC,GAAG,EAAE,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnG,yFAAyF;AACzF,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,YAAY,CAAA;AAEnD,iGAAiG;AACjG,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,CAAC,EAAE,OAAO,CAAC;IAAC,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAsE/E,4FAA4F;AAC5F,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC,EAC7C,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,GACzE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,GAChD,YAAY,CAWd;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,EAC3C,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,aAAa,EAAE,CAsBjB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IAC9B,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,aAAa,CAiChB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,EAAE,EACP,OAAO,EAAE,EAAE,EACX,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GACZ,CAAC,MAAM,EAAE,MAAM,CAAC,CAelB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,IAAI,EAAE,YAAY,CAAA;IAClB,IAAI,EAAE,GAAG,GAAG,GAAG,CAAA;IACf,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,MAAM,GAAG,IAAI,CA4BhB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,SAAS,SAAoB,GAC5B,MAAM,GAAG,IAAI,CAUf;AAWD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,SAAiB,GACzB,YAAY,CAiBd;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC,EAC7C,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,eAAe,CAAC,EAC7F,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,CAWvD"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { getLevelBelow, getWallBodyLine, getWallThickness, isCurvedWall, isRailingWall, } from '@pascal-app/core';
|
|
2
|
+
/** How near a roof's wall line comes to a wall's centre line before it catches on it (metres). */
|
|
3
|
+
export const ROOF_WALL_CATCH_M = 0.25;
|
|
4
|
+
/**
|
|
5
|
+
* A side drawn or picked this near a room's edge stands on it (metres): as near as a drawn corner
|
|
6
|
+
* sticks to a wall in grid (the wall snap's connect radius), so one drawn on a railing's centre
|
|
7
|
+
* line, a grid point, still takes its outside face.
|
|
8
|
+
*/
|
|
9
|
+
export const ROOF_EDGE_ON_M = 0.05;
|
|
10
|
+
/** A wall within this of parallel (the sine of 1°) runs along a roof edge. */
|
|
11
|
+
const PARALLEL = Math.sin(Math.PI / 180);
|
|
12
|
+
const NO_CATCH = { shift: [0, 0], u: false, v: false };
|
|
13
|
+
const dot = (a, b) => a[0] * b[0] + a[1] * b[1];
|
|
14
|
+
/**
|
|
15
|
+
* A catch line's ends: a wall's body centre line (a wall drawn by a face has it half its thickness
|
|
16
|
+
* off the middle), an edge's own.
|
|
17
|
+
*/
|
|
18
|
+
function lineEnds(line) {
|
|
19
|
+
if (line.type === 'roof-edge')
|
|
20
|
+
return [line.start, line.end];
|
|
21
|
+
const body = getWallBodyLine(line);
|
|
22
|
+
return [
|
|
23
|
+
[body.start.x, body.start.y],
|
|
24
|
+
[body.end.x, body.end.y],
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
/** A railing as a room's edge: its body's centre line, its faces half its thickness off it. */
|
|
28
|
+
function railingEdge(wall) {
|
|
29
|
+
const [start, end] = lineEnds(wall);
|
|
30
|
+
return { type: 'roof-edge', id: wall.id, start, end, thickness: getWallThickness(wall) };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The line nearest an edge through `mid`, and how far along `n` the edge moves onto it: lines
|
|
34
|
+
* parallel to the edge, within `threshold` of it, and overlapping its `half` length either side of
|
|
35
|
+
* `mid` along `t`. Null when none does. A wall takes the edge on its centre line; a room's edge
|
|
36
|
+
* takes the outer face of the roof's walls, `thickness` thick, on its face on the outer side.
|
|
37
|
+
*/
|
|
38
|
+
function nearestLine(mid, n, t, half, lines, threshold, thickness) {
|
|
39
|
+
let best = null;
|
|
40
|
+
for (const line of lines) {
|
|
41
|
+
const [from, to] = lineEnds(line);
|
|
42
|
+
const run = [to[0] - from[0], to[1] - from[1]];
|
|
43
|
+
const length = Math.hypot(run[0], run[1]);
|
|
44
|
+
if (length < 1e-6 || Math.abs(dot(run, n)) / length > PARALLEL)
|
|
45
|
+
continue;
|
|
46
|
+
const start = [from[0] - mid[0], from[1] - mid[1]];
|
|
47
|
+
const end = [to[0] - mid[0], to[1] - mid[1]];
|
|
48
|
+
const gap = dot(start, n) + (line.type === 'roof-edge' ? (line.thickness - thickness) / 2 : 0);
|
|
49
|
+
if (Math.abs(gap) > threshold)
|
|
50
|
+
continue;
|
|
51
|
+
const a = dot(start, t);
|
|
52
|
+
const b = dot(end, t);
|
|
53
|
+
if (Math.max(a, b) <= -half || Math.min(a, b) >= half)
|
|
54
|
+
continue;
|
|
55
|
+
if (best === null || Math.abs(gap) < Math.abs(best.gap))
|
|
56
|
+
best = { gap, line };
|
|
57
|
+
}
|
|
58
|
+
return best;
|
|
59
|
+
}
|
|
60
|
+
/** A wall line's four edges: outward normal, run, distance from the centre, half length. */
|
|
61
|
+
function lineEdges(line) {
|
|
62
|
+
const ex = [Math.cos(line.angle), Math.sin(line.angle)];
|
|
63
|
+
const ez = [-ex[1], ex[0]];
|
|
64
|
+
return [
|
|
65
|
+
{ n: ex, t: ez, offset: line.hw, half: line.hd },
|
|
66
|
+
{ n: [-ex[0], -ex[1]], t: ez, offset: line.hw, half: line.hd },
|
|
67
|
+
{ n: ez, t: ex, offset: line.hd, half: line.hw },
|
|
68
|
+
{ n: [-ez[0], -ez[1]], t: ex, offset: line.hd, half: line.hw },
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/** A segment's wall line with its roof at `roof`'s place, which a drag may be proposing. */
|
|
72
|
+
export function segmentWallLine(roof, segment) {
|
|
73
|
+
const cos = Math.cos(-roof.rotation);
|
|
74
|
+
const sin = Math.sin(-roof.rotation);
|
|
75
|
+
const [lx, , lz] = segment.position;
|
|
76
|
+
return {
|
|
77
|
+
center: [roof.position[0] + lx * cos - lz * sin, roof.position[2] + lx * sin + lz * cos],
|
|
78
|
+
angle: -(roof.rotation + segment.rotation),
|
|
79
|
+
hw: segment.width / 2,
|
|
80
|
+
hd: segment.depth / 2,
|
|
81
|
+
wallThickness: segment.wallThickness,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* What a roof on `levelId` catches on, on its own level and the storey below, which the roof plan
|
|
86
|
+
* draws dashed: the walls it sits on, and the rooms' edges there, their invisible walls and
|
|
87
|
+
* railings (`RoofEdgeLine`): a porch's, a deck's, a patio's. Curved walls have no straight line to
|
|
88
|
+
* catch on.
|
|
89
|
+
*/
|
|
90
|
+
export function roofCatchWalls(nodes, levelId) {
|
|
91
|
+
if (!levelId)
|
|
92
|
+
return [];
|
|
93
|
+
const below = getLevelBelow(levelId, nodes);
|
|
94
|
+
const lines = [];
|
|
95
|
+
for (const id of [levelId, below?.id]) {
|
|
96
|
+
const level = id ? nodes[id] : undefined;
|
|
97
|
+
if (level?.type !== 'level')
|
|
98
|
+
continue;
|
|
99
|
+
for (const childId of level.children) {
|
|
100
|
+
const node = nodes[childId];
|
|
101
|
+
if (node?.type === 'separator')
|
|
102
|
+
lines.push({
|
|
103
|
+
type: 'roof-edge',
|
|
104
|
+
id: node.id,
|
|
105
|
+
start: node.start,
|
|
106
|
+
end: node.end,
|
|
107
|
+
thickness: 0,
|
|
108
|
+
});
|
|
109
|
+
else if (node?.type === 'wall' && !isCurvedWall(node))
|
|
110
|
+
lines.push(isRailingWall(node) ? railingEdge(node) : node);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return lines;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Where a dragged roof's wall lines catch on the walls under it. Along each axis of the frame at
|
|
117
|
+
* `angle` (the dragged segment's or roof's x and z), the edge nearest the centre line of a wall
|
|
118
|
+
* that runs alongside it, parallel and within `threshold`, sets the shift onto that wall; one
|
|
119
|
+
* nearest a room's edge (`RoofEdgeLine`) stands the outer face of the walls the segment takes
|
|
120
|
+
* there on it.
|
|
121
|
+
*/
|
|
122
|
+
export function catchRoofOnWalls(args) {
|
|
123
|
+
const threshold = args.threshold ?? ROOF_WALL_CATCH_M;
|
|
124
|
+
const u = [Math.cos(args.angle), Math.sin(args.angle)];
|
|
125
|
+
const v = [-u[1], u[0]];
|
|
126
|
+
let bestU = null;
|
|
127
|
+
let bestV = null;
|
|
128
|
+
for (const line of args.lines) {
|
|
129
|
+
const thickness = landedWallThickness(line, args.walls, threshold);
|
|
130
|
+
for (const { n, t, offset, half } of lineEdges(line)) {
|
|
131
|
+
// An edge of a segment turned off the dragged frame moves along neither axis alone.
|
|
132
|
+
const alongU = dot(n, u);
|
|
133
|
+
const alongV = dot(n, v);
|
|
134
|
+
const axis = Math.abs(alongV) <= PARALLEL ? 'u' : Math.abs(alongU) <= PARALLEL ? 'v' : null;
|
|
135
|
+
if (!axis)
|
|
136
|
+
continue;
|
|
137
|
+
const mid = [line.center[0] + n[0] * offset, line.center[1] + n[1] * offset];
|
|
138
|
+
const gap = nearestLine(mid, n, t, half, args.walls, threshold, thickness)?.gap;
|
|
139
|
+
if (gap === undefined)
|
|
140
|
+
continue;
|
|
141
|
+
const amount = gap * (axis === 'u' ? alongU : alongV);
|
|
142
|
+
if (axis === 'u') {
|
|
143
|
+
if (bestU === null || Math.abs(amount) < Math.abs(bestU))
|
|
144
|
+
bestU = amount;
|
|
145
|
+
}
|
|
146
|
+
else if (bestV === null || Math.abs(amount) < Math.abs(bestV))
|
|
147
|
+
bestV = amount;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (bestU === null && bestV === null)
|
|
151
|
+
return NO_CATCH;
|
|
152
|
+
const du = bestU ?? 0;
|
|
153
|
+
const dv = bestV ?? 0;
|
|
154
|
+
return {
|
|
155
|
+
shift: [u[0] * du + v[0] * dv, u[1] * du + v[1] * dv],
|
|
156
|
+
u: bestU !== null,
|
|
157
|
+
v: bestV !== null,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A dragged roof's place: along an axis its wall line caught on, the raw place shifted onto the
|
|
162
|
+
* wall; along the other, the snapped place (the grid's, or the raw cursor's with no grid).
|
|
163
|
+
*/
|
|
164
|
+
export function placeRoofOnWalls(raw, snapped, caught, angle) {
|
|
165
|
+
const out = [snapped[0], snapped[1]];
|
|
166
|
+
const target = [raw[0] + caught.shift[0], raw[1] + caught.shift[1]];
|
|
167
|
+
const u = [Math.cos(angle), Math.sin(angle)];
|
|
168
|
+
const v = [-u[1], u[0]];
|
|
169
|
+
for (const [axis, on] of [
|
|
170
|
+
[u, caught.u],
|
|
171
|
+
[v, caught.v],
|
|
172
|
+
]) {
|
|
173
|
+
if (!on)
|
|
174
|
+
continue;
|
|
175
|
+
const k = (target[0] - out[0]) * axis[0] + (target[1] - out[1]) * axis[1];
|
|
176
|
+
out[0] += axis[0] * k;
|
|
177
|
+
out[1] += axis[1] * k;
|
|
178
|
+
}
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* A side dragged out from `line` (the segment's wall line before the drag), its opposite side held:
|
|
183
|
+
* the size along `axis` that lays the dragged side on the centre line of a wall alongside it, or
|
|
184
|
+
* stands its outer face on a room's edge there (`RoofEdgeLine`); null when neither is within
|
|
185
|
+
* `threshold` of `value`.
|
|
186
|
+
*/
|
|
187
|
+
export function catchRoofSideOnWalls(args) {
|
|
188
|
+
const { line, axis, side, value } = args;
|
|
189
|
+
const threshold = args.threshold ?? ROOF_WALL_CATCH_M;
|
|
190
|
+
const ex = [Math.cos(line.angle), Math.sin(line.angle)];
|
|
191
|
+
const ez = [-ex[1], ex[0]];
|
|
192
|
+
const along = axis === 'x' ? ex : ez;
|
|
193
|
+
const n = [along[0] * side, along[1] * side];
|
|
194
|
+
const half = axis === 'x' ? line.hw : line.hd;
|
|
195
|
+
const reach = value - half;
|
|
196
|
+
const mid = [line.center[0] + n[0] * reach, line.center[1] + n[1] * reach];
|
|
197
|
+
// Sized to `value`, the opposite side held: the thickness its walls take there.
|
|
198
|
+
const shift = value / 2 - half;
|
|
199
|
+
const sized = {
|
|
200
|
+
...line,
|
|
201
|
+
center: [line.center[0] + n[0] * shift, line.center[1] + n[1] * shift],
|
|
202
|
+
hw: axis === 'x' ? value / 2 : line.hw,
|
|
203
|
+
hd: axis === 'z' ? value / 2 : line.hd,
|
|
204
|
+
};
|
|
205
|
+
const caught = nearestLine(mid, n, axis === 'x' ? ez : ex, axis === 'x' ? line.hd : line.hw, args.walls, threshold, landedWallThickness(sized, args.walls, threshold));
|
|
206
|
+
return caught ? value + caught.gap : null;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The thickness a segment's walls take to stand flush on the walls under it: the thickest wall
|
|
210
|
+
* whose centre line runs along an edge of its wall line, within `threshold`. A room's edge (an
|
|
211
|
+
* invisible wall, a railing) carries no roof and gives none. Null when no wall does.
|
|
212
|
+
*/
|
|
213
|
+
export function bearingWallThickness(line, walls, threshold = ROOF_WALL_CATCH_M) {
|
|
214
|
+
const bearing = walls.filter((wall) => wall.type === 'wall');
|
|
215
|
+
let thickest = null;
|
|
216
|
+
for (const { n, t, offset, half } of lineEdges(line)) {
|
|
217
|
+
const mid = [line.center[0] + n[0] * offset, line.center[1] + n[1] * offset];
|
|
218
|
+
const wall = nearestLine(mid, n, t, half, bearing, threshold, 0)?.line;
|
|
219
|
+
if (wall?.type === 'wall' && (thickest === null || getWallThickness(wall) > thickest))
|
|
220
|
+
thickest = getWallThickness(wall);
|
|
221
|
+
}
|
|
222
|
+
return thickest;
|
|
223
|
+
}
|
|
224
|
+
/** The thickness a wall line's walls take where it stands: the walls' under it, else its own. */
|
|
225
|
+
function landedWallThickness(line, walls, threshold) {
|
|
226
|
+
return bearingWallThickness(line, walls, threshold) ?? line.wallThickness ?? 0;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* A wall line drawn or picked out to a room's edges (`RoofEdgeLine`): each side lying on one,
|
|
230
|
+
* within `tolerance`, moved in so the outer face of its walls, `thickness` thick, stands there, as
|
|
231
|
+
* the house's roof stands its walls' outer faces on the walls' outside faces. A side on a wall's
|
|
232
|
+
* centre line, or on nothing, stays.
|
|
233
|
+
*/
|
|
234
|
+
export function settleRoofOnEdges(line, walls, thickness, tolerance = ROOF_EDGE_ON_M) {
|
|
235
|
+
const ex = [Math.cos(line.angle), Math.sin(line.angle)];
|
|
236
|
+
const ez = [-ex[1], ex[0]];
|
|
237
|
+
// How far each side (+x, -x, +z, -z) moves out along its own normal.
|
|
238
|
+
const [px = 0, nx = 0, pz = 0, nz = 0] = lineEdges(line).map(({ n, t, offset, half }) => {
|
|
239
|
+
const mid = [line.center[0] + n[0] * offset, line.center[1] + n[1] * offset];
|
|
240
|
+
const on = nearestLine(mid, n, t, half, walls, tolerance, 0);
|
|
241
|
+
return on?.line.type === 'roof-edge' ? on.gap - thickness / 2 : 0;
|
|
242
|
+
});
|
|
243
|
+
const du = (px - nx) / 2;
|
|
244
|
+
const dv = (pz - nz) / 2;
|
|
245
|
+
return {
|
|
246
|
+
...line,
|
|
247
|
+
center: [line.center[0] + ex[0] * du + ez[0] * dv, line.center[1] + ex[1] * du + ez[1] * dv],
|
|
248
|
+
hw: Math.max(1e-3, line.hw + (px + nx) / 2),
|
|
249
|
+
hd: Math.max(1e-3, line.hd + (pz + nz) / 2),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* A segment drawn or picked out to a room's edges, in its roof at `roof`'s place: its size and
|
|
254
|
+
* place in its roof with its walls' outer faces on them (`settleRoofOnEdges`).
|
|
255
|
+
*/
|
|
256
|
+
export function settleSegmentOnEdges(roof, segment, walls) {
|
|
257
|
+
const settled = settleRoofOnEdges(segmentWallLine(roof, segment), walls, segment.wallThickness);
|
|
258
|
+
const dx = settled.center[0] - roof.position[0];
|
|
259
|
+
const dz = settled.center[1] - roof.position[2];
|
|
260
|
+
const cos = Math.cos(-roof.rotation);
|
|
261
|
+
const sin = Math.sin(-roof.rotation);
|
|
262
|
+
return {
|
|
263
|
+
position: [dx * cos + dz * sin, segment.position[1], -dx * sin + dz * cos],
|
|
264
|
+
width: settled.hw * 2,
|
|
265
|
+
depth: settled.hd * 2,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RoofSegmentNode } from '@pascal-app/core';
|
|
2
|
+
export declare function RoofBuildUpSection({ node, onApplyToRoof, onUpdate, unit, }: {
|
|
3
|
+
node: RoofSegmentNode;
|
|
4
|
+
/** Present when the plane's roof has other planes to take the same layers. */
|
|
5
|
+
onApplyToRoof?: () => void;
|
|
6
|
+
onUpdate: (patch: Partial<RoofSegmentNode>) => void;
|
|
7
|
+
unit: 'metric' | 'imperial';
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=build-up-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-up-section.d.ts","sourceRoot":"","sources":["../../src/roof-segment/build-up-section.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,eAAe,EAMrB,MAAM,kBAAkB,CAAA;AAuNzB,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,IAAI,GACL,EAAE;IACD,IAAI,EAAE,eAAe,CAAA;IACrB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;IACnD,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC5B,+BAkLA"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { LUMBER_DEPTH, ROOFING_THICKNESS, roofBuildUpDepths, roofBuildUpPatch, UNDERLAYMENT_THICKNESS, usePascalI18n, } from '@pascal-app/core';
|
|
4
|
+
import { ActionButton, PanelSection, SegmentedControl, SelectControl } from '@pascal-app/editor';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { BuildUpReadout, editedBuildUp, FinishFields, FramingSizeFields, formatSpacing, InsulationFields, LAYER_KIND_LABELS, NONE, PanelFields, } from '../shared/build-up-controls.js';
|
|
7
|
+
import { formatLayerDepth, formatLayerThickness } from '../shared/layer-thickness.js';
|
|
8
|
+
import { keptName, namedLayer, roofBuildUpOfDeck, roofBuildUpPresetOptions, roofBuildUpPresetPatch, roofBuildUpPresetValue, } from './panel-model.js';
|
|
9
|
+
const ROOFING_OPTIONS = [
|
|
10
|
+
{
|
|
11
|
+
label: /* i18n */ {
|
|
12
|
+
id: 'node.roofSegment.buildUpSection.asphalt3Tab',
|
|
13
|
+
message: 'Asphalt 3-tab',
|
|
14
|
+
},
|
|
15
|
+
value: 'asphalt-3-tab',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: /* i18n */ {
|
|
19
|
+
id: 'node.roofSegment.buildUpSection.architecturalShingle',
|
|
20
|
+
message: 'Architectural shingle',
|
|
21
|
+
},
|
|
22
|
+
value: 'architectural-shingle',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: /* i18n */ {
|
|
26
|
+
id: 'node.roofSegment.buildUpSection.standingSeamMetal',
|
|
27
|
+
message: 'Standing-seam metal',
|
|
28
|
+
},
|
|
29
|
+
value: 'standing-seam-metal',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: /* i18n */ {
|
|
33
|
+
id: 'node.roofSegment.buildUpSection.concreteTile',
|
|
34
|
+
message: 'Concrete tile',
|
|
35
|
+
},
|
|
36
|
+
value: 'concrete-tile',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.clayTile', message: 'Clay tile' },
|
|
40
|
+
value: 'clay-tile',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.woodShake', message: 'Wood shake' },
|
|
44
|
+
value: 'wood-shake',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.slate', message: 'Slate' },
|
|
48
|
+
value: 'slate',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
const UNDERLAYMENT_OPTIONS = [
|
|
52
|
+
{
|
|
53
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.none', message: 'None' },
|
|
54
|
+
value: NONE,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.n15Felt', message: '#15 felt' },
|
|
58
|
+
value: 'felt-15',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.n30Felt', message: '#30 felt' },
|
|
62
|
+
value: 'felt-30',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: /* i18n */ { id: 'node.roofSegment.buildUpSection.synthetic', message: 'Synthetic' },
|
|
66
|
+
value: 'synthetic',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: /* i18n */ {
|
|
70
|
+
id: 'node.roofSegment.buildUpSection.iceAndWaterShield',
|
|
71
|
+
message: 'Ice and water shield',
|
|
72
|
+
},
|
|
73
|
+
value: 'ice-and-water',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
/** What each kind is called where the layer has no name of its own. */
|
|
77
|
+
const KIND_LABELS = {
|
|
78
|
+
...Object.fromEntries([...ROOFING_OPTIONS, ...UNDERLAYMENT_OPTIONS].map((o) => [o.value, o.label])),
|
|
79
|
+
...LAYER_KIND_LABELS,
|
|
80
|
+
};
|
|
81
|
+
const kindLabel = (kind, i18n) => {
|
|
82
|
+
const label = KIND_LABELS[kind];
|
|
83
|
+
return label ? i18n._(label) : kind;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A layer's own name for its material ("GAF Timberline HDZ"), under its kind: the kind's name
|
|
87
|
+
* shows until one is typed, and emptied the name goes.
|
|
88
|
+
*/
|
|
89
|
+
function LayerNameField({ label, layer, onCommit, }) {
|
|
90
|
+
const i18n = usePascalI18n();
|
|
91
|
+
const [draft, setDraft] = useState(null);
|
|
92
|
+
return (_jsxs("label", { className: "flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-border/50 bg-black/4 px-3 text-sm dark:bg-[#2C2C2E]", children: [_jsx("span", { className: "shrink-0 select-none text-muted-foreground", children: label }), _jsx("input", { className: "min-w-0 flex-1 bg-transparent text-right text-foreground outline-none placeholder:text-muted-foreground/60", maxLength: 60, onBlur: () => {
|
|
93
|
+
if (draft !== null && draft.trim() !== (layer.name ?? ''))
|
|
94
|
+
onCommit(draft);
|
|
95
|
+
setDraft(null);
|
|
96
|
+
}, onChange: (event) => setDraft(event.target.value), onKeyDown: (event) => {
|
|
97
|
+
if (event.key === 'Enter')
|
|
98
|
+
event.currentTarget.blur();
|
|
99
|
+
if (event.key === 'Escape') {
|
|
100
|
+
setDraft(null);
|
|
101
|
+
event.currentTarget.blur();
|
|
102
|
+
}
|
|
103
|
+
}, placeholder: kindLabel(layer.kind, i18n), spellCheck: false, value: draft ?? layer.name ?? '' })] }));
|
|
104
|
+
}
|
|
105
|
+
/** A layer as a line of the readout: its name, else its kind's. */
|
|
106
|
+
const layerLabel = (layer, i18n) => layer.name ?? kindLabel(layer.kind, i18n);
|
|
107
|
+
/**
|
|
108
|
+
* A plane without layers draws its deck and shingle thicknesses as they are. The readout says
|
|
109
|
+
* which layers that deck is (`roofBuildUpOfDeck`: the default preset over the framing it holds),
|
|
110
|
+
* and "Edit layers" gives the plane those layers to edit.
|
|
111
|
+
*/
|
|
112
|
+
function DrawnLayers({ node, onUpdate, unit, }) {
|
|
113
|
+
const i18n = usePascalI18n();
|
|
114
|
+
const drawn = roofBuildUpOfDeck(node.deckThickness);
|
|
115
|
+
const { structure } = drawn;
|
|
116
|
+
return (_jsxs(_Fragment, { children: [_jsx(BuildUpReadout, { label: i18n._({ id: 'node.roofSegment.buildUpSection.roofing', message: 'Roofing' }), value: layerLabel(drawn.roofing, i18n) }), drawn.underlayment && (_jsx(BuildUpReadout, { label: i18n._({
|
|
117
|
+
id: 'node.roofSegment.buildUpSection.underlayment',
|
|
118
|
+
message: 'Underlayment',
|
|
119
|
+
}), value: layerLabel(drawn.underlayment, i18n) })), _jsx(BuildUpReadout, { label: i18n._({ id: 'node.roofSegment.buildUpSection.sheathing', message: 'Sheathing' }), value: `${layerLabel(drawn.sheathing, i18n)} ${formatLayerThickness(drawn.sheathing.thickness, unit)}` }), _jsx(BuildUpReadout, { label: structure.system === 'trusses'
|
|
120
|
+
? i18n._({ id: 'node.roofSegment.buildUpSection.trusses', message: 'Trusses' })
|
|
121
|
+
: i18n._({ id: 'node.roofSegment.buildUpSection.rafters', message: 'Rafters' }), value: `${structure.size} @ ${formatSpacing(structure.spacing, unit, i18n)}` }), _jsx(BuildUpReadout, { label: i18n._({ id: 'node.roofSegment.buildUpSection.deck', message: 'Deck' }), value: formatLayerDepth(node.deckThickness, unit) }), _jsx(BuildUpReadout, { label: i18n._({ id: 'node.roofSegment.buildUpSection.covering', message: 'Covering' }), value: formatLayerDepth(node.shingleThickness, unit) }), _jsx(ActionButton, { className: "rounded-full", label: i18n._({ id: 'node.roofSegment.buildUpSection.editLayers', message: 'Edit layers' }), onClick: () => onUpdate(roofBuildUpPatch(drawn)) })] }));
|
|
122
|
+
}
|
|
123
|
+
export function RoofBuildUpSection({ node, onApplyToRoof, onUpdate, unit, }) {
|
|
124
|
+
const i18n = usePascalI18n();
|
|
125
|
+
const buildUp = node.buildUp;
|
|
126
|
+
const edit = (change) => {
|
|
127
|
+
if (buildUp)
|
|
128
|
+
onUpdate(roofBuildUpPatch(editedBuildUp(buildUp, change)));
|
|
129
|
+
};
|
|
130
|
+
// a name is no change of material: the preset the layers came from stays theirs
|
|
131
|
+
const rename = (key, name) => {
|
|
132
|
+
const layer = buildUp?.[key];
|
|
133
|
+
if (buildUp && layer)
|
|
134
|
+
onUpdate(roofBuildUpPatch({ ...buildUp, [key]: namedLayer(layer, name) }));
|
|
135
|
+
};
|
|
136
|
+
const depths = buildUp ? roofBuildUpDepths(buildUp) : null;
|
|
137
|
+
return (_jsxs(PanelSection, { title: i18n._({ id: 'node.roofSegment.buildUpSection.layers', message: 'Layers' }), children: [_jsx(SelectControl, { label: i18n._({ id: 'node.roofSegment.buildUpSection.preset', message: 'Preset' }), onChange: (id) => {
|
|
138
|
+
const patch = roofBuildUpPresetPatch(id);
|
|
139
|
+
if (patch)
|
|
140
|
+
onUpdate(patch);
|
|
141
|
+
}, options: roofBuildUpPresetOptions(roofBuildUpPresetValue(buildUp)), value: roofBuildUpPresetValue(buildUp) }), !buildUp && _jsx(DrawnLayers, { node: node, onUpdate: onUpdate, unit: unit }), buildUp && depths && (_jsxs(_Fragment, { children: [_jsx(SelectControl, { label: i18n._({ id: 'node.roofSegment.buildUpSection.roofing', message: 'Roofing' }), onChange: (kind) => edit({ roofing: { kind, thickness: ROOFING_THICKNESS[kind] } }), options: ROOFING_OPTIONS.map((option) => ({ ...option, label: i18n._(option.label) })), value: buildUp.roofing.kind }), _jsx(LayerNameField, { label: i18n._({
|
|
142
|
+
id: 'node.roofSegment.buildUpSection.roofingName',
|
|
143
|
+
message: 'Roofing name',
|
|
144
|
+
}), layer: buildUp.roofing, onCommit: (name) => rename('roofing', name) }), _jsx(SelectControl, { label: i18n._({
|
|
145
|
+
id: 'node.roofSegment.buildUpSection.underlayment',
|
|
146
|
+
message: 'Underlayment',
|
|
147
|
+
}), onChange: (kind) => edit({
|
|
148
|
+
underlayment: kind === NONE ? undefined : { kind, thickness: UNDERLAYMENT_THICKNESS[kind] },
|
|
149
|
+
}), options: UNDERLAYMENT_OPTIONS.map((option) => ({
|
|
150
|
+
...option,
|
|
151
|
+
label: i18n._(option.label),
|
|
152
|
+
})), value: buildUp.underlayment?.kind ?? NONE }), buildUp.underlayment && (_jsx(LayerNameField, { label: i18n._({
|
|
153
|
+
id: 'node.roofSegment.buildUpSection.underlaymentName',
|
|
154
|
+
message: 'Underlayment name',
|
|
155
|
+
}), layer: buildUp.underlayment, onCommit: (name) => rename('underlayment', name) })), _jsx(PanelFields, { label: i18n._({
|
|
156
|
+
id: 'node.roofSegment.buildUpSection.sheathing',
|
|
157
|
+
message: 'Sheathing',
|
|
158
|
+
}), layer: buildUp.sheathing, onChange: (sheathing) => sheathing && edit({ sheathing: keptName(buildUp.sheathing, sheathing) }), unit: unit }), _jsx(LayerNameField, { label: i18n._({
|
|
159
|
+
id: 'node.roofSegment.buildUpSection.sheathingName',
|
|
160
|
+
message: 'Sheathing name',
|
|
161
|
+
}), layer: buildUp.sheathing, onCommit: (name) => rename('sheathing', name) }), _jsx(SegmentedControl, { onChange: (system) => edit({ structure: { ...buildUp.structure, system } }), options: [
|
|
162
|
+
{
|
|
163
|
+
label: i18n._({
|
|
164
|
+
id: 'node.roofSegment.buildUpSection.rafters',
|
|
165
|
+
message: 'Rafters',
|
|
166
|
+
}),
|
|
167
|
+
value: 'rafters',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
label: i18n._({
|
|
171
|
+
id: 'node.roofSegment.buildUpSection.trusses',
|
|
172
|
+
message: 'Trusses',
|
|
173
|
+
}),
|
|
174
|
+
value: 'trusses',
|
|
175
|
+
},
|
|
176
|
+
], value: buildUp.structure.system }), _jsx(FramingSizeFields, { framing: buildUp.structure, onChange: (change) => edit({ structure: { ...buildUp.structure, ...change } }), sizeLabel: buildUp.structure.system === 'trusses'
|
|
177
|
+
? i18n._({ id: 'node.roofSegment.buildUpSection.topChord', message: 'Top chord' })
|
|
178
|
+
: i18n._({ id: 'node.roofSegment.buildUpSection.rafters', message: 'Rafters' }), unit: unit }), _jsx(InsulationFields, { framingDepth: LUMBER_DEPTH[buildUp.structure.size], layer: buildUp.insulation, onChange: (insulation) => edit({ insulation: keptName(buildUp.insulation, insulation) }), unit: unit }), buildUp.insulation && (_jsx(LayerNameField, { label: i18n._({
|
|
179
|
+
id: 'node.roofSegment.buildUpSection.insulationName',
|
|
180
|
+
message: 'Insulation name',
|
|
181
|
+
}), layer: buildUp.insulation, onCommit: (name) => rename('insulation', name) })), _jsx(FinishFields, { label: i18n._({
|
|
182
|
+
id: 'node.roofSegment.buildUpSection.interiorFinish',
|
|
183
|
+
message: 'Interior finish',
|
|
184
|
+
}), layer: buildUp.finish, onChange: (finish) => edit({ finish: keptName(buildUp.finish, finish) }), unit: unit }), buildUp.finish && (_jsx(LayerNameField, { label: i18n._({
|
|
185
|
+
id: 'node.roofSegment.buildUpSection.finishName',
|
|
186
|
+
message: 'Finish name',
|
|
187
|
+
}), layer: buildUp.finish, onCommit: (name) => rename('finish', name) })), _jsx(BuildUpReadout, { label: i18n._({ id: 'node.roofSegment.buildUpSection.deck', message: 'Deck' }), value: formatLayerDepth(depths.deck, unit) }), _jsx(BuildUpReadout, { label: i18n._({ id: 'node.roofSegment.buildUpSection.covering', message: 'Covering' }), value: formatLayerDepth(depths.covering, unit) }), onApplyToRoof && (_jsx(ActionButton, { className: "rounded-full", label: i18n._({
|
|
188
|
+
id: 'node.roofSegment.buildUpSection.applyToAllPlanesOfThis',
|
|
189
|
+
message: 'Apply to all planes of this roof',
|
|
190
|
+
}), onClick: onApplyToRoof }))] }))] }));
|
|
191
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/roof-segment/definition.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/roof-segment/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,cAAc,EAMpB,MAAM,kBAAkB,CAAA;AAwBzB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA6R1C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,OAAO,eAAe,CAmGxE,CAAA"}
|