@ifc-lite/create 4.0.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/in-store/align-boxes.d.ts +38 -0
- package/dist/in-store/align-boxes.d.ts.map +1 -0
- package/dist/in-store/align-boxes.js +97 -0
- package/dist/in-store/align-boxes.js.map +1 -0
- package/dist/in-store/anchor.d.ts.map +1 -1
- package/dist/in-store/anchor.js +13 -2
- package/dist/in-store/anchor.js.map +1 -1
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +3 -10
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/copy-array.d.ts +17 -0
- package/dist/in-store/copy-array.d.ts.map +1 -0
- package/dist/in-store/copy-array.js +47 -0
- package/dist/in-store/copy-array.js.map +1 -0
- package/dist/in-store/copy-batch.d.ts +27 -0
- package/dist/in-store/copy-batch.d.ts.map +1 -0
- package/dist/in-store/copy-batch.js +101 -0
- package/dist/in-store/copy-batch.js.map +1 -0
- package/dist/in-store/copy-dependent-walk.d.ts +27 -0
- package/dist/in-store/copy-dependent-walk.d.ts.map +1 -0
- package/dist/in-store/copy-dependent-walk.js +61 -0
- package/dist/in-store/copy-dependent-walk.js.map +1 -0
- package/dist/in-store/copy-frame.d.ts +4 -3
- package/dist/in-store/copy-frame.d.ts.map +1 -1
- package/dist/in-store/copy-frame.js +14 -1
- package/dist/in-store/copy-frame.js.map +1 -1
- package/dist/in-store/copy-product.d.ts +0 -20
- package/dist/in-store/copy-product.d.ts.map +1 -1
- package/dist/in-store/copy-product.js +35 -35
- package/dist/in-store/copy-product.js.map +1 -1
- package/dist/in-store/duplicate.d.ts +8 -0
- package/dist/in-store/duplicate.d.ts.map +1 -1
- package/dist/in-store/duplicate.js +8 -1
- package/dist/in-store/duplicate.js.map +1 -1
- package/dist/in-store/edit/effective-mutation-view.d.ts +6 -0
- package/dist/in-store/edit/effective-mutation-view.d.ts.map +1 -0
- package/dist/in-store/edit/effective-mutation-view.js +45 -0
- package/dist/in-store/edit/effective-mutation-view.js.map +1 -0
- package/dist/in-store/edit/effective-storey.d.ts +13 -0
- package/dist/in-store/edit/effective-storey.d.ts.map +1 -0
- package/dist/in-store/edit/effective-storey.js +36 -0
- package/dist/in-store/edit/effective-storey.js.map +1 -0
- package/dist/in-store/edit/effective-storeys.d.ts +9 -0
- package/dist/in-store/edit/effective-storeys.d.ts.map +1 -0
- package/dist/in-store/edit/effective-storeys.js +16 -0
- package/dist/in-store/edit/effective-storeys.js.map +1 -0
- package/dist/in-store/edit/hosted-opening-refit.d.ts +29 -0
- package/dist/in-store/edit/hosted-opening-refit.d.ts.map +1 -0
- package/dist/in-store/edit/hosted-opening-refit.js +168 -0
- package/dist/in-store/edit/hosted-opening-refit.js.map +1 -0
- package/dist/in-store/edit/length-unit-scale.d.ts +24 -0
- package/dist/in-store/edit/length-unit-scale.d.ts.map +1 -0
- package/dist/in-store/edit/length-unit-scale.js +37 -0
- package/dist/in-store/edit/length-unit-scale.js.map +1 -0
- package/dist/in-store/edit/linear-element-edit.d.ts +131 -0
- package/dist/in-store/edit/linear-element-edit.d.ts.map +1 -0
- package/dist/in-store/edit/linear-element-edit.js +259 -0
- package/dist/in-store/edit/linear-element-edit.js.map +1 -0
- package/dist/in-store/edit/metadata-clone-effective.d.ts +5 -0
- package/dist/in-store/edit/metadata-clone-effective.d.ts.map +1 -0
- package/dist/in-store/edit/metadata-clone-effective.js +47 -0
- package/dist/in-store/edit/metadata-clone-effective.js.map +1 -0
- package/dist/in-store/edit/metadata-clone.d.ts +40 -0
- package/dist/in-store/edit/metadata-clone.d.ts.map +1 -0
- package/dist/in-store/edit/metadata-clone.js +142 -0
- package/dist/in-store/edit/metadata-clone.js.map +1 -0
- package/dist/in-store/edit/placement-core.d.ts +140 -0
- package/dist/in-store/edit/placement-core.d.ts.map +1 -0
- package/dist/in-store/edit/placement-core.js +317 -0
- package/dist/in-store/edit/placement-core.js.map +1 -0
- package/dist/in-store/edit/polygon-clip.d.ts +58 -0
- package/dist/in-store/edit/polygon-clip.d.ts.map +1 -0
- package/dist/in-store/edit/polygon-clip.js +153 -0
- package/dist/in-store/edit/polygon-clip.js.map +1 -0
- package/dist/in-store/edit/read-profile.d.ts +6 -0
- package/dist/in-store/edit/read-profile.d.ts.map +1 -0
- package/dist/in-store/edit/read-profile.js +95 -0
- package/dist/in-store/edit/read-profile.js.map +1 -0
- package/dist/in-store/edit/slab-edit-frame.d.ts +40 -0
- package/dist/in-store/edit/slab-edit-frame.d.ts.map +1 -0
- package/dist/in-store/edit/slab-edit-frame.js +146 -0
- package/dist/in-store/edit/slab-edit-frame.js.map +1 -0
- package/dist/in-store/edit/slab-edit.d.ts +112 -0
- package/dist/in-store/edit/slab-edit.d.ts.map +1 -0
- package/dist/in-store/edit/slab-edit.js +275 -0
- package/dist/in-store/edit/slab-edit.js.map +1 -0
- package/dist/in-store/edit/slab-opening-carry.d.ts +10 -0
- package/dist/in-store/edit/slab-opening-carry.d.ts.map +1 -0
- package/dist/in-store/edit/slab-opening-carry.js +65 -0
- package/dist/in-store/edit/slab-opening-carry.js.map +1 -0
- package/dist/in-store/edit/split-guid.d.ts +29 -0
- package/dist/in-store/edit/split-guid.d.ts.map +1 -0
- package/dist/in-store/edit/split-guid.js +64 -0
- package/dist/in-store/edit/split-guid.js.map +1 -0
- package/dist/in-store/edit/split-target.d.ts +90 -0
- package/dist/in-store/edit/split-target.d.ts.map +1 -0
- package/dist/in-store/edit/split-target.js +116 -0
- package/dist/in-store/edit/split-target.js.map +1 -0
- package/dist/in-store/edit/target.d.ts +8 -0
- package/dist/in-store/edit/target.d.ts.map +1 -0
- package/dist/in-store/edit/target.js +5 -0
- package/dist/in-store/edit/target.js.map +1 -0
- package/dist/in-store/edit/trim-extend-geometry.d.ts +99 -0
- package/dist/in-store/edit/trim-extend-geometry.d.ts.map +1 -0
- package/dist/in-store/edit/trim-extend-geometry.js +105 -0
- package/dist/in-store/edit/trim-extend-geometry.js.map +1 -0
- package/dist/in-store/edit/wall-axis-edit.d.ts +16 -0
- package/dist/in-store/edit/wall-axis-edit.d.ts.map +1 -0
- package/dist/in-store/edit/wall-axis-edit.js +40 -0
- package/dist/in-store/edit/wall-axis-edit.js.map +1 -0
- package/dist/in-store/edit/wall-edit.d.ts +157 -0
- package/dist/in-store/edit/wall-edit.d.ts.map +1 -0
- package/dist/in-store/edit/wall-edit.js +276 -0
- package/dist/in-store/edit/wall-edit.js.map +1 -0
- package/dist/in-store/edit/wall-hosted-cuts.d.ts +35 -0
- package/dist/in-store/edit/wall-hosted-cuts.d.ts.map +1 -0
- package/dist/in-store/edit/wall-hosted-cuts.js +27 -0
- package/dist/in-store/edit/wall-hosted-cuts.js.map +1 -0
- package/dist/in-store/edit/wall-opening-reassign.d.ts +18 -0
- package/dist/in-store/edit/wall-opening-reassign.d.ts.map +1 -0
- package/dist/in-store/edit/wall-opening-reassign.js +50 -0
- package/dist/in-store/edit/wall-opening-reassign.js.map +1 -0
- package/dist/in-store/element-align.d.ts +13 -0
- package/dist/in-store/element-align.d.ts.map +1 -0
- package/dist/in-store/element-align.js +90 -0
- package/dist/in-store/element-align.js.map +1 -0
- package/dist/in-store/element-replacement.d.ts +26 -0
- package/dist/in-store/element-replacement.d.ts.map +1 -0
- package/dist/in-store/element-replacement.js +68 -0
- package/dist/in-store/element-replacement.js.map +1 -0
- package/dist/in-store/element-size-edit.d.ts +40 -0
- package/dist/in-store/element-size-edit.d.ts.map +1 -0
- package/dist/in-store/element-size-edit.js +103 -0
- package/dist/in-store/element-size-edit.js.map +1 -0
- package/dist/in-store/element-split-axis.d.ts +6 -0
- package/dist/in-store/element-split-axis.d.ts.map +1 -0
- package/dist/in-store/element-split-axis.js +87 -0
- package/dist/in-store/element-split-axis.js.map +1 -0
- package/dist/in-store/element-split-joined.d.ts +13 -0
- package/dist/in-store/element-split-joined.d.ts.map +1 -0
- package/dist/in-store/element-split-joined.js +74 -0
- package/dist/in-store/element-split-joined.js.map +1 -0
- package/dist/in-store/element-split-placement.d.ts +19 -0
- package/dist/in-store/element-split-placement.d.ts.map +1 -0
- package/dist/in-store/element-split-placement.js +48 -0
- package/dist/in-store/element-split-placement.js.map +1 -0
- package/dist/in-store/element-split-slab.d.ts +19 -0
- package/dist/in-store/element-split-slab.d.ts.map +1 -0
- package/dist/in-store/element-split-slab.js +86 -0
- package/dist/in-store/element-split-slab.js.map +1 -0
- package/dist/in-store/element-split.d.ts +49 -0
- package/dist/in-store/element-split.d.ts.map +1 -0
- package/dist/in-store/element-split.js +52 -0
- package/dist/in-store/element-split.js.map +1 -0
- package/dist/in-store/element-transform-edit.d.ts +33 -0
- package/dist/in-store/element-transform-edit.d.ts.map +1 -0
- package/dist/in-store/element-transform-edit.js +97 -0
- package/dist/in-store/element-transform-edit.js.map +1 -0
- package/dist/in-store/element-transform-frames.d.ts +45 -0
- package/dist/in-store/element-transform-frames.d.ts.map +1 -0
- package/dist/in-store/element-transform-frames.js +121 -0
- package/dist/in-store/element-transform-frames.js.map +1 -0
- package/dist/in-store/element-transform-joins.d.ts +4 -0
- package/dist/in-store/element-transform-joins.d.ts.map +1 -0
- package/dist/in-store/element-transform-joins.js +62 -0
- package/dist/in-store/element-transform-joins.js.map +1 -0
- package/dist/in-store/element-transform-plan.d.ts +38 -0
- package/dist/in-store/element-transform-plan.d.ts.map +1 -0
- package/dist/in-store/element-transform-plan.js +115 -0
- package/dist/in-store/element-transform-plan.js.map +1 -0
- package/dist/in-store/element-trim-extend.d.ts +25 -0
- package/dist/in-store/element-trim-extend.d.ts.map +1 -0
- package/dist/in-store/element-trim-extend.js +97 -0
- package/dist/in-store/element-trim-extend.js.map +1 -0
- package/dist/in-store/extract-grids.d.ts +7 -17
- package/dist/in-store/extract-grids.d.ts.map +1 -1
- package/dist/in-store/extract-grids.js +11 -2
- package/dist/in-store/extract-grids.js.map +1 -1
- package/dist/in-store/grid-column.d.ts +23 -0
- package/dist/in-store/grid-column.d.ts.map +1 -0
- package/dist/in-store/grid-column.js +73 -0
- package/dist/in-store/grid-column.js.map +1 -0
- package/dist/in-store/grid-intersection-read.d.ts +10 -0
- package/dist/in-store/grid-intersection-read.d.ts.map +1 -0
- package/dist/in-store/grid-intersection-read.js +45 -0
- package/dist/in-store/grid-intersection-read.js.map +1 -0
- package/dist/in-store/grid.d.ts +7 -1
- package/dist/in-store/grid.d.ts.map +1 -1
- package/dist/in-store/grid.js +12 -2
- package/dist/in-store/grid.js.map +1 -1
- package/dist/in-store/group-evidence.d.ts +49 -0
- package/dist/in-store/group-evidence.d.ts.map +1 -0
- package/dist/in-store/group-evidence.js +111 -0
- package/dist/in-store/group-evidence.js.map +1 -0
- package/dist/in-store/group-graph.d.ts +51 -0
- package/dist/in-store/group-graph.d.ts.map +1 -0
- package/dist/in-store/group-graph.js +207 -0
- package/dist/in-store/group-graph.js.map +1 -0
- package/dist/in-store/group.d.ts +34 -0
- package/dist/in-store/group.d.ts.map +1 -0
- package/dist/in-store/group.js +181 -0
- package/dist/in-store/group.js.map +1 -0
- package/dist/in-store/host-geometry-frame.d.ts +5 -1
- package/dist/in-store/host-geometry-frame.d.ts.map +1 -1
- package/dist/in-store/host-geometry-frame.js +58 -10
- package/dist/in-store/host-geometry-frame.js.map +1 -1
- package/dist/in-store/index.d.ts +7 -0
- package/dist/in-store/index.d.ts.map +1 -1
- package/dist/in-store/index.js +7 -0
- package/dist/in-store/index.js.map +1 -1
- package/dist/in-store/linear-profile-frame.d.ts +10 -0
- package/dist/in-store/linear-profile-frame.d.ts.map +1 -0
- package/dist/in-store/linear-profile-frame.js +17 -0
- package/dist/in-store/linear-profile-frame.js.map +1 -0
- package/dist/in-store/material.d.ts.map +1 -1
- package/dist/in-store/material.js +17 -6
- package/dist/in-store/material.js.map +1 -1
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js +3 -7
- package/dist/in-store/member.js.map +1 -1
- package/dist/in-store/ordinary-element.d.ts +47 -0
- package/dist/in-store/ordinary-element.d.ts.map +1 -0
- package/dist/in-store/ordinary-element.js +38 -0
- package/dist/in-store/ordinary-element.js.map +1 -0
- package/dist/in-store/placement-frame.d.ts +5 -17
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js +59 -43
- package/dist/in-store/placement-frame.js.map +1 -1
- package/dist/in-store/resolve-anchor.d.ts +3 -2
- package/dist/in-store/resolve-anchor.d.ts.map +1 -1
- package/dist/in-store/resolve-anchor.js +7 -5
- package/dist/in-store/resolve-anchor.js.map +1 -1
- package/dist/in-store/resolve-relations.d.ts +3 -1
- package/dist/in-store/resolve-relations.d.ts.map +1 -1
- package/dist/in-store/resolve-relations.js +8 -3
- package/dist/in-store/resolve-relations.js.map +1 -1
- package/dist/in-store/resolve-source.d.ts.map +1 -1
- package/dist/in-store/resolve-source.js +10 -3
- package/dist/in-store/resolve-source.js.map +1 -1
- package/dist/in-store/room-candidates.d.ts +58 -0
- package/dist/in-store/room-candidates.d.ts.map +1 -0
- package/dist/in-store/room-candidates.js +135 -0
- package/dist/in-store/room-candidates.js.map +1 -0
- package/dist/in-store/room-creation-plan.d.ts +16 -0
- package/dist/in-store/room-creation-plan.d.ts.map +1 -0
- package/dist/in-store/room-creation-plan.js +28 -0
- package/dist/in-store/room-creation-plan.js.map +1 -0
- package/dist/in-store/room-floor-height.d.ts +24 -0
- package/dist/in-store/room-floor-height.d.ts.map +1 -0
- package/dist/in-store/room-floor-height.js +32 -0
- package/dist/in-store/room-floor-height.js.map +1 -0
- package/dist/in-store/room-footprint-native.d.ts +19 -0
- package/dist/in-store/room-footprint-native.d.ts.map +1 -0
- package/dist/in-store/room-footprint-native.js +117 -0
- package/dist/in-store/room-footprint-native.js.map +1 -0
- package/dist/in-store/room-layout-cache.d.ts +23 -0
- package/dist/in-store/room-layout-cache.d.ts.map +1 -0
- package/dist/in-store/room-layout-cache.js +84 -0
- package/dist/in-store/room-layout-cache.js.map +1 -0
- package/dist/in-store/room-layout-core.d.ts +68 -0
- package/dist/in-store/room-layout-core.d.ts.map +1 -0
- package/dist/in-store/room-layout-core.js +153 -0
- package/dist/in-store/room-layout-core.js.map +1 -0
- package/dist/in-store/room-population.d.ts +5 -0
- package/dist/in-store/room-population.d.ts.map +1 -0
- package/dist/in-store/room-population.js +28 -0
- package/dist/in-store/room-population.js.map +1 -0
- package/dist/in-store/room-space-meshes.d.ts +15 -0
- package/dist/in-store/room-space-meshes.d.ts.map +1 -0
- package/dist/in-store/room-space-meshes.js +38 -0
- package/dist/in-store/room-space-meshes.js.map +1 -0
- package/dist/in-store/room-store.d.ts +55 -0
- package/dist/in-store/room-store.d.ts.map +1 -0
- package/dist/in-store/room-store.js +173 -0
- package/dist/in-store/room-store.js.map +1 -0
- package/dist/in-store/room-storey-elevation.d.ts +5 -0
- package/dist/in-store/room-storey-elevation.d.ts.map +1 -0
- package/dist/in-store/room-storey-elevation.js +42 -0
- package/dist/in-store/room-storey-elevation.js.map +1 -0
- package/dist/in-store/room-storey-frame.d.ts +47 -0
- package/dist/in-store/room-storey-frame.d.ts.map +1 -0
- package/dist/in-store/room-storey-frame.js +48 -0
- package/dist/in-store/room-storey-frame.js.map +1 -0
- package/dist/in-store/room-wall-rects.d.ts +117 -0
- package/dist/in-store/room-wall-rects.d.ts.map +1 -0
- package/dist/in-store/room-wall-rects.js +157 -0
- package/dist/in-store/room-wall-rects.js.map +1 -0
- package/dist/in-store/schema-attributes.d.ts +3 -3
- package/dist/in-store/schema-attributes.d.ts.map +1 -1
- package/dist/in-store/schema-attributes.js +9 -7
- package/dist/in-store/schema-attributes.js.map +1 -1
- package/dist/in-store/slab.d.ts.map +1 -1
- package/dist/in-store/slab.js +1 -4
- package/dist/in-store/slab.js.map +1 -1
- package/dist/in-store/stair-removal.d.ts +17 -0
- package/dist/in-store/stair-removal.d.ts.map +1 -0
- package/dist/in-store/stair-removal.js +134 -0
- package/dist/in-store/stair-removal.js.map +1 -0
- package/dist/in-store/storey-plan-frame.d.ts +2 -1
- package/dist/in-store/storey-plan-frame.d.ts.map +1 -1
- package/dist/in-store/storey-plan-frame.js +20 -11
- package/dist/in-store/storey-plan-frame.js.map +1 -1
- package/dist/in-store/storey-reassignment-plan.d.ts +53 -0
- package/dist/in-store/storey-reassignment-plan.d.ts.map +1 -0
- package/dist/in-store/storey-reassignment-plan.js +237 -0
- package/dist/in-store/storey-reassignment-plan.js.map +1 -0
- package/dist/in-store/storey-reassignment.d.ts +8 -0
- package/dist/in-store/storey-reassignment.d.ts.map +1 -0
- package/dist/in-store/storey-reassignment.js +52 -0
- package/dist/in-store/storey-reassignment.js.map +1 -0
- package/dist/in-store/trim-extend-plan.d.ts +27 -0
- package/dist/in-store/trim-extend-plan.d.ts.map +1 -0
- package/dist/in-store/trim-extend-plan.js +49 -0
- package/dist/in-store/trim-extend-plan.js.map +1 -0
- package/dist/in-store/wall-join-edit.d.ts +0 -17
- package/dist/in-store/wall-join-edit.d.ts.map +1 -1
- package/dist/in-store/wall-join-edit.js +41 -7
- package/dist/in-store/wall-join-edit.js.map +1 -1
- package/dist/in-store/wall-section-edit.d.ts +16 -0
- package/dist/in-store/wall-section-edit.d.ts.map +1 -0
- package/dist/in-store/wall-section-edit.js +75 -0
- package/dist/in-store/wall-section-edit.js.map +1 -0
- package/dist/in-store/wall-size-edit.d.ts +29 -0
- package/dist/in-store/wall-size-edit.d.ts.map +1 -0
- package/dist/in-store/wall-size-edit.js +65 -0
- package/dist/in-store/wall-size-edit.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/landxml/profile-geometry.d.ts +10 -0
- package/dist/landxml/profile-geometry.d.ts.map +1 -1
- package/dist/landxml/profile-geometry.js +16 -1
- package/dist/landxml/profile-geometry.js.map +1 -1
- package/package.json +9 -8
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { roomConvexHull as convexHull } from './room-footprint-native.js';
|
|
5
|
+
export { roomConvexHull as convexHull } from './room-footprint-native.js';
|
|
6
|
+
const WALL_TYPES = new Set(['IfcWall', 'IfcWallStandardCase']);
|
|
7
|
+
/** OBB filter: drop slivers and anything too thick to be a wall (a mis-typed
|
|
8
|
+
* slab/footing caught in the band). */
|
|
9
|
+
const MIN_LEN = 0.3;
|
|
10
|
+
const MIN_THICK = 0.02;
|
|
11
|
+
const MAX_THICK = 2.5;
|
|
12
|
+
/** A wall is "on" a storey when its height range overlaps the band interior. */
|
|
13
|
+
const BAND_MARGIN = 0.2;
|
|
14
|
+
/**
|
|
15
|
+
* The render → room-frame plan offsets: `ifcX = renderX + cx`,
|
|
16
|
+
* `ifcY = cy − renderZ`.
|
|
17
|
+
*
|
|
18
|
+
* The room frame is the MODEL'S OWN IFC frame — `ifcLocal = renderLocal +
|
|
19
|
+
* shift` with the Y-up→Z-up swap — NOT the georeferenced survey frame.
|
|
20
|
+
* `wasmRtcOffset` is what the WASM mesh path subtracted when it resolved a
|
|
21
|
+
* site placement that anchors the building to a survey grid; folding it back
|
|
22
|
+
* in here would put the room frame a whole survey offset away from the
|
|
23
|
+
* rendered walls and from the storey band below (see the module docstring
|
|
24
|
+
* for the LV95 measurement that showed this). The anchor is carried by
|
|
25
|
+
* {@link roomFrameToModelWorld} instead, for the one consumer that needs the
|
|
26
|
+
* file's own placement-chain coordinates.
|
|
27
|
+
*
|
|
28
|
+
* Exported because this is where the room frame is DEFINED, and the bake needs
|
|
29
|
+
* to know which frame that is — see {@link roomFrameToModelWorld}.
|
|
30
|
+
*/
|
|
31
|
+
export function roomFramePlanOffsets(coord) {
|
|
32
|
+
const shift = coord?.originShift ?? { x: 0, y: 0, z: 0 };
|
|
33
|
+
return { cx: shift.x, cy: -shift.z };
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The plan offset that takes a room-frame point into the MODEL'S OWN WORLD
|
|
37
|
+
* FRAME — the coordinates the STEP file's placement chains resolve to, which
|
|
38
|
+
* is the frame `storeyPlanFrame` reads the storey out of.
|
|
39
|
+
*
|
|
40
|
+
* Exactly the survey anchor {@link roomFramePlanOffsets} leaves out: the
|
|
41
|
+
* canonical reconstruction is worldYup = renderLocal + shift + rtcYup with
|
|
42
|
+
* The viewer-axis conversion lives in `coordinate-frame.ts`; in IFC-plan axes, ifcX gains `rtc.x` and
|
|
43
|
+
* ifcY gains `rtc.y` on top of the room frame. Zero for any model within
|
|
44
|
+
* ~10 km of the origin (rtc is null there). Anything that changes which
|
|
45
|
+
* terms `roomFramePlanOffsets` carries changes this one too;
|
|
46
|
+
* `wall-rects-from-meshes.test.ts` pins the two together.
|
|
47
|
+
*/
|
|
48
|
+
export function roomFrameToModelWorld(coord) {
|
|
49
|
+
const rtc = coord?.wasmRtcOffset ?? { x: 0, y: 0, z: 0 };
|
|
50
|
+
return { dx: rtc.x, dy: rtc.y };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* MINIMUM-AREA bounding rectangle of a thin plan point cloud (rotating calipers
|
|
54
|
+
* on the convex hull) → its 4 CCW corners (long edge first), length, thickness.
|
|
55
|
+
*
|
|
56
|
+
* NOT PCA. PCA orients by minimizing variance, so on a wall whose mesh has uneven
|
|
57
|
+
* vertex density (short structural stubs especially) the principal axis tilts by
|
|
58
|
+
* several degrees even though the wall is axis-aligned — which skews the room into
|
|
59
|
+
* a parallelogram. The min-area rectangle depends only on the footprint OUTLINE
|
|
60
|
+
* (the hull), so it returns the true rectangle: measured 0.000° skew / 0 m off the
|
|
61
|
+
* rendered faces on the storeys where PCA produced ~5° skew.
|
|
62
|
+
*/
|
|
63
|
+
export function footprintOBB(pts) {
|
|
64
|
+
const h = convexHull(pts);
|
|
65
|
+
if (h.length < 3)
|
|
66
|
+
return null;
|
|
67
|
+
let best = null;
|
|
68
|
+
// The min-area rectangle is collinear with one hull edge — try them all.
|
|
69
|
+
for (let i = 0; i < h.length; i++) {
|
|
70
|
+
const a = h[i], b = h[(i + 1) % h.length];
|
|
71
|
+
let ex = b[0] - a[0], ey = b[1] - a[1];
|
|
72
|
+
const L = Math.hypot(ex, ey);
|
|
73
|
+
if (L < 1e-9)
|
|
74
|
+
continue;
|
|
75
|
+
ex /= L;
|
|
76
|
+
ey /= L;
|
|
77
|
+
const nx = -ey, ny = ex; // +90° (CCW) of the edge dir
|
|
78
|
+
let umin = Infinity, umax = -Infinity, vmin = Infinity, vmax = -Infinity;
|
|
79
|
+
for (const q of h) {
|
|
80
|
+
const du = (q[0] - a[0]) * ex + (q[1] - a[1]) * ey;
|
|
81
|
+
const dv = (q[0] - a[0]) * nx + (q[1] - a[1]) * ny;
|
|
82
|
+
if (du < umin)
|
|
83
|
+
umin = du;
|
|
84
|
+
if (du > umax)
|
|
85
|
+
umax = du;
|
|
86
|
+
if (dv < vmin)
|
|
87
|
+
vmin = dv;
|
|
88
|
+
if (dv > vmax)
|
|
89
|
+
vmax = dv;
|
|
90
|
+
}
|
|
91
|
+
const ulen = umax - umin, vlen = vmax - vmin;
|
|
92
|
+
const area = ulen * vlen;
|
|
93
|
+
if (best && area >= best.area)
|
|
94
|
+
continue;
|
|
95
|
+
const P = (du, dv) => [a[0] + ex * du + nx * dv, a[1] + ey * du + ny * dv];
|
|
96
|
+
// CCW corners; rotate so corners[0]→corners[1] is the LONG (length) axis,
|
|
97
|
+
// which `wallRectsFromMeshes` relies on to take the centreline.
|
|
98
|
+
let corners = [P(umin, vmin), P(umax, vmin), P(umax, vmax), P(umin, vmax)];
|
|
99
|
+
if (ulen < vlen)
|
|
100
|
+
corners = [corners[1], corners[2], corners[3], corners[0]];
|
|
101
|
+
best = { area, corners, length: Math.max(ulen, vlen), thickness: Math.min(ulen, vlen) };
|
|
102
|
+
}
|
|
103
|
+
return best;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Per-wall footprint rectangles (4 CCW corners, room frame) for the walls whose
|
|
107
|
+
* height range overlaps the storey band `[floorElevation, floorElevation +
|
|
108
|
+
* floorToFloor]`. Aggregates all mesh fragments of one wall (a void-cut wall
|
|
109
|
+
* renders as several) by `expressId` before taking the OBB.
|
|
110
|
+
*/
|
|
111
|
+
export function wallRectsFromMeshes(meshes, coord, floorElevation, floorToFloor) {
|
|
112
|
+
const shift = coord?.originShift ?? { x: 0, y: 0, z: 0 };
|
|
113
|
+
// Render → the model's own IFC frame (no rtc term — see roomFramePlanOffsets).
|
|
114
|
+
const { cx, cy } = roomFramePlanOffsets(coord);
|
|
115
|
+
// Storey band in render-Y (height): renderY = ifcZ − shift.y. `floorElevation`
|
|
116
|
+
// is the storey's own local Elevation, the frame the rendered geometry is in.
|
|
117
|
+
const lo = floorElevation - shift.y;
|
|
118
|
+
const hi = floorElevation + floorToFloor - shift.y;
|
|
119
|
+
const walls = new Map();
|
|
120
|
+
for (const m of meshes) {
|
|
121
|
+
if (!m.ifcType || !WALL_TYPES.has(m.ifcType))
|
|
122
|
+
continue;
|
|
123
|
+
const pos = m.positions;
|
|
124
|
+
const o = m.origin ?? [0, 0, 0];
|
|
125
|
+
let w = walls.get(m.expressId);
|
|
126
|
+
if (!w) {
|
|
127
|
+
w = { pts: [], ymin: Infinity, ymax: -Infinity };
|
|
128
|
+
walls.set(m.expressId, w);
|
|
129
|
+
}
|
|
130
|
+
for (let i = 0; i + 2 < pos.length; i += 3) {
|
|
131
|
+
const rx = o[0] + pos[i], ry = o[1] + pos[i + 1], rz = o[2] + pos[i + 2];
|
|
132
|
+
w.pts.push([rx + cx, cy - rz]);
|
|
133
|
+
if (ry < w.ymin)
|
|
134
|
+
w.ymin = ry;
|
|
135
|
+
if (ry > w.ymax)
|
|
136
|
+
w.ymax = ry;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const out = [];
|
|
140
|
+
for (const w of walls.values()) {
|
|
141
|
+
if (!(w.ymax > lo + BAND_MARGIN && w.ymin < hi - BAND_MARGIN))
|
|
142
|
+
continue; // not on this storey
|
|
143
|
+
if (w.pts.length < 6)
|
|
144
|
+
continue;
|
|
145
|
+
const o = footprintOBB(w.pts);
|
|
146
|
+
if (!o || o.length <= MIN_LEN || o.thickness <= MIN_THICK || o.thickness >= MAX_THICK)
|
|
147
|
+
continue;
|
|
148
|
+
const [c0, c1, c2, c3] = o.corners;
|
|
149
|
+
// Centreline = the mid-thickness line along the long axis (mid of each short
|
|
150
|
+
// edge). c0→c1 and c3→c2 are the long (face) edges.
|
|
151
|
+
const a = [(c0[0] + c3[0]) / 2, (c0[1] + c3[1]) / 2];
|
|
152
|
+
const b = [(c1[0] + c2[0]) / 2, (c1[1] + c2[1]) / 2];
|
|
153
|
+
out.push({ corners: o.corners, centreline: [a, b], thickness: o.thickness });
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=room-wall-rects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-wall-rects.js","sourceRoot":"","sources":["../../src/in-store/room-wall-rects.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiD/D,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAY1E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAE/D;wCACwC;AACxC,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,gFAAgF;AAChF,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAiC;IACpE,MAAM,KAAK,GAAG,KAAK,EAAE,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC,E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C,CAAC,CAAC;QACzD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* attribute unless it is an enumeration, which defaults to `NOTDEFINED` when
|
|
15
15
|
* the enumeration has that value.
|
|
16
16
|
*/
|
|
17
|
-
import { type SchemaRegistry } from '@ifc-lite/parser';
|
|
17
|
+
import { type SchemaRegistry, type SchemaEntityNameSnapshot } from '@ifc-lite/parser';
|
|
18
18
|
import type { SpatialAnchorSchema } from './anchor.js';
|
|
19
19
|
/**
|
|
20
20
|
* The registry for an authoring schema (default IFC4). Refuses IFC5 / IFCX and
|
|
@@ -23,11 +23,11 @@ import type { SpatialAnchorSchema } from './anchor.js';
|
|
|
23
23
|
*/
|
|
24
24
|
export declare function schemaRegistry(schema: SpatialAnchorSchema | undefined, op: string): SchemaRegistry;
|
|
25
25
|
/** The schema's canonical spelling of `type`, or null when the class does not exist in it. */
|
|
26
|
-
export declare function canonicalEntity(registry: SchemaRegistry, type: string): string | null;
|
|
26
|
+
export declare function canonicalEntity(registry: SchemaRegistry, type: string, snapshot?: SchemaEntityNameSnapshot): string | null;
|
|
27
27
|
/**
|
|
28
28
|
* Whether `type` is an `expected` in the schema: the class itself or one of its
|
|
29
29
|
* subtypes, or (transitively) a member of the `expected` SELECT.
|
|
30
30
|
*/
|
|
31
|
-
export declare function conformsTo(registry: SchemaRegistry, type: string, expected: string): boolean;
|
|
31
|
+
export declare function conformsTo(registry: SchemaRegistry, type: string, expected: string, snapshot?: SchemaEntityNameSnapshot): boolean;
|
|
32
32
|
export declare function schemaAttributes(registry: SchemaRegistry, type: string, values: Readonly<Record<string, unknown>>, op: string): unknown[];
|
|
33
33
|
//# sourceMappingURL=schema-attributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-attributes.d.ts","sourceRoot":"","sources":["../../src/in-store/schema-attributes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"schema-attributes.d.ts","sourceRoot":"","sources":["../../src/in-store/schema-attributes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAuD,KAAK,cAAc,EAAE,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC3I,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMvD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,CAMlG;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,wBAAwB,GAAG,MAAM,GAAG,IAAI,CAE1H;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,wBAAwB,GAAG,OAAO,CASjI;AASD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,EAAE,EAAE,MAAM,GACT,OAAO,EAAE,CAsCX"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* attribute unless it is an enumeration, which defaults to `NOTDEFINED` when
|
|
18
18
|
* the enumeration has that value.
|
|
19
19
|
*/
|
|
20
|
-
import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
20
|
+
import { getSchemaRegistryForVersion, getCanonicalEntityName } from '@ifc-lite/parser';
|
|
21
21
|
const AUTHORING_SCHEMAS = ['IFC2X3', 'IFC4', 'IFC4X3'];
|
|
22
22
|
/**
|
|
23
23
|
* The registry for an authoring schema (default IFC4). Refuses IFC5 / IFCX and
|
|
@@ -32,19 +32,21 @@ export function schemaRegistry(schema, op) {
|
|
|
32
32
|
return getSchemaRegistryForVersion(version);
|
|
33
33
|
}
|
|
34
34
|
/** The schema's canonical spelling of `type`, or null when the class does not exist in it. */
|
|
35
|
-
export function canonicalEntity(registry, type) {
|
|
36
|
-
|
|
37
|
-
return Object.keys(registry.entities).find((name) => name.toUpperCase() === upper) ?? null;
|
|
35
|
+
export function canonicalEntity(registry, type, snapshot) {
|
|
36
|
+
return getCanonicalEntityName(registry, type, snapshot) ?? null;
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
39
|
* Whether `type` is an `expected` in the schema: the class itself or one of its
|
|
41
40
|
* subtypes, or (transitively) a member of the `expected` SELECT.
|
|
42
41
|
*/
|
|
43
|
-
export function conformsTo(registry, type, expected) {
|
|
44
|
-
const name = canonicalEntity(registry, type);
|
|
42
|
+
export function conformsTo(registry, type, expected, snapshot) {
|
|
43
|
+
const name = canonicalEntity(registry, type, snapshot);
|
|
45
44
|
if (!name)
|
|
46
45
|
return false;
|
|
47
|
-
const
|
|
46
|
+
const definition = registry.entities[name];
|
|
47
|
+
if (!definition)
|
|
48
|
+
return false;
|
|
49
|
+
const chain = definition.inheritanceChain ?? [name];
|
|
48
50
|
const matches = (target, depth) => chain.includes(target) || (depth < 8 && (registry.selects[target] ?? []).some((member) => matches(member, depth + 1)));
|
|
49
51
|
return matches(expected, 0);
|
|
50
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-attributes.js","sourceRoot":"","sources":["../../src/in-store/schema-attributes.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,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,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AA8CD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CAyGjB"}
|
package/dist/in-store/slab.js
CHANGED
|
@@ -127,7 +127,6 @@ export function addSlabToStore(editor, anchor, params) {
|
|
|
127
127
|
null,
|
|
128
128
|
[`#${shapeRepId}`],
|
|
129
129
|
]).expressId;
|
|
130
|
-
// `IfcSlab.PredefinedType` only exists from IFC4 onward.
|
|
131
130
|
const slabAttrs = [
|
|
132
131
|
productGuid(params, anchor.guidRandom),
|
|
133
132
|
ownerHistoryRef(ownerHistoryId),
|
|
@@ -137,10 +136,8 @@ export function addSlabToStore(editor, anchor, params) {
|
|
|
137
136
|
`#${placementId}`,
|
|
138
137
|
`#${productShapeId}`,
|
|
139
138
|
params.Tag ?? null,
|
|
139
|
+
'.FLOOR.',
|
|
140
140
|
];
|
|
141
|
-
if ((anchor.schema ?? 'IFC4') !== 'IFC2X3') {
|
|
142
|
-
slabAttrs.push('.FLOOR.');
|
|
143
|
-
}
|
|
144
141
|
const slabId = editor.addEntity('IfcSlab', slabAttrs).expressId;
|
|
145
142
|
const relContainedId = editor.addEntity('IfcRelContainedInSpatialStructure', [
|
|
146
143
|
generateIfcGuid(anchor.guidRandom),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slab.js","sourceRoot":"","sources":["../../src/in-store/slab.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CA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,SAAS;QACT,OAAO;QACP,UAAU;QACV,cAAc;QACd,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** #6232: remove a single-flight stair assembly, retaining shared geometry
|
|
2
|
+
* and styles. Generic StoreEditor.removeEntity remains a one-record operation. */
|
|
3
|
+
import { type StoreEditor } from '@ifc-lite/mutations';
|
|
4
|
+
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
5
|
+
/** Resolve the live unique assembly before deleting either product. Shape,
|
|
6
|
+
* placement, style and material leaves remain available to other products;
|
|
7
|
+
* STEP export applies its existing deleted-endpoint relationship filtering. */
|
|
8
|
+
export declare function removeStairInStore(store: IfcDataStore, editor: StoreEditor, stairId: number): {
|
|
9
|
+
stairId: number;
|
|
10
|
+
flightId: number;
|
|
11
|
+
};
|
|
12
|
+
/** Package-private guarded removal inside an already-owned atomic transaction. */
|
|
13
|
+
export declare function removeStairFromDraft(store: IfcDataStore, draft: StoreEditor, stairId: number): {
|
|
14
|
+
stairId: number;
|
|
15
|
+
flightId: number;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=stair-removal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stair-removal.d.ts","sourceRoot":"","sources":["../../src/in-store/stair-removal.ts"],"names":[],"mappings":"AAIA;kFACkF;AAClF,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAA+B,KAAK,YAAY,EAAuB,MAAM,kBAAkB,CAAC;AAsCvG;;+EAE+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAEnI;AAED,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAoEpI"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/** #6232: remove a single-flight stair assembly, retaining shared geometry
|
|
5
|
+
* and styles. Generic StoreEditor.removeEntity remains a one-record operation. */
|
|
6
|
+
import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
|
|
7
|
+
import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
8
|
+
import { AnchorEntityReader } from './resolve-anchor.js';
|
|
9
|
+
import { asRef, refList } from './style-entity-reader.js';
|
|
10
|
+
function referenceType(registry, type) {
|
|
11
|
+
const pending = [type], visited = new Set();
|
|
12
|
+
while (pending.length) {
|
|
13
|
+
const candidate = pending.pop();
|
|
14
|
+
if (visited.has(candidate))
|
|
15
|
+
continue;
|
|
16
|
+
visited.add(candidate);
|
|
17
|
+
if (registry.entities[candidate])
|
|
18
|
+
return true;
|
|
19
|
+
pending.push(...(registry.selects[candidate] ?? []));
|
|
20
|
+
const alias = registry.types[candidate];
|
|
21
|
+
if (alias)
|
|
22
|
+
pending.push(alias);
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
/** References in an admitted entity slot, without recursive file-supplied walks. */
|
|
27
|
+
function referencesPair(value, pair) {
|
|
28
|
+
const pending = [value], visited = new Set();
|
|
29
|
+
let work = 0;
|
|
30
|
+
while (pending.length) {
|
|
31
|
+
if (++work > 100_000)
|
|
32
|
+
throw new Error('removeStairInStore: incoming product references exceed the inspection budget');
|
|
33
|
+
const item = pending.pop();
|
|
34
|
+
if (Array.isArray(item)) {
|
|
35
|
+
if (visited.has(item))
|
|
36
|
+
continue;
|
|
37
|
+
visited.add(item);
|
|
38
|
+
if (item.length > 100_000 - work - pending.length)
|
|
39
|
+
throw new Error('removeStairInStore: incoming product references exceed the inspection budget');
|
|
40
|
+
for (const member of item)
|
|
41
|
+
pending.push(member);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const id = asRef(item);
|
|
45
|
+
if (id !== null && pair.has(id))
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
/** Resolve the live unique assembly before deleting either product. Shape,
|
|
52
|
+
* placement, style and material leaves remain available to other products;
|
|
53
|
+
* STEP export applies its existing deleted-endpoint relationship filtering. */
|
|
54
|
+
export function removeStairInStore(store, editor, stairId) {
|
|
55
|
+
return editor.runAtomic(draft => removeStairFromDraft(store, draft, stairId));
|
|
56
|
+
}
|
|
57
|
+
/** Package-private guarded removal inside an already-owned atomic transaction. */
|
|
58
|
+
export function removeStairFromDraft(store, draft, stairId) {
|
|
59
|
+
const version = store.schemaVersion ?? 'IFC4';
|
|
60
|
+
if (version !== 'IFC2X3' && version !== 'IFC4' && version !== 'IFC4X3') {
|
|
61
|
+
throw new Error(`removeStairInStore: ${version} is not supported`);
|
|
62
|
+
}
|
|
63
|
+
const reader = new AnchorEntityReader(store, draft.getMutationView());
|
|
64
|
+
if (reader.entity(stairId)?.type.toUpperCase() !== 'IFCSTAIR') {
|
|
65
|
+
throw new Error(`removeStairInStore: #${stairId} is not a live IfcStair`);
|
|
66
|
+
}
|
|
67
|
+
const aggregates = [...reader.ids('IFCRELAGGREGATES')].map(id => {
|
|
68
|
+
const entity = reader.entity(id);
|
|
69
|
+
if (!entity)
|
|
70
|
+
throw new Error(`removeStairInStore: live IfcRelAggregates #${id} cannot be read`);
|
|
71
|
+
return entity;
|
|
72
|
+
});
|
|
73
|
+
const owned = aggregates.filter(entity => asRef(entity.attributes[4]) === stairId);
|
|
74
|
+
const rawMembers = owned.length === 1 ? owned[0].attributes[5] : null;
|
|
75
|
+
const flightId = Array.isArray(rawMembers) && rawMembers.length === 1 ? asRef(rawMembers[0]) : null;
|
|
76
|
+
if (flightId === null || reader.entity(flightId)?.type.toUpperCase() !== 'IFCSTAIRFLIGHT') {
|
|
77
|
+
throw new Error(`removeStairInStore: #${stairId} must aggregate exactly one live IfcStairFlight`);
|
|
78
|
+
}
|
|
79
|
+
if (aggregates.filter(entity => refList(entity.attributes[5]).includes(flightId)).length !== 1
|
|
80
|
+
|| aggregates.some(entity => refList(entity.attributes[5]).includes(stairId) || asRef(entity.attributes[4]) === flightId)) {
|
|
81
|
+
throw new Error(`removeStairInStore: #${stairId} or flight #${flightId} belongs to another assembly`);
|
|
82
|
+
}
|
|
83
|
+
const registry = getSchemaRegistryForVersion(version);
|
|
84
|
+
const admitsReferences = new Map();
|
|
85
|
+
const productSlots = new Map();
|
|
86
|
+
for (const definition of Object.values(registry.entities)) {
|
|
87
|
+
if (definition.name !== 'IfcProduct' && !definition.inheritanceChain?.includes('IfcProduct'))
|
|
88
|
+
continue;
|
|
89
|
+
const slots = [];
|
|
90
|
+
for (const [index, attribute] of (definition.allAttributes ?? []).entries()) {
|
|
91
|
+
let admitted = admitsReferences.get(attribute.type);
|
|
92
|
+
if (admitted === undefined) {
|
|
93
|
+
admitted = referenceType(registry, attribute.type);
|
|
94
|
+
admitsReferences.set(attribute.type, admitted);
|
|
95
|
+
}
|
|
96
|
+
if (admitted)
|
|
97
|
+
slots.push({ index, name: attribute.name });
|
|
98
|
+
}
|
|
99
|
+
if (slots.length)
|
|
100
|
+
productSlots.set(definition.name.toUpperCase(), slots);
|
|
101
|
+
}
|
|
102
|
+
const pair = new Set([stairId, flightId]);
|
|
103
|
+
for (const id of reader.ids('IFCRELVOIDSELEMENT')) {
|
|
104
|
+
const relationship = reader.entity(id);
|
|
105
|
+
if (!relationship)
|
|
106
|
+
throw new Error(`removeStairInStore: void relationship #${id} cannot be read`);
|
|
107
|
+
const host = asRef(relationship.attributes[4]);
|
|
108
|
+
if (host !== null && pair.has(host)) {
|
|
109
|
+
throw new Error(`removeStairInStore: stair or flight hosts a live opening; edit the host in place`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Effective type buckets preserve overlay creations/retypes and exclude
|
|
113
|
+
// geometry/property records before the reader materializes attributes.
|
|
114
|
+
for (const { expressId, type } of iterateEffectiveEntityIds(store, draft.getMutationView(), [...productSlots.keys()])) {
|
|
115
|
+
if (pair.has(expressId))
|
|
116
|
+
continue;
|
|
117
|
+
const slots = productSlots.get(type);
|
|
118
|
+
if (!slots)
|
|
119
|
+
continue;
|
|
120
|
+
const entity = reader.entity(expressId);
|
|
121
|
+
if (!entity)
|
|
122
|
+
throw new Error(`removeStairInStore: live product #${expressId} cannot be read`);
|
|
123
|
+
for (const { index, name } of slots) {
|
|
124
|
+
if (referencesPair(entity.attributes[index], pair)) {
|
|
125
|
+
throw new Error(`removeStairInStore: foreign product #${expressId}.${name} references the stair or flight`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (!draft.removeEntity(flightId) || !draft.removeEntity(stairId)) {
|
|
130
|
+
throw new Error(`removeStairInStore: #${stairId} or flight #${flightId} could not be removed`);
|
|
131
|
+
}
|
|
132
|
+
return { stairId, flightId };
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=stair-removal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stair-removal.js","sourceRoot":"","sources":["../../src/in-store/stair-removal.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;kFACkF;AAClF,OAAO,EAAE,yBAAyB,EAAoB,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAA0C,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE1D,SAAS,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,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;YACpC,IAAI,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;gBACnD,MAAM,IAAI,KAAK,CAAC,wCAAwC,SAAS,IAAI,IAAI,iCAAiC,CAAC,CAAC;YAC9G,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,eAAe,QAAQ,uBAAuB,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* schedule.
|
|
22
22
|
*/
|
|
23
23
|
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
24
|
+
import type { MutablePropertyView } from '@ifc-lite/mutations';
|
|
24
25
|
import type { Vec2 } from './auto-space-detect.js';
|
|
25
26
|
/**
|
|
26
27
|
* A storey's placement chain reduced to a planar rigid motion in the model's
|
|
@@ -54,7 +55,7 @@ export interface StoreyPlanFrame {
|
|
|
54
55
|
* - the chain closes on itself, so composing every link of it reaches no
|
|
55
56
|
* world frame to express the result in.
|
|
56
57
|
*/
|
|
57
|
-
export declare function storeyPlanFrame(store: IfcDataStore, storeyExpressId: number): StoreyPlanFrame | null;
|
|
58
|
+
export declare function storeyPlanFrame(store: IfcDataStore, storeyExpressId: number, view?: MutablePropertyView | null): StoreyPlanFrame | null;
|
|
58
59
|
/**
|
|
59
60
|
* World-frame point → the storey-local frame `addSpaceToStore` writes into:
|
|
60
61
|
* `Rᵀ · (p − origin)`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storey-plan-frame.d.ts","sourceRoot":"","sources":["../../src/in-store/storey-plan-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"storey-plan-frame.d.ts","sourceRoot":"","sources":["../../src/in-store/storey-plan-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAUnD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+CAA+C;IAC/C,MAAM,EAAE,IAAI,CAAC;IACb,iEAAiE;IACjE,KAAK,EAAE,IAAI,CAAC;CACb;AAQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,MAAM,EACvB,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAChC,eAAe,GAAG,IAAI,CAqCxB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAKnE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAMrE"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* schedule.
|
|
25
25
|
*/
|
|
26
26
|
import { EntityExtractor } from '@ifc-lite/parser';
|
|
27
|
+
import { AnchorEntityReader } from './resolve-anchor.js';
|
|
27
28
|
import { safeLengthUnitScale } from './length-unit-scale.js';
|
|
28
29
|
import { numericAttr, readEntity, readVec3, storeyFrameAboveBy, storeyPlacementChain, } from './placement-frame.js';
|
|
29
30
|
/** A placement `Axis` is treated as vertical within this of unit +Z. */
|
|
@@ -51,20 +52,28 @@ const IDENTITY_FRAME = { origin: [0, 0], axisX: [1, 0] };
|
|
|
51
52
|
* - the chain closes on itself, so composing every link of it reaches no
|
|
52
53
|
* world frame to express the result in.
|
|
53
54
|
*/
|
|
54
|
-
export function storeyPlanFrame(store, storeyExpressId) {
|
|
55
|
+
export function storeyPlanFrame(store, storeyExpressId, view) {
|
|
55
56
|
if (!store.source)
|
|
56
57
|
return null;
|
|
57
58
|
const extractor = new EntityExtractor(store.source);
|
|
58
|
-
const
|
|
59
|
-
|
|
59
|
+
const reader = view ? new AnchorEntityReader(store, view) : null;
|
|
60
|
+
const overlay = reader ? {
|
|
61
|
+
getNewEntities: () => [], readEntity: id => {
|
|
62
|
+
const record = reader.entity(id);
|
|
63
|
+
// Native StoreEditor fields are strings/IfcAttributeValue positional values.
|
|
64
|
+
return record ? { type: record.type, attributes: record.attributes } : null;
|
|
65
|
+
},
|
|
66
|
+
} : undefined;
|
|
67
|
+
const storey = readEntity(store, extractor, overlay, storeyExpressId);
|
|
68
|
+
if (!storey || (view && storey.type?.toUpperCase() !== 'IFCBUILDINGSTOREY'))
|
|
60
69
|
return null;
|
|
61
70
|
if (numericAttr(storey.attributes[5]) === null)
|
|
62
71
|
return IDENTITY_FRAME; // ObjectPlacement
|
|
63
|
-
const chain = storeyPlacementChain(store, extractor,
|
|
72
|
+
const chain = storeyPlacementChain(store, extractor, overlay, storeyExpressId);
|
|
64
73
|
if (!chain || chain.size === 0)
|
|
65
74
|
return null;
|
|
66
75
|
for (const placementId of chain.keys()) {
|
|
67
|
-
if (!placementIsInPlan(store, extractor, placementId))
|
|
76
|
+
if (!placementIsInPlan(store, extractor, placementId, overlay))
|
|
68
77
|
return null;
|
|
69
78
|
}
|
|
70
79
|
// `hops === chain.size` composes every link, so the result is expressed in
|
|
@@ -74,10 +83,10 @@ export function storeyPlanFrame(store, storeyExpressId) {
|
|
|
74
83
|
// malformed IFC ends with a link that still has a parent, and composing every
|
|
75
84
|
// link then lands in no frame at all rather than the world. Refuse.
|
|
76
85
|
const last = [...chain.keys()][chain.size - 1];
|
|
77
|
-
const lastPlacement = readEntity(store, extractor,
|
|
86
|
+
const lastPlacement = readEntity(store, extractor, overlay, last);
|
|
78
87
|
if (lastPlacement && numericAttr(lastPlacement.attributes[0]) !== null)
|
|
79
88
|
return null;
|
|
80
|
-
const frame = storeyFrameAboveBy(store, extractor,
|
|
89
|
+
const frame = storeyFrameAboveBy(store, extractor, overlay, chain, chain.size);
|
|
81
90
|
if (!frame)
|
|
82
91
|
return null;
|
|
83
92
|
// A thrown or degenerate unit lookup is not a reason to author a space a
|
|
@@ -127,21 +136,21 @@ export function fromStoreyLocal(frame, p) {
|
|
|
127
136
|
* is silently taken for +Z — which is the guess this function exists to
|
|
128
137
|
* prevent, on the one input where the guess cannot be checked.
|
|
129
138
|
*/
|
|
130
|
-
function placementIsInPlan(store, extractor, placementId) {
|
|
131
|
-
const placement = readEntity(store, extractor,
|
|
139
|
+
function placementIsInPlan(store, extractor, placementId, overlay) {
|
|
140
|
+
const placement = readEntity(store, extractor, overlay, placementId);
|
|
132
141
|
if (!placement)
|
|
133
142
|
return true;
|
|
134
143
|
const axisPlacementId = numericAttr(placement.attributes[1]); // RelativePlacement
|
|
135
144
|
if (axisPlacementId === null)
|
|
136
145
|
return true;
|
|
137
|
-
const axisPlacement = readEntity(store, extractor,
|
|
146
|
+
const axisPlacement = readEntity(store, extractor, overlay, axisPlacementId);
|
|
138
147
|
if (!axisPlacement)
|
|
139
148
|
return true;
|
|
140
149
|
const axisId = numericAttr(axisPlacement.attributes[1]); // Axis
|
|
141
150
|
if (axisId === null)
|
|
142
151
|
return true; // absent: +Z by default, per IFC
|
|
143
152
|
// Present from here on — any failure to read it is a refusal, not a default.
|
|
144
|
-
const axisDir = readEntity(store, extractor,
|
|
153
|
+
const axisDir = readEntity(store, extractor, overlay, axisId);
|
|
145
154
|
if (!axisDir)
|
|
146
155
|
return false;
|
|
147
156
|
const v = readVec3(axisDir.attributes[0]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storey-plan-frame.js","sourceRoot":"","sources":["../../src/in-store/storey-plan-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"storey-plan-frame.js","sourceRoot":"","sources":["../../src/in-store/storey-plan-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAAkB,CAAC;AAGtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAc9B,wEAAwE;AACxE,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B,4EAA4E;AAC5E,MAAM,cAAc,GAAoB,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAmB,EACnB,eAAuB,EACvB,IAAiC;IAEjC,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IA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