@ifc-lite/create 3.2.0 → 5.1.0
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 +43 -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/auto-space-detect.d.ts +1 -1
- package/dist/in-store/auto-space-detect.js +1 -1
- package/dist/in-store/beam.d.ts +10 -1
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +17 -35
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/column.d.ts +10 -1
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +23 -22
- package/dist/in-store/column.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 +53 -0
- package/dist/in-store/copy-frame.d.ts.map +1 -0
- package/dist/in-store/copy-frame.js +112 -0
- package/dist/in-store/copy-frame.js.map +1 -0
- package/dist/in-store/copy-product.d.ts +76 -0
- package/dist/in-store/copy-product.d.ts.map +1 -0
- package/dist/in-store/copy-product.js +318 -0
- package/dist/in-store/copy-product.js.map +1 -0
- package/dist/in-store/curtain-wall.d.ts +87 -0
- package/dist/in-store/curtain-wall.d.ts.map +1 -0
- package/dist/in-store/curtain-wall.js +237 -0
- package/dist/in-store/curtain-wall.js.map +1 -0
- 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 +107 -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 +58 -0
- package/dist/in-store/element-transform-frames.d.ts.map +1 -0
- package/dist/in-store/element-transform-frames.js +110 -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 +36 -0
- package/dist/in-store/extract-grids.d.ts.map +1 -0
- package/dist/in-store/extract-grids.js +220 -0
- package/dist/in-store/extract-grids.js.map +1 -0
- package/dist/in-store/extract-walls.d.ts +12 -23
- package/dist/in-store/extract-walls.d.ts.map +1 -1
- package/dist/in-store/extract-walls.js +6 -69
- package/dist/in-store/extract-walls.js.map +1 -1
- package/dist/in-store/generate-spaces.d.ts +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 +124 -0
- package/dist/in-store/grid.d.ts.map +1 -0
- package/dist/in-store/grid.js +204 -0
- package/dist/in-store/grid.js.map +1 -0
- 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 +213 -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 +48 -0
- package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
- package/dist/in-store/host-geometry-frame.js +190 -0
- package/dist/in-store/host-geometry-frame.js.map +1 -0
- package/dist/in-store/hosted-element-edit.d.ts +29 -0
- package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-element-edit.js +120 -0
- package/dist/in-store/hosted-element-edit.js.map +1 -0
- package/dist/in-store/hosted-element.d.ts +41 -0
- package/dist/in-store/hosted-element.d.ts.map +1 -0
- package/dist/in-store/hosted-element.js +124 -0
- package/dist/in-store/hosted-element.js.map +1 -0
- package/dist/in-store/hosted-fill-read.d.ts +56 -0
- package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
- package/dist/in-store/hosted-fill-read.js +197 -0
- package/dist/in-store/hosted-fill-read.js.map +1 -0
- package/dist/in-store/hosted-global-id.d.ts +8 -0
- package/dist/in-store/hosted-global-id.d.ts.map +1 -0
- package/dist/in-store/hosted-global-id.js +53 -0
- package/dist/in-store/hosted-global-id.js.map +1 -0
- package/dist/in-store/hosted-placement-edit.d.ts +30 -0
- package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-placement-edit.js +123 -0
- package/dist/in-store/hosted-placement-edit.js.map +1 -0
- package/dist/in-store/hosted-scale-chain.d.ts +12 -0
- package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
- package/dist/in-store/hosted-scale-chain.js +74 -0
- package/dist/in-store/hosted-scale-chain.js.map +1 -0
- package/dist/in-store/hosted-shape-edit.d.ts +9 -0
- package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-shape-edit.js +79 -0
- package/dist/in-store/hosted-shape-edit.js.map +1 -0
- package/dist/in-store/index.d.ts +66 -0
- package/dist/in-store/index.d.ts.map +1 -0
- package/dist/in-store/index.js +71 -0
- package/dist/in-store/index.js.map +1 -0
- 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 +8 -2
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js +15 -21
- 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 +15 -5
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js +25 -36
- package/dist/in-store/placement-frame.js.map +1 -1
- package/dist/in-store/profile.d.ts +141 -0
- package/dist/in-store/profile.d.ts.map +1 -0
- package/dist/in-store/profile.js +174 -0
- package/dist/in-store/profile.js.map +1 -0
- package/dist/in-store/railing.d.ts +65 -0
- package/dist/in-store/railing.d.ts.map +1 -0
- package/dist/in-store/railing.js +112 -0
- package/dist/in-store/railing.js.map +1 -0
- package/dist/in-store/rel-connects-path.d.ts +43 -0
- package/dist/in-store/rel-connects-path.d.ts.map +1 -0
- package/dist/in-store/rel-connects-path.js +65 -0
- package/dist/in-store/rel-connects-path.js.map +1 -0
- 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-host.d.ts +12 -1
- package/dist/in-store/resolve-host.d.ts.map +1 -1
- package/dist/in-store/resolve-host.js +169 -85
- package/dist/in-store/resolve-host.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 +39 -59
- 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 +8 -3
- package/dist/in-store/schema-attributes.d.ts.map +1 -1
- package/dist/in-store/schema-attributes.js +18 -9
- 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/space-footprints.d.ts +55 -0
- package/dist/in-store/space-footprints.d.ts.map +1 -0
- package/dist/in-store/space-footprints.js +260 -0
- package/dist/in-store/space-footprints.js.map +1 -0
- package/dist/in-store/space.d.ts.map +1 -1
- package/dist/in-store/space.js +15 -3
- package/dist/in-store/space.js.map +1 -1
- package/dist/in-store/spatial-children.d.ts +1 -1
- package/dist/in-store/spatial-children.js +1 -1
- package/dist/in-store/stair-edit.d.ts +24 -0
- package/dist/in-store/stair-edit.d.ts.map +1 -0
- package/dist/in-store/stair-edit.js +190 -0
- package/dist/in-store/stair-edit.js.map +1 -0
- 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/stair.d.ts +58 -0
- package/dist/in-store/stair.d.ts.map +1 -0
- package/dist/in-store/stair.js +156 -0
- package/dist/in-store/stair.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-apply.d.ts +74 -0
- package/dist/in-store/wall-join-apply.d.ts.map +1 -0
- package/dist/in-store/wall-join-apply.js +137 -0
- package/dist/in-store/wall-join-apply.js.map +1 -0
- package/dist/in-store/wall-join-edit.d.ts +53 -0
- package/dist/in-store/wall-join-edit.d.ts.map +1 -0
- package/dist/in-store/wall-join-edit.js +251 -0
- package/dist/in-store/wall-join-edit.js.map +1 -0
- package/dist/in-store/wall-join-read.d.ts +60 -0
- package/dist/in-store/wall-join-read.d.ts.map +1 -0
- package/dist/in-store/wall-join-read.js +230 -0
- package/dist/in-store/wall-join-read.js.map +1 -0
- package/dist/in-store/wall-join.d.ts +122 -0
- package/dist/in-store/wall-join.d.ts.map +1 -0
- package/dist/in-store/wall-join.js +231 -0
- package/dist/in-store/wall-join.js.map +1 -0
- package/dist/in-store/wall-opening-fit.d.ts +11 -0
- package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
- package/dist/in-store/wall-opening-fit.js +27 -0
- package/dist/in-store/wall-opening-fit.js.map +1 -0
- 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/in-store/wall.d.ts +32 -0
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +77 -13
- package/dist/in-store/wall.js.map +1 -1
- package/dist/index.d.ts +25 -38
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -40
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
|
@@ -0,0 +1,47 @@
|
|
|
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 { finiteCopyFrame, turnThenMove } from './copy-frame.js';
|
|
5
|
+
import { COPY_BATCH_LIMIT } from './copy-batch.js';
|
|
6
|
+
/** The same placement planner for viewer previews, commits and public arrays (#6232 D5). */
|
|
7
|
+
export function arrayCopyTransforms(params) {
|
|
8
|
+
const { mode, count, anchor, cursor } = params;
|
|
9
|
+
if (mode !== 'linear' && mode !== 'polar')
|
|
10
|
+
throw new Error('Unsupported array mode');
|
|
11
|
+
if (!Number.isSafeInteger(count) || count < 2)
|
|
12
|
+
throw new Error('Array count must be an integer of at least two');
|
|
13
|
+
if (count - 1 > COPY_BATCH_LIMIT)
|
|
14
|
+
throw new Error(`An array may contain at most ${COPY_BATCH_LIMIT} new copies`);
|
|
15
|
+
if (!anchor)
|
|
16
|
+
return null;
|
|
17
|
+
if (!anchor.every(Number.isFinite) || (cursor && !cursor.every(Number.isFinite)))
|
|
18
|
+
throw new Error('Array points must contain finite metre coordinates');
|
|
19
|
+
const copies = Array.from({ length: count - 1 }, (_, i) => i + 1);
|
|
20
|
+
if (mode === 'polar') {
|
|
21
|
+
const angle = params.angleDegrees ?? 360;
|
|
22
|
+
if (!Number.isFinite(angle) || angle === 0 || Math.abs(angle) > 360)
|
|
23
|
+
throw new Error('Polar span must be nonzero finite degrees within one turn');
|
|
24
|
+
const step = Math.abs(angle) >= 360 ? (Math.sign(angle) * 360) / count : angle / (count - 1);
|
|
25
|
+
return copies.map((i) => {
|
|
26
|
+
const turn = (step * i * Math.PI) / 180;
|
|
27
|
+
finiteCopyFrame(turnThenMove(turn, anchor, [0, 0, 0]), 'storey-local metres');
|
|
28
|
+
return { turn, pivot: [anchor[0], anchor[1]] };
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (!cursor)
|
|
32
|
+
return null;
|
|
33
|
+
const clicked = Math.hypot(cursor[0] - anchor[0], cursor[1] - anchor[1]);
|
|
34
|
+
if (!Number.isFinite(clicked))
|
|
35
|
+
throw new Error('Linear array direction must have finite length');
|
|
36
|
+
if (clicked < 1e-6)
|
|
37
|
+
return null;
|
|
38
|
+
const distance = params.distance ?? clicked;
|
|
39
|
+
if (!Number.isFinite(distance) || distance <= 0)
|
|
40
|
+
throw new Error('Linear array distance must be positive finite metres');
|
|
41
|
+
const ux = (cursor[0] - anchor[0]) / clicked, uy = (cursor[1] - anchor[1]) / clicked;
|
|
42
|
+
const step = params.fit ? distance / (count - 1) : distance;
|
|
43
|
+
if (!Number.isFinite(step * (count - 1)))
|
|
44
|
+
throw new Error('Linear array extent must be finite metres');
|
|
45
|
+
return copies.map((i) => ({ offset: [ux * step * i, uy * step * i, 0] }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=copy-array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-array.js","sourceRoot":"","sources":["../../src/in-store/copy-array.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAiBnD,4FAA4F;AAC5F,MAAM,UAAU,mBAAmB,CAAC,MAAuB;IACzD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/C,IAAI,IAAI,KAAK,Q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AAG,OAAO,CAAC;IACrF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IACvG,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Shared selection, preview and atomic write for paste, array and Duplicate (#6232 D5). */
|
|
2
|
+
import type { StoreEditor } from '@ifc-lite/mutations';
|
|
3
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
4
|
+
import { type CopyContext, type CopyProductResult, type CopyTransform } from './copy-product.js';
|
|
5
|
+
import type { DuplicateInStoreOptions } from './duplicate.js';
|
|
6
|
+
/** Bound pruned root fan-out before allocating products/transforms. */
|
|
7
|
+
export declare const COPY_BATCH_LIMIT = 10000;
|
|
8
|
+
/** Keep roots once; their openings, fillings and assembly parts travel with them. */
|
|
9
|
+
export declare function copySourcesInStore(ctx: CopyContext, ids: readonly number[], copyCount?: number): {
|
|
10
|
+
ids: number[];
|
|
11
|
+
} | {
|
|
12
|
+
refusal: string;
|
|
13
|
+
};
|
|
14
|
+
/** Products a copy preview displays, including hosted fillings and assembly parts. */
|
|
15
|
+
export declare function copiedProductsInStore(ctx: CopyContext, ids: readonly number[]): number[];
|
|
16
|
+
export interface CopyBatchOptions {
|
|
17
|
+
/** Duplicate's naming/randomness policy; displacement is supplied by transforms. */
|
|
18
|
+
readonly duplicate?: Pick<DuplicateInStoreOptions, 'name' | 'guidRandom'>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Each transform copies each selected root, in transform-major order. All
|
|
22
|
+
* graph writes succeed together or leave records, journal and allocator intact.
|
|
23
|
+
* The same selection policy is applied at preview and commit: selected hosted
|
|
24
|
+
* children never create a second independent copy.
|
|
25
|
+
*/
|
|
26
|
+
export declare function copyBatchInStore(store: IfcDataStore, editor: StoreEditor, ids: readonly number[], transforms: readonly CopyTransform[], options?: CopyBatchOptions): readonly CopyProductResult[];
|
|
27
|
+
//# sourceMappingURL=copy-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-batch.d.ts","sourceRoot":"","sources":["../../src/in-store/copy-batch.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAA2E,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC1K,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAG9D,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAEvC,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,SAAI,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CA4BnI;AAED,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAYxF;AAED,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC;CAC3E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,SAAS,MAAM,EAAE,EACtB,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,OAAO,GAAE,gBAAqB,GAC7B,SAAS,iBAAiB,EAAE,CAuB9B"}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 { copyProductInStore, copyRefusal, createCopyContext, productStoreyOrigin } from './copy-product.js';
|
|
5
|
+
import { copiedProductWork, COPY_PRODUCT_WORK_LIMIT } from './copy-dependent-walk.js';
|
|
6
|
+
/** Bound pruned root fan-out before allocating products/transforms. */
|
|
7
|
+
export const COPY_BATCH_LIMIT = 10_000;
|
|
8
|
+
/** Keep roots once; their openings, fillings and assembly parts travel with them. */
|
|
9
|
+
export function copySourcesInStore(ctx, ids, copyCount = 1) {
|
|
10
|
+
const hostOf = new Map();
|
|
11
|
+
for (const [host, openings] of ctx.voids)
|
|
12
|
+
for (const { id } of openings)
|
|
13
|
+
hostOf.set(id, host);
|
|
14
|
+
const chosen = new Set(ids);
|
|
15
|
+
const carried = (id) => {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
for (let up = id; up !== undefined && !seen.has(up);) {
|
|
18
|
+
seen.add(up);
|
|
19
|
+
up = ctx.partOf.get(up) ?? hostOf.get(ctx.filledBy.get(up) ?? up);
|
|
20
|
+
if (up !== undefined && chosen.has(up))
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
25
|
+
const kept = [...chosen].filter((id) => !carried(id));
|
|
26
|
+
if (!Number.isSafeInteger(copyCount) || copyCount < 1 || kept.length * copyCount > COPY_BATCH_LIMIT)
|
|
27
|
+
return { refusal: `A copy batch may contain at most ${COPY_BATCH_LIMIT} root copies` };
|
|
28
|
+
let productWork = 0;
|
|
29
|
+
for (const id of kept) {
|
|
30
|
+
const refusal = copyRefusal(ctx, id);
|
|
31
|
+
if (refusal)
|
|
32
|
+
return { refusal };
|
|
33
|
+
try {
|
|
34
|
+
productWork += copiedProductWork(ctx, id);
|
|
35
|
+
if (productWork * copyCount > COPY_PRODUCT_WORK_LIMIT)
|
|
36
|
+
return { refusal: `Copy carried products exceed ${COPY_PRODUCT_WORK_LIMIT} product writes` };
|
|
37
|
+
if (!productStoreyOrigin(ctx, id))
|
|
38
|
+
return { refusal: `#${id} has no placement to copy from` };
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return { refusal: error instanceof Error ? error.message : String(error) };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return kept.length > 0 ? { ids: kept } : { refusal: 'Nothing to copy' };
|
|
45
|
+
}
|
|
46
|
+
/** Products a copy preview displays, including hosted fillings and assembly parts. */
|
|
47
|
+
export function copiedProductsInStore(ctx, ids) {
|
|
48
|
+
const shown = new Set();
|
|
49
|
+
const pending = [...ids].reverse();
|
|
50
|
+
while (pending.length > 0) {
|
|
51
|
+
const id = pending.pop();
|
|
52
|
+
if (shown.has(id))
|
|
53
|
+
continue;
|
|
54
|
+
shown.add(id);
|
|
55
|
+
const children = (ctx.voids.get(id) ?? []).flatMap(({ id: opening }) => (ctx.fills.get(opening) ?? []).map(({ id: filling }) => filling));
|
|
56
|
+
children.push(...(ctx.parts.get(id) ?? []).flatMap((link) => link.parts));
|
|
57
|
+
for (let i = children.length - 1; i >= 0; i--)
|
|
58
|
+
pending.push(children[i]);
|
|
59
|
+
}
|
|
60
|
+
return [...shown];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Each transform copies each selected root, in transform-major order. All
|
|
64
|
+
* graph writes succeed together or leave records, journal and allocator intact.
|
|
65
|
+
* The same selection policy is applied at preview and commit: selected hosted
|
|
66
|
+
* children never create a second independent copy.
|
|
67
|
+
*/
|
|
68
|
+
export function copyBatchInStore(store, editor, ids, transforms, options = {}) {
|
|
69
|
+
if (transforms.length > COPY_BATCH_LIMIT)
|
|
70
|
+
throw new Error(`A copy batch may contain at most ${COPY_BATCH_LIMIT} transforms`);
|
|
71
|
+
if (transforms.length === 0)
|
|
72
|
+
throw new Error('At least one copy transform is required');
|
|
73
|
+
for (const transform of transforms) {
|
|
74
|
+
if (transform.offset && (transform.offset.length !== 3 || !transform.offset.every(Number.isFinite)))
|
|
75
|
+
throw new Error('Copy offset must contain three finite metre coordinates');
|
|
76
|
+
if (transform.pivot && (transform.pivot.length !== 2 || !transform.pivot.every(Number.isFinite)))
|
|
77
|
+
throw new Error('Copy pivot must contain two finite metre coordinates');
|
|
78
|
+
if (transform.turn !== undefined && !Number.isFinite(transform.turn))
|
|
79
|
+
throw new Error('Copy turn must be finite radians');
|
|
80
|
+
if (transform.targetStoreyId !== undefined && (!Number.isSafeInteger(transform.targetStoreyId) || transform.targetStoreyId <= 0))
|
|
81
|
+
throw new Error('Copy targetStoreyId must be a positive integer');
|
|
82
|
+
}
|
|
83
|
+
return editor.runAtomic((draft) => {
|
|
84
|
+
const ctx = createCopyContext(store, draft, { guidRandom: options.duplicate?.guidRandom });
|
|
85
|
+
for (const transform of transforms) {
|
|
86
|
+
if (transform.targetStoreyId !== undefined && ctx.read(transform.targetStoreyId)?.type.toUpperCase() !== 'IFCBUILDINGSTOREY')
|
|
87
|
+
throw new Error('Copy targetStoreyId must identify an IfcBuildingStorey in this model');
|
|
88
|
+
}
|
|
89
|
+
const sources = copySourcesInStore(ctx, ids, transforms.length);
|
|
90
|
+
if ('refusal' in sources)
|
|
91
|
+
throw new Error(sources.refusal);
|
|
92
|
+
return transforms.flatMap((transform) => sources.ids.map((id) => {
|
|
93
|
+
if (!options.duplicate)
|
|
94
|
+
return copyProductInStore(ctx, id, transform);
|
|
95
|
+
const sourceName = ctx.read(id)?.attributes[2];
|
|
96
|
+
const name = options.duplicate.name ?? (typeof sourceName === 'string' && sourceName.length > 0 ? `${sourceName} (copy)` : sourceName);
|
|
97
|
+
return copyProductInStore(ctx, id, transform, typeof name === 'string' ? { Name: name } : {});
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=copy-batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-batch.js","sourceRoot":"","sources":["../../src/in-store/copy-batch.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAK/D,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAgE,MAAM,mBAAmB,CAAC;AAE1K,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEvC,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAAC,GAAgB,EAAE,GAAsB,EAAE,SAAS,GAAG,CAAC;IACxF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,CAAC,KAAK;QAAE,KAAK,MAAM,EAAE,EAAE,EAAE,IAAI,QAAQ;YAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9F,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE;QACtC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAC/B,KAAK,IAAI,EAAE,GAAuB,EAAE,EAAE,EAAE,KAAK,SAAS,IAAI,CAAC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YAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;YACvI,OAAO,kBAAkB,CAAC,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CopyContext } from './copy-product.js';
|
|
2
|
+
/** Separate from the public 10k root/transform budget. A normal Bonsai wall
|
|
3
|
+
* carries two openings and two fillings: 10k roots remains exactly admissible. */
|
|
4
|
+
export declare const COPY_PRODUCT_WORK_LIMIT = 50000;
|
|
5
|
+
type ProductStep = {
|
|
6
|
+
kind: 'opening' | 'filling' | 'part';
|
|
7
|
+
sourceId: number;
|
|
8
|
+
parentId: number;
|
|
9
|
+
ownerHistory: string | null;
|
|
10
|
+
};
|
|
11
|
+
type AssemblyStep = {
|
|
12
|
+
kind: 'assembly';
|
|
13
|
+
sourceId: number;
|
|
14
|
+
parts: number[];
|
|
15
|
+
ownerHistory: string | null;
|
|
16
|
+
};
|
|
17
|
+
type Step = ProductStep | AssemblyStep;
|
|
18
|
+
/** Iterative depth-first traversal matches the existing product preorder and
|
|
19
|
+
* relation postorder. Assemblies dedupe parts globally; hosted links retain
|
|
20
|
+
* their existing per-host cardinality. Neither deep acyclic graphs nor cycles
|
|
21
|
+
* consume the JavaScript call stack. */
|
|
22
|
+
export declare function copyDependentSteps(ctx: CopyContext, rootId: number): Generator<Step>;
|
|
23
|
+
/** Actual writes, including openings that preview intentionally omits. Stops
|
|
24
|
+
* before writes when fan-out would exceed the separately bounded work budget. */
|
|
25
|
+
export declare function copiedProductWork(ctx: CopyContext, rootId: number): number;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=copy-dependent-walk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-dependent-walk.d.ts","sourceRoot":"","sources":["../../src/in-store/copy-dependent-walk.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;kFACkF;AAClF,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAG9C,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAC7H,KAAK,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AACzG,KAAK,IAAI,GAAG,WAAW,GAAG,YAAY,CAAC;AAGvC;;;wCAGwC;AACxC,wBAAiB,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAoCrF;AAED;iFACiF;AACjF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAK1E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Separate from the public 10k root/transform budget. A normal Bonsai wall
|
|
2
|
+
* carries two openings and two fillings: 10k roots remains exactly admissible. */
|
|
3
|
+
export const COPY_PRODUCT_WORK_LIMIT = 50_000;
|
|
4
|
+
const MAX_DEPENDENT_REFERENCES = COPY_PRODUCT_WORK_LIMIT * 4;
|
|
5
|
+
/** Iterative depth-first traversal matches the existing product preorder and
|
|
6
|
+
* relation postorder. Assemblies dedupe parts globally; hosted links retain
|
|
7
|
+
* their existing per-host cardinality. Neither deep acyclic graphs nor cycles
|
|
8
|
+
* consume the JavaScript call stack. */
|
|
9
|
+
export function* copyDependentSteps(ctx, rootId) {
|
|
10
|
+
const visited = new Set([rootId]);
|
|
11
|
+
const tasks = [{ kind: 'enter', id: rootId }];
|
|
12
|
+
let references = 0;
|
|
13
|
+
const boundedReference = () => {
|
|
14
|
+
if (++references > MAX_DEPENDENT_REFERENCES)
|
|
15
|
+
throw new Error(`Copy dependent graph exceeds ${MAX_DEPENDENT_REFERENCES} references`);
|
|
16
|
+
};
|
|
17
|
+
while (tasks.length > 0) {
|
|
18
|
+
const task = tasks.pop();
|
|
19
|
+
if (task.kind === 'assembly') {
|
|
20
|
+
yield task;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (task.kind === 'part') {
|
|
24
|
+
if (visited.has(task.id))
|
|
25
|
+
continue;
|
|
26
|
+
visited.add(task.id);
|
|
27
|
+
task.collected.push(task.id);
|
|
28
|
+
yield { kind: 'part', sourceId: task.id, parentId: task.parentId, ownerHistory: null };
|
|
29
|
+
tasks.push({ kind: 'enter', id: task.id });
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
for (const opening of ctx.voids.get(task.id) ?? []) {
|
|
33
|
+
boundedReference();
|
|
34
|
+
yield { kind: 'opening', sourceId: opening.id, parentId: task.id, ownerHistory: opening.ownerHistory };
|
|
35
|
+
for (const filling of ctx.fills.get(opening.id) ?? []) {
|
|
36
|
+
boundedReference();
|
|
37
|
+
yield { kind: 'filling', sourceId: filling.id, parentId: opening.id, ownerHistory: filling.ownerHistory };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const links = ctx.parts.get(task.id) ?? [];
|
|
41
|
+
for (let i = links.length - 1; i >= 0; i--) {
|
|
42
|
+
boundedReference();
|
|
43
|
+
const link = links[i], collected = [];
|
|
44
|
+
tasks.push({ kind: 'assembly', sourceId: task.id, parts: collected, ownerHistory: link.ownerHistory });
|
|
45
|
+
for (let p = link.parts.length - 1; p >= 0; p--) {
|
|
46
|
+
boundedReference();
|
|
47
|
+
tasks.push({ kind: 'part', id: link.parts[p], parentId: task.id, collected });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Actual writes, including openings that preview intentionally omits. Stops
|
|
53
|
+
* before writes when fan-out would exceed the separately bounded work budget. */
|
|
54
|
+
export function copiedProductWork(ctx, rootId) {
|
|
55
|
+
let count = 1;
|
|
56
|
+
for (const step of copyDependentSteps(ctx, rootId))
|
|
57
|
+
if (step.kind !== 'assembly' && ++count > COPY_PRODUCT_WORK_LIMIT)
|
|
58
|
+
throw new Error(`Copy carried products exceed ${COPY_PRODUCT_WORK_LIMIT} product writes`);
|
|
59
|
+
return count;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=copy-dependent-walk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-dependent-walk.js","sourceRoot":"","sources":["../../src/in-store/copy-dependent-walk.ts"],"names":[],"mappings":"AAKA;kFACkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC9C,MAAM,wBAAwB,GAAG,uBAAuB,GAAG,CAAC,CAAC;AAO7D;;;wCAGwC;AACxC,MAAM,SAAS,CAAC,CAAC,kBAAkB,CAAC,GAAgB,EAAE,MAAc;IAClE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAClC,MAAM,KAAK,GAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,MAAM,gBAAgB,GAAG,GAAG,EAAE;QAC5B,IAA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,MAAM,IAAI,IAAI,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC;QAAE,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,EAAE,KAAK,GAAG,uBAAuB;YACnH,MAAM,IAAI,KAAK,CAAC,gCAAgC,uBAAuB,iBAAiB,CAAC,CAAC;IAC5F,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The placement arithmetic behind copying a product (#6232 C3): an
|
|
3
|
+
* `IfcLocalPlacement` read as a rigid frame (a turn about the vertical plus
|
|
4
|
+
* a translation, in the file's native length unit), composed up to the
|
|
5
|
+
* storey's own placement, and the copy's turn-and-move applied to it.
|
|
6
|
+
*
|
|
7
|
+
* Frames here turn about the vertical only. Unsupported parent frames refuse
|
|
8
|
+
* rather than projecting their tilt; a copied leaf keeps its full source basis.
|
|
9
|
+
*/
|
|
10
|
+
import type { IfcAttributeValue } from '@ifc-lite/mutations';
|
|
11
|
+
export type CopyVec3 = [number, number, number];
|
|
12
|
+
/** A read of one live record (`createStyleEntityReader`). */
|
|
13
|
+
export type LiveRead = (id: number) => {
|
|
14
|
+
type: string;
|
|
15
|
+
attributes: readonly unknown[];
|
|
16
|
+
} | null;
|
|
17
|
+
/** `p ↦ R(c, s)·p + origin`; `z` just adds. */
|
|
18
|
+
export interface RigidFrame {
|
|
19
|
+
readonly origin: CopyVec3;
|
|
20
|
+
readonly c: number;
|
|
21
|
+
readonly s: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const IDENTITY_FRAME: RigidFrame;
|
|
24
|
+
export declare function applyRigid(f: RigidFrame, p: readonly number[]): CopyVec3;
|
|
25
|
+
export declare function composeRigid(outer: RigidFrame, inner: RigidFrame): RigidFrame;
|
|
26
|
+
export declare function invertRigid(f: RigidFrame): RigidFrame;
|
|
27
|
+
/** The turn about the vertical through `pivot`, then the move `offset`: one rigid frame. */
|
|
28
|
+
export declare function turnThenMove(turn: number, pivot: readonly [number, number], offset: readonly number[]): RigidFrame;
|
|
29
|
+
/** Both the preview planner and writer refuse arithmetic overflow. */
|
|
30
|
+
export declare function finiteCopyFrame(frame: RigidFrame, units?: string): RigidFrame;
|
|
31
|
+
export declare function numberTriple(value: unknown): CopyVec3 | null;
|
|
32
|
+
export interface OwnPlacement {
|
|
33
|
+
readonly frame: RigidFrame;
|
|
34
|
+
readonly parentId: number | null;
|
|
35
|
+
readonly location: CopyVec3;
|
|
36
|
+
readonly axis: CopyVec3 | null;
|
|
37
|
+
readonly refDirection: CopyVec3 | null;
|
|
38
|
+
}
|
|
39
|
+
/** One `IfcLocalPlacement`'s own frame in its parent's, or null when a link does not read. */
|
|
40
|
+
export declare function readOwnPlacement(read: LiveRead, placementId: number): OwnPlacement | null;
|
|
41
|
+
/**
|
|
42
|
+
* The frame of `placementId` in `ancestorId`'s frame: every placement from it
|
|
43
|
+
* up to (not including) the ancestor, composed. `placementId === ancestorId`
|
|
44
|
+
* is the identity. Null when the chain does not reach the ancestor (or loops).
|
|
45
|
+
*/
|
|
46
|
+
export declare function frameInAncestor(read: LiveRead, placementId: number | null, ancestorId: number): RigidFrame | null;
|
|
47
|
+
/** `v` turned counter-clockwise about the vertical by the frame's turn (directions do not translate). */
|
|
48
|
+
export declare function turnDirection(f: Pick<RigidFrame, 'c' | 's'>, v: CopyVec3): CopyVec3;
|
|
49
|
+
/** A `#N` reference token, or null. */
|
|
50
|
+
export declare function refToken(id: number | null): string | null;
|
|
51
|
+
/** Rewrite every `#old` token in a (possibly nested) attribute value that `ids` maps. */
|
|
52
|
+
export declare function remapRefs(value: unknown, ids: ReadonlyMap<number, number>): IfcAttributeValue;
|
|
53
|
+
//# sourceMappingURL=copy-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-frame.d.ts","sourceRoot":"","sources":["../../src/in-store/copy-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,i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AAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxC;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAkBzF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAkBjH;AAED,yGAAyG;AACzG,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAEnF;AAED,uCAAuC;AACvC,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAEzD;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAQ7F"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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 { asRef } from './style-entity-reader.js';
|
|
5
|
+
import { axis3d } from './host-geometry-frame.js';
|
|
6
|
+
export const IDENTITY_FRAME = { origin: [0, 0, 0], c: 1, s: 0 };
|
|
7
|
+
export function applyRigid(f, p) {
|
|
8
|
+
return [f.origin[0] + f.c * p[0] - f.s * p[1], f.origin[1] + f.s * p[0] + f.c * p[1], f.origin[2] + (p[2] ?? 0)];
|
|
9
|
+
}
|
|
10
|
+
export function composeRigid(outer, inner) {
|
|
11
|
+
return {
|
|
12
|
+
origin: applyRigid(outer, inner.origin),
|
|
13
|
+
c: outer.c * inner.c - outer.s * inner.s,
|
|
14
|
+
s: outer.s * inner.c + outer.c * inner.s,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function invertRigid(f) {
|
|
18
|
+
const [x, y, z] = f.origin;
|
|
19
|
+
return { origin: [-(f.c * x + f.s * y), -(-f.s * x + f.c * y), -z], c: f.c, s: -f.s };
|
|
20
|
+
}
|
|
21
|
+
/** The turn about the vertical through `pivot`, then the move `offset`: one rigid frame. */
|
|
22
|
+
export function turnThenMove(turn, pivot, offset) {
|
|
23
|
+
const c = Math.cos(turn);
|
|
24
|
+
const s = Math.sin(turn);
|
|
25
|
+
// q = R(p - pivot) + pivot + offset = R p + (pivot - R pivot + offset)
|
|
26
|
+
return {
|
|
27
|
+
origin: [pivot[0] - (c * pivot[0] - s * pivot[1]) + offset[0], pivot[1] - (s * pivot[0] + c * pivot[1]) + offset[1], offset[2] ?? 0],
|
|
28
|
+
c,
|
|
29
|
+
s,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Both the preview planner and writer refuse arithmetic overflow. */
|
|
33
|
+
export function finiteCopyFrame(frame, units = 'native model units') {
|
|
34
|
+
if (![...frame.origin, frame.c, frame.s].every(Number.isFinite))
|
|
35
|
+
throw new Error(`Copy frame must remain finite in ${units}`);
|
|
36
|
+
return frame;
|
|
37
|
+
}
|
|
38
|
+
export function numberTriple(value) {
|
|
39
|
+
if (!Array.isArray(value) || value.length < 2)
|
|
40
|
+
return null;
|
|
41
|
+
const out = [0, 0, 0].map((_, i) => (i < value.length ? value[i] : 0));
|
|
42
|
+
return out.every((v) => typeof v === 'number' && Number.isFinite(v)) ? out : null;
|
|
43
|
+
}
|
|
44
|
+
/** One `IfcLocalPlacement`'s own frame in its parent's, or null when a link does not read. */
|
|
45
|
+
export function readOwnPlacement(read, placementId) {
|
|
46
|
+
const placement = read(placementId);
|
|
47
|
+
const axisPlacementId = asRef(placement?.attributes[1]);
|
|
48
|
+
const axisPlacement = axisPlacementId === null ? null : read(axisPlacementId);
|
|
49
|
+
if (!placement || !axisPlacement)
|
|
50
|
+
return null;
|
|
51
|
+
const locationId = asRef(axisPlacement.attributes[0]);
|
|
52
|
+
const location = locationId === null ? null : numberTriple(read(locationId)?.attributes[0]);
|
|
53
|
+
if (!location)
|
|
54
|
+
return null;
|
|
55
|
+
const direction = (slot) => {
|
|
56
|
+
const id = asRef(slot);
|
|
57
|
+
return id === null ? null : numberTriple(read(id)?.attributes[0]);
|
|
58
|
+
};
|
|
59
|
+
const axis = direction(axisPlacement.attributes[1]);
|
|
60
|
+
const refDirection = direction(axisPlacement.attributes[2]);
|
|
61
|
+
const [dx, dy] = refDirection ?? [1, 0, 0];
|
|
62
|
+
const length = Math.hypot(dx, dy);
|
|
63
|
+
const [c, s] = length > 1e-9 ? [dx / length, dy / length] : [1, 0];
|
|
64
|
+
return { frame: { origin: location, c, s }, parentId: asRef(placement.attributes[0]), location, axis, refDirection };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The frame of `placementId` in `ancestorId`'s frame: every placement from it
|
|
68
|
+
* up to (not including) the ancestor, composed. `placementId === ancestorId`
|
|
69
|
+
* is the identity. Null when the chain does not reach the ancestor (or loops).
|
|
70
|
+
*/
|
|
71
|
+
export function frameInAncestor(read, placementId, ancestorId) {
|
|
72
|
+
let frame = IDENTITY_FRAME;
|
|
73
|
+
const visited = new Set();
|
|
74
|
+
let id = placementId;
|
|
75
|
+
while (id !== null && id !== ancestorId) {
|
|
76
|
+
if (visited.has(id))
|
|
77
|
+
return null;
|
|
78
|
+
visited.add(id);
|
|
79
|
+
const own = readOwnPlacement(read, id);
|
|
80
|
+
if (!own)
|
|
81
|
+
return null;
|
|
82
|
+
const placement = read(id);
|
|
83
|
+
const basis = axis3d({ entity: read }, placement?.attributes[1]);
|
|
84
|
+
if (!basis)
|
|
85
|
+
return null;
|
|
86
|
+
if (Math.abs(basis.z[0]) > 1e-9 || Math.abs(basis.z[1]) > 1e-9 || basis.z[2] < 1 - 1e-9)
|
|
87
|
+
throw new Error('Copy parent placement must be upright in its storey frame');
|
|
88
|
+
frame = composeRigid({ origin: basis.o, c: basis.x[0], s: basis.x[1] }, frame);
|
|
89
|
+
id = own.parentId;
|
|
90
|
+
}
|
|
91
|
+
return id === ancestorId ? frame : null;
|
|
92
|
+
}
|
|
93
|
+
/** `v` turned counter-clockwise about the vertical by the frame's turn (directions do not translate). */
|
|
94
|
+
export function turnDirection(f, v) {
|
|
95
|
+
return [f.c * v[0] - f.s * v[1], f.s * v[0] + f.c * v[1], v[2]];
|
|
96
|
+
}
|
|
97
|
+
/** A `#N` reference token, or null. */
|
|
98
|
+
export function refToken(id) {
|
|
99
|
+
return id === null ? null : `#${id}`;
|
|
100
|
+
}
|
|
101
|
+
/** Rewrite every `#old` token in a (possibly nested) attribute value that `ids` maps. */
|
|
102
|
+
export function remapRefs(value, ids) {
|
|
103
|
+
if (Array.isArray(value))
|
|
104
|
+
return value.map((v) => remapRefs(v, ids));
|
|
105
|
+
if (typeof value === 'string') {
|
|
106
|
+
const id = asRef(value);
|
|
107
|
+
const mapped = id === null ? undefined : ids.get(id);
|
|
108
|
+
return mapped === undefined ? value : `#${mapped}`;
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=copy-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-frame.js","sourceRoot":"","sources":["../../src/in-store/copy-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAa/D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAclD,MAAM,CAAC,MAAM,cAAc,GAAe,EAAE,MAAM,EAAE,CAAC,CAAC,EA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vE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,QAAQ,CAAC,EAAiB;IACxC,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACvC,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,GAAgC;IACxE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAsB,CAAC;IAC1F,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QACxB,MAAM,MAAM,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,KAA0B,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type StoreEditor } from '@ifc-lite/mutations';
|
|
2
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
3
|
+
import { type RandomSource } from '@ifc-lite/encoding';
|
|
4
|
+
import { type CopyVec3, type LiveRead } from './copy-frame.js';
|
|
5
|
+
export interface CopyTransform {
|
|
6
|
+
/** Move after the turn, storey-local metres (IFC Z-up). */
|
|
7
|
+
readonly offset?: readonly [number, number, number];
|
|
8
|
+
/** Counter-clockwise turn about the vertical, radians. */
|
|
9
|
+
readonly turn?: number;
|
|
10
|
+
/** The plan point the turn is about, storey-local metres. Default: the storey origin. */
|
|
11
|
+
readonly pivot?: readonly [number, number];
|
|
12
|
+
/** The storey the copy goes on. Default: the source's own. */
|
|
13
|
+
readonly targetStoreyId?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface CopyProductResult {
|
|
16
|
+
/** The copy of the product itself. */
|
|
17
|
+
readonly copyId: number;
|
|
18
|
+
readonly openingIds: readonly number[];
|
|
19
|
+
readonly fillingIds: readonly number[];
|
|
20
|
+
/** The copies of the assembly's parts, at every depth. */
|
|
21
|
+
readonly partIds: readonly number[];
|
|
22
|
+
/** Source product id for every copied product, including openings, fillings and assembly parts. */
|
|
23
|
+
readonly copiedFrom: ReadonlyMap<number, number>;
|
|
24
|
+
/** The storey the copy (and its doors and windows) is contained in. */
|
|
25
|
+
readonly storeyId: number | null;
|
|
26
|
+
/** Every element the copy wrote with a shape to mesh: the copy and its doors and windows. */
|
|
27
|
+
readonly meshed: readonly number[];
|
|
28
|
+
}
|
|
29
|
+
interface HostedLink {
|
|
30
|
+
readonly id: number;
|
|
31
|
+
readonly ownerHistory: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** One IfcRelAggregates: the parts of an assembly, and the rel's OwnerHistory. */
|
|
34
|
+
interface PartsLink {
|
|
35
|
+
readonly ownerHistory: string | null;
|
|
36
|
+
readonly parts: readonly number[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Everything one batch of copies reads once: the live reader, the styles and
|
|
40
|
+
* the void / fill links of the model as it was before the batch.
|
|
41
|
+
*/
|
|
42
|
+
export interface CopyContext {
|
|
43
|
+
readonly store: IfcDataStore;
|
|
44
|
+
readonly editor: StoreEditor;
|
|
45
|
+
readonly read: LiveRead;
|
|
46
|
+
readonly guidRandom?: RandomSource;
|
|
47
|
+
readonly styledBy: ReadonlyMap<number, number>;
|
|
48
|
+
readonly voids: ReadonlyMap<number, readonly HostedLink[]>;
|
|
49
|
+
readonly fills: ReadonlyMap<number, readonly HostedLink[]>;
|
|
50
|
+
/** Fillings (door / window id → opening id). */
|
|
51
|
+
readonly filledBy: ReadonlyMap<number, number>;
|
|
52
|
+
/** Assembly id → its IfcRelAggregates parts (a spatial container's children are not parts). */
|
|
53
|
+
readonly parts: ReadonlyMap<number, readonly PartsLink[]>;
|
|
54
|
+
/** Part id → its assembly. */
|
|
55
|
+
readonly partOf: ReadonlyMap<number, number>;
|
|
56
|
+
}
|
|
57
|
+
export declare function createCopyContext(store: IfcDataStore, editor: StoreEditor, options?: {
|
|
58
|
+
guidRandom?: RandomSource;
|
|
59
|
+
}): CopyContext;
|
|
60
|
+
/** Why `sourceId` cannot be copied on its own, or null when it can. */
|
|
61
|
+
export declare function copyRefusal(ctx: CopyContext, sourceId: number): string | null;
|
|
62
|
+
/** Copy the complete product graph. `options.Name` overrides only the root product’s Name. */
|
|
63
|
+
export declare function copyProductInStore(ctx: CopyContext, sourceId: number, transform?: CopyTransform, options?: {
|
|
64
|
+
Name?: string;
|
|
65
|
+
}): CopyProductResult;
|
|
66
|
+
/**
|
|
67
|
+
* Where a product's placement origin is on its storey, metres: the point a
|
|
68
|
+
* paste lines up with the cursor. Null when its placement does not read;
|
|
69
|
+
* throws (with the reason) when it is not tied to its storey, as a copy would.
|
|
70
|
+
*/
|
|
71
|
+
export declare function productStoreyOrigin(ctx: CopyContext, id: number): {
|
|
72
|
+
storeyId: number | null;
|
|
73
|
+
origin: CopyVec3;
|
|
74
|
+
} | null;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=copy-product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-product.d.ts","sourceRoot":"","sources":["../../src/in-store/copy-product.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