@ifc-lite/create 4.0.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 +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/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 +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 +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 +5 -1
- package/dist/in-store/host-geometry-frame.d.ts.map +1 -1
- package/dist/in-store/host-geometry-frame.js +46 -2
- 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 +6 -1
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js +5 -1
- 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/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/package.json +8 -7
|
@@ -0,0 +1,95 @@
|
|
|
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 { getCanonicalEntityName } from '@ifc-lite/parser';
|
|
5
|
+
/**
|
|
6
|
+
* A profile entity read back as a `ProfileSection` (charter #6232, D2): the
|
|
7
|
+
* inverse of `emitProfileSection`, for the inspector's Profile section, for
|
|
8
|
+
* split (a piece of an I-beam is an I-beam) and for one undo of a change.
|
|
9
|
+
*
|
|
10
|
+
* Attribute positions come from the model's schema registry. Supported optional
|
|
11
|
+
* radii survive an edit or split; a populated geometry attribute the shared
|
|
12
|
+
* builder cannot reproduce refuses editing rather than silently changing the
|
|
13
|
+
* section. Invalid dimensions also read as null.
|
|
14
|
+
*/
|
|
15
|
+
import { fromNativeLength } from '../anchor.js';
|
|
16
|
+
import { validateProfileSection } from '../profile.js';
|
|
17
|
+
import { getAttributeNamesAcrossSchemas, getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
18
|
+
/** IFC class (upper case, as STEP stores it) to section type and the attribute names from index 3. */
|
|
19
|
+
const LAYOUT = {
|
|
20
|
+
IFCRECTANGLEPROFILEDEF: { type: 'Rectangle', names: ['XDim', 'YDim'] },
|
|
21
|
+
IFCISHAPEPROFILEDEF: { type: 'I', names: ['OverallWidth', 'OverallDepth', 'WebThickness', 'FlangeThickness'] },
|
|
22
|
+
IFCLSHAPEPROFILEDEF: { type: 'L', names: ['Depth', 'Width', 'Thickness'] },
|
|
23
|
+
IFCTSHAPEPROFILEDEF: { type: 'T', names: ['Depth', 'FlangeWidth', 'WebThickness', 'FlangeThickness'] },
|
|
24
|
+
IFCUSHAPEPROFILEDEF: { type: 'U', names: ['Depth', 'FlangeWidth', 'WebThickness', 'FlangeThickness'] },
|
|
25
|
+
IFCCSHAPEPROFILEDEF: { type: 'C', names: ['Depth', 'Width', 'WallThickness', 'Girth'] },
|
|
26
|
+
IFCCIRCLEPROFILEDEF: { type: 'Circle', names: ['Radius'] },
|
|
27
|
+
IFCRECTANGLEHOLLOWPROFILEDEF: { type: 'RectangleHollow', names: ['XDim', 'YDim', 'WallThickness'] },
|
|
28
|
+
IFCCIRCLEHOLLOWPROFILEDEF: { type: 'CircleHollow', names: ['Radius', 'WallThickness'] },
|
|
29
|
+
};
|
|
30
|
+
/** A REAL attribute: a plain number, or the `{ real }` wrapper the overlay keeps a whole-number REAL in. */
|
|
31
|
+
function realOf(raw) {
|
|
32
|
+
const value = typeof raw === 'object' && raw !== null && 'real' in raw ? raw.real : raw;
|
|
33
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
34
|
+
}
|
|
35
|
+
/** Whether `stepType` names one of the nine profile classes the picker writes. */
|
|
36
|
+
export function isSectionProfileClass(stepType) {
|
|
37
|
+
return stepType !== null && stepType !== undefined && stepType.toUpperCase() in LAYOUT;
|
|
38
|
+
}
|
|
39
|
+
/** Optional geometry the shared ProfileSection/emitProfileSection can reproduce. */
|
|
40
|
+
const OPTIONAL = {
|
|
41
|
+
I: ['FilletRadius'], L: ['FilletRadius'], T: ['FilletRadius'], U: ['FilletRadius'],
|
|
42
|
+
C: ['InternalFilletRadius'], RectangleHollow: ['InnerFilletRadius', 'OuterFilletRadius'],
|
|
43
|
+
};
|
|
44
|
+
/** Read a profile in metres without dropping geometry when it is rebuilt. */
|
|
45
|
+
export function sectionFromProfile(stepType, attributes, lengthUnitScale, schemaVersion = 'IFC4') {
|
|
46
|
+
const upper = stepType.toUpperCase();
|
|
47
|
+
const layout = LAYOUT[upper];
|
|
48
|
+
if (!layout || !Number.isFinite(lengthUnitScale) || lengthUnitScale <= 0)
|
|
49
|
+
return null;
|
|
50
|
+
let declared;
|
|
51
|
+
if (schemaVersion === 'IFC2X3' || schemaVersion === 'IFC4' || schemaVersion === 'IFC4X3') {
|
|
52
|
+
const registry = getSchemaRegistryForVersion(schemaVersion);
|
|
53
|
+
const name = getCanonicalEntityName(registry, upper);
|
|
54
|
+
declared = name ? registry.entities[name].allAttributes?.map((attribute) => attribute.name) : undefined;
|
|
55
|
+
}
|
|
56
|
+
else if (schemaVersion === 'IFC5' && layout.type === 'Rectangle') {
|
|
57
|
+
// IFCX adapts positional attributes using this same canonical name list.
|
|
58
|
+
// Basic rectangular authoring remains supported; profiled emission refuses IFC5.
|
|
59
|
+
declared = getAttributeNamesAcrossSchemas(stepType);
|
|
60
|
+
}
|
|
61
|
+
if (!declared || declared.length === 0)
|
|
62
|
+
return null;
|
|
63
|
+
// Extra positional values cannot be recreated by a builder using this registry.
|
|
64
|
+
if (attributes.slice(declared.length).some((value) => value != null))
|
|
65
|
+
return null;
|
|
66
|
+
const section = { Type: layout.type };
|
|
67
|
+
const optional = OPTIONAL[layout.type] ?? [];
|
|
68
|
+
for (let i = 3; i < declared.length; i++) {
|
|
69
|
+
const field = declared[i];
|
|
70
|
+
const required = layout.names.includes(field);
|
|
71
|
+
const raw = attributes[i];
|
|
72
|
+
if (raw == null && !required)
|
|
73
|
+
continue;
|
|
74
|
+
// The builder has no representation of slopes, edge radii or schema-specific
|
|
75
|
+
// gravity offsets: refusing is safer than authoring a different cross-section.
|
|
76
|
+
if (!required && !optional.includes(field))
|
|
77
|
+
return null;
|
|
78
|
+
const value = realOf(raw);
|
|
79
|
+
if (value === null || (required ? value <= 0 : value < 0))
|
|
80
|
+
return null;
|
|
81
|
+
section[field] = fromNativeLength({ lengthUnitScale }, value);
|
|
82
|
+
}
|
|
83
|
+
const result = section;
|
|
84
|
+
try {
|
|
85
|
+
validateProfileSection(result, 'profile');
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
// Malformed file dimensions are a normal refusal, not an editable section.
|
|
89
|
+
if (error instanceof Error)
|
|
90
|
+
return null;
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=read-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-profile.js","sourceRoot":"","sources":["../../../src/in-store/edit/read-profile.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAgD,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAE/F,sGAAsG;AACtG,MAAM,MAAM,GAAqF;IAC/F,sBAAsB,EAAE,EAAE,IAAI,EA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AAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACvE,OAAO,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,EAAE,eAAe,EAAE,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,MAAM,GAAG,OAAoC,CAAC;IACpD,IAAI,CAAC;QACH,sBAAsB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,2EAA2E;QAC3E,IAAI,KAAK,YAAY,KAAK;YAAE,OAAO,IAAI,CAAC;QACxC,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
2
|
+
import type { MutablePropertyView, StoreEditor } from '@ifc-lite/mutations';
|
|
3
|
+
/**
|
|
4
|
+
* Null when the element is not a vertical extrusion of its plan outline;
|
|
5
|
+
* otherwise the NATIVE-unit height of the extrusion's bottom above the
|
|
6
|
+
* element placement's origin.
|
|
7
|
+
*/
|
|
8
|
+
export declare function slabExtrusionBase(dataStore: IfcDataStore, view: MutablePropertyView, editor: StoreEditor, elementAxisPlacementId: number, solidAttrs: readonly unknown[], depth: number): number | null;
|
|
9
|
+
/**
|
|
10
|
+
* {@link slabExtrusionBase} plus the direction the depth runs: `up` is true
|
|
11
|
+
* when the extrusion grows upward from the solid's profile plane (the layout
|
|
12
|
+
* the builders write and AC20's `Bodenplatte` has), false when the solid or
|
|
13
|
+
* its extrusion direction is flipped so it grows downward from it. Push /
|
|
14
|
+
* pull needs it: a bigger depth moves the top face in the first case and the
|
|
15
|
+
* underside in the second (#6232 C4).
|
|
16
|
+
*/
|
|
17
|
+
export declare function slabExtrusionFrame(dataStore: IfcDataStore, view: MutablePropertyView, editor: StoreEditor, elementAxisPlacementId: number, solidAttrs: readonly unknown[], depth: number): {
|
|
18
|
+
base: number;
|
|
19
|
+
up: boolean;
|
|
20
|
+
} | null;
|
|
21
|
+
/**
|
|
22
|
+
* A 2D rigid transform mapping a profile-coordinate point into the
|
|
23
|
+
* solid's local plan (XY). Built from the `IfcExtrudedAreaSolid`'s
|
|
24
|
+
* `Position` (an `IfcAxis2Placement3D`), it folds in the in-place
|
|
25
|
+
* translation + rotation that real-world authoring tools bake there.
|
|
26
|
+
* In-store-built slabs carry an identity Position, so the resolver
|
|
27
|
+
* defaults to the identity transform for them.
|
|
28
|
+
*/
|
|
29
|
+
export type Xform2D = (p: [number, number]) => [number, number];
|
|
30
|
+
/**
|
|
31
|
+
* Build the plan-space transform for an `IfcExtrudedAreaSolid.Position`.
|
|
32
|
+
* The profile lives in the placement's local XY plane; we map a profile
|
|
33
|
+
* point `(px, py)` to `origin + px·X + py·Y` and keep the XY components
|
|
34
|
+
* (the footprint is the plan). X comes from RefDirection (orthonormalised
|
|
35
|
+
* against the Axis/Z), Y = Z × X — matching the IFC placement convention,
|
|
36
|
+
* including axis flips (e.g. Axis `(0,0,-1)`, RefDirection `(-1,0,0)`).
|
|
37
|
+
* Returns identity when the placement is absent or degenerate.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveSolidPositionXform(dataStore: IfcDataStore, view: MutablePropertyView, editor: StoreEditor, placementId: number | null): Xform2D;
|
|
40
|
+
//# sourceMappingURL=slab-edit-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slab-edit-frame.d.ts","sourceRoot":"","sources":["../../../src/in-store/edit/slab-edit-frame.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAgB5E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,WAAW,EACnB,sBAAsB,EAAE,MAAM,EAC9B,UAAU,EAAE,SAAS,OAAO,EAAE,EAC9B,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAEf;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,WAAW,EACnB,sBAAsB,EAAE,MAAM,EAC9B,UAAU,EAAE,SAAS,OAAO,EAAE,EAC9B,KAAK,EAAE,MAAM,GACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA0BtC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAehE;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAiDT"}
|
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* The frame of a slab-like element's extrusion: the solid position's plan
|
|
6
|
+
* transform the footprint is read through, and (#6233) whether the element
|
|
7
|
+
* is a vertical extrusion of that plan outline at all.
|
|
8
|
+
*
|
|
9
|
+
* The slab chain reads a FOOTPRINT in plan: the element placement's origin
|
|
10
|
+
* plus the solid position's plan transform (which may flip or turn the
|
|
11
|
+
* profile about Z). A split re-authors pieces from that plan outline, so it
|
|
12
|
+
* is only faithful when the element really is a vertical extrusion of that
|
|
13
|
+
* outline:
|
|
14
|
+
* - the element placement is not rotated (the chain reads only its origin);
|
|
15
|
+
* - the solid position's Axis is vertical (a tilted roof slab is not a
|
|
16
|
+
* plan outline — AC20's `Dach-1` extrudes along (0, 0.5, 0.866));
|
|
17
|
+
* - the extrusion direction is vertical in the solid's frame.
|
|
18
|
+
* Otherwise the element is refused, rather than cut into flat slabs.
|
|
19
|
+
*
|
|
20
|
+
* For an accepted element it also returns where the extrusion starts,
|
|
21
|
+
* above the placement origin: AC20's `Bodenplatte` hangs 0.2 m below its
|
|
22
|
+
* placement (solid Location z = -0.2), which a re-authored piece must keep.
|
|
23
|
+
*/
|
|
24
|
+
import { firstProjAxis } from '@ifc-lite/data';
|
|
25
|
+
import { axis3d } from '../host-geometry-frame.js';
|
|
26
|
+
import { asCoordinateTriple, asDirectionRatios, asExpressIdRef, readAttributes } from './placement-core.js';
|
|
27
|
+
const EPS = 1e-6;
|
|
28
|
+
/** A unit-normalised direction, or `fallback` when the slot is `$`; null when unreadable. */
|
|
29
|
+
function direction(read, id, fallback) {
|
|
30
|
+
if (id == null)
|
|
31
|
+
return fallback;
|
|
32
|
+
const d = asDirectionRatios(read(asExpressIdRef(id))?.[0]);
|
|
33
|
+
const len = d ? Math.hypot(d[0], d[1], d[2]) : 0;
|
|
34
|
+
return d && len > EPS ? [d[0] / len, d[1] / len, d[2] / len] : null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Null when the element is not a vertical extrusion of its plan outline;
|
|
38
|
+
* otherwise the NATIVE-unit height of the extrusion's bottom above the
|
|
39
|
+
* element placement's origin.
|
|
40
|
+
*/
|
|
41
|
+
export function slabExtrusionBase(dataStore, view, editor, elementAxisPlacementId, solidAttrs, depth) {
|
|
42
|
+
return slabExtrusionFrame(dataStore, view, editor, elementAxisPlacementId, solidAttrs, depth)?.base ?? null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* {@link slabExtrusionBase} plus the direction the depth runs: `up` is true
|
|
46
|
+
* when the extrusion grows upward from the solid's profile plane (the layout
|
|
47
|
+
* the builders write and AC20's `Bodenplatte` has), false when the solid or
|
|
48
|
+
* its extrusion direction is flipped so it grows downward from it. Push /
|
|
49
|
+
* pull needs it: a bigger depth moves the top face in the first case and the
|
|
50
|
+
* underside in the second (#6232 C4).
|
|
51
|
+
*/
|
|
52
|
+
export function slabExtrusionFrame(dataStore, view, editor, elementAxisPlacementId, solidAttrs, depth) {
|
|
53
|
+
const read = (id) => (id === null ? null : readAttributes(dataStore, view, editor, id));
|
|
54
|
+
const reader = {
|
|
55
|
+
entity(id) {
|
|
56
|
+
const attributes = read(id), type = editor.getEntityType(id);
|
|
57
|
+
return attributes && type ? { type, attributes } : null;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
const placement = axis3d(reader, elementAxisPlacementId);
|
|
61
|
+
// #6589: a cosine-only check admits rotations of order sqrt(EPS).
|
|
62
|
+
// Compare the actual orthonormal frame components, including the small
|
|
63
|
+
// transverse components that the origin-only plan reader cannot retain.
|
|
64
|
+
if (!placement || Math.abs(placement.x[0] - 1) > EPS || Math.abs(placement.x[1]) > EPS
|
|
65
|
+
|| Math.abs(placement.x[2]) > EPS || Math.abs(placement.z[0]) > EPS
|
|
66
|
+
|| Math.abs(placement.z[1]) > EPS || Math.abs(placement.z[2] - 1) > EPS)
|
|
67
|
+
return null;
|
|
68
|
+
const position = axis3d(reader, solidAttrs[1]);
|
|
69
|
+
if (!position || Math.abs(position.z[0]) > EPS || Math.abs(position.z[1]) > EPS
|
|
70
|
+
|| Math.abs(Math.abs(position.z[2]) - 1) > EPS)
|
|
71
|
+
return null;
|
|
72
|
+
const extrusion = direction(read, solidAttrs[2], [0, 0, 1]);
|
|
73
|
+
if (!extrusion || Math.abs(extrusion[0]) > EPS || Math.abs(extrusion[1]) > EPS
|
|
74
|
+
|| Math.abs(Math.abs(extrusion[2]) - 1) > EPS)
|
|
75
|
+
return null;
|
|
76
|
+
// Upward (+1) or downward (-1) in the element frame.
|
|
77
|
+
const up = Math.sign(position.z[2] * extrusion[2]);
|
|
78
|
+
return { base: position.o[2] + Math.min(0, up * depth), up: up > 0 };
|
|
79
|
+
}
|
|
80
|
+
const IDENTITY_XFORM2D = (p) => [p[0], p[1]];
|
|
81
|
+
function readDirection(dataStore, view, editor, id) {
|
|
82
|
+
if (id === null)
|
|
83
|
+
return null;
|
|
84
|
+
const attrs = readAttributes(dataStore, view, editor, id);
|
|
85
|
+
return attrs ? asDirectionRatios(attrs[0]) : null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Build the plan-space transform for an `IfcExtrudedAreaSolid.Position`.
|
|
89
|
+
* The profile lives in the placement's local XY plane; we map a profile
|
|
90
|
+
* point `(px, py)` to `origin + px·X + py·Y` and keep the XY components
|
|
91
|
+
* (the footprint is the plan). X comes from RefDirection (orthonormalised
|
|
92
|
+
* against the Axis/Z), Y = Z × X — matching the IFC placement convention,
|
|
93
|
+
* including axis flips (e.g. Axis `(0,0,-1)`, RefDirection `(-1,0,0)`).
|
|
94
|
+
* Returns identity when the placement is absent or degenerate.
|
|
95
|
+
*/
|
|
96
|
+
export function resolveSolidPositionXform(dataStore, view, editor, placementId) {
|
|
97
|
+
if (placementId === null)
|
|
98
|
+
return IDENTITY_XFORM2D;
|
|
99
|
+
const attrs = readAttributes(dataStore, view, editor, placementId);
|
|
100
|
+
if (!attrs)
|
|
101
|
+
return IDENTITY_XFORM2D;
|
|
102
|
+
// IfcAxis2Placement3D: [0] Location · [1] Axis (Z) · [2] RefDirection (X).
|
|
103
|
+
const locId = asExpressIdRef(attrs[0]);
|
|
104
|
+
let ox = 0;
|
|
105
|
+
let oy = 0;
|
|
106
|
+
if (locId !== null) {
|
|
107
|
+
const locAttrs = readAttributes(dataStore, view, editor, locId);
|
|
108
|
+
const c = locAttrs ? asCoordinateTriple(locAttrs[0]) : null;
|
|
109
|
+
if (c) {
|
|
110
|
+
ox = c[0];
|
|
111
|
+
oy = c[1];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// IfcDirection ratios are NOT guaranteed unit length, so normalise Z
|
|
115
|
+
// before using it as a basis vector — otherwise the Gram-Schmidt
|
|
116
|
+
// projection (which assumes |Z|=1) and Y = Z × X both pick up |Z| as a
|
|
117
|
+
// stray scale factor, skewing the footprint away from the rendered mesh
|
|
118
|
+
// for files with e.g. Axis=(0,0,2). The Rust profile extractor
|
|
119
|
+
// normalises the same placement.
|
|
120
|
+
const rawZ = readDirection(dataStore, view, editor, asExpressIdRef(attrs[1])) ?? [0, 0, 1];
|
|
121
|
+
const zlen = Math.hypot(rawZ[0], rawZ[1], rawZ[2]);
|
|
122
|
+
if (zlen < 1e-9)
|
|
123
|
+
return IDENTITY_XFORM2D;
|
|
124
|
+
const z = [rawZ[0] / zlen, rawZ[1] / zlen, rawZ[2] / zlen];
|
|
125
|
+
// A `$` RefDirection takes the renderer's fill, not world X as-is (#5922).
|
|
126
|
+
const refX = readDirection(dataStore, view, editor, asExpressIdRef(attrs[2])) ?? firstProjAxis(z);
|
|
127
|
+
// Orthonormalise X against the unit Z (Gram-Schmidt), then Y = Z × X.
|
|
128
|
+
const dot = refX[0] * z[0] + refX[1] * z[1] + refX[2] * z[2];
|
|
129
|
+
let xv = [
|
|
130
|
+
refX[0] - dot * z[0],
|
|
131
|
+
refX[1] - dot * z[1],
|
|
132
|
+
refX[2] - dot * z[2],
|
|
133
|
+
];
|
|
134
|
+
const xlen = Math.hypot(xv[0], xv[1], xv[2]);
|
|
135
|
+
if (xlen < 1e-9)
|
|
136
|
+
return IDENTITY_XFORM2D;
|
|
137
|
+
xv = [xv[0] / xlen, xv[1] / xlen, xv[2] / xlen];
|
|
138
|
+
// Z and X are now orthonormal, so Y = Z × X is already unit length.
|
|
139
|
+
const yv = [
|
|
140
|
+
z[1] * xv[2] - z[2] * xv[1],
|
|
141
|
+
z[2] * xv[0] - z[0] * xv[2],
|
|
142
|
+
z[0] * xv[1] - z[1] * xv[0],
|
|
143
|
+
];
|
|
144
|
+
return (p) => [ox + p[0] * xv[0] + p[1] * yv[0], oy + p[0] * xv[1] + p[1] * yv[1]];
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=slab-edit-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slab-edit-frame.js","sourceRoot":"","sources":["../../../src/in-store/edit/slab-edit-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,MAAM,EAA6B,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE5G,MAAM,GAAG,GAAG,IAAI,CAAC;AAIjB,6FAA6F;AAC7F,SAAS,SAAS,CAAC,IAAU,EAAE,EAAW,EAAE,QAAkC;IAC5E,IAAI,EAAE,IAAI,IAAI;QAAE,OAAO,QAAQ,CAAC;IAChC,MAAM,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAA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EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KAC5B,CAAC;IAEF,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Footprint reader + cut helpers for slab-like elements (IfcSlab,
|
|
3
|
+
* IfcRoof, IfcPlate, IfcSpace) shaped by the in-store builders in
|
|
4
|
+
* `@ifc-lite/create`. The shared shape is:
|
|
5
|
+
*
|
|
6
|
+
* IfcExtrudedAreaSolid
|
|
7
|
+
* ├── SweptArea : IfcRectangleProfileDef (W × D) — rectangle mode
|
|
8
|
+
* │ OR IfcArbitraryClosedProfileDef → IfcPolyline — polygon mode
|
|
9
|
+
* └── Depth : thickness along +Z (storey-local)
|
|
10
|
+
*
|
|
11
|
+
* The "footprint" is the profile polygon in storey-local 2D (XY).
|
|
12
|
+
* For rectangle mode we derive it from (placementOrigin, W, D); for
|
|
13
|
+
* polygon mode we read the polyline's vertex list.
|
|
14
|
+
*
|
|
15
|
+
* The split workflow:
|
|
16
|
+
*
|
|
17
|
+
* 1. user clicks twice on the slab (in storey-local 2D)
|
|
18
|
+
* 2. polygon-clip cuts the footprint into two halves
|
|
19
|
+
* 3. caller builds two fresh slabs via `addSlab` polygon-mode
|
|
20
|
+
* (cleaner than trying to detect "rectangle still fits" — most
|
|
21
|
+
* cuts produce non-rectangular halves)
|
|
22
|
+
* 4. source is tombstoned + its mesh hidden
|
|
23
|
+
*
|
|
24
|
+
* Source-buffer slabs with unusual representations (mapped shapes,
|
|
25
|
+
* tessellated faces, …) refuse with a clear reason and the caller's
|
|
26
|
+
* Split tool stays armed.
|
|
27
|
+
*/
|
|
28
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
29
|
+
import type { MutablePropertyView, StoreEditor } from '@ifc-lite/mutations';
|
|
30
|
+
import { type Point2D } from './polygon-clip.js';
|
|
31
|
+
/**
|
|
32
|
+
* Slab-like element types this module handles. Matches the STEP
|
|
33
|
+
* storage form (`IFCSLAB`, …) so the slice's split action can
|
|
34
|
+
* dispatch to the right `addSlab` / `addRoof` / `addPlate` /
|
|
35
|
+
* `addSpace` follow-up. (Roof/plate/space are added in subsequent
|
|
36
|
+
* commits but their representation is identical, so this resolver
|
|
37
|
+
* already accepts them.)
|
|
38
|
+
*/
|
|
39
|
+
export type SlabLikeType = 'IfcSlab' | 'IfcRoof' | 'IfcPlate' | 'IfcSpace';
|
|
40
|
+
export interface SlabEditChain {
|
|
41
|
+
/** STEP type name, for the slice's dispatch. */
|
|
42
|
+
elementType: SlabLikeType;
|
|
43
|
+
/** Placement origin (storey-local). The footprint polygon is in
|
|
44
|
+
* world-XY space, with the origin already added. */
|
|
45
|
+
placementOrigin: [number, number, number];
|
|
46
|
+
/**
|
|
47
|
+
* Storey-local height where the extrusion starts, or null when the element
|
|
48
|
+
* is not a vertical extrusion of its plan outline (`slab-edit-frame.ts`):
|
|
49
|
+
* the footprint still reads, but a split must refuse it (#6233).
|
|
50
|
+
*/
|
|
51
|
+
baseElevation: number | null;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the depth grows upward from the profile plane (the builders'
|
|
54
|
+
* layout) or the slab hangs down from it. Meaningful only when
|
|
55
|
+
* `baseElevation` is not null; true otherwise.
|
|
56
|
+
*/
|
|
57
|
+
extrusionUp: boolean;
|
|
58
|
+
/** Footprint polygon as an ordered list of 2D vertices (storey-
|
|
59
|
+
* local world XY). First vertex does NOT repeat at the end. */
|
|
60
|
+
footprint: Point2D[];
|
|
61
|
+
/** IfcExtrudedAreaSolid id — holds the thickness on attr 3. */
|
|
62
|
+
extrudedSolidId: number;
|
|
63
|
+
/** Current extrusion thickness (metres along +Z). */
|
|
64
|
+
thickness: number;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the source profile was a rectangle (XDim/YDim) or an
|
|
67
|
+
* arbitrary polygon (IfcArbitraryClosedProfileDef → IfcPolyline).
|
|
68
|
+
* Surface for telemetry; not required by the split flow.
|
|
69
|
+
*/
|
|
70
|
+
profileKind: 'rectangle' | 'polygon';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Resolve the slab chain (placement + footprint + extrusion). Works
|
|
74
|
+
* for IfcSlab / IfcRoof / IfcPlate / IfcSpace whose representation
|
|
75
|
+
* matches the in-store builder shape; null otherwise.
|
|
76
|
+
*
|
|
77
|
+
* `lengthUnitScale` is the model's native-unit → metre factor (e.g.
|
|
78
|
+
* `0.001` for a millimetre file). Raw STEP coordinate reads are in
|
|
79
|
+
* native units, but the rest of the split flow — raycast cut points,
|
|
80
|
+
* preview meshes, selection hit-tests — lives in metres, so the
|
|
81
|
+
* resolved footprint/thickness are scaled to match. Authored overlay
|
|
82
|
+
* entities are scaled too: the in-store builders convert their metre
|
|
83
|
+
* params to the file's native unit (`toNativePoint3` / `toNativeLength`),
|
|
84
|
+
* so an authored slab in a millimetre file stores millimetres (#6233).
|
|
85
|
+
*/
|
|
86
|
+
export declare function resolveSlabEditChain(dataStore: IfcDataStore, view: MutablePropertyView, editor: StoreEditor, expressId: number, lengthUnitScale?: number,
|
|
87
|
+
/** A validated extrusion beneath an envelope's clipping results. */
|
|
88
|
+
bodyItemId?: number): SlabEditChain | null;
|
|
89
|
+
export interface SlabSplitResult {
|
|
90
|
+
ok: true;
|
|
91
|
+
leftFootprint: Point2D[];
|
|
92
|
+
rightFootprint: Point2D[];
|
|
93
|
+
thickness: number;
|
|
94
|
+
placementOrigin: [number, number, number];
|
|
95
|
+
elementType: SlabLikeType;
|
|
96
|
+
}
|
|
97
|
+
export type SlabSplitOutcome = SlabSplitResult | {
|
|
98
|
+
ok: false;
|
|
99
|
+
reason: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Pure split-geometry helper. Clips the slab's footprint by a cut
|
|
103
|
+
* line (defined by two storey-local 2D points) and returns the two
|
|
104
|
+
* halves so the caller can build new slabs with `addSlab`. Both
|
|
105
|
+
* halves carry the source's thickness + storey placement; only the
|
|
106
|
+
* outer-curve polygon changes.
|
|
107
|
+
*
|
|
108
|
+
* Returns the underlying polygon-clip reason on failure so the UI
|
|
109
|
+
* can surface "Cut line does not cross the slab" verbatim.
|
|
110
|
+
*/
|
|
111
|
+
export declare function computeSlabSplitGeometry(chain: SlabEditChain, cutA: Point2D, cutB: Point2D): SlabSplitOutcome;
|
|
112
|
+
//# sourceMappingURL=slab-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slab-edit.d.ts","sourceRoot":"","sources":["../../../src/in-store/edit/slab-edit.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAO5E,OAAO,EAAqB,KAAK,OAAO,EAA0B,MAAM,mBAAmB,CAAC;AAI5F;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAa3E,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,WAAW,EAAE,YAAY,CAAC;IAC1B;wDACoD;IACpD,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;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