@bldrs-ai/conway 1.375.1183 → 1.376.1184
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/compiled/examples/browser-bundled.cjs +1 -1
- package/compiled/examples/cli-bundled.cjs +1 -1
- package/compiled/examples/cli-step-bundled.cjs +1 -1
- package/compiled/examples/validator-bundled.cjs +1 -1
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.d.ts +89 -3
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.js +195 -15
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.test.js +97 -4
- package/compiled/src/compat/web-ifc/ap214_properties.d.ts +16 -2
- package/compiled/src/compat/web-ifc/ap214_properties.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ap214_properties.js +33 -2
- package/compiled/src/compat/web-ifc/ap214_properties.test.js +22 -0
- package/compiled/src/compat/web-ifc/properties.d.ts +2 -2
- package/compiled/src/compat/web-ifc/properties.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/properties.js +3 -2
- package/compiled/src/compat/web-ifc/properties_passthrough.d.ts +13 -1
- package/compiled/src/compat/web-ifc/properties_passthrough.d.ts.map +1 -1
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -161,11 +161,15 @@ export class AP214Properties {
|
|
|
161
161
|
*
|
|
162
162
|
* @param includeProperties When true, merge each node's item properties onto
|
|
163
163
|
* the node (mirrors the IFC surface's `includeProperties`).
|
|
164
|
+
* @param options Optional shaping: `{ includeSolids: true }` adds the
|
|
165
|
+
* ephemeral solid layer beneath multibody products (`type: 'solid'`,
|
|
166
|
+
* `ephemeral: true` nodes) — see `design/new/step-nonproduct-semantics.md`.
|
|
164
167
|
* @return {Promise<Node>} The root node. A single-root file returns its root
|
|
165
168
|
* directly; a multi-root file is wrapped in a synthetic container root.
|
|
166
169
|
*/
|
|
167
|
-
async getSpatialStructure(includeProperties) {
|
|
168
|
-
const roots =
|
|
170
|
+
async getSpatialStructure(includeProperties, options) {
|
|
171
|
+
const roots = options?.includeSolids === true ?
|
|
172
|
+
this.productStructureWithSolids() : this.productStructure();
|
|
169
173
|
const nodes = await Promise.all(roots.map((root) => this.toSpatialNode(root, includeProperties)));
|
|
170
174
|
if (nodes.length === 1) {
|
|
171
175
|
return nodes[0];
|
|
@@ -217,6 +221,12 @@ export class AP214Properties {
|
|
|
217
221
|
occurrencePath: node.occurrencePath,
|
|
218
222
|
children,
|
|
219
223
|
};
|
|
224
|
+
if (node.ephemeral === true) {
|
|
225
|
+
spatialNode.ephemeral = true;
|
|
226
|
+
}
|
|
227
|
+
if (node.droppedSolids !== void 0) {
|
|
228
|
+
spatialNode.droppedSolids = node.droppedSolids;
|
|
229
|
+
}
|
|
220
230
|
if (includeProperties === "names") {
|
|
221
231
|
// Satisfied by the unconditional Name handle above.
|
|
222
232
|
}
|
|
@@ -312,6 +322,27 @@ export class AP214Properties {
|
|
|
312
322
|
this.buildIndexes();
|
|
313
323
|
return this.structureRoots_;
|
|
314
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Return (and cache) the product-structure forest with the ephemeral solid
|
|
327
|
+
* layer included. Built separately from the plain forest so default callers
|
|
328
|
+
* never pay for the solid walk; the solid nodes are also indexed so
|
|
329
|
+
* `getItemProperties` resolves a solid id to its identity row and
|
|
330
|
+
* `getPropertySets` maps it to the owning product's rows.
|
|
331
|
+
*
|
|
332
|
+
* @return {ProductStructureNode[]} The cached solid-including roots.
|
|
333
|
+
*/
|
|
334
|
+
productStructureWithSolids() {
|
|
335
|
+
this.buildIndexes();
|
|
336
|
+
if (this.structureRootsWithSolids_ === void 0) {
|
|
337
|
+
this.structureRootsWithSolids_ =
|
|
338
|
+
new AP214ProductStructureExtraction(this.api.StepModel)
|
|
339
|
+
.extractProductStructure({ includeSolids: true });
|
|
340
|
+
for (const root of this.structureRootsWithSolids_) {
|
|
341
|
+
this.indexNodes(root);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return this.structureRootsWithSolids_;
|
|
345
|
+
}
|
|
315
346
|
/**
|
|
316
347
|
* Lazily build and cache the extracted property map.
|
|
317
348
|
*
|
|
@@ -39,6 +39,28 @@ describe("compat/web-ifc/AP214Properties", () => {
|
|
|
39
39
|
expect(Array.isArray(child.occurrencePath)).toBe(true);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
test("getSpatialStructure surfaces the ephemeral solid layer on opt-in only", async () => {
|
|
43
|
+
const surface = compatSurfaceFor("data/ap214-multibody-part.step");
|
|
44
|
+
const plainRoot = await surface.getSpatialStructure();
|
|
45
|
+
const collectTypes = (node, into) => {
|
|
46
|
+
into.add(node.type);
|
|
47
|
+
node.children.forEach((child) => collectTypes(child, into));
|
|
48
|
+
return into;
|
|
49
|
+
};
|
|
50
|
+
expect(collectTypes(plainRoot, new Set()).has("solid")).toBe(false);
|
|
51
|
+
const root = await surface.getSpatialStructure(void 0, { includeSolids: true });
|
|
52
|
+
const widget = root.children.find((node) => node.Name.value === "widget");
|
|
53
|
+
const solids = widget.children.filter((node) => node.type === "solid");
|
|
54
|
+
expect(solids.length).toBeGreaterThan(0);
|
|
55
|
+
for (const solid of solids) {
|
|
56
|
+
expect(solid.ephemeral).toBe(true);
|
|
57
|
+
expect(solid.Name.type).toBe(1);
|
|
58
|
+
expect(solid.occurrencePath).toEqual(widget.occurrencePath);
|
|
59
|
+
}
|
|
60
|
+
// A solid id resolves to its own identity row, like any tree node.
|
|
61
|
+
const item = await surface.getItemProperties(solids[0].expressID);
|
|
62
|
+
expect(item.Name.value).toBe(solids[0].Name.value);
|
|
63
|
+
});
|
|
42
64
|
test("getItemProperties returns a {value}-wrapped identity for a node", async () => {
|
|
43
65
|
const surface = compatSurfaceFor("data/as1-assembly.step");
|
|
44
66
|
const root = await surface.getSpatialStructure();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IfcAPI } from "./ifc_api.js";
|
|
2
|
-
import { IncludeProperties } from "./properties_passthrough.js";
|
|
2
|
+
import { IncludeProperties, SpatialStructureOptions } from "./properties_passthrough.js";
|
|
3
3
|
export declare class Properties {
|
|
4
4
|
private api;
|
|
5
5
|
private types;
|
|
@@ -9,7 +9,7 @@ export declare class Properties {
|
|
|
9
9
|
getPropertySets(modelID: number, elementID: number, recursive?: boolean): Promise<any[] | undefined>;
|
|
10
10
|
getTypeProperties(modelID: number, elementID: number, recursive?: boolean): Promise<any[] | undefined>;
|
|
11
11
|
getMaterialsProperties(modelID: number, elementID: number, recursive?: boolean): Promise<any[] | undefined>;
|
|
12
|
-
getSpatialStructure(modelID: number, includeProperties?: IncludeProperties): Promise<import("./properties_passthrough.js").Node | undefined>;
|
|
12
|
+
getSpatialStructure(modelID: number, includeProperties?: IncludeProperties, options?: SpatialStructureOptions): Promise<import("./properties_passthrough.js").Node | undefined>;
|
|
13
13
|
getAllItemsOfType(modelID: number, type: number, verbose: boolean): Promise<any[] | undefined>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/properties.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACP,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/properties.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACP,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAGrF,qBAAa,UAAU;IAIT,OAAO,CAAC,GAAG;IAFvB,OAAO,CAAC,KAAK,CAAK;gBAEE,GAAG,EAAE,MAAM;IAG/B,UAAU,CAAC,IAAI,EAAE,MAAM;IAIjB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,UAAQ;IAIhE,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,UAAQ;IAIrE,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,UAAQ;IAIvE,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,UAAQ;IAI5E,mBAAmB,CACrB,OAAO,EAAE,MAAM,EACf,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,OAAO,CAAC,EAAE,uBAAuB;IAM/B,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;CAIxE"}
|
|
@@ -18,8 +18,9 @@ export class Properties {
|
|
|
18
18
|
async getMaterialsProperties(modelID, elementID, recursive = false) {
|
|
19
19
|
return await this.api.getPassthrough(modelID)?.properties.getMaterialsProperties(elementID, recursive);
|
|
20
20
|
}
|
|
21
|
-
async getSpatialStructure(modelID, includeProperties) {
|
|
22
|
-
return await this.api.getPassthrough(modelID)?.properties
|
|
21
|
+
async getSpatialStructure(modelID, includeProperties, options) {
|
|
22
|
+
return await this.api.getPassthrough(modelID)?.properties
|
|
23
|
+
.getSpatialStructure(includeProperties, options);
|
|
23
24
|
}
|
|
24
25
|
async getAllItemsOfType(modelID, type, verbose) {
|
|
25
26
|
return await this.api.getPassthrough(modelID)?.properties.getAllItemsOfType(type, verbose);
|
|
@@ -24,13 +24,25 @@ export interface Node {
|
|
|
24
24
|
* (web-ifc parity behavior).
|
|
25
25
|
*/
|
|
26
26
|
export type IncludeProperties = boolean | 'names';
|
|
27
|
+
/**
|
|
28
|
+
* Optional spatial-structure shaping, beyond web-ifc parity.
|
|
29
|
+
*/
|
|
30
|
+
export interface SpatialStructureOptions {
|
|
31
|
+
/**
|
|
32
|
+
* STEP (AP214/AP242) only: surface ephemeral solid-level nodes beneath
|
|
33
|
+
* multibody products — pickable bodies that carry identity in the file but
|
|
34
|
+
* no product semantics (`type: 'solid'`, `ephemeral: true`). Ignored by the
|
|
35
|
+
* IFC surface. See `design/new/step-nonproduct-semantics.md`.
|
|
36
|
+
*/
|
|
37
|
+
includeSolids?: boolean;
|
|
38
|
+
}
|
|
27
39
|
export interface PropertiesPassthrough {
|
|
28
40
|
getIfcType(type: number): string | undefined;
|
|
29
41
|
getItemProperties(id: number, recursive?: boolean): Promise<any>;
|
|
30
42
|
getPropertySets(elementID: number, recursive?: boolean): Promise<any[]>;
|
|
31
43
|
getTypeProperties(elementID: number, recursive?: boolean): Promise<any[]>;
|
|
32
44
|
getMaterialsProperties(elementID: number, recursive?: boolean): Promise<any[]>;
|
|
33
|
-
getSpatialStructure(includeProperties?: IncludeProperties): Promise<Node>;
|
|
45
|
+
getSpatialStructure(includeProperties?: IncludeProperties, options?: SpatialStructureOptions): Promise<Node>;
|
|
34
46
|
getAllItemsOfType(type: number, verbose: boolean): Promise<any[]>;
|
|
35
47
|
}
|
|
36
48
|
//# sourceMappingURL=properties_passthrough.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties_passthrough.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/properties_passthrough.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,IAAI;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,IAAI,EAAE,CAAA;IAIhB,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,QAAQ,CAAC,EAAE,eAAe,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,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,qBAAqB;IAEpC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAE5C,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,OAAO,CAAE,GAAG,CAAE,CAAA;IAEnE,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,OAAO,CAAE,GAAG,EAAE,CAAE,CAAA;IAE1E,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,OAAO,CAAE,GAAG,EAAE,CAAE,CAAA;IAE5E,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAE,GAAG,EAAE,CAAE,CAAA;IAEhF,mBAAmB,CACjB,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,OAAO,CAAC,EAAE,uBAAuB,GAAI,OAAO,CAAE,IAAI,CAAE,CAAA;IAEtD,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAE,GAAG,EAAE,CAAE,CAAA;CACpE"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// only the first segment (major) is meaningful and is the one CI carries forward.
|
|
6
6
|
// Must stay in `vN.N.N` shape: the CI stamp regex, scripts/updateVersion.mjs, and
|
|
7
7
|
// statistics.ts all match `v\d+\.\d+\.\d+`.
|
|
8
|
-
const versionString = 'Conway Web-Ifc Shim v1.
|
|
8
|
+
const versionString = 'Conway Web-Ifc Shim v1.376.1184';
|
|
9
9
|
export { versionString };
|