@pascal-app/core 1.0.1 → 1.0.4
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/dist/agent-operations/__fixtures__/add-object-cases.d.ts +235 -0
- package/dist/agent-operations/__fixtures__/add-object-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/add-object-cases.js +129 -0
- package/dist/agent-operations/__fixtures__/build-room-cases.d.ts +4 -0
- package/dist/agent-operations/__fixtures__/build-room-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/build-room-cases.js +635 -0
- package/dist/agent-operations/__fixtures__/cases.d.ts +52 -0
- package/dist/agent-operations/__fixtures__/cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/cases.js +689 -0
- package/dist/agent-operations/__fixtures__/find-by-type-cases.d.ts +7 -0
- package/dist/agent-operations/__fixtures__/find-by-type-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/find-by-type-cases.js +21 -0
- package/dist/agent-operations/__fixtures__/place-items-cases.d.ts +17 -0
- package/dist/agent-operations/__fixtures__/place-items-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/place-items-cases.js +506 -0
- package/dist/agent-operations/__fixtures__/room-cases.d.ts +3 -0
- package/dist/agent-operations/__fixtures__/room-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/room-cases.js +338 -0
- package/dist/agent-operations/__fixtures__/search-assets-cases.d.ts +5 -0
- package/dist/agent-operations/__fixtures__/search-assets-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/search-assets-cases.js +137 -0
- package/dist/agent-operations/__fixtures__/structure-cases.d.ts +6 -0
- package/dist/agent-operations/__fixtures__/structure-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/structure-cases.js +588 -0
- package/dist/agent-operations/__fixtures__/verify-scene-cases.d.ts +3 -0
- package/dist/agent-operations/__fixtures__/verify-scene-cases.d.ts.map +1 -0
- package/dist/agent-operations/__fixtures__/verify-scene-cases.js +302 -0
- package/dist/agent-operations/achieved.d.ts +16 -0
- package/dist/agent-operations/achieved.d.ts.map +1 -0
- package/dist/agent-operations/achieved.js +28 -0
- package/dist/agent-operations/add-column.d.ts +23 -0
- package/dist/agent-operations/add-column.d.ts.map +1 -0
- package/dist/agent-operations/add-column.js +97 -0
- package/dist/agent-operations/add-level.d.ts +14 -0
- package/dist/agent-operations/add-level.d.ts.map +1 -0
- package/dist/agent-operations/add-level.js +94 -0
- package/dist/agent-operations/add-object.d.ts +114 -0
- package/dist/agent-operations/add-object.d.ts.map +1 -0
- package/dist/agent-operations/add-object.js +361 -0
- package/dist/agent-operations/add-wall.d.ts +15 -0
- package/dist/agent-operations/add-wall.d.ts.map +1 -0
- package/dist/agent-operations/add-wall.js +47 -0
- package/dist/agent-operations/apply-changes.d.ts +16 -0
- package/dist/agent-operations/apply-changes.d.ts.map +1 -0
- package/dist/agent-operations/apply-changes.js +93 -0
- package/dist/agent-operations/apply-outcome.d.ts +15 -0
- package/dist/agent-operations/apply-outcome.d.ts.map +1 -0
- package/dist/agent-operations/apply-outcome.js +18 -0
- package/dist/agent-operations/collections.d.ts +28 -0
- package/dist/agent-operations/collections.d.ts.map +1 -0
- package/dist/agent-operations/collections.js +130 -0
- package/dist/agent-operations/create-room.d.ts +36 -0
- package/dist/agent-operations/create-room.d.ts.map +1 -0
- package/dist/agent-operations/create-room.js +177 -0
- package/dist/agent-operations/create-stair.d.ts +33 -0
- package/dist/agent-operations/create-stair.d.ts.map +1 -0
- package/dist/agent-operations/create-stair.js +247 -0
- package/dist/agent-operations/delete-node.d.ts +6 -0
- package/dist/agent-operations/delete-node.d.ts.map +1 -0
- package/dist/agent-operations/delete-node.js +9 -0
- package/dist/agent-operations/door-clearance.d.ts +135 -0
- package/dist/agent-operations/door-clearance.d.ts.map +1 -0
- package/dist/agent-operations/door-clearance.js +334 -0
- package/dist/agent-operations/duplicate-level.d.ts +12 -0
- package/dist/agent-operations/duplicate-level.d.ts.map +1 -0
- package/dist/agent-operations/duplicate-level.js +54 -0
- package/dist/agent-operations/find-by-type.d.ts +11 -0
- package/dist/agent-operations/find-by-type.d.ts.map +1 -0
- package/dist/agent-operations/find-by-type.js +94 -0
- package/dist/agent-operations/furnish-room.d.ts +18 -0
- package/dist/agent-operations/furnish-room.d.ts.map +1 -0
- package/dist/agent-operations/furnish-room.js +259 -0
- package/dist/agent-operations/get-node.d.ts +9 -0
- package/dist/agent-operations/get-node.d.ts.map +1 -0
- package/dist/agent-operations/get-node.js +33 -0
- package/dist/agent-operations/hosted-services.d.ts +13 -0
- package/dist/agent-operations/hosted-services.d.ts.map +1 -0
- package/dist/agent-operations/hosted-services.js +22 -0
- package/dist/agent-operations/index.d.ts +277 -0
- package/dist/agent-operations/index.d.ts.map +1 -0
- package/dist/agent-operations/index.js +80 -0
- package/dist/agent-operations/layout-clearance.d.ts +108 -0
- package/dist/agent-operations/layout-clearance.d.ts.map +1 -0
- package/dist/agent-operations/layout-clearance.js +190 -0
- package/dist/agent-operations/level-reads.d.ts +33 -0
- package/dist/agent-operations/level-reads.d.ts.map +1 -0
- package/dist/agent-operations/level-reads.js +161 -0
- package/dist/agent-operations/level-target.d.ts +11 -0
- package/dist/agent-operations/level-target.d.ts.map +1 -0
- package/dist/agent-operations/level-target.js +29 -0
- package/dist/agent-operations/list-levels.d.ts +4 -0
- package/dist/agent-operations/list-levels.d.ts.map +1 -0
- package/dist/agent-operations/list-levels.js +31 -0
- package/dist/agent-operations/material-preset.d.ts +11 -0
- package/dist/agent-operations/material-preset.d.ts.map +1 -0
- package/dist/agent-operations/material-preset.js +74 -0
- package/dist/agent-operations/material-refs.d.ts +24 -0
- package/dist/agent-operations/material-refs.d.ts.map +1 -0
- package/dist/agent-operations/material-refs.js +100 -0
- package/dist/agent-operations/node-patch.d.ts +3 -0
- package/dist/agent-operations/node-patch.d.ts.map +1 -0
- package/dist/agent-operations/node-patch.js +114 -0
- package/dist/agent-operations/paint.d.ts +21 -0
- package/dist/agent-operations/paint.d.ts.map +1 -0
- package/dist/agent-operations/paint.js +219 -0
- package/dist/agent-operations/place-items.d.ts +20 -0
- package/dist/agent-operations/place-items.d.ts.map +1 -0
- package/dist/agent-operations/place-items.js +226 -0
- package/dist/agent-operations/plan-geometry.d.ts +24 -0
- package/dist/agent-operations/plan-geometry.d.ts.map +1 -0
- package/dist/agent-operations/plan-geometry.js +94 -0
- package/dist/agent-operations/room-structure.d.ts +87 -0
- package/dist/agent-operations/room-structure.d.ts.map +1 -0
- package/dist/agent-operations/room-structure.js +144 -0
- package/dist/agent-operations/scene-materials.d.ts +15 -0
- package/dist/agent-operations/scene-materials.d.ts.map +1 -0
- package/dist/agent-operations/scene-materials.js +62 -0
- package/dist/agent-operations/scene-measure.d.ts +73 -0
- package/dist/agent-operations/scene-measure.d.ts.map +1 -0
- package/dist/agent-operations/scene-measure.js +73 -0
- package/dist/agent-operations/scene-queries.d.ts +4510 -0
- package/dist/agent-operations/scene-queries.d.ts.map +1 -0
- package/dist/agent-operations/scene-queries.js +84 -0
- package/dist/agent-operations/scene-view.d.ts +98 -0
- package/dist/agent-operations/scene-view.d.ts.map +1 -0
- package/dist/agent-operations/scene-view.js +559 -0
- package/dist/agent-operations/search-assets.d.ts +14 -0
- package/dist/agent-operations/search-assets.d.ts.map +1 -0
- package/dist/agent-operations/search-assets.js +42 -0
- package/dist/agent-operations/search-materials.d.ts +12 -0
- package/dist/agent-operations/search-materials.d.ts.map +1 -0
- package/dist/agent-operations/search-materials.js +111 -0
- package/dist/agent-operations/stairs.d.ts +5 -0
- package/dist/agent-operations/stairs.d.ts.map +1 -0
- package/dist/agent-operations/stairs.js +70 -0
- package/dist/agent-operations/types.d.ts +59 -0
- package/dist/agent-operations/types.d.ts.map +1 -0
- package/dist/agent-operations/types.js +1 -0
- package/dist/agent-operations/verify-scene.d.ts +50 -0
- package/dist/agent-operations/verify-scene.d.ts.map +1 -0
- package/dist/agent-operations/verify-scene.js +369 -0
- package/dist/agent-operations/wall-opening.d.ts +65 -0
- package/dist/agent-operations/wall-opening.d.ts.map +1 -0
- package/dist/agent-operations/wall-opening.js +55 -0
- package/dist/agent-tools/achieved.d.ts +9 -0
- package/dist/agent-tools/achieved.d.ts.map +1 -0
- package/dist/agent-tools/achieved.js +8 -0
- package/dist/agent-tools/add-object.d.ts +43 -0
- package/dist/agent-tools/add-object.d.ts.map +1 -0
- package/dist/agent-tools/add-object.js +86 -0
- package/dist/agent-tools/assets.d.ts +13 -0
- package/dist/agent-tools/assets.d.ts.map +1 -0
- package/dist/agent-tools/assets.js +18 -0
- package/dist/agent-tools/clear-scene.d.ts +10 -0
- package/dist/agent-tools/clear-scene.d.ts.map +1 -0
- package/dist/agent-tools/clear-scene.js +9 -0
- package/dist/agent-tools/collections.d.ts +35 -0
- package/dist/agent-tools/collections.d.ts.map +1 -0
- package/dist/agent-tools/collections.js +31 -0
- package/dist/agent-tools/columns.d.ts +44 -0
- package/dist/agent-tools/columns.d.ts.map +1 -0
- package/dist/agent-tools/columns.js +59 -0
- package/dist/agent-tools/contract.d.ts +68 -0
- package/dist/agent-tools/contract.d.ts.map +1 -0
- package/dist/agent-tools/contract.js +1 -0
- package/dist/agent-tools/create-room.d.ts +63 -0
- package/dist/agent-tools/create-room.d.ts.map +1 -0
- package/dist/agent-tools/create-room.js +90 -0
- package/dist/agent-tools/find-by-type.d.ts +11 -0
- package/dist/agent-tools/find-by-type.d.ts.map +1 -0
- package/dist/agent-tools/find-by-type.js +14 -0
- package/dist/agent-tools/furnish-room.d.ts +26 -0
- package/dist/agent-tools/furnish-room.d.ts.map +1 -0
- package/dist/agent-tools/furnish-room.js +35 -0
- package/dist/agent-tools/hosted-services.d.ts +402 -0
- package/dist/agent-tools/hosted-services.d.ts.map +1 -0
- package/dist/agent-tools/hosted-services.js +148 -0
- package/dist/agent-tools/index.d.ts +864 -0
- package/dist/agent-tools/index.d.ts.map +1 -0
- package/dist/agent-tools/index.js +82 -0
- package/dist/agent-tools/levels.d.ts +72 -0
- package/dist/agent-tools/levels.d.ts.map +1 -0
- package/dist/agent-tools/levels.js +76 -0
- package/dist/agent-tools/measurement.d.ts +37 -0
- package/dist/agent-tools/measurement.d.ts.map +1 -0
- package/dist/agent-tools/measurement.js +94 -0
- package/dist/agent-tools/node-id.d.ts +3 -0
- package/dist/agent-tools/node-id.d.ts.map +1 -0
- package/dist/agent-tools/node-id.js +2 -0
- package/dist/agent-tools/nodes.d.ts +17 -0
- package/dist/agent-tools/nodes.d.ts.map +1 -0
- package/dist/agent-tools/nodes.js +13 -0
- package/dist/agent-tools/paint.d.ts +46 -0
- package/dist/agent-tools/paint.d.ts.map +1 -0
- package/dist/agent-tools/paint.js +29 -0
- package/dist/agent-tools/place-items.d.ts +19 -0
- package/dist/agent-tools/place-items.d.ts.map +1 -0
- package/dist/agent-tools/place-items.js +29 -0
- package/dist/agent-tools/refusal.d.ts +20 -0
- package/dist/agent-tools/refusal.d.ts.map +1 -0
- package/dist/agent-tools/refusal.js +29 -0
- package/dist/agent-tools/room-structure.d.ts +438 -0
- package/dist/agent-tools/room-structure.d.ts.map +1 -0
- package/dist/agent-tools/room-structure.js +207 -0
- package/dist/agent-tools/search-materials.d.ts +20 -0
- package/dist/agent-tools/search-materials.d.ts.map +1 -0
- package/dist/agent-tools/search-materials.js +32 -0
- package/dist/agent-tools/stairs.d.ts +86 -0
- package/dist/agent-tools/stairs.d.ts.map +1 -0
- package/dist/agent-tools/stairs.js +103 -0
- package/dist/agent-tools/verify-scene.d.ts +13 -0
- package/dist/agent-tools/verify-scene.d.ts.map +1 -0
- package/dist/agent-tools/verify-scene.js +21 -0
- package/dist/agent-tools/view-scene.d.ts +43 -0
- package/dist/agent-tools/view-scene.d.ts.map +1 -0
- package/dist/agent-tools/view-scene.js +80 -0
- package/dist/agent-tools/wall-openings.d.ts +163 -0
- package/dist/agent-tools/wall-openings.d.ts.map +1 -0
- package/dist/agent-tools/wall-openings.js +144 -0
- package/dist/agent-tools/walls.d.ts +21 -0
- package/dist/agent-tools/walls.d.ts.map +1 -0
- package/dist/agent-tools/walls.js +30 -0
- package/dist/agent-tools/write-target.d.ts +12 -0
- package/dist/agent-tools/write-target.d.ts.map +1 -0
- package/dist/agent-tools/write-target.js +10 -0
- package/dist/building/__fixtures__/wall-opening-cases.d.ts +736 -0
- package/dist/building/__fixtures__/wall-opening-cases.d.ts.map +1 -0
- package/dist/building/__fixtures__/wall-opening-cases.js +307 -0
- package/dist/building/door-types.d.ts +22 -0
- package/dist/building/door-types.d.ts.map +1 -0
- package/dist/building/door-types.js +167 -0
- package/dist/building/floor-item-fit.d.ts +38 -0
- package/dist/building/floor-item-fit.d.ts.map +1 -0
- package/dist/building/floor-item-fit.js +47 -0
- package/dist/building/index.d.ts +7 -0
- package/dist/building/index.d.ts.map +1 -0
- package/dist/building/index.js +6 -0
- package/dist/building/level-duplication.d.ts +8983 -0
- package/dist/building/level-duplication.d.ts.map +1 -0
- package/dist/building/level-duplication.js +314 -0
- package/dist/building/opening-style-presets.d.ts +46 -0
- package/dist/building/opening-style-presets.d.ts.map +1 -0
- package/dist/building/opening-style-presets.js +195 -0
- package/dist/building/wall-openings.d.ts +445 -0
- package/dist/building/wall-openings.d.ts.map +1 -0
- package/dist/building/wall-openings.js +231 -0
- package/dist/building/window-types.d.ts +17 -0
- package/dist/building/window-types.d.ts.map +1 -0
- package/dist/building/window-types.js +31 -0
- package/dist/commands/structure/apply-zone-transform.d.ts +23 -0
- package/dist/commands/structure/apply-zone-transform.d.ts.map +1 -0
- package/dist/commands/structure/apply-zone-transform.js +55 -0
- package/dist/commands/structure/create-mezzanine.d.ts +12 -0
- package/dist/commands/structure/create-mezzanine.d.ts.map +1 -0
- package/dist/commands/structure/create-mezzanine.js +46 -0
- package/dist/commands/structure/create-zone.d.ts +32 -0
- package/dist/commands/structure/create-zone.d.ts.map +1 -0
- package/dist/commands/structure/create-zone.js +126 -0
- package/dist/commands/structure/delete-zone.d.ts +51 -0
- package/dist/commands/structure/delete-zone.d.ts.map +1 -0
- package/dist/commands/structure/delete-zone.js +354 -0
- package/dist/commands/structure/divide-zone.d.ts +38 -0
- package/dist/commands/structure/divide-zone.d.ts.map +1 -0
- package/dist/commands/structure/divide-zone.js +186 -0
- package/dist/commands/structure/duplicate-zone.d.ts +7 -0
- package/dist/commands/structure/duplicate-zone.d.ts.map +1 -0
- package/dist/commands/structure/duplicate-zone.js +21 -0
- package/dist/commands/structure/floor-opening.d.ts +36 -0
- package/dist/commands/structure/floor-opening.d.ts.map +1 -0
- package/dist/commands/structure/floor-opening.js +124 -0
- package/dist/commands/structure/index.d.ts +22 -0
- package/dist/commands/structure/index.d.ts.map +1 -0
- package/dist/commands/structure/index.js +20 -0
- package/dist/commands/structure/lock-outside-faces.d.ts +12 -0
- package/dist/commands/structure/lock-outside-faces.d.ts.map +1 -0
- package/dist/commands/structure/lock-outside-faces.js +32 -0
- package/dist/commands/structure/merge-zones.d.ts +5 -0
- package/dist/commands/structure/merge-zones.d.ts.map +1 -0
- package/dist/commands/structure/merge-zones.js +22 -0
- package/dist/commands/structure/mezzanine-content.d.ts +16 -0
- package/dist/commands/structure/mezzanine-content.d.ts.map +1 -0
- package/dist/commands/structure/mezzanine-content.js +109 -0
- package/dist/commands/structure/plan-mezzanine-stair.d.ts +7 -0
- package/dist/commands/structure/plan-mezzanine-stair.d.ts.map +1 -0
- package/dist/commands/structure/plan-mezzanine-stair.js +127 -0
- package/dist/commands/structure/plan-wall-deletion.d.ts +9 -0
- package/dist/commands/structure/plan-wall-deletion.d.ts.map +1 -0
- package/dist/commands/structure/plan-wall-deletion.js +151 -0
- package/dist/commands/structure/rebase-floor-reference.d.ts +7 -0
- package/dist/commands/structure/rebase-floor-reference.d.ts.map +1 -0
- package/dist/commands/structure/rebase-floor-reference.js +90 -0
- package/dist/commands/structure/resize-mezzanine.d.ts +8 -0
- package/dist/commands/structure/resize-mezzanine.d.ts.map +1 -0
- package/dist/commands/structure/resize-mezzanine.js +43 -0
- package/dist/commands/structure/rotate-zone.d.ts +8 -0
- package/dist/commands/structure/rotate-zone.d.ts.map +1 -0
- package/dist/commands/structure/rotate-zone.js +28 -0
- package/dist/commands/structure/set-floor-foundation.d.ts +62 -0
- package/dist/commands/structure/set-floor-foundation.d.ts.map +1 -0
- package/dist/commands/structure/set-floor-foundation.js +162 -0
- package/dist/commands/structure/set-room-floor-construction.d.ts +8 -0
- package/dist/commands/structure/set-room-floor-construction.d.ts.map +1 -0
- package/dist/commands/structure/set-room-floor-construction.js +72 -0
- package/dist/commands/structure/set-wall-geometry.d.ts +10 -0
- package/dist/commands/structure/set-wall-geometry.d.ts.map +1 -0
- package/dist/commands/structure/set-wall-geometry.js +52 -0
- package/dist/commands/structure/set-zone-edges.d.ts +14 -0
- package/dist/commands/structure/set-zone-edges.d.ts.map +1 -0
- package/dist/commands/structure/set-zone-edges.js +143 -0
- package/dist/commands/structure/set-zone-intent.d.ts +39 -0
- package/dist/commands/structure/set-zone-intent.d.ts.map +1 -0
- package/dist/commands/structure/set-zone-intent.js +125 -0
- package/dist/commands/structure/shared.d.ts +4512 -0
- package/dist/commands/structure/shared.d.ts.map +1 -0
- package/dist/commands/structure/shared.js +102 -0
- package/dist/commands/structure/transform-zone.d.ts +23 -0
- package/dist/commands/structure/transform-zone.d.ts.map +1 -0
- package/dist/commands/structure/transform-zone.js +472 -0
- package/dist/commands/structure/validate-mezzanine.d.ts +5 -0
- package/dist/commands/structure/validate-mezzanine.d.ts.map +1 -0
- package/dist/commands/structure/validate-mezzanine.js +46 -0
- package/dist/commands/structure/zone-crossings.d.ts +8 -0
- package/dist/commands/structure/zone-crossings.d.ts.map +1 -0
- package/dist/commands/structure/zone-crossings.js +162 -0
- package/dist/commands/structure/zone-drop.d.ts +4 -0
- package/dist/commands/structure/zone-drop.d.ts.map +1 -0
- package/dist/commands/structure/zone-drop.js +68 -0
- package/dist/commands/structure/zone-insertion.d.ts +4 -0
- package/dist/commands/structure/zone-insertion.d.ts.map +1 -0
- package/dist/commands/structure/zone-insertion.js +200 -0
- package/dist/commands/structure/zone-transform-content.d.ts +6 -0
- package/dist/commands/structure/zone-transform-content.d.ts.map +1 -0
- package/dist/commands/structure/zone-transform-content.js +117 -0
- package/dist/commands/structure/zone-wall-merge.d.ts +4977 -0
- package/dist/commands/structure/zone-wall-merge.d.ts.map +1 -0
- package/dist/commands/structure/zone-wall-merge.js +135 -0
- package/dist/contracts/reference-discovery.d.ts +18 -0
- package/dist/contracts/reference-discovery.d.ts.map +1 -0
- package/dist/contracts/reference-discovery.js +100 -0
- package/dist/contracts/reference-inventory.d.ts +44 -0
- package/dist/contracts/reference-inventory.d.ts.map +1 -0
- package/dist/contracts/reference-inventory.js +872 -0
- package/dist/events/bus.d.ts +70 -9
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/hooks/scene-registry/item-clip-registry.d.ts +6 -3
- package/dist/hooks/scene-registry/item-clip-registry.d.ts.map +1 -1
- package/dist/hooks/scene-registry/item-clip-registry.js +2 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/floor-placed-elevation.js +15 -1
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +3 -2
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-manager.js +53 -66
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +1650 -131
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.js +86 -83
- package/dist/hooks/spatial-grid/support-host-patch.d.ts +1 -0
- package/dist/hooks/spatial-grid/support-host-patch.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/support-host-patch.js +12 -5
- package/dist/index.d.ts +83 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -11
- package/dist/lib/__bench__/near-linear-walls.d.ts +2 -0
- package/dist/lib/__bench__/near-linear-walls.d.ts.map +1 -0
- package/dist/lib/__bench__/near-linear-walls.js +24 -0
- package/dist/lib/__bench__/structure-preview.bench.d.ts +2 -0
- package/dist/lib/__bench__/structure-preview.bench.d.ts.map +1 -0
- package/dist/lib/__bench__/structure-preview.bench.js +72 -0
- package/dist/lib/__fixtures__/mezzanine.d.ts +13968 -0
- package/dist/lib/__fixtures__/mezzanine.d.ts.map +1 -0
- package/dist/lib/__fixtures__/mezzanine.js +43 -0
- package/dist/lib/absorb-wall-separators.d.ts +4483 -0
- package/dist/lib/absorb-wall-separators.d.ts.map +1 -0
- package/dist/lib/absorb-wall-separators.js +65 -0
- package/dist/lib/angle-accumulator.d.ts +3 -0
- package/dist/lib/angle-accumulator.d.ts.map +1 -0
- package/dist/lib/angle-accumulator.js +13 -0
- package/dist/lib/artifact-store.d.ts +31 -0
- package/dist/lib/artifact-store.d.ts.map +1 -0
- package/dist/lib/artifact-store.js +42 -0
- package/dist/lib/assembly-stack.d.ts +54 -0
- package/dist/lib/assembly-stack.d.ts.map +1 -0
- package/dist/lib/assembly-stack.js +52 -0
- package/dist/lib/asset-storage.d.ts.map +1 -1
- package/dist/lib/asset-storage.js +3 -0
- package/dist/lib/canonical-opening-ring.d.ts +3 -0
- package/dist/lib/canonical-opening-ring.d.ts.map +1 -0
- package/dist/lib/canonical-opening-ring.js +14 -0
- package/dist/lib/ceiling-children.d.ts +8 -0
- package/dist/lib/ceiling-children.d.ts.map +1 -0
- package/dist/lib/ceiling-children.js +36 -0
- package/dist/lib/ceiling-surface.d.ts +40 -0
- package/dist/lib/ceiling-surface.d.ts.map +1 -0
- package/dist/lib/ceiling-surface.js +65 -0
- package/dist/lib/cutter-host.d.ts +5 -0
- package/dist/lib/cutter-host.d.ts.map +1 -0
- package/dist/lib/cutter-host.js +30 -0
- package/dist/lib/floor-construction-lift.d.ts +4 -0
- package/dist/lib/floor-construction-lift.d.ts.map +1 -0
- package/dist/lib/floor-construction-lift.js +54 -0
- package/dist/lib/floor-footprint-key.d.ts +3 -0
- package/dist/lib/floor-footprint-key.d.ts.map +1 -0
- package/dist/lib/floor-footprint-key.js +9 -0
- package/dist/lib/floor-footprint-name.d.ts +11 -0
- package/dist/lib/floor-footprint-name.d.ts.map +1 -0
- package/dist/lib/floor-footprint-name.js +52 -0
- package/dist/lib/floor-foundation-datum.d.ts +31 -0
- package/dist/lib/floor-foundation-datum.d.ts.map +1 -0
- package/dist/lib/floor-foundation-datum.js +226 -0
- package/dist/lib/floor-foundation-stack.d.ts +16 -0
- package/dist/lib/floor-foundation-stack.d.ts.map +1 -0
- package/dist/lib/floor-foundation-stack.js +214 -0
- package/dist/lib/floor-intent-changes.d.ts +10 -0
- package/dist/lib/floor-intent-changes.d.ts.map +1 -0
- package/dist/lib/floor-intent-changes.js +461 -0
- package/dist/lib/floor-opening-footprints.d.ts +24 -0
- package/dist/lib/floor-opening-footprints.d.ts.map +1 -0
- package/dist/lib/floor-opening-footprints.js +127 -0
- package/dist/lib/floor-opening-intent.d.ts +16 -0
- package/dist/lib/floor-opening-intent.d.ts.map +1 -0
- package/dist/lib/floor-opening-intent.js +82 -0
- package/dist/lib/floor-plate-id.d.ts +5 -0
- package/dist/lib/floor-plate-id.d.ts.map +1 -0
- package/dist/lib/floor-plate-id.js +20 -0
- package/dist/lib/floor-plate-paint.d.ts +8 -0
- package/dist/lib/floor-plate-paint.d.ts.map +1 -0
- package/dist/lib/floor-plate-paint.js +11 -0
- package/dist/lib/floor-plates.d.ts +211 -0
- package/dist/lib/floor-plates.d.ts.map +1 -0
- package/dist/lib/floor-plates.js +729 -0
- package/dist/lib/floor-room-faces.d.ts +5 -0
- package/dist/lib/floor-room-faces.d.ts.map +1 -0
- package/dist/lib/floor-room-faces.js +29 -0
- package/dist/lib/floor-step-finish.d.ts +49 -0
- package/dist/lib/floor-step-finish.d.ts.map +1 -0
- package/dist/lib/floor-step-finish.js +128 -0
- package/dist/lib/geometry-script-node.d.ts +82 -0
- package/dist/lib/geometry-script-node.d.ts.map +1 -0
- package/dist/lib/geometry-script-node.js +147 -0
- package/dist/lib/geometry-surfaces.d.ts +61 -0
- package/dist/lib/geometry-surfaces.d.ts.map +1 -0
- package/dist/lib/geometry-surfaces.js +156 -0
- package/dist/lib/item-slab-support.d.ts +14 -0
- package/dist/lib/item-slab-support.d.ts.map +1 -0
- package/dist/lib/item-slab-support.js +40 -0
- package/dist/lib/level-footprints.d.ts +23 -0
- package/dist/lib/level-footprints.d.ts.map +1 -0
- package/dist/lib/level-footprints.js +398 -0
- package/dist/lib/level-name.d.ts +7 -0
- package/dist/lib/level-name.d.ts.map +1 -1
- package/dist/lib/level-name.js +11 -3
- package/dist/lib/new-zone.d.ts +10 -0
- package/dist/lib/new-zone.d.ts.map +1 -0
- package/dist/lib/new-zone.js +10 -0
- package/dist/lib/node-ancestry.d.ts +30 -0
- package/dist/lib/node-ancestry.d.ts.map +1 -0
- package/dist/lib/node-ancestry.js +76 -0
- package/dist/lib/node-visibility.d.ts +12 -0
- package/dist/lib/node-visibility.d.ts.map +1 -0
- package/dist/lib/node-visibility.js +12 -0
- package/dist/lib/object-cuts.d.ts +11 -0
- package/dist/lib/object-cuts.d.ts.map +1 -0
- package/dist/lib/object-cuts.js +63 -0
- package/dist/lib/opening-floor-datum.d.ts +24 -0
- package/dist/lib/opening-floor-datum.d.ts.map +1 -0
- package/dist/lib/opening-floor-datum.js +145 -0
- package/dist/lib/own-floor-intent.d.ts +15 -0
- package/dist/lib/own-floor-intent.d.ts.map +1 -0
- package/dist/lib/own-floor-intent.js +201 -0
- package/dist/lib/plate-reference.d.ts +3 -0
- package/dist/lib/plate-reference.d.ts.map +1 -0
- package/dist/lib/plate-reference.js +91 -0
- package/dist/lib/plate-surface.d.ts +120 -0
- package/dist/lib/plate-surface.d.ts.map +1 -0
- package/dist/lib/plate-surface.js +725 -0
- package/dist/lib/polygon-boolean.d.ts +17 -0
- package/dist/lib/polygon-boolean.d.ts.map +1 -0
- package/dist/lib/polygon-boolean.js +195 -0
- package/dist/lib/polygon-label.d.ts +7 -0
- package/dist/lib/polygon-label.d.ts.map +1 -0
- package/dist/lib/polygon-label.js +94 -0
- package/dist/lib/room-drawn-floor.d.ts +29 -0
- package/dist/lib/room-drawn-floor.d.ts.map +1 -0
- package/dist/lib/room-drawn-floor.js +88 -0
- package/dist/lib/room-floor-choices.d.ts +11 -0
- package/dist/lib/room-floor-choices.d.ts.map +1 -0
- package/dist/lib/room-floor-choices.js +60 -0
- package/dist/lib/room-floor-feasibility.d.ts +25 -0
- package/dist/lib/room-floor-feasibility.d.ts.map +1 -0
- package/dist/lib/room-floor-feasibility.js +293 -0
- package/dist/lib/room-floor-plate.d.ts +3 -0
- package/dist/lib/room-floor-plate.d.ts.map +1 -0
- package/dist/lib/room-floor-plate.js +4 -0
- package/dist/lib/room-graph.d.ts +79 -0
- package/dist/lib/room-graph.d.ts.map +1 -0
- package/dist/lib/room-graph.js +1265 -0
- package/dist/lib/room-name.d.ts +10 -0
- package/dist/lib/room-name.d.ts.map +1 -0
- package/dist/lib/room-name.js +22 -0
- package/dist/lib/room-topology-index.d.ts +53 -5
- package/dist/lib/room-topology-index.d.ts.map +1 -1
- package/dist/lib/room-topology-index.js +176 -30
- package/dist/lib/room-vertical-placement.d.ts +12 -0
- package/dist/lib/room-vertical-placement.d.ts.map +1 -0
- package/dist/lib/room-vertical-placement.js +28 -0
- package/dist/lib/room-zone-adoption.d.ts +74 -0
- package/dist/lib/room-zone-adoption.d.ts.map +1 -0
- package/dist/lib/room-zone-adoption.js +150 -0
- package/dist/lib/setback-envelope.d.ts +73 -0
- package/dist/lib/setback-envelope.d.ts.map +1 -0
- package/dist/lib/setback-envelope.js +506 -0
- package/dist/lib/slab-polygon.d.ts.map +1 -1
- package/dist/lib/slab-polygon.js +33 -12
- package/dist/lib/slots.d.ts +20 -0
- package/dist/lib/slots.d.ts.map +1 -1
- package/dist/lib/slots.js +44 -0
- package/dist/lib/space-detection.d.ts +14 -94
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +244 -1616
- package/dist/lib/structure-commit.d.ts +38 -0
- package/dist/lib/structure-commit.d.ts.map +1 -0
- package/dist/lib/structure-commit.js +52 -0
- package/dist/lib/structure-kernel.d.ts +66 -0
- package/dist/lib/structure-kernel.d.ts.map +1 -0
- package/dist/lib/structure-kernel.js +735 -0
- package/dist/lib/structure-reconcile.d.ts +15 -0
- package/dist/lib/structure-reconcile.d.ts.map +1 -0
- package/dist/lib/structure-reconcile.js +218 -0
- package/dist/lib/terrain-contours.d.ts +29 -0
- package/dist/lib/terrain-contours.d.ts.map +1 -0
- package/dist/lib/terrain-contours.js +199 -0
- package/dist/lib/terrain-source-persisted.d.ts +42 -0
- package/dist/lib/terrain-source-persisted.d.ts.map +1 -0
- package/dist/lib/terrain-source-persisted.js +68 -0
- package/dist/lib/terrain-source.d.ts +2 -40
- package/dist/lib/terrain-source.d.ts.map +1 -1
- package/dist/lib/terrain-source.js +2 -68
- package/dist/lib/terrain-support-query.d.ts +83 -0
- package/dist/lib/terrain-support-query.d.ts.map +1 -0
- package/dist/lib/terrain-support-query.js +187 -0
- package/dist/lib/terrain-support.d.ts +1 -77
- package/dist/lib/terrain-support.d.ts.map +1 -1
- package/dist/lib/terrain-support.js +3 -181
- package/dist/lib/unit-containment.js +2 -2
- package/dist/lib/unit-report.d.ts.map +1 -1
- package/dist/lib/unit-report.js +5 -4
- package/dist/lib/zone-colors.d.ts +11 -0
- package/dist/lib/zone-colors.d.ts.map +1 -0
- package/dist/lib/zone-colors.js +32 -0
- package/dist/lib/zone-quantities.d.ts.map +1 -1
- package/dist/lib/zone-quantities.js +113 -223
- package/dist/material-library.d.ts +9 -1
- package/dist/material-library.d.ts.map +1 -1
- package/dist/material-library.js +550 -1
- package/dist/node-slots/block.d.ts +7 -0
- package/dist/node-slots/block.d.ts.map +1 -0
- package/dist/node-slots/block.js +27 -0
- package/dist/node-slots/cabinet.d.ts +4 -0
- package/dist/node-slots/cabinet.d.ts.map +1 -0
- package/dist/node-slots/cabinet.js +24 -0
- package/dist/node-slots/ceiling.d.ts +6 -0
- package/dist/node-slots/ceiling.d.ts.map +1 -0
- package/dist/node-slots/ceiling.js +7 -0
- package/dist/node-slots/column.d.ts +9 -0
- package/dist/node-slots/column.d.ts.map +1 -0
- package/dist/node-slots/column.js +24 -0
- package/dist/node-slots/door.d.ts +9 -0
- package/dist/node-slots/door.d.ts.map +1 -0
- package/dist/node-slots/door.js +20 -0
- package/dist/node-slots/duct.d.ts +5 -0
- package/dist/node-slots/duct.d.ts.map +1 -0
- package/dist/node-slots/duct.js +5 -0
- package/dist/node-slots/elevator.d.ts +9 -0
- package/dist/node-slots/elevator.d.ts.map +1 -0
- package/dist/node-slots/elevator.js +17 -0
- package/dist/node-slots/fence.d.ts +10 -0
- package/dist/node-slots/fence.d.ts.map +1 -0
- package/dist/node-slots/fence.js +23 -0
- package/dist/node-slots/index.d.ts +25 -0
- package/dist/node-slots/index.d.ts.map +1 -0
- package/dist/node-slots/index.js +92 -0
- package/dist/node-slots/lean-to-extension.d.ts +5 -0
- package/dist/node-slots/lean-to-extension.d.ts.map +1 -0
- package/dist/node-slots/lean-to-extension.js +15 -0
- package/dist/node-slots/procedural-item.d.ts +4 -0
- package/dist/node-slots/procedural-item.d.ts.map +1 -0
- package/dist/node-slots/procedural-item.js +3 -0
- package/dist/node-slots/roof-accessories.d.ts +9 -0
- package/dist/node-slots/roof-accessories.d.ts.map +1 -0
- package/dist/node-slots/roof-accessories.js +34 -0
- package/dist/node-slots/shelf.d.ts +9 -0
- package/dist/node-slots/shelf.d.ts.map +1 -0
- package/dist/node-slots/shelf.js +30 -0
- package/dist/node-slots/slab.d.ts +7 -0
- package/dist/node-slots/slab.d.ts.map +1 -0
- package/dist/node-slots/slab.js +21 -0
- package/dist/node-slots/stair.d.ts +8 -0
- package/dist/node-slots/stair.d.ts.map +1 -0
- package/dist/node-slots/stair.js +17 -0
- package/dist/node-slots/wall.d.ts +12 -0
- package/dist/node-slots/wall.d.ts.map +1 -0
- package/dist/node-slots/wall.js +55 -0
- package/dist/node-slots/window.d.ts +5 -0
- package/dist/node-slots/window.d.ts.map +1 -0
- package/dist/node-slots/window.js +11 -0
- package/dist/procedural-items/design-placement.d.ts +49 -0
- package/dist/procedural-items/design-placement.d.ts.map +1 -0
- package/dist/procedural-items/design-placement.js +129 -0
- package/dist/procedural-items/design.d.ts +261 -0
- package/dist/procedural-items/design.d.ts.map +1 -0
- package/dist/procedural-items/design.js +707 -0
- package/dist/procedural-items/fixtures.d.ts +464 -24
- package/dist/procedural-items/fixtures.d.ts.map +1 -1
- package/dist/procedural-items/index.d.ts +5 -0
- package/dist/procedural-items/index.d.ts.map +1 -1
- package/dist/procedural-items/index.js +5 -0
- package/dist/procedural-items/integration.d.ts +127 -6
- package/dist/procedural-items/integration.d.ts.map +1 -1
- package/dist/procedural-items/joints.d.ts +56 -0
- package/dist/procedural-items/joints.d.ts.map +1 -0
- package/dist/procedural-items/joints.js +251 -0
- package/dist/procedural-items/library-colors.d.ts +12 -0
- package/dist/procedural-items/library-colors.d.ts.map +1 -1
- package/dist/procedural-items/library-colors.js +37 -3
- package/dist/procedural-items/motion-controller.d.ts +29 -0
- package/dist/procedural-items/motion-controller.d.ts.map +1 -0
- package/dist/procedural-items/motion-controller.js +130 -0
- package/dist/procedural-items/node.d.ts +490 -24
- package/dist/procedural-items/node.d.ts.map +1 -1
- package/dist/procedural-items/query.d.ts +19 -1
- package/dist/procedural-items/query.d.ts.map +1 -1
- package/dist/procedural-items/query.js +131 -48
- package/dist/procedural-items/recipe.d.ts +258 -14
- package/dist/procedural-items/recipe.d.ts.map +1 -1
- package/dist/procedural-items/recipe.js +933 -61
- package/dist/procedural-items/section.d.ts +27 -0
- package/dist/procedural-items/section.d.ts.map +1 -0
- package/dist/procedural-items/section.js +237 -0
- package/dist/procedural-items/spatial.d.ts +21 -0
- package/dist/procedural-items/spatial.d.ts.map +1 -1
- package/dist/procedural-items/spatial.js +90 -0
- package/dist/registry/handles.d.ts +30 -1
- package/dist/registry/handles.d.ts.map +1 -1
- package/dist/registry/index.d.ts +7 -5
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +4 -2
- package/dist/registry/mechanism.d.ts +9 -0
- package/dist/registry/mechanism.d.ts.map +1 -0
- package/dist/registry/mechanism.js +21 -0
- package/dist/registry/registry.d.ts +6 -3
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +59 -22
- package/dist/registry/scene-api.d.ts +20 -0
- package/dist/registry/scene-api.d.ts.map +1 -1
- package/dist/registry/scene-api.js +26 -13
- package/dist/registry/subtree.d.ts +8 -0
- package/dist/registry/subtree.d.ts.map +1 -1
- package/dist/registry/subtree.js +59 -0
- package/dist/registry/types.d.ts +352 -13
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/schema/__fixtures__/node-fixtures.d.ts.map +1 -1
- package/dist/schema/__fixtures__/node-fixtures.js +2 -0
- package/dist/schema/assembly.d.ts +153 -0
- package/dist/schema/assembly.d.ts.map +1 -0
- package/dist/schema/assembly.js +155 -0
- package/dist/schema/asset-url.d.ts +2 -1
- package/dist/schema/asset-url.d.ts.map +1 -1
- package/dist/schema/asset-url.js +5 -2
- package/dist/schema/base.d.ts +26 -0
- package/dist/schema/base.d.ts.map +1 -1
- package/dist/schema/base.js +2 -0
- package/dist/schema/collection-templates.d.ts +46 -0
- package/dist/schema/collection-templates.d.ts.map +1 -0
- package/dist/schema/collection-templates.js +14 -0
- package/dist/schema/collections.d.ts +7 -0
- package/dist/schema/collections.d.ts.map +1 -1
- package/dist/schema/cut.d.ts +29 -0
- package/dist/schema/cut.d.ts.map +1 -0
- package/dist/schema/cut.js +50 -0
- package/dist/schema/geometry-metadata.d.ts +51 -0
- package/dist/schema/geometry-metadata.d.ts.map +1 -0
- package/dist/schema/geometry-metadata.js +57 -0
- package/dist/schema/geometry-source.d.ts +250 -0
- package/dist/schema/geometry-source.d.ts.map +1 -0
- package/dist/schema/geometry-source.js +130 -0
- package/dist/schema/index.d.ts +20 -7
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +22 -5
- package/dist/schema/nodes/block.d.ts +28 -2
- package/dist/schema/nodes/block.d.ts.map +1 -1
- package/dist/schema/nodes/block.js +22 -9
- package/dist/schema/nodes/box-vent.d.ts +26 -0
- package/dist/schema/nodes/box-vent.d.ts.map +1 -1
- package/dist/schema/nodes/building.d.ts +26 -0
- package/dist/schema/nodes/building.d.ts.map +1 -1
- package/dist/schema/nodes/cabinet.d.ts +61 -9
- package/dist/schema/nodes/cabinet.d.ts.map +1 -1
- package/dist/schema/nodes/ceiling.d.ts +37 -0
- package/dist/schema/nodes/ceiling.d.ts.map +1 -1
- package/dist/schema/nodes/ceiling.js +8 -0
- package/dist/schema/nodes/chimney.d.ts +26 -0
- package/dist/schema/nodes/chimney.d.ts.map +1 -1
- package/dist/schema/nodes/column.d.ts +126 -0
- package/dist/schema/nodes/column.d.ts.map +1 -1
- package/dist/schema/nodes/column.js +2 -0
- package/dist/schema/nodes/construction-dimension.d.ts +26 -0
- package/dist/schema/nodes/construction-dimension.d.ts.map +1 -1
- package/dist/schema/nodes/cupola.d.ts +26 -0
- package/dist/schema/nodes/cupola.d.ts.map +1 -1
- package/dist/schema/nodes/curtain-wall.d.ts +129 -0
- package/dist/schema/nodes/curtain-wall.d.ts.map +1 -0
- package/dist/schema/nodes/curtain-wall.js +49 -0
- package/dist/schema/nodes/door.d.ts +141 -22
- package/dist/schema/nodes/door.d.ts.map +1 -1
- package/dist/schema/nodes/door.js +18 -33
- package/dist/schema/nodes/dormer.d.ts +28 -2
- package/dist/schema/nodes/dormer.d.ts.map +1 -1
- package/dist/schema/nodes/downspout.d.ts +27 -1
- package/dist/schema/nodes/downspout.d.ts.map +1 -1
- package/dist/schema/nodes/duct-fitting.d.ts +27 -1
- package/dist/schema/nodes/duct-fitting.d.ts.map +1 -1
- package/dist/schema/nodes/duct-segment.d.ts +27 -1
- package/dist/schema/nodes/duct-segment.d.ts.map +1 -1
- package/dist/schema/nodes/duct-terminal.d.ts +26 -0
- package/dist/schema/nodes/duct-terminal.d.ts.map +1 -1
- package/dist/schema/nodes/elevator.d.ts +26 -0
- package/dist/schema/nodes/elevator.d.ts.map +1 -1
- package/dist/schema/nodes/eyebrow-vent.d.ts +26 -0
- package/dist/schema/nodes/eyebrow-vent.d.ts.map +1 -1
- package/dist/schema/nodes/fence-feature.d.ts +141 -0
- package/dist/schema/nodes/fence-feature.d.ts.map +1 -0
- package/dist/schema/nodes/fence-feature.js +21 -0
- package/dist/schema/nodes/fence.d.ts +186 -0
- package/dist/schema/nodes/fence.d.ts.map +1 -1
- package/dist/schema/nodes/fence.js +92 -7
- package/dist/schema/nodes/floor-opening.d.ts +61 -0
- package/dist/schema/nodes/floor-opening.d.ts.map +1 -0
- package/dist/schema/nodes/floor-opening.js +17 -0
- package/dist/schema/nodes/guide.d.ts +26 -0
- package/dist/schema/nodes/guide.d.ts.map +1 -1
- package/dist/schema/nodes/gutter.d.ts +26 -0
- package/dist/schema/nodes/gutter.d.ts.map +1 -1
- package/dist/schema/nodes/hvac-equipment.d.ts +26 -0
- package/dist/schema/nodes/hvac-equipment.d.ts.map +1 -1
- package/dist/schema/nodes/imported-mesh.d.ts +26 -0
- package/dist/schema/nodes/imported-mesh.d.ts.map +1 -1
- package/dist/schema/nodes/item.d.ts +153 -2
- package/dist/schema/nodes/item.d.ts.map +1 -1
- package/dist/schema/nodes/item.js +13 -0
- package/dist/schema/nodes/lean-to-extension.d.ts +26 -0
- package/dist/schema/nodes/lean-to-extension.d.ts.map +1 -1
- package/dist/schema/nodes/level.d.ts +27 -1
- package/dist/schema/nodes/level.d.ts.map +1 -1
- package/dist/schema/nodes/lineset.d.ts +26 -0
- package/dist/schema/nodes/lineset.d.ts.map +1 -1
- package/dist/schema/nodes/liquid-line.d.ts +26 -0
- package/dist/schema/nodes/liquid-line.d.ts.map +1 -1
- package/dist/schema/nodes/measurement.d.ts +26 -0
- package/dist/schema/nodes/measurement.d.ts.map +1 -1
- package/dist/schema/nodes/opening-types.d.ts +41 -0
- package/dist/schema/nodes/opening-types.d.ts.map +1 -0
- package/dist/schema/nodes/opening-types.js +48 -0
- package/dist/schema/nodes/pipe-fitting.d.ts +26 -0
- package/dist/schema/nodes/pipe-fitting.d.ts.map +1 -1
- package/dist/schema/nodes/pipe-segment.d.ts +26 -0
- package/dist/schema/nodes/pipe-segment.d.ts.map +1 -1
- package/dist/schema/nodes/pipe-trap.d.ts +26 -0
- package/dist/schema/nodes/pipe-trap.d.ts.map +1 -1
- package/dist/schema/nodes/ridge-vent.d.ts +26 -0
- package/dist/schema/nodes/ridge-vent.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment-walls.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment-walls.js +2 -1
- package/dist/schema/nodes/roof-segment.d.ts +30 -2
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +9 -0
- package/dist/schema/nodes/roof.d.ts +101 -0
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +6 -0
- package/dist/schema/nodes/scan.d.ts +26 -0
- package/dist/schema/nodes/scan.d.ts.map +1 -1
- package/dist/schema/nodes/separator.d.ts +50 -0
- package/dist/schema/nodes/separator.d.ts.map +1 -0
- package/dist/schema/nodes/separator.js +8 -0
- package/dist/schema/nodes/shelf.d.ts +26 -0
- package/dist/schema/nodes/shelf.d.ts.map +1 -1
- package/dist/schema/nodes/site.d.ts +192 -0
- package/dist/schema/nodes/site.d.ts.map +1 -1
- package/dist/schema/nodes/site.js +178 -1
- package/dist/schema/nodes/skylight.d.ts +30 -4
- package/dist/schema/nodes/skylight.d.ts.map +1 -1
- package/dist/schema/nodes/slab.d.ts +84 -0
- package/dist/schema/nodes/slab.d.ts.map +1 -1
- package/dist/schema/nodes/slab.js +37 -2
- package/dist/schema/nodes/solar-panel.d.ts +26 -0
- package/dist/schema/nodes/solar-panel.d.ts.map +1 -1
- package/dist/schema/nodes/spawn.d.ts +26 -0
- package/dist/schema/nodes/spawn.d.ts.map +1 -1
- package/dist/schema/nodes/stair-construction.d.ts +21 -0
- package/dist/schema/nodes/stair-construction.d.ts.map +1 -0
- package/dist/schema/nodes/stair-construction.js +13 -0
- package/dist/schema/nodes/stair-design-targets.d.ts +9 -0
- package/dist/schema/nodes/stair-design-targets.d.ts.map +1 -0
- package/dist/schema/nodes/stair-design-targets.js +7 -0
- package/dist/schema/nodes/stair-segment.d.ts +72 -4
- package/dist/schema/nodes/stair-segment.d.ts.map +1 -1
- package/dist/schema/nodes/stair-segment.js +13 -0
- package/dist/schema/nodes/stair.d.ts +119 -2
- package/dist/schema/nodes/stair.d.ts.map +1 -1
- package/dist/schema/nodes/stair.js +59 -2
- package/dist/schema/nodes/structural-grid.d.ts +26 -0
- package/dist/schema/nodes/structural-grid.d.ts.map +1 -1
- package/dist/schema/nodes/surface-hole-metadata.d.ts +3 -0
- package/dist/schema/nodes/surface-hole-metadata.d.ts.map +1 -1
- package/dist/schema/nodes/surface-hole-metadata.js +2 -1
- package/dist/schema/nodes/surface-paint-region.d.ts +14 -0
- package/dist/schema/nodes/surface-paint-region.d.ts.map +1 -0
- package/dist/schema/nodes/surface-paint-region.js +12 -0
- package/dist/schema/nodes/turbine-vent.d.ts +26 -0
- package/dist/schema/nodes/turbine-vent.d.ts.map +1 -1
- package/dist/schema/nodes/unit.d.ts +26 -0
- package/dist/schema/nodes/unit.d.ts.map +1 -1
- package/dist/schema/nodes/wall.d.ts +423 -59
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +188 -186
- package/dist/schema/nodes/window.d.ts +139 -20
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/nodes/window.js +12 -14
- package/dist/schema/nodes/zone.d.ts +69 -1
- package/dist/schema/nodes/zone.d.ts.map +1 -1
- package/dist/schema/nodes/zone.js +46 -0
- package/dist/schema/provenance.d.ts +118 -0
- package/dist/schema/provenance.d.ts.map +1 -0
- package/dist/schema/provenance.js +76 -0
- package/dist/schema/source-ref.d.ts +23 -0
- package/dist/schema/source-ref.d.ts.map +1 -0
- package/dist/schema/source-ref.js +29 -0
- package/dist/schema/types.d.ts +3389 -67
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +7 -0
- package/dist/services/__fixtures__/hosting.d.ts +3 -0
- package/dist/services/__fixtures__/hosting.d.ts.map +1 -0
- package/dist/services/__fixtures__/hosting.js +9 -0
- package/dist/services/__fixtures__/shelf-surface-rows.d.ts +4 -0
- package/dist/services/__fixtures__/shelf-surface-rows.d.ts.map +1 -0
- package/dist/services/__fixtures__/shelf-surface-rows.js +18 -0
- package/dist/services/alignment-anchors.d.ts +2 -1
- package/dist/services/alignment-anchors.d.ts.map +1 -1
- package/dist/services/alignment-anchors.js +9 -6
- package/dist/services/hosting.d.ts +3 -0
- package/dist/services/hosting.d.ts.map +1 -1
- package/dist/services/hosting.js +24 -7
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +4 -4
- package/dist/services/level-height.d.ts.map +1 -1
- package/dist/services/level-height.js +6 -4
- package/dist/services/snap.d.ts +3 -0
- package/dist/services/snap.d.ts.map +1 -1
- package/dist/services/snap.js +11 -0
- package/dist/services/storey.d.ts +21 -1
- package/dist/services/storey.d.ts.map +1 -1
- package/dist/services/storey.js +94 -8
- package/dist/services/surface-hosting.d.ts +6 -2
- package/dist/services/surface-hosting.d.ts.map +1 -1
- package/dist/services/surface-hosting.js +51 -11
- package/dist/store/actions/node-actions.d.ts +4563 -8
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +497 -269
- package/dist/store/derived-node-guard.d.ts +84 -0
- package/dist/store/derived-node-guard.d.ts.map +1 -0
- package/dist/store/derived-node-guard.js +586 -0
- package/dist/store/history-control.d.ts +34 -0
- package/dist/store/history-control.d.ts.map +1 -1
- package/dist/store/history-control.js +99 -1
- package/dist/store/history-drafts.d.ts +48 -0
- package/dist/store/history-drafts.d.ts.map +1 -0
- package/dist/store/history-drafts.js +403 -0
- package/dist/store/history-invalidation.d.ts.map +1 -1
- package/dist/store/history-invalidation.js +1 -0
- package/dist/store/item-interaction.d.ts +28 -0
- package/dist/store/item-interaction.d.ts.map +1 -0
- package/dist/store/item-interaction.js +34 -0
- package/dist/store/registered-node-defaults.d.ts +11 -0
- package/dist/store/registered-node-defaults.d.ts.map +1 -0
- package/dist/store/registered-node-defaults.js +25 -0
- package/dist/store/scene-annotations.d.ts +8969 -0
- package/dist/store/scene-annotations.d.ts.map +1 -0
- package/dist/store/scene-annotations.js +107 -0
- package/dist/store/use-interactive.d.ts +23 -1
- package/dist/store/use-interactive.d.ts.map +1 -1
- package/dist/store/use-interactive.js +128 -5
- package/dist/store/use-scene.d.ts +68 -12
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +429 -306
- package/dist/systems/elevator/elevator-opening-sync.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-opening-sync.js +4 -6
- package/dist/systems/elevator/elevator-opening-system.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-opening-system.js +12 -6
- package/dist/systems/elevator/elevator-service.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-service.js +8 -3
- package/dist/systems/fence/fence-centerline.d.ts.map +1 -1
- package/dist/systems/fence/fence-centerline.js +6 -5
- package/dist/systems/fence/fence-features.d.ts +36 -0
- package/dist/systems/fence/fence-features.d.ts.map +1 -0
- package/dist/systems/fence/fence-features.js +105 -0
- package/dist/systems/fence/fence-spline.d.ts +8 -5
- package/dist/systems/fence/fence-spline.d.ts.map +1 -1
- package/dist/systems/fence/fence-spline.js +51 -16
- package/dist/systems/owned-floor-openings.d.ts +9 -0
- package/dist/systems/owned-floor-openings.d.ts.map +1 -0
- package/dist/systems/owned-floor-openings.js +326 -0
- package/dist/systems/reconcile-owned-floor-openings.d.ts +3 -0
- package/dist/systems/reconcile-owned-floor-openings.d.ts.map +1 -0
- package/dist/systems/reconcile-owned-floor-openings.js +25 -0
- package/dist/systems/slab/__fixtures__/doorway-steps.d.ts +8 -0
- package/dist/systems/slab/__fixtures__/doorway-steps.d.ts.map +1 -0
- package/dist/systems/slab/__fixtures__/doorway-steps.js +62 -0
- package/dist/systems/slab/__fixtures__/floor-step.d.ts +5636 -0
- package/dist/systems/slab/__fixtures__/floor-step.d.ts.map +1 -0
- package/dist/systems/slab/__fixtures__/floor-step.js +66 -0
- package/dist/systems/slab/__fixtures__/raised-room.d.ts +5775 -0
- package/dist/systems/slab/__fixtures__/raised-room.d.ts.map +1 -0
- package/dist/systems/slab/__fixtures__/raised-room.js +54 -0
- package/dist/systems/slab/ensure-slab-openings.d.ts +9 -0
- package/dist/systems/slab/ensure-slab-openings.d.ts.map +1 -0
- package/dist/systems/slab/ensure-slab-openings.js +41 -0
- package/dist/systems/slab/slab-support.d.ts +25 -6
- package/dist/systems/slab/slab-support.d.ts.map +1 -1
- package/dist/systems/slab/slab-support.js +471 -54
- package/dist/systems/stair/stair-base-elevation.d.ts +3 -0
- package/dist/systems/stair/stair-base-elevation.d.ts.map +1 -0
- package/dist/systems/stair/stair-base-elevation.js +49 -0
- package/dist/systems/stair/stair-clearance.d.ts +39 -0
- package/dist/systems/stair/stair-clearance.d.ts.map +1 -0
- package/dist/systems/stair/stair-clearance.js +508 -0
- package/dist/systems/stair/stair-construction.d.ts +37 -0
- package/dist/systems/stair/stair-construction.d.ts.map +1 -0
- package/dist/systems/stair/stair-construction.js +314 -0
- package/dist/systems/stair/stair-detail-budget.d.ts +13 -0
- package/dist/systems/stair/stair-detail-budget.d.ts.map +1 -0
- package/dist/systems/stair/stair-detail-budget.js +64 -0
- package/dist/systems/stair/stair-flight.d.ts +2 -2
- package/dist/systems/stair/stair-flight.d.ts.map +1 -1
- package/dist/systems/stair/stair-flight.js +4 -3
- package/dist/systems/stair/stair-floor-footprints.d.ts +7 -0
- package/dist/systems/stair/stair-floor-footprints.d.ts.map +1 -0
- package/dist/systems/stair/stair-floor-footprints.js +113 -0
- package/dist/systems/stair/stair-footprint.d.ts +3 -1
- package/dist/systems/stair/stair-footprint.d.ts.map +1 -1
- package/dist/systems/stair/stair-footprint.js +97 -44
- package/dist/systems/stair/stair-layout.d.ts +39 -0
- package/dist/systems/stair/stair-layout.d.ts.map +1 -0
- package/dist/systems/stair/stair-layout.js +58 -0
- package/dist/systems/stair/stair-opening-preview.d.ts +1650 -84
- package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-sync.d.ts +8 -2
- package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-sync.js +136 -315
- package/dist/systems/stair/stair-opening-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-system.js +40 -8
- package/dist/systems/stair/stair-presets.d.ts +276 -0
- package/dist/systems/stair/stair-presets.d.ts.map +1 -0
- package/dist/systems/stair/stair-presets.js +151 -0
- package/dist/systems/stair/stair-rail-budget.d.ts +6 -0
- package/dist/systems/stair/stair-rail-budget.d.ts.map +1 -0
- package/dist/systems/stair/stair-rail-budget.js +36 -0
- package/dist/systems/stair/stair-rail-path.d.ts +22 -0
- package/dist/systems/stair/stair-rail-path.d.ts.map +1 -0
- package/dist/systems/stair/stair-rail-path.js +497 -0
- package/dist/systems/stair/stair-rise-edit.d.ts +9 -0
- package/dist/systems/stair/stair-rise-edit.d.ts.map +1 -0
- package/dist/systems/stair/stair-rise-edit.js +46 -0
- package/dist/systems/stair/stair-rise-query.d.ts +24 -0
- package/dist/systems/stair/stair-rise-query.d.ts.map +1 -0
- package/dist/systems/stair/stair-rise-query.js +125 -0
- package/dist/systems/stair/stair-rise.d.ts +4 -19
- package/dist/systems/stair/stair-rise.d.ts.map +1 -1
- package/dist/systems/stair/stair-rise.js +8 -71
- package/dist/systems/stair/stair-sizing.d.ts +414 -0
- package/dist/systems/stair/stair-sizing.d.ts.map +1 -0
- package/dist/systems/stair/stair-sizing.js +255 -0
- package/dist/systems/stair/stair-sweep-edit.d.ts +7 -0
- package/dist/systems/stair/stair-sweep-edit.d.ts.map +1 -0
- package/dist/systems/stair/stair-sweep-edit.js +8 -0
- package/dist/systems/stair/stair-walking-line.d.ts +5 -0
- package/dist/systems/stair/stair-walking-line.d.ts.map +1 -0
- package/dist/systems/stair/stair-walking-line.js +91 -0
- package/dist/systems/stair/stair-winder.d.ts +36 -0
- package/dist/systems/stair/stair-winder.d.ts.map +1 -0
- package/dist/systems/stair/stair-winder.js +173 -0
- package/dist/systems/wall/wall-assembly.d.ts +234 -0
- package/dist/systems/wall/wall-assembly.d.ts.map +1 -0
- package/dist/systems/wall/wall-assembly.js +854 -0
- package/dist/systems/wall/wall-curve.d.ts +2 -1
- package/dist/systems/wall/wall-curve.d.ts.map +1 -1
- package/dist/systems/wall/wall-curve.js +21 -5
- package/dist/systems/wall/wall-finish.d.ts +102 -0
- package/dist/systems/wall/wall-finish.d.ts.map +1 -0
- package/dist/systems/wall/wall-finish.js +264 -0
- package/dist/systems/wall/wall-footprint.d.ts +3 -0
- package/dist/systems/wall/wall-footprint.d.ts.map +1 -1
- package/dist/systems/wall/wall-footprint.js +15 -13
- package/dist/systems/wall/wall-frame.d.ts +45 -0
- package/dist/systems/wall/wall-frame.d.ts.map +1 -0
- package/dist/systems/wall/wall-frame.js +162 -0
- package/dist/systems/wall/wall-layer-bands.d.ts +38 -0
- package/dist/systems/wall/wall-layer-bands.d.ts.map +1 -0
- package/dist/systems/wall/wall-layer-bands.js +109 -0
- package/dist/systems/wall/wall-merge.d.ts +57 -0
- package/dist/systems/wall/wall-merge.d.ts.map +1 -0
- package/dist/systems/wall/wall-merge.js +411 -0
- package/dist/systems/wall/wall-mitering.d.ts +6 -5
- package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
- package/dist/systems/wall/wall-mitering.js +70 -20
- package/dist/systems/wall/wall-operations.d.ts +28 -0
- package/dist/systems/wall/wall-operations.d.ts.map +1 -0
- package/dist/systems/wall/wall-operations.js +146 -0
- package/dist/systems/wall/wall-paint-plan.d.ts +30 -0
- package/dist/systems/wall/wall-paint-plan.d.ts.map +1 -0
- package/dist/systems/wall/wall-paint-plan.js +167 -0
- package/dist/systems/wall/wall-room-sides.d.ts +6 -0
- package/dist/systems/wall/wall-room-sides.d.ts.map +1 -0
- package/dist/systems/wall/wall-room-sides.js +14 -0
- package/dist/systems/wall/wall-step-openings.d.ts +17 -0
- package/dist/systems/wall/wall-step-openings.d.ts.map +1 -0
- package/dist/systems/wall/wall-step-openings.js +32 -0
- package/dist/systems/wall/wall-top.d.ts +2 -6
- package/dist/systems/wall/wall-top.d.ts.map +1 -1
- package/dist/systems/wall/wall-top.js +3 -9
- package/dist/systems/wall/wall-topology.d.ts +28 -0
- package/dist/systems/wall/wall-topology.d.ts.map +1 -1
- package/dist/systems/wall/wall-topology.js +458 -9
- package/dist/utils/clone-scene-graph.d.ts +6 -0
- package/dist/utils/clone-scene-graph.d.ts.map +1 -1
- package/dist/utils/clone-scene-graph.js +123 -15
- package/dist/utils/ensure-scene-openings.d.ts +8965 -0
- package/dist/utils/ensure-scene-openings.d.ts.map +1 -0
- package/dist/utils/ensure-scene-openings.js +29 -0
- package/dist/utils/exterior-threshold-migration.d.ts +4 -0
- package/dist/utils/exterior-threshold-migration.d.ts.map +1 -0
- package/dist/utils/exterior-threshold-migration.js +114 -0
- package/dist/utils/floor-follow-migration.d.ts +3 -0
- package/dist/utils/floor-follow-migration.d.ts.map +1 -0
- package/dist/utils/floor-follow-migration.js +29 -0
- package/dist/utils/floor-opening-migration.d.ts +13 -0
- package/dist/utils/floor-opening-migration.d.ts.map +1 -0
- package/dist/utils/floor-opening-migration.js +148 -0
- package/dist/utils/floor-piece-adoption.d.ts +50 -0
- package/dist/utils/floor-piece-adoption.d.ts.map +1 -0
- package/dist/utils/floor-piece-adoption.js +182 -0
- package/dist/utils/floor-plate-migration.d.ts +4507 -0
- package/dist/utils/floor-plate-migration.d.ts.map +1 -0
- package/dist/utils/floor-plate-migration.js +1360 -0
- package/dist/utils/heal-plan-coordinates.d.ts +2 -0
- package/dist/utils/heal-plan-coordinates.d.ts.map +1 -0
- package/dist/utils/heal-plan-coordinates.js +69 -0
- package/dist/utils/heal-scene-graph.d.ts +20 -6
- package/dist/utils/heal-scene-graph.d.ts.map +1 -1
- package/dist/utils/heal-scene-graph.js +61 -16
- package/dist/utils/legacy-material-slots.d.ts +23 -0
- package/dist/utils/legacy-material-slots.d.ts.map +1 -0
- package/dist/utils/legacy-material-slots.js +120 -0
- package/dist/utils/legacy-opening-datums.d.ts +11 -0
- package/dist/utils/legacy-opening-datums.d.ts.map +1 -0
- package/dist/utils/legacy-opening-datums.js +92 -0
- package/dist/utils/legacy-wall-datums.d.ts +6 -0
- package/dist/utils/legacy-wall-datums.d.ts.map +1 -0
- package/dist/utils/legacy-wall-datums.js +199 -0
- package/dist/utils/load-migration.d.ts +28 -0
- package/dist/utils/load-migration.d.ts.map +1 -0
- package/dist/utils/load-migration.js +89 -0
- package/dist/utils/node-defaults.d.ts +37 -0
- package/dist/utils/node-defaults.d.ts.map +1 -0
- package/dist/utils/node-defaults.js +96 -0
- package/dist/utils/normalize-legacy-structure.d.ts +2 -0
- package/dist/utils/normalize-legacy-structure.d.ts.map +1 -0
- package/dist/utils/normalize-legacy-structure.js +61 -0
- package/dist/utils/omit-undefined.d.ts +2 -0
- package/dist/utils/omit-undefined.d.ts.map +1 -0
- package/dist/utils/omit-undefined.js +17 -0
- package/dist/utils/owned-floor-opening-migration.d.ts +4489 -0
- package/dist/utils/owned-floor-opening-migration.d.ts.map +1 -0
- package/dist/utils/owned-floor-opening-migration.js +365 -0
- package/dist/utils/reconcile-structure-on-load.d.ts +8965 -0
- package/dist/utils/reconcile-structure-on-load.d.ts.map +1 -0
- package/dist/utils/reconcile-structure-on-load.js +307 -0
- package/dist/utils/room-zone-migration.d.ts +18 -0
- package/dist/utils/room-zone-migration.d.ts.map +1 -0
- package/dist/utils/room-zone-migration.js +258 -0
- package/dist/utils/scene-migrations.d.ts +16 -1
- package/dist/utils/scene-migrations.d.ts.map +1 -1
- package/dist/utils/scene-migrations.js +15 -1
- package/dist/utils/structure-id.d.ts +4 -0
- package/dist/utils/structure-id.d.ts.map +1 -0
- package/dist/utils/structure-id.js +115 -0
- package/dist/utils/vertical-scene-migration.d.ts +8 -8
- package/dist/utils/vertical-scene-migration.d.ts.map +1 -1
- package/dist/utils/vertical-scene-migration.js +18 -8
- package/dist/utils/wall-assembly-migration.d.ts +14 -0
- package/dist/utils/wall-assembly-migration.d.ts.map +1 -0
- package/dist/utils/wall-assembly-migration.js +23 -0
- package/dist/utils/wall-face-migration.d.ts +23 -0
- package/dist/utils/wall-face-migration.d.ts.map +1 -0
- package/dist/utils/wall-face-migration.js +246 -0
- package/dist/validation/opening-bounds.d.ts +36 -0
- package/dist/validation/opening-bounds.d.ts.map +1 -0
- package/dist/validation/opening-bounds.js +34 -0
- package/dist/validation/validate-build-json.d.ts +2 -0
- package/dist/validation/validate-build-json.d.ts.map +1 -1
- package/dist/validation/validate-build-json.js +48 -1
- package/package.json +37 -4
- package/dist/services/surface-hosting-procedural-parity.fixtures.d.ts +0 -13
- package/dist/services/surface-hosting-procedural-parity.fixtures.d.ts.map +0 -1
- package/dist/services/surface-hosting-procedural-parity.fixtures.js +0 -4691
- package/dist/services/surface-hosting-shelf-parity.fixtures.d.ts +0 -1060
- package/dist/services/surface-hosting-shelf-parity.fixtures.d.ts.map +0 -1
- package/dist/services/surface-hosting-shelf-parity.fixtures.js +0 -3127
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { refuse } from '../agent-tools/refusal.js';
|
|
2
|
+
import { floorItemFit } from '../building/floor-item-fit.js';
|
|
3
|
+
import { flushMountRotation, geometrySurfaceAt, geometryUndersideAt, mountsFlush, } from '../lib/geometry-surfaces.js';
|
|
4
|
+
import { ItemNode } from '../schema/index.js';
|
|
5
|
+
import { getWallLocalFaceZ } from '../systems/wall/wall-frame.js';
|
|
6
|
+
import { collectDoorKeepouts } from './door-clearance.js';
|
|
7
|
+
import { targetLevel } from './level-target.js';
|
|
8
|
+
import { pointInPolygon, projectWorldPointToWallLocalX, wallLength, } from './plan-geometry.js';
|
|
9
|
+
/**
|
|
10
|
+
* What belongs on the lot rather than in a room. Anything else placed outside every room of a
|
|
11
|
+
* level that has rooms is refused: in production a model that had fallen back to raw place_items
|
|
12
|
+
* put a bed on the lawn (2026-09-04).
|
|
13
|
+
*/
|
|
14
|
+
const OUTDOOR_ASSET = /tree|plant|shrub|bush|hedge|flower|palm|\bfir\b|bench|grill|bbq|barbecue|\bcar\b|vehicle|truck|bike|bicycle|pool|fence|gate|lamp ?post|street|outdoor|garden|patio|deck|swing|trampoline|planter|mailbox|umbrella|parasol/i;
|
|
15
|
+
const isOutdoor = (asset) => OUTDOOR_ASSET.test(`${asset.name} ${asset.category ?? ''} ${(asset.tags ?? []).join(' ')}`);
|
|
16
|
+
function roomsOn(nodes, levelId) {
|
|
17
|
+
return Object.values(nodes).flatMap((node) => node.type === 'zone' && node.parentId === levelId && node.polygon.length >= 3
|
|
18
|
+
? [node.polygon]
|
|
19
|
+
: []);
|
|
20
|
+
}
|
|
21
|
+
const refused = (assetId, code, error) => ({
|
|
22
|
+
ok: false,
|
|
23
|
+
assetId,
|
|
24
|
+
code,
|
|
25
|
+
error,
|
|
26
|
+
});
|
|
27
|
+
const round = (value) => Math.round(value * 100) / 100;
|
|
28
|
+
/**
|
|
29
|
+
* A floor item that does not fit where it is put (`floorItemFit`), refused with what to do:
|
|
30
|
+
* one its room cannot hold in any turn points to a smaller one; one in a door's way names the door
|
|
31
|
+
* and a spot in the room that clears every door, when there is one.
|
|
32
|
+
*/
|
|
33
|
+
function floorFit(nodes, levelId, entry, asset, doors) {
|
|
34
|
+
const misfit = floorItemFit(nodes, {
|
|
35
|
+
levelId,
|
|
36
|
+
x: entry.x,
|
|
37
|
+
z: entry.z,
|
|
38
|
+
rotationDeg: entry.rotation ?? 0,
|
|
39
|
+
dimensions: asset.dimensions,
|
|
40
|
+
doors,
|
|
41
|
+
});
|
|
42
|
+
if (!misfit)
|
|
43
|
+
return null;
|
|
44
|
+
const [width = 1, , depth = 1] = asset.dimensions ?? [1, 1, 1];
|
|
45
|
+
if (misfit.code === 'too_large_for_room')
|
|
46
|
+
return refused(entry.assetId, 'too_large_for_room', `"${asset.name}" is ${round(width)} × ${round(depth)} m; the room it stands in is ${round(misfit.room.width)} × ${round(misfit.room.depth)} m, so it fits in no turn. Pick a smaller one (search_assets), or build one at the room's size with add_object.`);
|
|
47
|
+
const { candidate } = misfit;
|
|
48
|
+
return refused(entry.assetId, 'blocks_door', `"${asset.name}" at (${entry.x}, ${entry.z}) stands in the space door ${misfit.doorId} needs to open and be walked through.${candidate
|
|
49
|
+
? ` A spot that fits: (${round(candidate.x)}, ${round(candidate.z)}), turned ${candidate.rotationDeg}°.`
|
|
50
|
+
: ' No spot in this room clears its doors: pick a smaller one, or none.'}`);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* On a wall: along it from its start, the height given for the item's bottom, on the side of the
|
|
54
|
+
* wall the point is on (the front faces the wall's left, the back is turned round), centred in the
|
|
55
|
+
* wall or, for a wall-side fixture, on its face. Kept inside the wall's span and height, as the
|
|
56
|
+
* editor's wall placement keeps it.
|
|
57
|
+
*/
|
|
58
|
+
function onWall(wall, entry, asset) {
|
|
59
|
+
const [width = 0, height = 0] = asset.dimensions ?? [1, 1, 1];
|
|
60
|
+
const wallHeight = wall.height ?? 2.5;
|
|
61
|
+
if (entry.y === undefined)
|
|
62
|
+
return refused(entry.assetId, 'height_required', `On wall ${wall.id}, give y: the height of the item's bottom above the floor (its top, y + ${height.toFixed(2)} m, must stay under the wall's ${wallHeight.toFixed(2)} m). Art centred at eye level is 1.5 − its height / 2; a sconce about 1.5.`);
|
|
63
|
+
if (height > wallHeight)
|
|
64
|
+
return refused(entry.assetId, 'item_too_tall', `"${asset.name}" is ${height.toFixed(2)} m tall; wall ${wall.id} is ${wallHeight.toFixed(2)} m. Pick a shorter item or a taller wall.`);
|
|
65
|
+
const length = wallLength(wall);
|
|
66
|
+
const along = projectWorldPointToWallLocalX(wall, [entry.x, 0, entry.z]);
|
|
67
|
+
const x = Math.max(width / 2, Math.min(length - width / 2, along));
|
|
68
|
+
const y = Math.max(0, Math.min(wallHeight - height, entry.y));
|
|
69
|
+
const [dx, dz] = [wall.end[0] - wall.start[0], wall.end[1] - wall.start[1]];
|
|
70
|
+
// The wall's left (its local +z) is its front.
|
|
71
|
+
const left = -dz * (entry.x - wall.start[0]) + dx * (entry.z - wall.start[1]) >= 0;
|
|
72
|
+
const side = left ? 'front' : 'back';
|
|
73
|
+
const z = asset.attachTo === 'wall-side' ? getWallLocalFaceZ(wall, left ? 'a' : 'b') : 0;
|
|
74
|
+
const turn = (left ? 0 : Math.PI) + ((entry.rotation ?? 0) * Math.PI) / 180;
|
|
75
|
+
return {
|
|
76
|
+
parentId: wall.id,
|
|
77
|
+
position: [x, y, z],
|
|
78
|
+
rotation: [0, turn, 0],
|
|
79
|
+
extra: { wallId: wall.id, wallT: length ? x / length : 0, side },
|
|
80
|
+
side,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* On an item standing on the floor: in its frame (translation, turn, scale). An object built with
|
|
85
|
+
* add_object takes the item on its real surface under the point, or hangs a ceiling item from its
|
|
86
|
+
* underside above it; a catalog item, on its top. A height given (y above 0) is kept.
|
|
87
|
+
*/
|
|
88
|
+
function onItem(host, entry, asset) {
|
|
89
|
+
const [hx, hy, hz] = host.position;
|
|
90
|
+
const yaw = host.rotation[1] ?? 0;
|
|
91
|
+
const [dx, dz] = [entry.x - hx, entry.z - hz];
|
|
92
|
+
const lx = (Math.cos(yaw) * dx - Math.sin(yaw) * dz) / host.scale[0];
|
|
93
|
+
const lz = (Math.sin(yaw) * dx + Math.cos(yaw) * dz) / host.scale[2];
|
|
94
|
+
const turn = ((entry.rotation ?? 0) * Math.PI) / 180 - yaw;
|
|
95
|
+
const hanging = asset.attachTo === 'ceiling' && !!host.source;
|
|
96
|
+
const surface = host.source
|
|
97
|
+
? hanging
|
|
98
|
+
? geometryUndersideAt(host.source.manifest, lx, lz)
|
|
99
|
+
: geometrySurfaceAt(host.source.manifest, lx, lz)
|
|
100
|
+
: null;
|
|
101
|
+
const explicit = !hanging && entry.y !== undefined && entry.y > 0;
|
|
102
|
+
const flush = hanging && mountsFlush(asset);
|
|
103
|
+
const drop = hanging ? (flush ? 0.02 : (asset.dimensions?.[1] ?? 0)) : 0;
|
|
104
|
+
const y = explicit
|
|
105
|
+
? entry.y - hy
|
|
106
|
+
: surface
|
|
107
|
+
? surface.y * host.scale[1] - drop
|
|
108
|
+
: (host.asset.surface?.height ?? host.asset.dimensions[1]) * host.scale[1];
|
|
109
|
+
return {
|
|
110
|
+
parentId: host.id,
|
|
111
|
+
position: [lx * host.scale[0], y, lz * host.scale[2]],
|
|
112
|
+
// A flush fixture tilts with a sloped underside (a can in a vault plane).
|
|
113
|
+
rotation: flush && surface && 'normal' in surface
|
|
114
|
+
? flushMountRotation(surface.normal, turn)
|
|
115
|
+
: [0, turn, 0],
|
|
116
|
+
...(!explicit && surface?.part ? { restingOn: surface.part } : {}),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* `place_items`: catalog items on a level's floor, or on the host each names (a wall, a ceiling,
|
|
121
|
+
* an item standing on the floor), each placed or refused on its own.
|
|
122
|
+
*/
|
|
123
|
+
export const placeItems = (nodes, input, context) => {
|
|
124
|
+
const catalog = context.catalog;
|
|
125
|
+
if (!catalog)
|
|
126
|
+
refuse('no_catalog', 'This host has no item library to place from; build it with add_object.');
|
|
127
|
+
const level = targetLevel(nodes, input, context);
|
|
128
|
+
const create = [];
|
|
129
|
+
const doorsOn = {};
|
|
130
|
+
const make = (asset, pose) => {
|
|
131
|
+
const node = ItemNode.parse({
|
|
132
|
+
name: asset.name,
|
|
133
|
+
parentId: pose.parentId,
|
|
134
|
+
position: pose.position,
|
|
135
|
+
rotation: pose.rotation,
|
|
136
|
+
asset,
|
|
137
|
+
...pose.extra,
|
|
138
|
+
});
|
|
139
|
+
create.push({ node, parentId: pose.parentId });
|
|
140
|
+
return node;
|
|
141
|
+
};
|
|
142
|
+
const items = input.items.map((entry) => {
|
|
143
|
+
const { assetId, x, z, rotation = 0, targetNodeId } = entry;
|
|
144
|
+
const asset = catalog.find((candidate) => candidate.id === assetId);
|
|
145
|
+
if (!asset)
|
|
146
|
+
return refused(assetId, 'asset_not_found', `Asset "${assetId}" is not in the library. Find a valid id with search_assets.`);
|
|
147
|
+
const host = targetNodeId ? nodes[targetNodeId] : undefined;
|
|
148
|
+
if (targetNodeId && !host)
|
|
149
|
+
return refused(assetId, 'host_not_found', `Host not found: ${targetNodeId}.`);
|
|
150
|
+
if (host?.type === 'wall' || host?.type === 'ceiling' || host?.type === 'item') {
|
|
151
|
+
let pose;
|
|
152
|
+
if (host.type === 'wall')
|
|
153
|
+
pose = onWall(host, entry, asset);
|
|
154
|
+
else if (host.type === 'ceiling')
|
|
155
|
+
// Under its underside, its top flush with it.
|
|
156
|
+
pose = {
|
|
157
|
+
parentId: host.id,
|
|
158
|
+
position: [x, -(asset.dimensions?.[1] ?? 0), z],
|
|
159
|
+
rotation: [0, (rotation * Math.PI) / 180, 0],
|
|
160
|
+
};
|
|
161
|
+
else {
|
|
162
|
+
if (nodes[host.parentId ?? '']?.type !== 'level')
|
|
163
|
+
return refused(assetId, 'host_not_on_level', `${host.name ?? host.id} rests on ${host.parentId}: only an item standing on a floor hosts another here.`);
|
|
164
|
+
pose = onItem(host, entry, asset);
|
|
165
|
+
}
|
|
166
|
+
if ('ok' in pose)
|
|
167
|
+
return pose;
|
|
168
|
+
const node = make(asset, pose);
|
|
169
|
+
return {
|
|
170
|
+
ok: true,
|
|
171
|
+
itemId: node.id,
|
|
172
|
+
assetId,
|
|
173
|
+
name: asset.name,
|
|
174
|
+
x,
|
|
175
|
+
z,
|
|
176
|
+
hostId: host.id,
|
|
177
|
+
...(pose.side ? { side: pose.side } : {}),
|
|
178
|
+
...(pose.restingOn ? { restingOn: pose.restingOn } : {}),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
// A floor: the level named, or the level holding the room or slab named.
|
|
182
|
+
const floorId = !host
|
|
183
|
+
? level.id
|
|
184
|
+
: host.type === 'level'
|
|
185
|
+
? host.id
|
|
186
|
+
: host.type === 'zone' || host.type === 'slab'
|
|
187
|
+
? (host.parentId ?? '')
|
|
188
|
+
: null;
|
|
189
|
+
if (!floorId || nodes[floorId]?.type !== 'level')
|
|
190
|
+
return refused(assetId, 'unsupported_host', `A ${host?.type} hosts no item: name a wall, a ceiling, an item standing on the floor, or a room, slab or level for its floor.`);
|
|
191
|
+
const rooms = roomsOn(nodes, floorId);
|
|
192
|
+
const room = rooms.find((polygon) => pointInPolygon([x, z], polygon));
|
|
193
|
+
if (rooms.length && !isOutdoor(asset) && !room)
|
|
194
|
+
return refused(assetId, 'outside_rooms', `"${asset.name}" at (${x}, ${z}) is outside every room on this level: indoor items go inside a room (read the rooms with get_zones); trees and garden items may stand outside.`);
|
|
195
|
+
doorsOn[floorId] ??= collectDoorKeepouts(Object.values(nodes), { levelId: floorId });
|
|
196
|
+
const misfit = floorFit(nodes, floorId, entry, asset, doorsOn[floorId]);
|
|
197
|
+
if (misfit)
|
|
198
|
+
return misfit;
|
|
199
|
+
const node = make(asset, {
|
|
200
|
+
parentId: floorId,
|
|
201
|
+
position: [x, 0, z],
|
|
202
|
+
rotation: [0, (rotation * Math.PI) / 180, 0],
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
ok: true,
|
|
206
|
+
itemId: node.id,
|
|
207
|
+
assetId,
|
|
208
|
+
name: asset.name,
|
|
209
|
+
x,
|
|
210
|
+
z,
|
|
211
|
+
...(host ? { hostId: floorId } : {}),
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
const failed = items.length - create.length;
|
|
215
|
+
return {
|
|
216
|
+
result: {
|
|
217
|
+
ok: failed === 0,
|
|
218
|
+
levelId: level.id,
|
|
219
|
+
items,
|
|
220
|
+
message: failed
|
|
221
|
+
? `Placed ${create.length} of ${items.length} items (${failed} refused).`
|
|
222
|
+
: `Placed ${create.length} item${create.length === 1 ? '' : 's'}.`,
|
|
223
|
+
},
|
|
224
|
+
...(create.length ? { changes: { create } } : {}),
|
|
225
|
+
};
|
|
226
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WallNode } from '../schema/index.js';
|
|
2
|
+
export type Vec2 = [number, number];
|
|
3
|
+
export type Vec3 = [number, number, number];
|
|
4
|
+
export declare function distance2D(a: Vec2, b: Vec2): number;
|
|
5
|
+
export declare function wallLength(wall: Pick<WallNode, 'start' | 'end'>): number;
|
|
6
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
7
|
+
export declare function wallLocalXFromT(wall: Pick<WallNode, 'start' | 'end'>, t: number, width: number): number;
|
|
8
|
+
export declare function projectWorldPointToWallLocalX(wall: Pick<WallNode, 'start' | 'end'>, position: Vec3): number;
|
|
9
|
+
export declare function polygonArea(points: Vec2[]): number;
|
|
10
|
+
export declare function polygonBounds(points: Vec2[]): {
|
|
11
|
+
minX: number;
|
|
12
|
+
maxX: number;
|
|
13
|
+
minZ: number;
|
|
14
|
+
maxZ: number;
|
|
15
|
+
width: number;
|
|
16
|
+
depth: number;
|
|
17
|
+
centerX: number;
|
|
18
|
+
centerZ: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function pointInBoundsWithPadding(x: number, z: number, bounds: ReturnType<typeof polygonBounds>, padding: number): boolean;
|
|
21
|
+
export declare function pointOnSegment(point: Vec2, a: Vec2, b: Vec2, tolerance?: number): boolean;
|
|
22
|
+
export declare function pointInPolygon(point: Vec2, polygon: Vec2[], includeBoundary?: boolean): boolean;
|
|
23
|
+
export declare function polygonContainsPolygon(outer: Vec2[], inner: Vec2[]): boolean;
|
|
24
|
+
//# sourceMappingURL=plan-geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-geometry.d.ts","sourceRoot":"","sources":["../../src/agent-operations/plan-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACnC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE3C,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAInD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG,MAAM,CAExE;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGrE;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAC,EACrC,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACZ,MAAM,CAGR;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAC,EACrC,QAAQ,EAAE,IAAI,GACb,MAAM,CAWR;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CASlD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAiBA;AAED,wBAAgB,wBAAwB,CACtC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,EACxC,OAAO,EAAE,MAAM,GACd,OAAO,CAOT;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,SAAO,GAAG,OAAO,CAOvF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,eAAe,UAAO,GAAG,OAAO,CAgB5F;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export function distance2D(a, b) {
|
|
2
|
+
const dx = b[0] - a[0];
|
|
3
|
+
const dz = b[1] - a[1];
|
|
4
|
+
return Math.sqrt(dx * dx + dz * dz);
|
|
5
|
+
}
|
|
6
|
+
export function wallLength(wall) {
|
|
7
|
+
return distance2D(wall.start, wall.end);
|
|
8
|
+
}
|
|
9
|
+
export function clamp(value, min, max) {
|
|
10
|
+
if (max < min)
|
|
11
|
+
return (min + max) / 2;
|
|
12
|
+
return Math.max(min, Math.min(max, value));
|
|
13
|
+
}
|
|
14
|
+
export function wallLocalXFromT(wall, t, width) {
|
|
15
|
+
const length = wallLength(wall);
|
|
16
|
+
return clamp(t * length, width / 2, length - width / 2);
|
|
17
|
+
}
|
|
18
|
+
export function projectWorldPointToWallLocalX(wall, position) {
|
|
19
|
+
const [sx, sz] = wall.start;
|
|
20
|
+
const [ex, ez] = wall.end;
|
|
21
|
+
const dx = ex - sx;
|
|
22
|
+
const dz = ez - sz;
|
|
23
|
+
const len = Math.sqrt(dx * dx + dz * dz);
|
|
24
|
+
if (len === 0)
|
|
25
|
+
return 0;
|
|
26
|
+
const px = position[0] - sx;
|
|
27
|
+
const pz = position[2] - sz;
|
|
28
|
+
const distance = px * (dx / len) + pz * (dz / len);
|
|
29
|
+
return clamp(distance, 0, len);
|
|
30
|
+
}
|
|
31
|
+
export function polygonArea(points) {
|
|
32
|
+
if (points.length < 3)
|
|
33
|
+
return 0;
|
|
34
|
+
let area = 0;
|
|
35
|
+
for (let i = 0; i < points.length; i++) {
|
|
36
|
+
const current = points[i];
|
|
37
|
+
const next = points[(i + 1) % points.length];
|
|
38
|
+
area += current[0] * next[1] - next[0] * current[1];
|
|
39
|
+
}
|
|
40
|
+
return Math.abs(area) / 2;
|
|
41
|
+
}
|
|
42
|
+
export function polygonBounds(points) {
|
|
43
|
+
const xs = points.map((p) => p[0]);
|
|
44
|
+
const zs = points.map((p) => p[1]);
|
|
45
|
+
const minX = Math.min(...xs);
|
|
46
|
+
const maxX = Math.max(...xs);
|
|
47
|
+
const minZ = Math.min(...zs);
|
|
48
|
+
const maxZ = Math.max(...zs);
|
|
49
|
+
return {
|
|
50
|
+
minX,
|
|
51
|
+
maxX,
|
|
52
|
+
minZ,
|
|
53
|
+
maxZ,
|
|
54
|
+
width: maxX - minX,
|
|
55
|
+
depth: maxZ - minZ,
|
|
56
|
+
centerX: (minX + maxX) / 2,
|
|
57
|
+
centerZ: (minZ + maxZ) / 2,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function pointInBoundsWithPadding(x, z, bounds, padding) {
|
|
61
|
+
return (x >= bounds.minX + padding &&
|
|
62
|
+
x <= bounds.maxX - padding &&
|
|
63
|
+
z >= bounds.minZ + padding &&
|
|
64
|
+
z <= bounds.maxZ - padding);
|
|
65
|
+
}
|
|
66
|
+
export function pointOnSegment(point, a, b, tolerance = 1e-6) {
|
|
67
|
+
const cross = (point[1] - a[1]) * (b[0] - a[0]) - (point[0] - a[0]) * (b[1] - a[1]);
|
|
68
|
+
if (Math.abs(cross) > tolerance)
|
|
69
|
+
return false;
|
|
70
|
+
const dot = (point[0] - a[0]) * (b[0] - a[0]) + (point[1] - a[1]) * (b[1] - a[1]);
|
|
71
|
+
if (dot < -tolerance)
|
|
72
|
+
return false;
|
|
73
|
+
const lenSq = (b[0] - a[0]) ** 2 + (b[1] - a[1]) ** 2;
|
|
74
|
+
return dot <= lenSq + tolerance;
|
|
75
|
+
}
|
|
76
|
+
export function pointInPolygon(point, polygon, includeBoundary = true) {
|
|
77
|
+
if (polygon.length < 3)
|
|
78
|
+
return false;
|
|
79
|
+
let inside = false;
|
|
80
|
+
const [x, z] = point;
|
|
81
|
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
82
|
+
const a = polygon[i];
|
|
83
|
+
const b = polygon[j];
|
|
84
|
+
if (pointOnSegment(point, a, b))
|
|
85
|
+
return includeBoundary;
|
|
86
|
+
const intersects = a[1] > z !== b[1] > z && x < ((b[0] - a[0]) * (z - a[1])) / (b[1] - a[1]) + a[0];
|
|
87
|
+
if (intersects)
|
|
88
|
+
inside = !inside;
|
|
89
|
+
}
|
|
90
|
+
return inside;
|
|
91
|
+
}
|
|
92
|
+
export function polygonContainsPolygon(outer, inner) {
|
|
93
|
+
return inner.every((point) => pointInPolygon(point, outer, true));
|
|
94
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { AgentOperation } from './types.js';
|
|
2
|
+
type RoomTransformInput = {
|
|
3
|
+
zoneId: string;
|
|
4
|
+
translate?: number[];
|
|
5
|
+
rotate?: {
|
|
6
|
+
angle: number;
|
|
7
|
+
pivot?: number[];
|
|
8
|
+
};
|
|
9
|
+
force?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type SlabTarget = {
|
|
12
|
+
slabId?: string;
|
|
13
|
+
slabIds?: string[];
|
|
14
|
+
};
|
|
15
|
+
/** The room and floor-construction tools' operations, by tool name. */
|
|
16
|
+
export declare const ROOM_OPERATIONS: {
|
|
17
|
+
readonly cut_floor_opening: AgentOperation<{
|
|
18
|
+
levelId?: string;
|
|
19
|
+
zoneId?: string;
|
|
20
|
+
levelIds?: string[];
|
|
21
|
+
polygon?: number[][];
|
|
22
|
+
rect?: {
|
|
23
|
+
x: number;
|
|
24
|
+
z: number;
|
|
25
|
+
width: number;
|
|
26
|
+
depth: number;
|
|
27
|
+
};
|
|
28
|
+
drawnOn?: "floor" | "ceiling";
|
|
29
|
+
cutsPrimary?: boolean;
|
|
30
|
+
cutsAdjacent?: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
readonly remove_floor_opening: AgentOperation<{
|
|
33
|
+
id: string;
|
|
34
|
+
}>;
|
|
35
|
+
readonly set_floor_foundation: AgentOperation<SlabTarget & {
|
|
36
|
+
patch: unknown;
|
|
37
|
+
}>;
|
|
38
|
+
readonly set_room_floor_construction: AgentOperation<{
|
|
39
|
+
zoneId: string;
|
|
40
|
+
slabId?: string;
|
|
41
|
+
patch: unknown;
|
|
42
|
+
}>;
|
|
43
|
+
readonly rebase_floor_reference: AgentOperation<SlabTarget & {
|
|
44
|
+
referenceFloorElevation: number | null;
|
|
45
|
+
}>;
|
|
46
|
+
readonly create_mezzanine: AgentOperation<{
|
|
47
|
+
hostZoneId: string;
|
|
48
|
+
polygon: number[][];
|
|
49
|
+
elevation?: number;
|
|
50
|
+
thickness?: number;
|
|
51
|
+
}>;
|
|
52
|
+
readonly move_zone: AgentOperation<RoomTransformInput>;
|
|
53
|
+
readonly duplicate_zone: AgentOperation<RoomTransformInput & {
|
|
54
|
+
translate: number[];
|
|
55
|
+
}>;
|
|
56
|
+
readonly rotate_zone: AgentOperation<{
|
|
57
|
+
zoneId: string;
|
|
58
|
+
quarterTurns: number;
|
|
59
|
+
gridStep?: number;
|
|
60
|
+
force?: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
readonly lock_outside_faces: AgentOperation<{
|
|
63
|
+
levelId?: string;
|
|
64
|
+
zoneIds?: string[];
|
|
65
|
+
}>;
|
|
66
|
+
readonly set_zone_intent: AgentOperation<{
|
|
67
|
+
zoneId: string;
|
|
68
|
+
patch: unknown;
|
|
69
|
+
}>;
|
|
70
|
+
readonly divide_zone: AgentOperation<{
|
|
71
|
+
zoneId: string;
|
|
72
|
+
cut?: number[][];
|
|
73
|
+
path?: number[][];
|
|
74
|
+
closed?: boolean;
|
|
75
|
+
startBoundaryId?: string;
|
|
76
|
+
endBoundaryId?: string;
|
|
77
|
+
}>;
|
|
78
|
+
readonly merge_zones: AgentOperation<{
|
|
79
|
+
zoneIds: string[];
|
|
80
|
+
}>;
|
|
81
|
+
readonly delete_zone: AgentOperation<{
|
|
82
|
+
zoneId: string;
|
|
83
|
+
contents: "delete" | "keep";
|
|
84
|
+
}>;
|
|
85
|
+
};
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=room-structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-structure.d.ts","sourceRoot":"","sources":["../../src/agent-operations/room-structure.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,cAAc,EAAmD,MAAM,SAAS,CAAA;AA6G9F,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAUD,KAAK,UAAU,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AA+JzD,uEAAuE;AACvE,eAAO,MAAM,eAAe;;kBA7JhB,MAAM;iBACP,MAAM;mBACJ,MAAM,EAAE;kBACT,MAAM,EAAE,EAAE;eACb;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;kBACnD,OAAO,GAAG,SAAS;sBACf,OAAO;uBACN,OAAO;;;YAagC,MAAM;;;eAMU,OAAO;;;gBAUrE,MAAM;iBACL,MAAM;eACR,OAAO;;;iCAU0B,MAAM,GAAG,IAAI;;;oBAQzC,MAAM;iBACT,MAAM,EAAE,EAAE;oBACP,MAAM;oBACN,MAAM;;;;mBAgB2D,MAAM,EAAE;;;gBAW7E,MAAM;sBACA,MAAM;mBACT,MAAM;gBACT,OAAO;;;kBAc2C,MAAM;kBAAY,MAAM,EAAE;;;gBAY/B,MAAM;eAAS,OAAO;;;gBAOnE,MAAM;cACR,MAAM,EAAE,EAAE;eACT,MAAM,EAAE,EAAE;iBACR,OAAO;0BACE,MAAM;wBACR,MAAM;;;iBAc6B,MAAM,EAAE;;;gBAMT,MAAM;kBAAY,QAAQ,GAAG,MAAM;;CAyB7E,CAAA"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { refuse } from '../agent-tools/refusal.js';
|
|
2
|
+
import { createMezzanine, cutFloorOpening, deleteZone, divideZone, duplicateZone, lockOutsideFaces, mergeZones, rebaseFloorReference, removeFloorOpening, resolveZoneTransformHosts, rotateZone, setFloorFoundation, setRoomFloorConstruction, setZoneIntent, transformZone, } from '../commands/structure/index.js';
|
|
3
|
+
import { containsPoint } from '../lib/polygon-boolean.js';
|
|
4
|
+
import { generateId } from '../schema/index.js';
|
|
5
|
+
import { mergeSceneChanges } from './apply-changes.js';
|
|
6
|
+
/** A plan's ordered changes as one set, landing where applying them one by one does. */
|
|
7
|
+
function sceneChanges(changes) {
|
|
8
|
+
return mergeSceneChanges(changes.map((change) => change.op === 'create'
|
|
9
|
+
? { create: [{ node: change.node, parentId: change.node.parentId ?? undefined }] }
|
|
10
|
+
: change.op === 'update'
|
|
11
|
+
? { update: [{ id: change.id, data: change.data }] }
|
|
12
|
+
: { delete: [change.id] }));
|
|
13
|
+
}
|
|
14
|
+
/** The commands throw a plain Error for an edit they cannot make ("Room not found: …"). */
|
|
15
|
+
function plan(command) {
|
|
16
|
+
try {
|
|
17
|
+
return command();
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof Error && error.name === 'Error')
|
|
21
|
+
refuse('structure_refused', error.message);
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A room or floor command's plan as a shared tool's outcome, as the editor applies it: conflicts
|
|
27
|
+
* are answers and change nothing unless forced; otherwise the plan's changes, then — once the host
|
|
28
|
+
* has re-derived rooms and ceilings — the copied fixtures onto their new ceilings, and the result's
|
|
29
|
+
* rooms read from the derived scene (a room the reconciler re-minted is found by its seed).
|
|
30
|
+
*/
|
|
31
|
+
function roomOutcome(nodes, plan, force = false) {
|
|
32
|
+
const result = (zoneId = plan.zoneId, zoneIds) => ({
|
|
33
|
+
changes: plan.changes.length,
|
|
34
|
+
...(zoneId ? { zoneId } : {}),
|
|
35
|
+
...(plan.openingId ? { openingId: plan.openingId } : {}),
|
|
36
|
+
...(plan.openingIds ? { openingIds: plan.openingIds } : {}),
|
|
37
|
+
...(plan.hints ? { hints: plan.hints } : {}),
|
|
38
|
+
...(plan.idMap
|
|
39
|
+
? {
|
|
40
|
+
idMap: Object.fromEntries(Object.entries(plan.idMap).map(([id, targets]) => [
|
|
41
|
+
id,
|
|
42
|
+
targets.map((target) => (target === plan.zoneId ? zoneId : target)),
|
|
43
|
+
])),
|
|
44
|
+
}
|
|
45
|
+
: {}),
|
|
46
|
+
...(zoneIds ? { zoneIds } : {}),
|
|
47
|
+
...(plan.payload ? { payload: plan.payload } : {}),
|
|
48
|
+
...(plan.separatorId ? { separatorId: plan.separatorId } : {}),
|
|
49
|
+
...(plan.separatorIds ? { separatorIds: plan.separatorIds } : {}),
|
|
50
|
+
...(plan.conflicts ? { conflicts: plan.conflicts } : {}),
|
|
51
|
+
});
|
|
52
|
+
if (!plan.changes.length || (plan.conflicts?.length && !force))
|
|
53
|
+
return { result: result() };
|
|
54
|
+
let plannedZone = plan.zoneId ? nodes[plan.zoneId] : undefined;
|
|
55
|
+
for (const change of plan.changes) {
|
|
56
|
+
if (change.op === 'create' && change.node.id === plan.zoneId)
|
|
57
|
+
plannedZone = change.node;
|
|
58
|
+
else if (change.op === 'update' && change.id === plan.zoneId && plannedZone?.type === 'zone')
|
|
59
|
+
plannedZone = { ...plannedZone, ...change.data };
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
result: result(),
|
|
63
|
+
changes: sceneChanges(plan.changes),
|
|
64
|
+
afterReconcile: (derived) => {
|
|
65
|
+
let zoneId = plan.zoneId;
|
|
66
|
+
if (zoneId && !derived[zoneId] && plannedZone?.type === 'zone' && plannedZone.seed) {
|
|
67
|
+
const { seed, parentId } = plannedZone;
|
|
68
|
+
zoneId =
|
|
69
|
+
Object.values(derived).find((node) => node.type === 'zone' &&
|
|
70
|
+
node.parentId === parentId &&
|
|
71
|
+
containsPoint([{ outer: node.polygon, holes: node.holes }], seed))?.id ?? zoneId;
|
|
72
|
+
}
|
|
73
|
+
const zoneIds = plan.separatorIds?.length && !plan.conflicts?.length
|
|
74
|
+
? Object.values(derived)
|
|
75
|
+
.filter((node) => node.type === 'zone' &&
|
|
76
|
+
plan.separatorIds.some((id) => node.boundarySeparatorIds.includes(id)))
|
|
77
|
+
.map((node) => node.id)
|
|
78
|
+
.sort()
|
|
79
|
+
: undefined;
|
|
80
|
+
const hosts = resolveZoneTransformHosts(derived, plan);
|
|
81
|
+
return {
|
|
82
|
+
result: result(zoneId, zoneIds),
|
|
83
|
+
...(hosts.length ? { changes: sceneChanges(hosts) } : {}),
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const points = (list) => list;
|
|
89
|
+
const transform = ({ translate, rotate, ...input }) => ({
|
|
90
|
+
...input,
|
|
91
|
+
...(translate ? { translate: translate } : {}),
|
|
92
|
+
...(rotate
|
|
93
|
+
? { rotate: { angle: rotate.angle, ...(rotate.pivot ? { pivot: rotate.pivot } : {}) } }
|
|
94
|
+
: {}),
|
|
95
|
+
mintId: generateId,
|
|
96
|
+
});
|
|
97
|
+
const cutFloorOpeningOperation = (nodes, { polygon, ...input }) => roomOutcome(nodes, plan(() => cutFloorOpening(nodes, {
|
|
98
|
+
...input,
|
|
99
|
+
...(polygon ? { polygon: points(polygon) } : {}),
|
|
100
|
+
mintId: generateId,
|
|
101
|
+
})));
|
|
102
|
+
const removeFloorOpeningOperation = (nodes, { id }) => roomOutcome(nodes, plan(() => removeFloorOpening(nodes, id)));
|
|
103
|
+
const setFloorFoundationOperation = (nodes, input) => roomOutcome(nodes, plan(() => setFloorFoundation(nodes, { ...input, patch: input.patch })));
|
|
104
|
+
const setRoomFloorConstructionOperation = (nodes, input) => roomOutcome(nodes, plan(() => setRoomFloorConstruction(nodes, { ...input, patch: input.patch })));
|
|
105
|
+
const rebaseFloorReferenceOperation = (nodes, input) => roomOutcome(nodes, plan(() => rebaseFloorReference(nodes, input)));
|
|
106
|
+
const createMezzanineOperation = (nodes, input) => roomOutcome(nodes, plan(() => createMezzanine(nodes, { ...input, polygon: points(input.polygon), mintId: generateId })));
|
|
107
|
+
const moveZoneOperation = (nodes, input) => roomOutcome(nodes, plan(() => transformZone(nodes, transform(input))), input.force);
|
|
108
|
+
const duplicateZoneOperation = (nodes, input) => roomOutcome(nodes, plan(() => duplicateZone(nodes, { ...transform(input), translate: input.translate })), input.force);
|
|
109
|
+
const rotateZoneOperation = (nodes, input) => roomOutcome(nodes, plan(() => rotateZone(nodes, {
|
|
110
|
+
...input,
|
|
111
|
+
quarterTurns: input.quarterTurns,
|
|
112
|
+
mintId: generateId,
|
|
113
|
+
})), input.force);
|
|
114
|
+
const lockOutsideFacesOperation = (nodes, { levelId, zoneIds }) => {
|
|
115
|
+
if (Boolean(levelId) === Boolean(zoneIds))
|
|
116
|
+
refuse('target_required', 'Supply either levelId or zoneIds.');
|
|
117
|
+
return roomOutcome(nodes, plan(() => lockOutsideFaces(nodes, levelId ? { levelId } : { zoneIds: zoneIds })));
|
|
118
|
+
};
|
|
119
|
+
const setZoneIntentOperation = (nodes, input) => roomOutcome(nodes, plan(() => setZoneIntent(nodes, { ...input, patch: input.patch })));
|
|
120
|
+
const divideZoneOperation = (nodes, { cut, path, ...input }) => roomOutcome(nodes, plan(() => divideZone(nodes, {
|
|
121
|
+
...input,
|
|
122
|
+
...(cut ? { cut: points(cut) } : {}),
|
|
123
|
+
...(path ? { path: points(path) } : {}),
|
|
124
|
+
mintId: generateId,
|
|
125
|
+
})));
|
|
126
|
+
const mergeZonesOperation = (nodes, { zoneIds }) => roomOutcome(nodes, plan(() => mergeZones(nodes, { zoneIds: zoneIds })));
|
|
127
|
+
const deleteZoneOperation = (nodes, input) => roomOutcome(nodes, plan(() => deleteZone(nodes, input)));
|
|
128
|
+
/** The room and floor-construction tools' operations, by tool name. */
|
|
129
|
+
export const ROOM_OPERATIONS = {
|
|
130
|
+
cut_floor_opening: cutFloorOpeningOperation,
|
|
131
|
+
remove_floor_opening: removeFloorOpeningOperation,
|
|
132
|
+
set_floor_foundation: setFloorFoundationOperation,
|
|
133
|
+
set_room_floor_construction: setRoomFloorConstructionOperation,
|
|
134
|
+
rebase_floor_reference: rebaseFloorReferenceOperation,
|
|
135
|
+
create_mezzanine: createMezzanineOperation,
|
|
136
|
+
move_zone: moveZoneOperation,
|
|
137
|
+
duplicate_zone: duplicateZoneOperation,
|
|
138
|
+
rotate_zone: rotateZoneOperation,
|
|
139
|
+
lock_outside_faces: lockOutsideFacesOperation,
|
|
140
|
+
set_zone_intent: setZoneIntentOperation,
|
|
141
|
+
divide_zone: divideZoneOperation,
|
|
142
|
+
merge_zones: mergeZonesOperation,
|
|
143
|
+
delete_zone: deleteZoneOperation,
|
|
144
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaterialSchema } from '../schema/material.js';
|
|
2
|
+
import { type SceneMaterial, type SceneMaterialId } from '../schema/scene-material.js';
|
|
3
|
+
/**
|
|
4
|
+
* A native material as the editor's Paint keeps a one-off: the scene's equal material when it has
|
|
5
|
+
* one (compared as the schema reads both), else a new scene material. Refused where the host
|
|
6
|
+
* cannot store scene materials, so no node points at a material nothing keeps.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveInlinePaintMaterial(materials: Readonly<Record<SceneMaterialId, SceneMaterial>> | undefined, input: MaterialSchema, name?: string): {
|
|
9
|
+
ref: string;
|
|
10
|
+
sceneMaterial: SceneMaterial;
|
|
11
|
+
created: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** The scene materials a node points at, in its slots and its role fields alike. */
|
|
14
|
+
export declare function referencedSceneMaterialIds(value: unknown): Set<string>;
|
|
15
|
+
//# sourceMappingURL=scene-materials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-materials.d.ts","sourceRoot":"","sources":["../../src/agent-operations/scene-materials.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAA;AAqBjC;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,GAAG,SAAS,EACvE,KAAK,EAAE,cAAc,EACrB,IAAI,CAAC,EAAE,MAAM,GACZ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAqBjE;AAED,oFAAoF;AACpF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAWtE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { refuse } from '../agent-tools/refusal.js';
|
|
2
|
+
import { parseMaterialRef, toSceneMaterialRef } from '../material-library.js';
|
|
3
|
+
import { MaterialSchema } from '../schema/material.js';
|
|
4
|
+
import { generateSceneMaterialId, } from '../schema/scene-material.js';
|
|
5
|
+
/** Whether two parsed values are the same, whatever their keys' order. */
|
|
6
|
+
function equal(a, b) {
|
|
7
|
+
if (a === b)
|
|
8
|
+
return true;
|
|
9
|
+
if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object')
|
|
10
|
+
return false;
|
|
11
|
+
if (Array.isArray(a) || Array.isArray(b))
|
|
12
|
+
return (Array.isArray(a) &&
|
|
13
|
+
Array.isArray(b) &&
|
|
14
|
+
a.length === b.length &&
|
|
15
|
+
a.every((value, index) => equal(value, b[index])));
|
|
16
|
+
const left = a;
|
|
17
|
+
const right = b;
|
|
18
|
+
return (Object.keys(left).length === Object.keys(right).length &&
|
|
19
|
+
Object.keys(left).every((key) => Object.hasOwn(right, key) && equal(left[key], right[key])));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A native material as the editor's Paint keeps a one-off: the scene's equal material when it has
|
|
23
|
+
* one (compared as the schema reads both), else a new scene material. Refused where the host
|
|
24
|
+
* cannot store scene materials, so no node points at a material nothing keeps.
|
|
25
|
+
*/
|
|
26
|
+
export function resolveInlinePaintMaterial(materials, input, name) {
|
|
27
|
+
if (!materials)
|
|
28
|
+
refuse('materials_unavailable', 'This host cannot keep native materials: give a library material or a colour. Nothing was painted.');
|
|
29
|
+
const parsed = MaterialSchema.safeParse(input);
|
|
30
|
+
if (!parsed.success)
|
|
31
|
+
refuse('invalid_material', `Not a native material: ${parsed.error.message}`);
|
|
32
|
+
for (const existing of Object.values(materials)) {
|
|
33
|
+
const normalized = MaterialSchema.safeParse(existing.material);
|
|
34
|
+
if (normalized.success && equal(normalized.data, parsed.data))
|
|
35
|
+
return { ref: toSceneMaterialRef(existing.id), sceneMaterial: existing, created: false };
|
|
36
|
+
}
|
|
37
|
+
let id = generateSceneMaterialId();
|
|
38
|
+
while (materials[id])
|
|
39
|
+
id = generateSceneMaterialId();
|
|
40
|
+
const sceneMaterial = {
|
|
41
|
+
id,
|
|
42
|
+
name: name ?? `Material ${Object.keys(materials).length + 1}`,
|
|
43
|
+
material: parsed.data,
|
|
44
|
+
};
|
|
45
|
+
return { ref: toSceneMaterialRef(id), sceneMaterial, created: true };
|
|
46
|
+
}
|
|
47
|
+
/** The scene materials a node points at, in its slots and its role fields alike. */
|
|
48
|
+
export function referencedSceneMaterialIds(value) {
|
|
49
|
+
const ids = new Set();
|
|
50
|
+
const visit = (entry) => {
|
|
51
|
+
if (typeof entry === 'string') {
|
|
52
|
+
const parsed = parseMaterialRef(entry);
|
|
53
|
+
if (parsed?.kind === 'scene')
|
|
54
|
+
ids.add(parsed.id);
|
|
55
|
+
}
|
|
56
|
+
else if (entry && typeof entry === 'object')
|
|
57
|
+
for (const child of Object.values(entry))
|
|
58
|
+
visit(child);
|
|
59
|
+
};
|
|
60
|
+
visit(value);
|
|
61
|
+
return ids;
|
|
62
|
+
}
|