@ifc-lite/create 2.7.0 → 2.9.2
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 +7 -0
- package/dist/ifc-creator-alignment.d.ts +30 -0
- package/dist/ifc-creator-alignment.d.ts.map +1 -0
- package/dist/ifc-creator-alignment.js +174 -0
- package/dist/ifc-creator-alignment.js.map +1 -0
- package/dist/ifc-creator-header.d.ts +2 -0
- package/dist/ifc-creator-header.d.ts.map +1 -0
- package/dist/ifc-creator-header.js +22 -0
- package/dist/ifc-creator-header.js.map +1 -0
- package/dist/ifc-creator-math.d.ts +15 -5
- package/dist/ifc-creator-math.d.ts.map +1 -1
- package/dist/ifc-creator-math.js +25 -2
- package/dist/ifc-creator-math.js.map +1 -1
- package/dist/ifc-creator-relationships.d.ts +43 -0
- package/dist/ifc-creator-relationships.d.ts.map +1 -0
- package/dist/ifc-creator-relationships.js +38 -0
- package/dist/ifc-creator-relationships.js.map +1 -0
- package/dist/ifc-creator-styles.d.ts +22 -0
- package/dist/ifc-creator-styles.d.ts.map +1 -0
- package/dist/ifc-creator-styles.js +50 -0
- package/dist/ifc-creator-styles.js.map +1 -0
- package/dist/ifc-creator-terrain.d.ts +170 -0
- package/dist/ifc-creator-terrain.d.ts.map +1 -0
- package/dist/ifc-creator-terrain.js +180 -0
- package/dist/ifc-creator-terrain.js.map +1 -0
- package/dist/ifc-creator.d.ts +21 -7
- package/dist/ifc-creator.d.ts.map +1 -1
- package/dist/ifc-creator.js +95 -95
- package/dist/ifc-creator.js.map +1 -1
- package/dist/in-store/_emit-helpers.d.ts +10 -0
- package/dist/in-store/_emit-helpers.d.ts.map +1 -1
- package/dist/in-store/_emit-helpers.js +15 -2
- package/dist/in-store/_emit-helpers.js.map +1 -1
- package/dist/in-store/anchor.d.ts +2 -0
- package/dist/in-store/anchor.d.ts.map +1 -1
- package/dist/in-store/anchor.js.map +1 -1
- package/dist/in-store/apply-style.d.ts +3 -6
- package/dist/in-store/apply-style.d.ts.map +1 -1
- package/dist/in-store/apply-style.js +3 -77
- package/dist/in-store/apply-style.js.map +1 -1
- package/dist/in-store/beam.d.ts +2 -0
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +2 -2
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/column.d.ts +2 -0
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +4 -2
- package/dist/in-store/column.js.map +1 -1
- package/dist/in-store/door.d.ts +2 -0
- package/dist/in-store/door.d.ts.map +1 -1
- package/dist/in-store/door.js +2 -0
- package/dist/in-store/door.js.map +1 -1
- package/dist/in-store/extract-walls.d.ts +1 -1
- package/dist/in-store/extract-walls.d.ts.map +1 -1
- package/dist/in-store/extract-walls.js +28 -54
- package/dist/in-store/extract-walls.js.map +1 -1
- package/dist/in-store/generate-spaces-all.d.ts +6 -2
- package/dist/in-store/generate-spaces-all.d.ts.map +1 -1
- package/dist/in-store/generate-spaces-all.js +33 -9
- package/dist/in-store/generate-spaces-all.js.map +1 -1
- package/dist/in-store/generate-spaces.js +1 -1
- package/dist/in-store/generate-spaces.js.map +1 -1
- package/dist/in-store/member.d.ts +2 -0
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js.map +1 -1
- package/dist/in-store/placement-frame.d.ts +8 -0
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js.map +1 -1
- package/dist/in-store/plate.d.ts +4 -0
- package/dist/in-store/plate.d.ts.map +1 -1
- package/dist/in-store/plate.js +4 -0
- package/dist/in-store/plate.js.map +1 -1
- package/dist/in-store/resolve-anchor.d.ts +4 -2
- package/dist/in-store/resolve-anchor.d.ts.map +1 -1
- package/dist/in-store/resolve-anchor.js +79 -92
- package/dist/in-store/resolve-anchor.js.map +1 -1
- package/dist/in-store/resolve-source.d.ts +2 -1
- package/dist/in-store/resolve-source.d.ts.map +1 -1
- package/dist/in-store/resolve-source.js +49 -49
- package/dist/in-store/resolve-source.js.map +1 -1
- package/dist/in-store/roof.d.ts +4 -0
- package/dist/in-store/roof.d.ts.map +1 -1
- package/dist/in-store/roof.js +4 -0
- package/dist/in-store/roof.js.map +1 -1
- package/dist/in-store/slab.d.ts +4 -0
- package/dist/in-store/slab.d.ts.map +1 -1
- package/dist/in-store/slab.js +6 -2
- package/dist/in-store/slab.js.map +1 -1
- package/dist/in-store/space.d.ts +4 -0
- package/dist/in-store/space.d.ts.map +1 -1
- package/dist/in-store/space.js +6 -2
- package/dist/in-store/space.js.map +1 -1
- package/dist/in-store/spatial-children.d.ts +52 -0
- package/dist/in-store/spatial-children.d.ts.map +1 -0
- package/dist/in-store/spatial-children.js +112 -0
- package/dist/in-store/spatial-children.js.map +1 -0
- package/dist/in-store/structural-action.d.ts +85 -0
- package/dist/in-store/structural-action.d.ts.map +1 -0
- package/dist/in-store/structural-action.js +83 -0
- package/dist/in-store/structural-action.js.map +1 -0
- package/dist/in-store/structural-analysis-model.d.ts +49 -0
- package/dist/in-store/structural-analysis-model.d.ts.map +1 -0
- package/dist/in-store/structural-analysis-model.js +29 -0
- package/dist/in-store/structural-analysis-model.js.map +1 -0
- package/dist/in-store/structural-curve-member.d.ts +90 -0
- package/dist/in-store/structural-curve-member.d.ts.map +1 -0
- package/dist/in-store/structural-curve-member.js +83 -0
- package/dist/in-store/structural-curve-member.js.map +1 -0
- package/dist/in-store/structural-load-group.d.ts +61 -0
- package/dist/in-store/structural-load-group.d.ts.map +1 -0
- package/dist/in-store/structural-load-group.js +38 -0
- package/dist/in-store/structural-load-group.js.map +1 -0
- package/dist/in-store/structural-point-connection.d.ts +75 -0
- package/dist/in-store/structural-point-connection.d.ts.map +1 -0
- package/dist/in-store/structural-point-connection.js +41 -0
- package/dist/in-store/structural-point-connection.js.map +1 -0
- package/dist/in-store/structural-relationships.d.ts +47 -0
- package/dist/in-store/structural-relationships.d.ts.map +1 -0
- package/dist/in-store/structural-relationships.js +85 -0
- package/dist/in-store/structural-relationships.js.map +1 -0
- package/dist/in-store/style-entity-reader.d.ts +14 -0
- package/dist/in-store/style-entity-reader.d.ts.map +1 -0
- package/dist/in-store/style-entity-reader.js +58 -0
- package/dist/in-store/style-entity-reader.js.map +1 -0
- package/dist/in-store/wall.d.ts +2 -0
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +2 -2
- package/dist/in-store/wall.js.map +1 -1
- package/dist/in-store/window.d.ts +2 -0
- package/dist/in-store/window.d.ts.map +1 -1
- package/dist/in-store/window.js +2 -0
- package/dist/in-store/window.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/landxml/alignment-mapping.d.ts +98 -0
- package/dist/landxml/alignment-mapping.d.ts.map +1 -0
- package/dist/landxml/alignment-mapping.js +282 -0
- package/dist/landxml/alignment-mapping.js.map +1 -0
- package/dist/landxml/alignment-record.d.ts +18 -0
- package/dist/landxml/alignment-record.d.ts.map +1 -0
- package/dist/landxml/alignment-record.js +63 -0
- package/dist/landxml/alignment-record.js.map +1 -0
- package/dist/landxml/coordinate-plausibility.d.ts +54 -0
- package/dist/landxml/coordinate-plausibility.d.ts.map +1 -0
- package/dist/landxml/coordinate-plausibility.js +59 -0
- package/dist/landxml/coordinate-plausibility.js.map +1 -0
- package/dist/landxml/landxml-to-ifc.d.ts +45 -0
- package/dist/landxml/landxml-to-ifc.d.ts.map +1 -0
- package/dist/landxml/landxml-to-ifc.js +197 -0
- package/dist/landxml/landxml-to-ifc.js.map +1 -0
- package/dist/landxml/refusals.d.ts +41 -0
- package/dist/landxml/refusals.d.ts.map +1 -0
- package/dist/landxml/refusals.js +118 -0
- package/dist/landxml/refusals.js.map +1 -0
- package/dist/landxml/result-types.d.ts +73 -0
- package/dist/landxml/result-types.d.ts.map +1 -0
- package/dist/landxml/result-types.js +5 -0
- package/dist/landxml/result-types.js.map +1 -0
- package/dist/landxml/source-types.d.ts +169 -0
- package/dist/landxml/source-types.d.ts.map +1 -0
- package/dist/landxml/source-types.js +5 -0
- package/dist/landxml/source-types.js.map +1 -0
- package/dist/landxml/writers.d.ts +31 -0
- package/dist/landxml/writers.d.ts.map +1 -0
- package/dist/landxml/writers.js +143 -0
- package/dist/landxml/writers.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -2,28 +2,32 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
/**
|
|
5
|
-
* Resolve a `SpatialAnchor` from a parsed `IfcDataStore
|
|
5
|
+
* Resolve a `SpatialAnchor` from a parsed `IfcDataStore` and optional live
|
|
6
|
+
* mutation view.
|
|
6
7
|
*
|
|
7
8
|
* Walks the entity index for the IfcOwnerHistory, the 'Body'
|
|
8
9
|
* IfcGeometricRepresentationSubContext (falling back to the model's
|
|
9
10
|
* 3D IfcGeometricRepresentationContext), and the target storey's
|
|
10
11
|
* IfcLocalPlacement.
|
|
11
12
|
*/
|
|
12
|
-
import { EntityExtractor,
|
|
13
|
+
import { EntityExtractor, resolveEffectiveEntityRecord } from '@ifc-lite/parser';
|
|
14
|
+
import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
|
|
13
15
|
import { safeLengthUnitScale } from './length-unit-scale.js';
|
|
14
|
-
export function resolveSpatialAnchor(store, storeyExpressId) {
|
|
16
|
+
export function resolveSpatialAnchor(store, storeyExpressId, view) {
|
|
17
|
+
const reader = new AnchorEntityReader(store, view);
|
|
15
18
|
// OwnerHistory is OPTIONAL from IFC4 onward — minimal files (including
|
|
16
19
|
// ifc-lite's own exports) legitimately omit it. Builders emit `$` then.
|
|
17
|
-
const ownerHistoryId =
|
|
18
|
-
const
|
|
20
|
+
const ownerHistoryId = reader.firstId('IFCOWNERHISTORY');
|
|
21
|
+
const rootContextId = reader.rootContextId();
|
|
22
|
+
const bodyContextId = reader.contextId('body', rootContextId);
|
|
19
23
|
if (bodyContextId === null) {
|
|
20
24
|
throw new Error('resolveSpatialAnchor: no IfcGeometricRepresentationContext (or Body subcontext) found in store');
|
|
21
25
|
}
|
|
22
|
-
const axisContextId =
|
|
26
|
+
const axisContextId = reader.contextId('axis', rootContextId);
|
|
23
27
|
if (axisContextId === null) {
|
|
24
28
|
throw new Error('resolveSpatialAnchor: no IfcGeometricRepresentationContext (or Axis subcontext) found in store');
|
|
25
29
|
}
|
|
26
|
-
const storeyPlacementId =
|
|
30
|
+
const storeyPlacementId = reader.storeyPlacementId(storeyExpressId);
|
|
27
31
|
if (storeyPlacementId === null) {
|
|
28
32
|
throw new Error(`resolveSpatialAnchor: storey #${storeyExpressId} has no resolvable IfcLocalPlacement`);
|
|
29
33
|
}
|
|
@@ -47,98 +51,81 @@ export function resolveSpatialAnchor(store, storeyExpressId) {
|
|
|
47
51
|
const lengthUnitScale = store.source.byteLength > 0
|
|
48
52
|
? safeLengthUnitScale(store.source, store.entityIndex, 'resolveSpatialAnchor') ?? 1.0
|
|
49
53
|
: 1.0;
|
|
50
|
-
return { ownerHistoryId, bodyContextId, axisContextId, storeyId: storeyExpressId, storeyPlacementId, schema, lengthUnitScale };
|
|
54
|
+
return { ownerHistoryId, bodyContextId, axisContextId, rootContextId, storeyId: storeyExpressId, storeyPlacementId, schema, lengthUnitScale };
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (store.source.byteLength <= 0)
|
|
62
|
-
return null;
|
|
63
|
-
const extractor = new EntityExtractor(store.source);
|
|
64
|
-
const subIds = store.entityIndex.byType.get('IFCGEOMETRICREPRESENTATIONSUBCONTEXT') ?? [];
|
|
65
|
-
for (const id of subIds) {
|
|
66
|
-
const ref = store.entityIndex.byId.get(id);
|
|
67
|
-
if (!ref)
|
|
68
|
-
continue;
|
|
69
|
-
const entity = extractor.extractEntity(ref);
|
|
70
|
-
const identifier = entity?.attributes?.[1];
|
|
71
|
-
if (typeof identifier === 'string' && identifier.toLowerCase() === 'body') {
|
|
72
|
-
return id;
|
|
73
|
-
}
|
|
56
|
+
/** Read source and overlay entities through the same effective ID boundary. */
|
|
57
|
+
class AnchorEntityReader {
|
|
58
|
+
store;
|
|
59
|
+
view;
|
|
60
|
+
extractor;
|
|
61
|
+
constructor(store, view) {
|
|
62
|
+
this.store = store;
|
|
63
|
+
this.view = view;
|
|
64
|
+
this.extractor = store.source.byteLength > 0 ? new EntityExtractor(store.source) : null;
|
|
74
65
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (!ref)
|
|
79
|
-
continue;
|
|
80
|
-
const entity = extractor.extractEntity(ref);
|
|
81
|
-
const dimension = entity?.attributes?.[2];
|
|
82
|
-
if (typeof dimension === 'number' && dimension === 3) {
|
|
83
|
-
return id;
|
|
66
|
+
*ids(type) {
|
|
67
|
+
for (const { expressId } of iterateEffectiveEntityIds(this.store, this.view, [type])) {
|
|
68
|
+
yield expressId;
|
|
84
69
|
}
|
|
85
70
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const extractor = new EntityExtractor(store.source);
|
|
96
|
-
const subIds = store.entityIndex.byType.get('IFCGEOMETRICREPRESENTATIONSUBCONTEXT') ?? [];
|
|
97
|
-
for (const id of subIds) {
|
|
98
|
-
const ref = store.entityIndex.byId.get(id);
|
|
99
|
-
if (!ref)
|
|
100
|
-
continue;
|
|
101
|
-
const entity = extractor.extractEntity(ref);
|
|
102
|
-
const identifier = entity?.attributes?.[1];
|
|
103
|
-
if (typeof identifier === 'string' && identifier.toLowerCase() === 'axis') {
|
|
104
|
-
return id;
|
|
71
|
+
firstId(type) {
|
|
72
|
+
return this.ids(type).next().value ?? null;
|
|
73
|
+
}
|
|
74
|
+
/** Prefer the named subcontext, then the root 3D context. */
|
|
75
|
+
contextId(identifier, rootContextId) {
|
|
76
|
+
for (const id of this.ids('IFCGEOMETRICREPRESENTATIONSUBCONTEXT')) {
|
|
77
|
+
const value = this.entity(id)?.attributes[1];
|
|
78
|
+
if (typeof value === 'string' && value.toLowerCase() === identifier)
|
|
79
|
+
return id;
|
|
105
80
|
}
|
|
81
|
+
return rootContextId;
|
|
106
82
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
83
|
+
/** The model's root 3D context, never a subcontext. */
|
|
84
|
+
rootContextId() {
|
|
85
|
+
let fallback = null;
|
|
86
|
+
for (const id of this.ids('IFCGEOMETRICREPRESENTATIONCONTEXT')) {
|
|
87
|
+
const entity = this.entity(id);
|
|
88
|
+
if (!entity)
|
|
89
|
+
continue;
|
|
90
|
+
fallback ??= id;
|
|
91
|
+
if (entity.attributes[2] === 3)
|
|
92
|
+
return id;
|
|
116
93
|
}
|
|
94
|
+
return fallback;
|
|
95
|
+
}
|
|
96
|
+
/** The effective storey's live IfcLocalPlacement, including overlay refs. */
|
|
97
|
+
storeyPlacementId(storeyId) {
|
|
98
|
+
const storey = this.entity(storeyId);
|
|
99
|
+
if (storey?.type.toUpperCase() !== 'IFCBUILDINGSTOREY')
|
|
100
|
+
return null;
|
|
101
|
+
const index = storey.names.indexOf('ObjectPlacement');
|
|
102
|
+
const raw = storey.attributes[index >= 0 ? index : 5];
|
|
103
|
+
const placementId = typeof raw === 'number' && Number.isInteger(raw) && raw > 0
|
|
104
|
+
? raw
|
|
105
|
+
: typeof raw === 'string' && /^#[1-9][0-9]*$/.test(raw)
|
|
106
|
+
? Number(raw.slice(1))
|
|
107
|
+
: null;
|
|
108
|
+
if (placementId === null)
|
|
109
|
+
return null;
|
|
110
|
+
return this.entity(placementId)?.type.toUpperCase() === 'IFCLOCALPLACEMENT'
|
|
111
|
+
? placementId
|
|
112
|
+
: null;
|
|
113
|
+
}
|
|
114
|
+
entity(id) {
|
|
115
|
+
if (this.view?.isDeleted(id))
|
|
116
|
+
return null;
|
|
117
|
+
const created = this.view?.getNewEntity(id);
|
|
118
|
+
// @raw-entity-enumeration-ok point lookup after effective enumeration; source bytes are needed only for this candidate's attributes
|
|
119
|
+
const ref = created ? undefined : this.store.entityIndex.byId.get(id);
|
|
120
|
+
const source = ref && this.extractor ? this.extractor.extractEntity(ref) : null;
|
|
121
|
+
const entity = created ?? source;
|
|
122
|
+
if (!entity)
|
|
123
|
+
return null;
|
|
124
|
+
return resolveEffectiveEntityRecord(entity, {
|
|
125
|
+
retype: this.view?.getEntityTypeMutation(id)?.newType,
|
|
126
|
+
named: this.view?.getAttributeMutationsForEntity(id).map(({ name, value }) => [name, value]) ?? [],
|
|
127
|
+
positional: this.view?.getPositionalMutationsForEntity(id) ?? [],
|
|
128
|
+
}, this.store.schemaVersion);
|
|
117
129
|
}
|
|
118
|
-
return ctxIds[0] ?? null;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Resolve the target storey's `ObjectPlacement` (an IfcLocalPlacement).
|
|
122
|
-
*
|
|
123
|
-
* The attribute lives at the same positional index across IFC2X3 and IFC4
|
|
124
|
-
* (inherited from IfcProduct), but rather than hard-code an offset we walk
|
|
125
|
-
* the schema-resolved attribute name list — that way the lookup keeps
|
|
126
|
-
* working if the schema gen ever shifts inheritance.
|
|
127
|
-
*/
|
|
128
|
-
function findStoreyPlacementId(store, storeyExpressId) {
|
|
129
|
-
if (store.source.byteLength <= 0)
|
|
130
|
-
return null;
|
|
131
|
-
const ref = store.entityIndex.byId.get(storeyExpressId);
|
|
132
|
-
if (!ref)
|
|
133
|
-
return null;
|
|
134
|
-
const extractor = new EntityExtractor(store.source);
|
|
135
|
-
const entity = extractor.extractEntity(ref);
|
|
136
|
-
if (!entity)
|
|
137
|
-
return null;
|
|
138
|
-
const attrNames = getAttributeNames(entity.type);
|
|
139
|
-
const placementIndex = attrNames.indexOf('ObjectPlacement');
|
|
140
|
-
const idx = placementIndex >= 0 ? placementIndex : 5;
|
|
141
|
-
const placement = entity.attributes?.[idx];
|
|
142
|
-
return typeof placement === 'number' ? placement : null;
|
|
143
130
|
}
|
|
144
131
|
//# sourceMappingURL=resolve-anchor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-anchor.js","sourceRoot":"","sources":["../../src/in-store/resolve-anchor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D
|
|
1
|
+
{"version":3,"file":"resolve-anchor.js","sourceRoot":"","sources":["../../src/in-store/resolve-anchor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAiD,MAAM,kBAAkB,CAAC;AAChI,OAAO,EAAE,yBAAyB,EAA4B,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,UAAU,oBAAoB,CAClC,KAAmB,EACnB,eAAuB,EACvB,IAAiC;IAEjC,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACnD,uEAAuE;IACvE,wEAAwE;IACxE,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEzD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;IAC7C,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC9D,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,gGAAgG,CAAC,CAAC;IACpH,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,aAAa,C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QACpI,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChF,MAAM,MAAM,GAAG,OAAO,IAAI,MAAM,CAAC;QACjC,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,4BAA4B,CAAC,MAAM,EAAE;YAC1C,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,EAAE,OAAO;YACrD,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,8BAA8B,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAU,CAAC,IAAI,EAAE;YAC3G,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,+BAA+B,CAAC,EAAE,CAAC,IAAI,EAAE;SACjE,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* backend layer can call it without needing parser internals.
|
|
10
10
|
*/
|
|
11
11
|
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
12
|
+
import { type StoreEditor } from '@ifc-lite/mutations';
|
|
12
13
|
import type { SourceAttributes } from './duplicate.js';
|
|
13
14
|
/**
|
|
14
15
|
* Resolve everything `duplicateInStore` needs to clone a source
|
|
15
16
|
* IfcRoot product. Throws when the source isn't an IfcProduct
|
|
16
17
|
* (no ObjectPlacement at index 5).
|
|
17
18
|
*/
|
|
18
|
-
export declare function resolveDuplicateSource(store: IfcDataStore, sourceExpressId: number): SourceAttributes;
|
|
19
|
+
export declare function resolveDuplicateSource(store: IfcDataStore, sourceExpressId: number, editor?: StoreEditor): SourceAttributes;
|
|
19
20
|
//# sourceMappingURL=resolve-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-source.d.ts","sourceRoot":"","sources":["../../src/in-store/resolve-source.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-source.d.ts","sourceRoot":"","sources":["../../src/in-store/resolve-source.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAqD,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG1G,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,gBAAgB,CAAC;AA0ChF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,gBAAgB,CAsHlB"}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* backend layer can call it without needing parser internals.
|
|
13
13
|
*/
|
|
14
14
|
import { EntityExtractor } from '@ifc-lite/parser';
|
|
15
|
+
import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
|
|
15
16
|
import { resolvedTypeName } from '@ifc-lite/data';
|
|
17
|
+
import { asRef, createStyleEntityReader, refList } from './style-entity-reader.js';
|
|
16
18
|
import { safeLengthUnitScale } from './length-unit-scale.js';
|
|
17
19
|
/**
|
|
18
20
|
* Rel types whose `RelatedObjects` list is replayed against a
|
|
@@ -58,10 +60,14 @@ function asNumber(v) {
|
|
|
58
60
|
* IfcRoot product. Throws when the source isn't an IfcProduct
|
|
59
61
|
* (no ObjectPlacement at index 5).
|
|
60
62
|
*/
|
|
61
|
-
export function resolveDuplicateSource(store, sourceExpressId) {
|
|
63
|
+
export function resolveDuplicateSource(store, sourceExpressId, editor) {
|
|
62
64
|
if (!store.source) {
|
|
63
65
|
throw new Error('resolveDuplicateSource: data store has no source bytes');
|
|
64
66
|
}
|
|
67
|
+
if (editor?.getMutationView().isDeleted(sourceExpressId)) {
|
|
68
|
+
throw new Error(`resolveDuplicateSource: entity #${sourceExpressId} was deleted`);
|
|
69
|
+
}
|
|
70
|
+
// @raw-entity-enumeration-ok point read of the duplicated source product's own placement chain; a deleted source was refused above and a created one has no bytes to duplicate from
|
|
65
71
|
const sourceRef = store.entityIndex.byId.get(sourceExpressId);
|
|
66
72
|
if (!sourceRef) {
|
|
67
73
|
throw new Error(`resolveDuplicateSource: entity #${sourceExpressId} not found`);
|
|
@@ -80,6 +86,7 @@ export function resolveDuplicateSource(store, sourceExpressId) {
|
|
|
80
86
|
if (placementId === null) {
|
|
81
87
|
throw new Error(`resolveDuplicateSource: #${sourceExpressId} has no ObjectPlacement — only IfcProduct can be duplicated`);
|
|
82
88
|
}
|
|
89
|
+
// @raw-entity-enumeration-ok point read of the duplicated source product's own placement chain; a deleted source was refused above and a created one has no bytes to duplicate from
|
|
83
90
|
const placementRef = store.entityIndex.byId.get(placementId);
|
|
84
91
|
if (!placementRef) {
|
|
85
92
|
throw new Error(`resolveDuplicateSource: placement #${placementId} missing from index`);
|
|
@@ -93,6 +100,7 @@ export function resolveDuplicateSource(store, sourceExpressId) {
|
|
|
93
100
|
if (axisPlacementId === null) {
|
|
94
101
|
throw new Error(`resolveDuplicateSource: placement #${placementId} has no RelativePlacement`);
|
|
95
102
|
}
|
|
103
|
+
// @raw-entity-enumeration-ok point read of the duplicated source product's own placement chain; a deleted source was refused above and a created one has no bytes to duplicate from
|
|
96
104
|
const axisPlacementRef = store.entityIndex.byId.get(axisPlacementId);
|
|
97
105
|
if (!axisPlacementRef) {
|
|
98
106
|
throw new Error(`resolveDuplicateSource: axis placement #${axisPlacementId} missing`);
|
|
@@ -106,6 +114,7 @@ export function resolveDuplicateSource(store, sourceExpressId) {
|
|
|
106
114
|
const refDirectionRef = asRefOrNull(axisEntity.attributes[2]); // RefDirection (optional)
|
|
107
115
|
let sourceLocation = [0, 0, 0];
|
|
108
116
|
if (locationId !== null) {
|
|
117
|
+
// @raw-entity-enumeration-ok point read of the duplicated source product's own placement chain; a deleted source was refused above and a created one has no bytes to duplicate from
|
|
109
118
|
const pointRef = store.entityIndex.byId.get(locationId);
|
|
110
119
|
if (pointRef) {
|
|
111
120
|
const pointEntity = extractor.extractEntity(pointRef);
|
|
@@ -126,7 +135,7 @@ export function resolveDuplicateSource(store, sourceExpressId) {
|
|
|
126
135
|
// the duplicate by `duplicateInStore` so the exported STEP carries
|
|
127
136
|
// the same psets / qsets / material / classifications / documents
|
|
128
137
|
// / type binding.
|
|
129
|
-
const associations = collectSourceAssociations(store, extractor, sourceExpressId);
|
|
138
|
+
const associations = collectSourceAssociations(store, extractor, sourceExpressId, editor);
|
|
130
139
|
// Metres per native unit (0.001 for a millimetre file) — lets the
|
|
131
140
|
// duplicate flow convert its metre offset onto the native-unit
|
|
132
141
|
// sourceLocation. Falls back to 1 (metres) on extraction failure.
|
|
@@ -157,55 +166,46 @@ export function resolveDuplicateSource(store, sourceExpressId) {
|
|
|
157
166
|
* Returns one `SourceAssociation` per matching rel — duplicate flow
|
|
158
167
|
* emits a fresh rel of the same type pointing at the duplicate.
|
|
159
168
|
*/
|
|
160
|
-
function collectSourceAssociations(store, extractor, sourceId) {
|
|
169
|
+
function collectSourceAssociations(store, extractor, sourceId, editor) {
|
|
161
170
|
const out = [];
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
// The session's effective relationships (#5249): one deleted this session is
|
|
172
|
+
// not replayed onto the duplicate, one created this session (a type binding,
|
|
173
|
+
// a material) is, and a queued edit to a relationship is what gets copied.
|
|
174
|
+
const view = editor?.getMutationView() ?? null;
|
|
175
|
+
const read = editor
|
|
176
|
+
? createStyleEntityReader(store, editor)
|
|
177
|
+
: (id) => {
|
|
178
|
+
// @raw-entity-enumeration-ok point read of one effective candidate's source bytes when no session editor was supplied
|
|
179
|
+
const ref = store.entityIndex.byId.get(id);
|
|
180
|
+
return ref ? extractor.extractEntity(ref) : null;
|
|
181
|
+
};
|
|
182
|
+
for (const { expressId: relId, type } of iterateEffectiveEntityIds(store, view, ASSOCIATION_REL_TYPES)) {
|
|
183
|
+
const entity = read(relId);
|
|
184
|
+
if (!entity)
|
|
165
185
|
continue;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const relatingExpressId = asNumber(entity.attributes[5]);
|
|
190
|
-
// RelatingPropertyDefinition / RelatingType / etc. is required
|
|
191
|
-
// by the schema, so a missing one is a hard skip. OwnerHistory
|
|
192
|
-
// is optional (IFC4) — null is fine and round-trips cleanly.
|
|
193
|
-
if (relatingExpressId === null)
|
|
194
|
-
continue;
|
|
195
|
-
const name = typeof entity.attributes[2] === 'string' ? entity.attributes[2] : null;
|
|
196
|
-
const description = typeof entity.attributes[3] === 'string' ? entity.attributes[3] : null;
|
|
197
|
-
// Canonical PascalCase when the table has it; association rels are
|
|
198
|
-
// usually categorised out of the `EntityTable` entirely, so `relType`
|
|
199
|
-
// (the constant this loop is already iterating by) is the fallback.
|
|
200
|
-
const canonicalRelType = resolvedTypeName(store.entities, relId) ?? relType;
|
|
201
|
-
out.push({
|
|
202
|
-
relType: canonicalRelType,
|
|
203
|
-
ownerHistoryId,
|
|
204
|
-
name,
|
|
205
|
-
description,
|
|
206
|
-
relatingExpressId,
|
|
207
|
-
});
|
|
208
|
-
}
|
|
186
|
+
// RelatedObjects: a parsed `#N` is a number, an authored one a `#N` string.
|
|
187
|
+
if (!refList(entity.attributes[4]).includes(sourceId))
|
|
188
|
+
continue;
|
|
189
|
+
const ownerHistoryId = asRef(entity.attributes[1]);
|
|
190
|
+
const relatingExpressId = asRef(entity.attributes[5]);
|
|
191
|
+
// RelatingPropertyDefinition / RelatingType / etc. is required
|
|
192
|
+
// by the schema, so a missing one is a hard skip. OwnerHistory
|
|
193
|
+
// is optional (IFC4) — null is fine and round-trips cleanly.
|
|
194
|
+
if (relatingExpressId === null)
|
|
195
|
+
continue;
|
|
196
|
+
const name = typeof entity.attributes[2] === 'string' ? entity.attributes[2] : null;
|
|
197
|
+
const description = typeof entity.attributes[3] === 'string' ? entity.attributes[3] : null;
|
|
198
|
+
// Canonical PascalCase when the table has it; association rels are
|
|
199
|
+
// usually categorised out of the `EntityTable` entirely, so the
|
|
200
|
+
// effective STEP class the iterator reports is the fallback.
|
|
201
|
+
const canonicalRelType = resolvedTypeName(store.entities, relId) ?? type;
|
|
202
|
+
out.push({
|
|
203
|
+
relType: canonicalRelType,
|
|
204
|
+
ownerHistoryId,
|
|
205
|
+
name,
|
|
206
|
+
description,
|
|
207
|
+
relatingExpressId,
|
|
208
|
+
});
|
|
209
209
|
}
|
|
210
210
|
return out;
|
|
211
211
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-source.js","sourceRoot":"","sources":["../../src/in-store/resolve-source.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-source.js","sourceRoot":"","sources":["../../src/in-store/resolve-source.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAA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,CAAC,QAAQ,CAAC;YAAE,SAAS;QAEhE,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,+DAA+D;QAC/D,+DAA+D;QAC/D,6DAA6D;QAC7D,IAAI,iBAAiB,KAAK,IAAI;YAAE,SAAS;QAEzC,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACpF,MAAM,WAAW,GAAG,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE3F,mEAAmE;QACnE,gEAAgE;QAChE,6DAA6D;QAC7D,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC;QACzE,GAAG,CAAC,IAAI,CAAC;YACP,OAAO,EAAE,gBAAgB;YACzB,cAAc;YACd,IAAI;YACJ,WAAW;YACX,iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/in-store/roof.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface RoofRectangleParams {
|
|
|
19
19
|
Description?: string;
|
|
20
20
|
ObjectType?: string;
|
|
21
21
|
Tag?: string;
|
|
22
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
23
|
+
GlobalId?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface RoofPolygonParams {
|
|
24
26
|
Profile: 'polygon';
|
|
@@ -29,6 +31,8 @@ export interface RoofPolygonParams {
|
|
|
29
31
|
Description?: string;
|
|
30
32
|
ObjectType?: string;
|
|
31
33
|
Tag?: string;
|
|
34
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
35
|
+
GlobalId?: string;
|
|
32
36
|
}
|
|
33
37
|
export interface RoofBuildResult {
|
|
34
38
|
roofId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roof.d.ts","sourceRoot":"","sources":["../../src/in-store/roof.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"roof.d.ts","sourceRoot":"","sources":["../../src/in-store/roof.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAkD,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjG,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,SAAS,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAMD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CAgDjB"}
|
package/dist/in-store/roof.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { assertFinitePoint3 } from '../ifc-creator-math.js';
|
|
4
5
|
import { toNativeLength, toNativePoint2, toNativePoint3 } from './anchor.js';
|
|
5
6
|
import { assertPositiveFinite, emitBodyRepresentation, emitExtrudedSolid, emitLocalPlacement, emitPolygonProfile, emitRectangleProfile, emitRelContainedInSpatialStructure, ifcElementHeader, } from './_emit-helpers.js';
|
|
6
7
|
function isPolygonParams(p) {
|
|
@@ -8,6 +9,9 @@ function isPolygonParams(p) {
|
|
|
8
9
|
}
|
|
9
10
|
export function addRoofToStore(editor, anchor, params) {
|
|
10
11
|
assertPositiveFinite([params.Thickness], 'addRoofToStore: Thickness must be positive');
|
|
12
|
+
if (params.Position !== undefined) {
|
|
13
|
+
assertFinitePoint3({ Position: params.Position }, 'addRoofToStore');
|
|
14
|
+
}
|
|
11
15
|
if (!isPolygonParams(params)) {
|
|
12
16
|
assertPositiveFinite([params.Width, params.Depth], 'addRoofToStore: Width and Depth must be positive');
|
|
13
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roof.js","sourceRoot":"","sources":["../../src/in-store/roof.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjG,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,EAClC,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"roof.js","sourceRoot":"","sources":["../../src/in-store/roof.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjG,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,EAClC,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAyC5B,SAAS,eAAe,CAAC,CAAoB;IAC3C,OAAO,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAAmB,EACnB,MAAqB,EACrB,MAAyB;IAEzB,oBAAoB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,4CAA4C,CAAC,CAAC;IACvF,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,C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AC;AACjG,CAAC"}
|
package/dist/in-store/slab.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface SlabRectangleParams {
|
|
|
12
12
|
Description?: string;
|
|
13
13
|
ObjectType?: string;
|
|
14
14
|
Tag?: string;
|
|
15
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
16
|
+
GlobalId?: string;
|
|
15
17
|
}
|
|
16
18
|
export interface SlabPolygonParams {
|
|
17
19
|
/** `'polygon'` discriminator selects the IfcArbitraryClosedProfileDef path. */
|
|
@@ -30,6 +32,8 @@ export interface SlabPolygonParams {
|
|
|
30
32
|
Description?: string;
|
|
31
33
|
ObjectType?: string;
|
|
32
34
|
Tag?: string;
|
|
35
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
36
|
+
GlobalId?: string;
|
|
33
37
|
}
|
|
34
38
|
export interface SlabBuildResult {
|
|
35
39
|
slabId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slab.d.ts","sourceRoot":"","sources":["../../src/in-store/slab.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"slab.d.ts","sourceRoot":"","sources":["../../src/in-store/slab.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAkD,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjG,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AA8CD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CA4GjB"}
|
package/dist/in-store/slab.js
CHANGED
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
* I/O, no parser access.
|
|
22
22
|
*/
|
|
23
23
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
24
|
+
import { assertFinitePoint3 } from '../ifc-creator-math.js';
|
|
24
25
|
import { toNativeLength, toNativePoint2, toNativePoint3 } from './anchor.js';
|
|
25
|
-
import { assertPositiveFinite, ownerHistoryRef } from './_emit-helpers.js';
|
|
26
|
+
import { assertPositiveFinite, ownerHistoryRef, productGuid } from './_emit-helpers.js';
|
|
26
27
|
const POINT_EPSILON = 1e-6;
|
|
27
28
|
function isPolygonParams(p) {
|
|
28
29
|
return p.Profile === 'polygon';
|
|
@@ -64,6 +65,9 @@ function emitPolygonProfile(editor, curve) {
|
|
|
64
65
|
export function addSlabToStore(editor, anchor, params) {
|
|
65
66
|
const { ownerHistoryId, bodyContextId, storeyId, storeyPlacementId } = anchor;
|
|
66
67
|
assertPositiveFinite([params.Thickness], 'addSlabToStore: Thickness must be positive');
|
|
68
|
+
if (params.Position !== undefined) {
|
|
69
|
+
assertFinitePoint3({ Position: params.Position }, 'addSlabToStore');
|
|
70
|
+
}
|
|
67
71
|
if (!isPolygonParams(params)) {
|
|
68
72
|
assertPositiveFinite([params.Width, params.Depth], 'addSlabToStore: Width and Depth must be positive');
|
|
69
73
|
}
|
|
@@ -125,7 +129,7 @@ export function addSlabToStore(editor, anchor, params) {
|
|
|
125
129
|
]).expressId;
|
|
126
130
|
// `IfcSlab.PredefinedType` only exists from IFC4 onward.
|
|
127
131
|
const slabAttrs = [
|
|
128
|
-
|
|
132
|
+
productGuid(params, anchor.guidRandom),
|
|
129
133
|
ownerHistoryRef(ownerHistoryId),
|
|
130
134
|
params.Name ?? 'Slab',
|
|
131
135
|
params.Description ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slab.js","sourceRoot":"","sources":["../../src/in-store/slab.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE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OAAO;QACP,UAAU;QACV,cAAc;QACd,cAAc;KACf,CAAC;AACJ,CAAC"}
|
package/dist/in-store/space.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface SpaceRectangleParams {
|
|
|
19
19
|
Profile?: 'rectangle';
|
|
20
20
|
Name?: string;
|
|
21
21
|
LongName?: string;
|
|
22
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
23
|
+
GlobalId?: string;
|
|
22
24
|
Description?: string;
|
|
23
25
|
ObjectType?: string;
|
|
24
26
|
/**
|
|
@@ -42,6 +44,8 @@ export interface SpacePolygonParams {
|
|
|
42
44
|
Height: number;
|
|
43
45
|
Name?: string;
|
|
44
46
|
LongName?: string;
|
|
47
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
48
|
+
GlobalId?: string;
|
|
45
49
|
Description?: string;
|
|
46
50
|
ObjectType?: string;
|
|
47
51
|
/** See SpaceRectangleParams.PredefinedType. */
|