@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../src/in-store/space.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../src/in-store/space.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjE,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAE3E,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB;8CAC0C;IAC1C,kBAAkB,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;IAC5D,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAC5C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MA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AC;CAC5B;AA4BD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,kBAAkB,GACzB,gBAAgB,CAkIlB"}
|
package/dist/in-store/space.js
CHANGED
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* (.INTERNAL.), ElevationWithFlooring
|
|
16
16
|
*/
|
|
17
17
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
18
|
+
import { assertFinitePoint3 } from '../ifc-creator-math.js';
|
|
18
19
|
import { toNativeLength } from './anchor.js';
|
|
19
|
-
import { assertPositiveFinite, emitBodyRepresentation, emitExtrudedSolid, emitLocalPlacement, emitPolygonProfile, emitRectangleProfile, ownerHistoryRef, } from './_emit-helpers.js';
|
|
20
|
+
import { assertPositiveFinite, emitBodyRepresentation, emitExtrudedSolid, emitLocalPlacement, emitPolygonProfile, emitRectangleProfile, ownerHistoryRef, productGuid } from './_emit-helpers.js';
|
|
20
21
|
/** Absolute polygon area (shoelace), m². */
|
|
21
22
|
function polygonArea(pts) {
|
|
22
23
|
let acc = 0;
|
|
@@ -42,6 +43,9 @@ function isPolygonParams(p) {
|
|
|
42
43
|
}
|
|
43
44
|
export function addSpaceToStore(editor, anchor, params) {
|
|
44
45
|
const polygon = isPolygonParams(params);
|
|
46
|
+
if (params.Position !== undefined) {
|
|
47
|
+
assertFinitePoint3({ Position: params.Position }, 'addSpaceToStore');
|
|
48
|
+
}
|
|
45
49
|
const placementOrigin = polygon
|
|
46
50
|
? params.Position ?? [0, 0, 0]
|
|
47
51
|
: params.Position;
|
|
@@ -67,7 +71,7 @@ export function addSpaceToStore(editor, anchor, params) {
|
|
|
67
71
|
// (IFC2X3 IfcInternalOrExternalEnum), ElevationWithFlooring
|
|
68
72
|
// INTERNAL is a valid value in both enums, so it makes a safe default.
|
|
69
73
|
const attrs = [
|
|
70
|
-
|
|
74
|
+
productGuid(params, anchor.guidRandom),
|
|
71
75
|
ownerHistoryRef(anchor.ownerHistoryId),
|
|
72
76
|
params.Name ?? 'Space',
|
|
73
77
|
params.Description ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.js","sourceRoot":"","sources":["../../src/in-store/space.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"space.js","sourceRoot":"","sources":["../../src/in-store/space.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAgFjM,4CAA4C;AAC5C,SAAS,WAAW,CAAC,GAA6C;IAChE,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAC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AAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;KAC7E,CAAC,CAAC;IAEH,6EAA6E;IAC7E,oEAAoE;IACpE,0EAA0E;IAC1E,6EAA6E;IAC7E,6DAA6D;IAC7D,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACzD,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC;YAClC,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC;YACtC,IAAI;YACJ,IAAI;YACJ,IAAI,OAAO,EAAE;YACb,IAAI,QAAQ,CAAC,SAAS,EAAE;YACxB,IAAI;YACJ,IAAI,QAAQ,CAAC,iBAAiB,IAAI,UAAU,GAAG;YAC/C,IAAI,QAAQ,CAAC,kBAAkB,IAAI,YAAY,GAAG;SACR,CAAC,CAAC,SAAS,CAAC;QACxD,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO;QACP,WAAW;QACX,SAAS;QACT,OAAO;QACP,UAAU;QACV,cAAc;QACd,eAAe;QACf,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spatial children (aggregation / containment) and storeys of the session's
|
|
3
|
+
* EFFECTIVE model, for the in-store authoring walks (#5249).
|
|
4
|
+
*
|
|
5
|
+
* `extractWallSegmentsForStorey` and `existingSpaceFootprintsByStorey` index
|
|
6
|
+
* `IfcRelAggregates` / `IfcRelContainedInSpatialStructure` by their relating
|
|
7
|
+
* element. That index was built from the parsed type buckets only. So:
|
|
8
|
+
* - a wall deleted this session was still a room divider;
|
|
9
|
+
* - a space baked in an earlier Space Sketch run (overlay-created, together
|
|
10
|
+
* with its containment relationship) was not an "existing space", so
|
|
11
|
+
* baking again produced a duplicate room on top of it.
|
|
12
|
+
*
|
|
13
|
+
* Relationships and storeys now come from the shared effective-entity
|
|
14
|
+
* iterator. Relationships are read through `readEntity` (source bytes or an
|
|
15
|
+
* overlay-created payload) with queued positional edits applied, and a deleted
|
|
16
|
+
* child is dropped.
|
|
17
|
+
*
|
|
18
|
+
* {@link OverlayLookup} snapshots the overlay ONCE per walk: the view copies
|
|
19
|
+
* `getNewEntities()` / `getTypeMutations()` on every call, so resolving each
|
|
20
|
+
* member through them would be O(members x created entities) per index build.
|
|
21
|
+
*/
|
|
22
|
+
import { type EffectiveEntityOverlay } from '@ifc-lite/data';
|
|
23
|
+
import type { EntityExtractor, IfcAttributeValue, IfcDataStore } from '@ifc-lite/parser';
|
|
24
|
+
import { type OverlayWallReader } from './placement-frame.js';
|
|
25
|
+
/** The overlay, snapshotted once for one walk. */
|
|
26
|
+
export interface OverlayLookup {
|
|
27
|
+
readonly overlay: OverlayWallReader | undefined;
|
|
28
|
+
readonly iteratorOverlay: EffectiveEntityOverlay | null;
|
|
29
|
+
isDeleted(id: number): boolean;
|
|
30
|
+
/** Authored class of an overlay-created entity, else `undefined`. */
|
|
31
|
+
createdType(id: number): string | undefined;
|
|
32
|
+
/** Queued retype, else `undefined`. */
|
|
33
|
+
retypeOf(id: number): string | undefined;
|
|
34
|
+
/** Authored attributes of an overlay-created entity, else `undefined`. */
|
|
35
|
+
createdAttributes(id: number): readonly IfcAttributeValue[] | undefined;
|
|
36
|
+
}
|
|
37
|
+
export declare function createOverlayLookup(overlay: OverlayWallReader | undefined): OverlayLookup;
|
|
38
|
+
/** The scalar an authored attribute holds: `{ real }` and `{ typed }` unwrapped. */
|
|
39
|
+
export declare function authoredScalar(value: IfcAttributeValue | undefined): string | number | boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Index every effective relationship of `relType` by its relating attribute,
|
|
42
|
+
* so "what is anchored to id X" is O(1) instead of an O(R) scan per parent.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildRelatingChildrenIndex(store: IfcDataStore, extractor: EntityExtractor, lookup: OverlayLookup, relType: string, relatingIdx: number, relatedIdx: number): Map<number, number[]>;
|
|
45
|
+
/**
|
|
46
|
+
* The effective class of an entity: its retype, else an overlay-created
|
|
47
|
+
* entity's authored class, else the parsed table's. `null` when deleted.
|
|
48
|
+
*/
|
|
49
|
+
export declare function effectiveMemberType(store: IfcDataStore, lookup: OverlayLookup, id: number): string | null;
|
|
50
|
+
/** Every storey of the effective model, in iterator order. */
|
|
51
|
+
export declare function effectiveStoreyIds(store: IfcDataStore, lookup: OverlayLookup): number[];
|
|
52
|
+
//# sourceMappingURL=spatial-children.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-children.d.ts","sourceRoot":"","sources":["../../src/in-store/spatial-children.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAA4B,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,qEAAqE;IACrE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC5C,uCAAuC;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;CACzE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,aAAa,CAwBzF;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAO1G;AAaD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,eAAe,EAC1B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAqBvB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzG;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAEvF"}
|
|
@@ -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
|
+
/**
|
|
5
|
+
* Spatial children (aggregation / containment) and storeys of the session's
|
|
6
|
+
* EFFECTIVE model, for the in-store authoring walks (#5249).
|
|
7
|
+
*
|
|
8
|
+
* `extractWallSegmentsForStorey` and `existingSpaceFootprintsByStorey` index
|
|
9
|
+
* `IfcRelAggregates` / `IfcRelContainedInSpatialStructure` by their relating
|
|
10
|
+
* element. That index was built from the parsed type buckets only. So:
|
|
11
|
+
* - a wall deleted this session was still a room divider;
|
|
12
|
+
* - a space baked in an earlier Space Sketch run (overlay-created, together
|
|
13
|
+
* with its containment relationship) was not an "existing space", so
|
|
14
|
+
* baking again produced a duplicate room on top of it.
|
|
15
|
+
*
|
|
16
|
+
* Relationships and storeys now come from the shared effective-entity
|
|
17
|
+
* iterator. Relationships are read through `readEntity` (source bytes or an
|
|
18
|
+
* overlay-created payload) with queued positional edits applied, and a deleted
|
|
19
|
+
* child is dropped.
|
|
20
|
+
*
|
|
21
|
+
* {@link OverlayLookup} snapshots the overlay ONCE per walk: the view copies
|
|
22
|
+
* `getNewEntities()` / `getTypeMutations()` on every call, so resolving each
|
|
23
|
+
* member through them would be O(members x created entities) per index build.
|
|
24
|
+
*/
|
|
25
|
+
import { iterateEffectiveEntities } from '@ifc-lite/data';
|
|
26
|
+
import { numericAttr, readEntity } from './placement-frame.js';
|
|
27
|
+
export function createOverlayLookup(overlay) {
|
|
28
|
+
if (!overlay) {
|
|
29
|
+
return {
|
|
30
|
+
overlay,
|
|
31
|
+
iteratorOverlay: null,
|
|
32
|
+
isDeleted: () => false,
|
|
33
|
+
createdType: () => undefined,
|
|
34
|
+
retypeOf: () => undefined,
|
|
35
|
+
createdAttributes: () => undefined,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const created = Array.from(overlay.getNewEntities());
|
|
39
|
+
const createdTypes = new Map(created.map((e) => [e.expressId, e.type]));
|
|
40
|
+
const createdAttrs = new Map(created.map((e) => [e.expressId, e.attributes]));
|
|
41
|
+
const retypes = overlay.getTypeMutations?.() ?? new Map();
|
|
42
|
+
const isDeleted = (id) => overlay.isDeleted?.(id) ?? false;
|
|
43
|
+
return {
|
|
44
|
+
overlay,
|
|
45
|
+
iteratorOverlay: { isDeleted, getNewEntities: () => created, getTypeMutations: () => retypes },
|
|
46
|
+
isDeleted,
|
|
47
|
+
createdType: (id) => createdTypes.get(id),
|
|
48
|
+
retypeOf: (id) => retypes.get(id)?.newType,
|
|
49
|
+
createdAttributes: (id) => createdAttrs.get(id),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** The scalar an authored attribute holds: `{ real }` and `{ typed }` unwrapped. */
|
|
53
|
+
export function authoredScalar(value) {
|
|
54
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')
|
|
55
|
+
return value;
|
|
56
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
57
|
+
if ('real' in value)
|
|
58
|
+
return value.real;
|
|
59
|
+
if ('typed' in value)
|
|
60
|
+
return value.typed.value;
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
/** One relationship attribute with a queued positional edit applied. */
|
|
65
|
+
function effectiveAttr(overlay, id, attributes, index) {
|
|
66
|
+
const edited = overlay?.getPositionalMutationsForEntity?.(id)?.get(index);
|
|
67
|
+
return edited !== undefined ? edited : attributes[index];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Index every effective relationship of `relType` by its relating attribute,
|
|
71
|
+
* so "what is anchored to id X" is O(1) instead of an O(R) scan per parent.
|
|
72
|
+
*/
|
|
73
|
+
export function buildRelatingChildrenIndex(store, extractor, lookup, relType, relatingIdx, relatedIdx) {
|
|
74
|
+
const out = new Map();
|
|
75
|
+
const { overlay } = lookup;
|
|
76
|
+
for (const { expressId: relId } of iterateEffectiveEntities(store, lookup.iteratorOverlay, [relType])) {
|
|
77
|
+
const rel = readEntity(store, extractor, overlay, relId);
|
|
78
|
+
if (!rel)
|
|
79
|
+
continue;
|
|
80
|
+
const relating = numericAttr(effectiveAttr(overlay, relId, rel.attributes, relatingIdx));
|
|
81
|
+
if (relating === null)
|
|
82
|
+
continue;
|
|
83
|
+
const related = effectiveAttr(overlay, relId, rel.attributes, relatedIdx);
|
|
84
|
+
if (!Array.isArray(related))
|
|
85
|
+
continue;
|
|
86
|
+
let bucket = out.get(relating);
|
|
87
|
+
if (!bucket) {
|
|
88
|
+
bucket = [];
|
|
89
|
+
out.set(relating, bucket);
|
|
90
|
+
}
|
|
91
|
+
for (const member of related) {
|
|
92
|
+
const child = numericAttr(member);
|
|
93
|
+
if (child !== null && !lookup.isDeleted(child))
|
|
94
|
+
bucket.push(child);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The effective class of an entity: its retype, else an overlay-created
|
|
101
|
+
* entity's authored class, else the parsed table's. `null` when deleted.
|
|
102
|
+
*/
|
|
103
|
+
export function effectiveMemberType(store, lookup, id) {
|
|
104
|
+
if (lookup.isDeleted(id))
|
|
105
|
+
return null;
|
|
106
|
+
return lookup.retypeOf(id) ?? lookup.createdType(id) ?? (store.entities.getTypeName(id) || null);
|
|
107
|
+
}
|
|
108
|
+
/** Every storey of the effective model, in iterator order. */
|
|
109
|
+
export function effectiveStoreyIds(store, lookup) {
|
|
110
|
+
return Array.from(iterateEffectiveEntities(store, lookup.iteratorOverlay, ['IFCBUILDINGSTOREY']), (e) => e.expressId);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=spatial-children.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-children.js","sourceRoot":"","sources":["../../src/in-store/spatial-children.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,wBAAwB,EAA+B,MAAM,gBAAgB,CAAC;AAEvF,OAAO,EAAE,WAAW,EAAE,UAAU,EAA0B,MAAM,sBAAsB,CAAC;AAevF,MAAM,UAAU,mBAAmB,CAAC,OAAsC;IACxE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,OAAO;YACP,eAAe,EAAE,IAAI;YACrB,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK;YACtB,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;YAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;YACzB,iBAAiB,EAAE,GAAG,EAAE,CA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BAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACxH,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchored builders for `IfcStructuralPointAction` and
|
|
3
|
+
* `IfcStructuralLinearAction` — the two `IfcStructuralActivity` subtypes
|
|
4
|
+
* task S.1 asks for (#5167).
|
|
5
|
+
*
|
|
6
|
+
* Schema targeted: IFC4 (IFC4_ADD2_TC1.exp), verified against the generated
|
|
7
|
+
* IFC4 registry's `allAttributes`:
|
|
8
|
+
* `IfcStructuralPointAction`: `GlobalId, OwnerHistory?, Name?,
|
|
9
|
+
* Description?, ObjectType?, ObjectPlacement?, Representation?,
|
|
10
|
+
* AppliedLoad, GlobalOrLocal, DestabilizingLoad?`
|
|
11
|
+
* `IfcStructuralLinearAction`: the same seven inherited attributes plus
|
|
12
|
+
* `ProjectedOrTrue?, PredefinedType` (from `IfcStructuralCurveAction`).
|
|
13
|
+
* `AppliedLoad`/`GlobalOrLocal` are MANDATORY on `IfcStructuralActivity`
|
|
14
|
+
* (no `?` in the registry) — both always written below, `GlobalOrLocal`
|
|
15
|
+
* defaulting to `GLOBAL_COORDS`.
|
|
16
|
+
* `IfcStructuralLinearAction`'s `ConstPredefinedType` WHERE rule forces
|
|
17
|
+
* `PredefinedType = CONST` — this builder hardcodes it; there is no
|
|
18
|
+
* parameter for it, because any other value is an EXPRESS violation.
|
|
19
|
+
* Each action's `AppliedLoad` is narrowed to the load types the
|
|
20
|
+
* `SuitableLoadType` WHERE rule accepts for that subtype:
|
|
21
|
+
* `IfcStructuralLoadSingleForce` for the point action,
|
|
22
|
+
* `IfcStructuralLoadLinearForce` for the linear action (both are also
|
|
23
|
+
* `IfcStructuralLoadStatic` → `IfcStructuralLoadOrResult` → `IfcStructuralLoad`).
|
|
24
|
+
*
|
|
25
|
+
* REPRESENTATION OWNERSHIP: neither action gets an `ObjectPlacement` or
|
|
26
|
+
* `Representation` (both left `$`) — an action's location is implied by the
|
|
27
|
+
* structural item it is connected to via `IfcRelConnectsStructuralActivity`
|
|
28
|
+
* (`connectStructuralActivityToItemInStore` in `structural-relationships.ts`).
|
|
29
|
+
* The schema makes both optional specifically to allow this; giving an
|
|
30
|
+
* action independent geometry would create a second, easily-diverging
|
|
31
|
+
* source of location truth for no read-side benefit
|
|
32
|
+
* (`StructuralActivityInfo` carries no geometry field). The `AppliedLoad`
|
|
33
|
+
* entity (`IfcStructuralLoadSingleForce`/`IfcStructuralLoadLinearForce`) IS
|
|
34
|
+
* owned exclusively by its action — freshly created per call, never shared.
|
|
35
|
+
*
|
|
36
|
+
* Pure: no I/O, no parser access — operates entirely through the editor.
|
|
37
|
+
*/
|
|
38
|
+
import type { StoreEditor } from '@ifc-lite/mutations';
|
|
39
|
+
import type { SpatialAnchor } from './anchor.js';
|
|
40
|
+
export type StructuralGlobalOrLocal = 'GLOBAL_COORDS' | 'LOCAL_COORDS';
|
|
41
|
+
export interface StructuralPointActionInStoreParams {
|
|
42
|
+
Name?: string;
|
|
43
|
+
Description?: string;
|
|
44
|
+
ObjectType?: string;
|
|
45
|
+
GlobalOrLocal?: StructuralGlobalOrLocal;
|
|
46
|
+
DestabilizingLoad?: boolean;
|
|
47
|
+
/** `IfcStructuralLoadSingleForce` components (all optional, at least one should be given). */
|
|
48
|
+
LoadName?: string;
|
|
49
|
+
ForceX?: number;
|
|
50
|
+
ForceY?: number;
|
|
51
|
+
ForceZ?: number;
|
|
52
|
+
MomentX?: number;
|
|
53
|
+
MomentY?: number;
|
|
54
|
+
MomentZ?: number;
|
|
55
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
56
|
+
GlobalId?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface StructuralPointActionBuildResult {
|
|
59
|
+
activityId: number;
|
|
60
|
+
loadId: number;
|
|
61
|
+
}
|
|
62
|
+
export declare function addStructuralPointActionToStore(editor: StoreEditor, anchor: Pick<SpatialAnchor, 'ownerHistoryId' | 'guidRandom' | 'schema'>, params: StructuralPointActionInStoreParams): StructuralPointActionBuildResult;
|
|
63
|
+
export interface StructuralLinearActionInStoreParams {
|
|
64
|
+
Name?: string;
|
|
65
|
+
Description?: string;
|
|
66
|
+
ObjectType?: string;
|
|
67
|
+
GlobalOrLocal?: StructuralGlobalOrLocal;
|
|
68
|
+
DestabilizingLoad?: boolean;
|
|
69
|
+
/** `IfcStructuralLoadLinearForce` components (all optional, at least one should be given). */
|
|
70
|
+
LoadName?: string;
|
|
71
|
+
LinearForceX?: number;
|
|
72
|
+
LinearForceY?: number;
|
|
73
|
+
LinearForceZ?: number;
|
|
74
|
+
LinearMomentX?: number;
|
|
75
|
+
LinearMomentY?: number;
|
|
76
|
+
LinearMomentZ?: number;
|
|
77
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
78
|
+
GlobalId?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface StructuralLinearActionBuildResult {
|
|
81
|
+
activityId: number;
|
|
82
|
+
loadId: number;
|
|
83
|
+
}
|
|
84
|
+
export declare function addStructuralLinearActionToStore(editor: StoreEditor, anchor: Pick<SpatialAnchor, 'ownerHistoryId' | 'guidRandom' | 'schema'>, params: StructuralLinearActionInStoreParams): StructuralLinearActionBuildResult;
|
|
85
|
+
//# sourceMappingURL=structural-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-action.d.ts","sourceRoot":"","sources":["../../src/in-store/structural-action.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG,cAAc,CAAC;AAQvE,MAAM,WAAW,kCAAkC;IACjD,IAAI,CAAC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E,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iCAAiC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC,EACvE,MAAM,EAAE,mCAAmC,GAC1C,iCAAiC,CAkCnC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { ownerHistoryRef, productGuid } from './_emit-helpers.js';
|
|
5
|
+
function boolAttr(v) {
|
|
6
|
+
return v === undefined ? null : v ? '.T.' : '.F.';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* An action whose load carries no component at all is not a load: it
|
|
10
|
+
* serializes an `IfcStructuralLoad*` with every value `$` and reports success,
|
|
11
|
+
* so a caller that forgot to supply one gets a silently weightless model
|
|
12
|
+
* (#5167 review). Refusing here keeps the absence from reading as success.
|
|
13
|
+
*/
|
|
14
|
+
function assertLoadHasComponent(builder, components) {
|
|
15
|
+
if (components.some((value) => value !== undefined))
|
|
16
|
+
return;
|
|
17
|
+
throw new Error(`${builder}: supply at least one force or moment component; an action with no load component is not a load`);
|
|
18
|
+
}
|
|
19
|
+
export function addStructuralPointActionToStore(editor, anchor, params) {
|
|
20
|
+
if (anchor.schema === 'IFC2X3') {
|
|
21
|
+
throw new Error('addStructuralPointActionToStore: IFC2X3 has no IfcStructuralPointAction — target IFC4 or later');
|
|
22
|
+
}
|
|
23
|
+
assertLoadHasComponent('addStructuralPointActionToStore', [
|
|
24
|
+
params.ForceX, params.ForceY, params.ForceZ,
|
|
25
|
+
params.MomentX, params.MomentY, params.MomentZ,
|
|
26
|
+
]);
|
|
27
|
+
const loadId = editor.addEntity('IfcStructuralLoadSingleForce', [
|
|
28
|
+
params.LoadName ?? null,
|
|
29
|
+
params.ForceX ?? null,
|
|
30
|
+
params.ForceY ?? null,
|
|
31
|
+
params.ForceZ ?? null,
|
|
32
|
+
params.MomentX ?? null,
|
|
33
|
+
params.MomentY ?? null,
|
|
34
|
+
params.MomentZ ?? null,
|
|
35
|
+
]).expressId;
|
|
36
|
+
const activityId = editor.addEntity('IfcStructuralPointAction', [
|
|
37
|
+
productGuid(params, anchor.guidRandom),
|
|
38
|
+
ownerHistoryRef(anchor.ownerHistoryId),
|
|
39
|
+
params.Name ?? 'Point Action',
|
|
40
|
+
params.Description ?? null,
|
|
41
|
+
params.ObjectType ?? null,
|
|
42
|
+
null, // ObjectPlacement — see module doc
|
|
43
|
+
null, // Representation
|
|
44
|
+
`#${loadId}`,
|
|
45
|
+
`.${params.GlobalOrLocal ?? 'GLOBAL_COORDS'}.`,
|
|
46
|
+
boolAttr(params.DestabilizingLoad),
|
|
47
|
+
]).expressId;
|
|
48
|
+
return { activityId, loadId };
|
|
49
|
+
}
|
|
50
|
+
export function addStructuralLinearActionToStore(editor, anchor, params) {
|
|
51
|
+
if (anchor.schema === 'IFC2X3') {
|
|
52
|
+
throw new Error('addStructuralLinearActionToStore: IFC2X3 has no IfcStructuralLinearAction — target IFC4 or later');
|
|
53
|
+
}
|
|
54
|
+
assertLoadHasComponent('addStructuralLinearActionToStore', [
|
|
55
|
+
params.LinearForceX, params.LinearForceY, params.LinearForceZ,
|
|
56
|
+
params.LinearMomentX, params.LinearMomentY, params.LinearMomentZ,
|
|
57
|
+
]);
|
|
58
|
+
const loadId = editor.addEntity('IfcStructuralLoadLinearForce', [
|
|
59
|
+
params.LoadName ?? null,
|
|
60
|
+
params.LinearForceX ?? null,
|
|
61
|
+
params.LinearForceY ?? null,
|
|
62
|
+
params.LinearForceZ ?? null,
|
|
63
|
+
params.LinearMomentX ?? null,
|
|
64
|
+
params.LinearMomentY ?? null,
|
|
65
|
+
params.LinearMomentZ ?? null,
|
|
66
|
+
]).expressId;
|
|
67
|
+
const activityId = editor.addEntity('IfcStructuralLinearAction', [
|
|
68
|
+
productGuid(params, anchor.guidRandom),
|
|
69
|
+
ownerHistoryRef(anchor.ownerHistoryId),
|
|
70
|
+
params.Name ?? 'Linear Action',
|
|
71
|
+
params.Description ?? null,
|
|
72
|
+
params.ObjectType ?? null,
|
|
73
|
+
null, // ObjectPlacement — see module doc
|
|
74
|
+
null, // Representation
|
|
75
|
+
`#${loadId}`,
|
|
76
|
+
`.${params.GlobalOrLocal ?? 'GLOBAL_COORDS'}.`,
|
|
77
|
+
boolAttr(params.DestabilizingLoad),
|
|
78
|
+
null, // ProjectedOrTrue
|
|
79
|
+
'.CONST.', // PredefinedType — EXPRESS ConstPredefinedType WHERE rule
|
|
80
|
+
]).expressId;
|
|
81
|
+
return { activityId, loadId };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=structural-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-action.js","sourceRoot":"","sources":["../../src/in-store/structural-action.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA0C/D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIlE,SAAS,QAAQ,CAAC,CAAsB;IACtC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC;AA2BD;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,OAAe,EAAE,UAA6C;IAC5F,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;QAAE,OAAO;IAC5D,MAAM,IAAI,KAAK,CAAC,G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,MAAM,CAAC,iBAAiB,CAAC;QAClC,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,0DAA0D;KACtE,CAAC,CAAC,SAAS,CAAC;IAEb,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchored builder for `IfcStructuralAnalysisModel` — the container that
|
|
3
|
+
* turns a bag of structural members/connections/loads into an analytical
|
|
4
|
+
* *model* (#5167 task S.1).
|
|
5
|
+
*
|
|
6
|
+
* `IfcStructuralAnalysisModel` is `IfcSystem` → `IfcGroup` → `IfcObject`,
|
|
7
|
+
* never `IfcProduct` — it has no `ObjectPlacement`/`Representation` at all
|
|
8
|
+
* (confirmed against the generated IFC4 registry's `allAttributes`), so
|
|
9
|
+
* unlike every other in-store builder in this directory it emits no
|
|
10
|
+
* placement or geometry sub-graph. Membership (which members/connections
|
|
11
|
+
* belong to the model) is NOT one of this entity's own attributes; it is
|
|
12
|
+
* established separately via `IfcRelAssignsToGroup`
|
|
13
|
+
* (`assignToStructuralGroupInStore` in `structural-relationships.ts`),
|
|
14
|
+
* matching what `extractStructuralOnDemand` in `@ifc-lite/parser` reads
|
|
15
|
+
* back (`StructuralAnalysisModelInfo.itemGlobalIds`).
|
|
16
|
+
*
|
|
17
|
+
* `LoadedBy` / `HasResults`, by contrast, ARE direct attributes on this
|
|
18
|
+
* entity (`SET OF IfcStructuralLoadGroup` / `SET OF IfcStructuralResultGroup`
|
|
19
|
+
* — no relationship indirection), so a load group's expressId is passed
|
|
20
|
+
* straight through here.
|
|
21
|
+
*
|
|
22
|
+
* Schema targeted: IFC4 (IFC4_ADD2_TC1.exp) — `IfcStructuralAnalysisModel`
|
|
23
|
+
* is unchanged from IFC4 to IFC4X3, so this builder is schema-neutral within
|
|
24
|
+
* ifc-lite's supported IFC4+ range. Not offered for IFC2X3, which has no
|
|
25
|
+
* structural-analysis schema module at all.
|
|
26
|
+
*
|
|
27
|
+
* Pure: no I/O, no parser access — operates entirely through the editor.
|
|
28
|
+
*/
|
|
29
|
+
import type { StoreEditor } from '@ifc-lite/mutations';
|
|
30
|
+
import type { SpatialAnchor } from './anchor.js';
|
|
31
|
+
export type StructuralAnalysisModelType = 'IN_PLANE_LOADING_2D' | 'OUT_PLANE_LOADING_2D' | 'LOADING_3D' | 'USERDEFINED' | 'NOTDEFINED';
|
|
32
|
+
export interface StructuralAnalysisModelInStoreParams {
|
|
33
|
+
Name?: string;
|
|
34
|
+
Description?: string;
|
|
35
|
+
/** Required by the EXPRESS `HasObjectType` WHERE rule when `PredefinedType` is `'USERDEFINED'`. */
|
|
36
|
+
ObjectType?: string;
|
|
37
|
+
PredefinedType?: StructuralAnalysisModelType;
|
|
38
|
+
/** `IfcStructuralAnalysisModel.LoadedBy` — expressIds of existing `IfcStructuralLoadGroup`/`IfcStructuralLoadCase` entities. */
|
|
39
|
+
LoadGroupIds?: readonly number[];
|
|
40
|
+
/** `IfcStructuralAnalysisModel.HasResults` — expressIds of existing `IfcStructuralResultGroup` entities. */
|
|
41
|
+
ResultGroupIds?: readonly number[];
|
|
42
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
43
|
+
GlobalId?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface StructuralAnalysisModelBuildResult {
|
|
46
|
+
analysisModelId: number;
|
|
47
|
+
}
|
|
48
|
+
export declare function addStructuralAnalysisModelToStore(editor: StoreEditor, anchor: Pick<SpatialAnchor, 'ownerHistoryId' | 'guidRandom' | 'schema'>, params: StructuralAnalysisModelInStoreParams): StructuralAnalysisModelBuildResult;
|
|
49
|
+
//# sourceMappingURL=structural-analysis-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-analysis-model.d.ts","sourceRoot":"","sources":["../../src/in-store/structural-analysis-model.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,MAAM,MAAM,2BAA2B,GACnC,qBAAqB,GAAG,sBAAsB,GAAG,YAAY,GAC7D,aAAa,GAAG,YAAY,CAAC;AAEjC,MAAM,WAAW,oCAAoC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,gIAAgI;IAChI,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,4GAA4G;IAC5G,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kCAAkC;IACjD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC,EACvE,MAAM,EAAE,oCAAoC,GAC3C,kCAAkC,CA0BpC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { ownerHistoryRef, productGuid } from './_emit-helpers.js';
|
|
5
|
+
export function addStructuralAnalysisModelToStore(editor, anchor, params) {
|
|
6
|
+
if (anchor.schema === 'IFC2X3') {
|
|
7
|
+
throw new Error('addStructuralAnalysisModelToStore: IFC2X3 has no IfcStructuralAnalysisModel — target IFC4 or later');
|
|
8
|
+
}
|
|
9
|
+
const predefinedType = params.PredefinedType ?? 'NOTDEFINED';
|
|
10
|
+
if (predefinedType === 'USERDEFINED' && !params.ObjectType) {
|
|
11
|
+
throw new Error('addStructuralAnalysisModelToStore: ObjectType is required when PredefinedType is USERDEFINED');
|
|
12
|
+
}
|
|
13
|
+
const loadGroupIds = params.LoadGroupIds ?? [];
|
|
14
|
+
const resultGroupIds = params.ResultGroupIds ?? [];
|
|
15
|
+
const analysisModelId = editor.addEntity('IfcStructuralAnalysisModel', [
|
|
16
|
+
productGuid(params, anchor.guidRandom),
|
|
17
|
+
ownerHistoryRef(anchor.ownerHistoryId),
|
|
18
|
+
params.Name ?? 'Structural Analysis Model',
|
|
19
|
+
params.Description ?? null,
|
|
20
|
+
params.ObjectType ?? null,
|
|
21
|
+
`.${predefinedType}.`,
|
|
22
|
+
null, // OrientationOf2DPlane
|
|
23
|
+
loadGroupIds.length > 0 ? loadGroupIds.map((id) => `#${id}`) : null, // LoadedBy
|
|
24
|
+
resultGroupIds.length > 0 ? resultGroupIds.map((id) => `#${id}`) : null, // HasResults
|
|
25
|
+
null, // SharedPlacement
|
|
26
|
+
]).expressId;
|
|
27
|
+
return { analysisModelId };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=structural-analysis-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-analysis-model.js","sourceRoot":"","sources":["../../src/in-store/structural-analysis-model.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiC/D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAwBlE,MAAM,UAAU,iCAAiC,CAC/C,MAAmB,EACnB,MAAuE,EACvE,MAA4C;IAE5C,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,oGAAoG,CAAC,CAAC;IACxH,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,YAAY,CAAC;IAC7D,IAAI,cAAc,KAAK,aAAa,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,8FAA8F,CAAC,CAAC;IAClH,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,EAAE,CAAC;IAEnD,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,4BAA4B,EAAE;QACrE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;QACtC,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC;QACtC,MAAM,CAAC,IAAI,IAAI,2BAA2B;QAC1C,MAAM,CAAC,WAAW,IAAI,IAAI;QAC1B,MAAM,CAAC,UAAU,IAAI,IAAI;QACzB,IAAI,cAAc,GAAG;QACrB,IAAI,EAAE,uBAAuB;QAC7B,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW;QAChF,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,aAAa;QACtF,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC,SAAS,CAAC;IAEb,OAAO,EAAE,eAAe,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchored builder for `IfcStructuralCurveMember` — a straight analytical
|
|
3
|
+
* line member (beam/column/brace idealisation) between `Start` and `End`
|
|
4
|
+
* (#5167 task S.1).
|
|
5
|
+
*
|
|
6
|
+
* Schema targeted: IFC4 (IFC4_ADD2_TC1.exp), verified against the generated
|
|
7
|
+
* IFC4 registry's `allAttributes` for `IfcStructuralCurveMember`:
|
|
8
|
+
* `GlobalId, OwnerHistory?, Name?, Description?, ObjectType?,
|
|
9
|
+
* ObjectPlacement?, Representation?, PredefinedType, Axis`
|
|
10
|
+
* `PredefinedType` (`IfcStructuralCurveMemberTypeEnum`) and `Axis`
|
|
11
|
+
* (`IfcDirection`, mandatory — NOT an inline list) are both own attributes
|
|
12
|
+
* of this entity, not inherited.
|
|
13
|
+
*
|
|
14
|
+
* REPRESENTATION OWNERSHIP (the part the task brief calls out explicitly):
|
|
15
|
+
*
|
|
16
|
+
* `ObjectPlacement`: an `IfcLocalPlacement` chained from the storey's
|
|
17
|
+
* placement, origin at `Start`, local Z = member axis — same shape as
|
|
18
|
+
* `addBeamToStore`/`addMemberToStore`'s physical-element placements.
|
|
19
|
+
* OWNED exclusively by this member: nothing else in the model ever
|
|
20
|
+
* references it, so there is no reference-counting question, only a
|
|
21
|
+
* lifetime one (see removal note below).
|
|
22
|
+
*
|
|
23
|
+
* `Representation`: an `IfcTopologyRepresentation` (`RepresentationType:
|
|
24
|
+
* 'Edge'`, verified against the EXPRESS `IfcTopologyRepresentationTypes`
|
|
25
|
+
* WHERE function, which accepts `'Edge'` for a `SET` of `IfcEdge` items)
|
|
26
|
+
* holding one `IfcEdge` between two `IfcVertexPoint`s at the placement-
|
|
27
|
+
* local origin and `(0, 0, length)`. This is the buildingSMART-documented
|
|
28
|
+
* shape for an analytical member's line geometry — lighter than a solid,
|
|
29
|
+
* and the read side (`extractStructuralOnDemand`) does not need it at all
|
|
30
|
+
* (member geometry isn't part of `StructuralMemberInfo`), so it is
|
|
31
|
+
* authored for downstream tools/viewers that walk `Representation`, not
|
|
32
|
+
* for this package's own round trip. Every entity in the chain
|
|
33
|
+
* (2 points, 2 vertices, 1 edge, the topology rep, the product shape) is
|
|
34
|
+
* OWNED exclusively by this member — freshly created per call, never
|
|
35
|
+
* deduplicated or shared across members, so — like the placement — a
|
|
36
|
+
* member's owned sub-graph is a closed set with no external references
|
|
37
|
+
* to reason about.
|
|
38
|
+
*
|
|
39
|
+
* What is NOT owned by the member: `anchor.axisContextId` (the model's
|
|
40
|
+
* shared `IfcGeometricRepresentationSubContext`, an existing entity this
|
|
41
|
+
* builder only references) and `anchor.storeyPlacementId` (ditto).
|
|
42
|
+
*
|
|
43
|
+
* Removal: `bim.store.removeEntity` tombstones only the product row (the
|
|
44
|
+
* known #592-era gap column.ts's header comment references), so removing
|
|
45
|
+
* a member built here would currently orphan its placement chain AND its
|
|
46
|
+
* topology sub-graph — the same defect, not a new one, and NOT fixed by
|
|
47
|
+
* this builder. What this builder does instead: because nothing is
|
|
48
|
+
* shared, EVERY id in `StructuralCurveMemberBuildResult` is safe to
|
|
49
|
+
* delete unconditionally once the member itself is gone (no other entity
|
|
50
|
+
* in the model can be pointing at any of them) — so a future
|
|
51
|
+
* `removeStructuralEntityInStore` (mirroring `cost-removal.ts`'s pattern)
|
|
52
|
+
* can walk this result's ids directly with no reference-discovery pass.
|
|
53
|
+
* That follow-up function does not exist yet; this is deliberately left
|
|
54
|
+
* unresolved rather than silently ignored (see the task's PR description
|
|
55
|
+
* for the explicit call-out).
|
|
56
|
+
*
|
|
57
|
+
* Pure: no I/O, no parser access — operates entirely through the editor.
|
|
58
|
+
*/
|
|
59
|
+
import type { StoreEditor } from '@ifc-lite/mutations';
|
|
60
|
+
import { type SpatialAnchor } from './anchor.js';
|
|
61
|
+
export type StructuralCurveMemberType = 'RIGID_JOINED_MEMBER' | 'PIN_JOINED_MEMBER' | 'CABLE' | 'TENSION_MEMBER' | 'COMPRESSION_MEMBER' | 'USERDEFINED' | 'NOTDEFINED';
|
|
62
|
+
export interface StructuralCurveMemberInStoreParams {
|
|
63
|
+
Start: [number, number, number];
|
|
64
|
+
End: [number, number, number];
|
|
65
|
+
PredefinedType?: StructuralCurveMemberType;
|
|
66
|
+
Name?: string;
|
|
67
|
+
Description?: string;
|
|
68
|
+
/** Required by the EXPRESS `HasObjectType` WHERE rule when `PredefinedType` is `'USERDEFINED'`. */
|
|
69
|
+
ObjectType?: string;
|
|
70
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
71
|
+
GlobalId?: string;
|
|
72
|
+
}
|
|
73
|
+
/** Every expressId this builder emits — the member's full owned sub-graph (see removal note above). */
|
|
74
|
+
export interface StructuralCurveMemberBuildResult {
|
|
75
|
+
memberId: number;
|
|
76
|
+
placementId: number;
|
|
77
|
+
axisDirectionId: number;
|
|
78
|
+
/** The `IfcCartesianPoint` each `IfcVertexPoint` below is built on. Exposed
|
|
79
|
+
* because they are owned too: a cascade delete driven by this result would
|
|
80
|
+
* otherwise orphan both points (#5167 review). */
|
|
81
|
+
point1Id: number;
|
|
82
|
+
point2Id: number;
|
|
83
|
+
vertex1Id: number;
|
|
84
|
+
vertex2Id: number;
|
|
85
|
+
edgeId: number;
|
|
86
|
+
topologyRepId: number;
|
|
87
|
+
productShapeId: number;
|
|
88
|
+
}
|
|
89
|
+
export declare function addStructuralCurveMemberToStore(editor: StoreEditor, anchor: SpatialAnchor, params: StructuralCurveMemberInStoreParams): StructuralCurveMemberBuildResult;
|
|
90
|
+
//# sourceMappingURL=structural-curve-member.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-curve-member.d.ts","sourceRoot":"","sources":["../../src/in-store/structural-curve-member.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjE,MAAM,MAAM,yBAAyB,GACjC,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,GAAG,gBAAgB,GACxE,oBAAoB,GAAG,aAAa,GAAG,YAAY,CAAC;AAExD,MAAM,WAAW,kCAAkC;IACjD,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