@bldrs-ai/conway 1.421.1270 → 1.422.1273
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/compat/web-ifc/ifc_api.d.ts +29 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +22 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +88 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +8 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +3 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +61 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +210 -1
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ var import_node_process = require("node:process");
|
|
|
30
30
|
var readline = __toESM(require("node:readline"), 1);
|
|
31
31
|
|
|
32
32
|
// compiled/src/version/version.js
|
|
33
|
-
var versionString = "Conway v1.
|
|
33
|
+
var versionString = "Conway v1.422.1273";
|
|
34
34
|
|
|
35
35
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
36
|
var wasmType = "";
|
|
@@ -14965,7 +14965,7 @@ ${t5.join("\n")}` : "";
|
|
|
14965
14965
|
var import_process = require("process");
|
|
14966
14966
|
|
|
14967
14967
|
// compiled/src/version/version.js
|
|
14968
|
-
var versionString = "Conway v1.
|
|
14968
|
+
var versionString = "Conway v1.422.1273";
|
|
14969
14969
|
|
|
14970
14970
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
14971
14971
|
function pThreadsAllowed() {
|
|
@@ -15943,7 +15943,7 @@ var ParsingBuffer = class {
|
|
|
15943
15943
|
};
|
|
15944
15944
|
|
|
15945
15945
|
// compiled/src/version/version.js
|
|
15946
|
-
var versionString = "Conway v1.
|
|
15946
|
+
var versionString = "Conway v1.422.1273";
|
|
15947
15947
|
|
|
15948
15948
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
15949
15949
|
function pThreadsAllowed() {
|
|
@@ -944,7 +944,7 @@ var EntityTypesIfcCount = 909;
|
|
|
944
944
|
var entity_types_ifc_gen_default = EntityTypesIfc;
|
|
945
945
|
|
|
946
946
|
// compiled/src/version/version.js
|
|
947
|
-
var versionString = "Conway v1.
|
|
947
|
+
var versionString = "Conway v1.422.1273";
|
|
948
948
|
|
|
949
949
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
950
950
|
var wasmType = "";
|
|
@@ -37,6 +37,16 @@ export interface Loadersettings {
|
|
|
37
37
|
* embedders can print the model line as early as possible (issue #301).
|
|
38
38
|
*/
|
|
39
39
|
ON_MODEL_INFO?: (info: ModelInfo) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Conway extension (OpenModelStreamed only; Share demand/tiled
|
|
42
|
+
* rendering slice A): open with NO geometry extraction — the model
|
|
43
|
+
* registers with an empty scene and the embedder pumps
|
|
44
|
+
* `ExtractGeometryBatch` to extract products in file-order batches,
|
|
45
|
+
* receiving each batch's meshes incrementally. Properties and the
|
|
46
|
+
* spatial structure work from the first batch. Ignored by the
|
|
47
|
+
* classic open paths and by the internal streamed→classic fallback.
|
|
48
|
+
*/
|
|
49
|
+
DEFER_GEOMETRY?: boolean;
|
|
40
50
|
}
|
|
41
51
|
/**
|
|
42
52
|
* web-ifc compatible log levels (numeric values match web-ifc's enum so an
|
|
@@ -341,6 +351,25 @@ export declare class IfcAPI {
|
|
|
341
351
|
* @param modelID Model handle retrieved by OpenModel, model must not be closed
|
|
342
352
|
*/
|
|
343
353
|
CloseModel(modelID: number): void;
|
|
354
|
+
/**
|
|
355
|
+
* Conway extension (Share demand/tiled rendering slice A): on a model
|
|
356
|
+
* opened with `OpenModelStreamed(data, {DEFER_GEOMETRY: true})`,
|
|
357
|
+
* extract the next `batchSize` products and emit this batch's meshes —
|
|
358
|
+
* the incremental twin of StreamAllMeshes. Feature-detect with
|
|
359
|
+
* `typeof api.ExtractGeometryBatch === 'function'`; call repeatedly
|
|
360
|
+
* until `remaining` is 0.
|
|
361
|
+
*
|
|
362
|
+
* @param modelID handle retrieved by OpenModelStreamed
|
|
363
|
+
* @param batchSize max products to extract this call
|
|
364
|
+
* @param meshCallback receives each newly-extracted product's mesh
|
|
365
|
+
* @return {object} `{extracted, remaining}`; `{extracted: 0,
|
|
366
|
+
* remaining: 0}` for unknown models or models without the deferred
|
|
367
|
+
* pump (non-IFC / fully-extracted opens).
|
|
368
|
+
*/
|
|
369
|
+
ExtractGeometryBatch(modelID: number, batchSize: number, meshCallback?: (mesh: FlatMesh) => void): {
|
|
370
|
+
extracted: number;
|
|
371
|
+
remaining: number;
|
|
372
|
+
};
|
|
344
373
|
/**
|
|
345
374
|
*
|
|
346
375
|
* @param modelID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_api.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,IAAI,mBAAmB,EAEjE,MAAM,aAAa,CAAA;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM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MAAM;IAI1B,2FAA2F;IAC3F,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG;CAGpC"}
|
|
@@ -547,6 +547,28 @@ export class IfcAPI {
|
|
|
547
547
|
this.models.delete(modelID);
|
|
548
548
|
this.conwaywasm.destroy();
|
|
549
549
|
}
|
|
550
|
+
/**
|
|
551
|
+
* Conway extension (Share demand/tiled rendering slice A): on a model
|
|
552
|
+
* opened with `OpenModelStreamed(data, {DEFER_GEOMETRY: true})`,
|
|
553
|
+
* extract the next `batchSize` products and emit this batch's meshes —
|
|
554
|
+
* the incremental twin of StreamAllMeshes. Feature-detect with
|
|
555
|
+
* `typeof api.ExtractGeometryBatch === 'function'`; call repeatedly
|
|
556
|
+
* until `remaining` is 0.
|
|
557
|
+
*
|
|
558
|
+
* @param modelID handle retrieved by OpenModelStreamed
|
|
559
|
+
* @param batchSize max products to extract this call
|
|
560
|
+
* @param meshCallback receives each newly-extracted product's mesh
|
|
561
|
+
* @return {object} `{extracted, remaining}`; `{extracted: 0,
|
|
562
|
+
* remaining: 0}` for unknown models or models without the deferred
|
|
563
|
+
* pump (non-IFC / fully-extracted opens).
|
|
564
|
+
*/
|
|
565
|
+
ExtractGeometryBatch(modelID, batchSize, meshCallback) {
|
|
566
|
+
const result = this.models.get(modelID);
|
|
567
|
+
if (result?.extractGeometryBatch === void 0) {
|
|
568
|
+
return { extracted: 0, remaining: 0 };
|
|
569
|
+
}
|
|
570
|
+
return result.extractGeometryBatch(batchSize, meshCallback);
|
|
571
|
+
}
|
|
550
572
|
/**
|
|
551
573
|
*
|
|
552
574
|
* @param modelID
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ifc_api_deferred_open.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_deferred_open.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
// Deferred-geometry streamed open (demand/tiled rendering slice A):
|
|
3
|
+
// pumping ExtractGeometryBatch to completion must reproduce EXACTLY the
|
|
4
|
+
// meshes a classic OpenModel + StreamAllMeshes produces — same
|
|
5
|
+
// entities, same placed-geometry ids, colors, and transforms — across
|
|
6
|
+
// multiple small batches (which exercises the persisted coordination
|
|
7
|
+
// matrix; a single-shot capture can't catch a stale one).
|
|
8
|
+
import * as fs from "fs";
|
|
9
|
+
import { beforeAll, describe, expect, test } from "@jest/globals";
|
|
10
|
+
import { IfcAPI } from "./ifc_api.js";
|
|
11
|
+
const SETTINGS = { COORDINATE_TO_ORIGIN: true, USE_FAST_BOOLS: true };
|
|
12
|
+
let api;
|
|
13
|
+
let buffer;
|
|
14
|
+
/**
|
|
15
|
+
* Flatten a FlatMesh into comparable plain data.
|
|
16
|
+
*
|
|
17
|
+
* @param mesh The mesh.
|
|
18
|
+
* @return {object} Plain comparable form.
|
|
19
|
+
*/
|
|
20
|
+
function flatten(mesh) {
|
|
21
|
+
const geometries = [];
|
|
22
|
+
for (let where = 0; where < mesh.geometries.size(); ++where) {
|
|
23
|
+
const placed = mesh.geometries.get(where);
|
|
24
|
+
geometries.push({
|
|
25
|
+
color: placed.color,
|
|
26
|
+
geometryExpressID: placed.geometryExpressID,
|
|
27
|
+
flatTransformation: [...placed.flatTransformation],
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return { expressID: mesh.expressID, geometries };
|
|
31
|
+
}
|
|
32
|
+
beforeAll(async () => {
|
|
33
|
+
api = new IfcAPI();
|
|
34
|
+
await api.Init();
|
|
35
|
+
buffer = new Uint8Array(fs.readFileSync("data/index.ifc"));
|
|
36
|
+
}, 120000);
|
|
37
|
+
describe("OpenModelStreamed + DEFER_GEOMETRY", () => {
|
|
38
|
+
test("batch pump to completion matches classic StreamAllMeshes exactly", async () => {
|
|
39
|
+
const classicID = api.OpenModel(buffer, SETTINGS);
|
|
40
|
+
const classic = new Map();
|
|
41
|
+
api.StreamAllMeshes(classicID, (mesh) => {
|
|
42
|
+
classic.set(mesh.expressID, flatten(mesh));
|
|
43
|
+
});
|
|
44
|
+
expect(classic.size).toBeGreaterThan(0);
|
|
45
|
+
const deferredID = await api.OpenModelStreamed(buffer, { ...SETTINGS, DEFER_GEOMETRY: true });
|
|
46
|
+
expect(deferredID).toBeGreaterThanOrEqual(0);
|
|
47
|
+
// Nothing extracted yet: the scene walk yields no meshes.
|
|
48
|
+
const before = [];
|
|
49
|
+
api.StreamAllMeshes(deferredID, (mesh) => {
|
|
50
|
+
before.push(mesh.expressID);
|
|
51
|
+
});
|
|
52
|
+
expect(before).toHaveLength(0);
|
|
53
|
+
// Pump in deliberately small batches; collect incremental meshes.
|
|
54
|
+
const streamed = new Map();
|
|
55
|
+
let firstBatchCount = 0;
|
|
56
|
+
let rounds = 0;
|
|
57
|
+
for (;;) {
|
|
58
|
+
const { extracted, remaining } = api.ExtractGeometryBatch(deferredID, 7, (mesh) => {
|
|
59
|
+
streamed.set(mesh.expressID, flatten(mesh));
|
|
60
|
+
});
|
|
61
|
+
if (rounds === 0) {
|
|
62
|
+
firstBatchCount = streamed.size;
|
|
63
|
+
}
|
|
64
|
+
++rounds;
|
|
65
|
+
if (remaining === 0 && extracted === 0) {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Incrementality: meshes arrived before the pump completed.
|
|
70
|
+
expect(rounds).toBeGreaterThan(2);
|
|
71
|
+
expect(firstBatchCount).toBeGreaterThanOrEqual(0);
|
|
72
|
+
expect(streamed.size).toBe(classic.size);
|
|
73
|
+
// Exact parity per entity: ids, colors, transforms.
|
|
74
|
+
for (const [expressID, mesh] of classic) {
|
|
75
|
+
expect(streamed.get(expressID)).toEqual(mesh);
|
|
76
|
+
}
|
|
77
|
+
api.CloseModel(classicID);
|
|
78
|
+
api.CloseModel(deferredID);
|
|
79
|
+
}, 240000);
|
|
80
|
+
test("ExtractGeometryBatch is a safe no-op on non-deferred models", async () => {
|
|
81
|
+
const modelID = await api.OpenModelStreamed(buffer, SETTINGS);
|
|
82
|
+
expect(api.ExtractGeometryBatch(modelID, 8))
|
|
83
|
+
.toEqual({ extracted: 0, remaining: 0 });
|
|
84
|
+
expect(api.ExtractGeometryBatch(9999, 8))
|
|
85
|
+
.toEqual({ extracted: 0, remaining: 0 });
|
|
86
|
+
api.CloseModel(modelID);
|
|
87
|
+
}, 120000);
|
|
88
|
+
});
|
|
@@ -7,6 +7,14 @@ export interface IfcApiModelPassthrough {
|
|
|
7
7
|
loadAllGeometry(): Vector<FlatMesh>;
|
|
8
8
|
streamAllMeshesWithTypes(types: number[], meshCallback: (mesh: FlatMesh) => void): void;
|
|
9
9
|
streamAllMeshes(meshCallback: (mesh: FlatMesh) => void): void;
|
|
10
|
+
/**
|
|
11
|
+
* Deferred-mode batch pump (IFC proxies opened with DEFER_GEOMETRY) —
|
|
12
|
+
* see IfcApiProxyIfc.extractGeometryBatch.
|
|
13
|
+
*/
|
|
14
|
+
extractGeometryBatch?(batchSize: number, meshCallback?: (mesh: FlatMesh) => void): {
|
|
15
|
+
extracted: number;
|
|
16
|
+
remaining: number;
|
|
17
|
+
};
|
|
10
18
|
getCoordinationMatrix(): number[];
|
|
11
19
|
getAllLines(): Vector<number>;
|
|
12
20
|
getLineIDsWithType(type: number): Vector<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_api_model_passthrough.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_model_passthrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAGhE,MAAM,WAAW,sBAAsB;IAErC,UAAU,EAAE,qBAAqB,CAAA;IAEjC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAA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IAAI,CAAA;IAE3B;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAEnC;;;OAGG;IACH,0BAA0B,CAAC,CACzB,KAAK,EAAE,qBAAqB,EAC5B,UAAU,CAAC,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,MAAM,GAAI,IAAI,CAAA;IAEpC;;;OAGG;IACH,kBAAkB,CAAC,CAAE,SAAS,EAAE,MAAM,GAAI,OAAO,CAAE,IAAI,CAAE,CAAA;IAEzD;;;;;OAKG;IACH,cAAc,CAAC,IAAI,gBAAgB,CAAE,MAAM,CAAE,CAAA;CAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_api_model_passthrough_factory.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_model_passthrough_factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAKpE;;GAEG;AACH,qBAAa,6BAA6B;IAExC;;;;;;;OAOG;WACW,IAAI,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,sBAAsB,GAAG,SAAS;IA2EnE;;;;;;;;;;;;;;OAcG;WACiB,YAAY,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ifc_api_model_passthrough_factory.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_model_passthrough_factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAKpE;;GAEG;AACH,qBAAa,6BAA6B;IAExC;;;;;;;OAOG;WACW,IAAI,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,sBAAsB,GAAG,SAAS;IA2EnE;;;;;;;;;;;;;;OAcG;WACiB,YAAY,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAyB5E;;;;;;;;;;;;OAYG;WACiB,SAAS,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;CA+C7E"}
|
|
@@ -85,7 +85,9 @@ export class IfcApiModelPassthroughFactory {
|
|
|
85
85
|
const modelFormat = ModelFormatDetector.detect(new ParsingBuffer(data));
|
|
86
86
|
if (modelFormat === ModelFormatType.IFC) {
|
|
87
87
|
try {
|
|
88
|
-
return
|
|
88
|
+
return settings?.DEFER_GEOMETRY === true ?
|
|
89
|
+
await IfcApiProxyIfc.createDeferred(modelID, data, wasmModule, settings) :
|
|
90
|
+
await IfcApiProxyIfc.createStreamed(modelID, data, wasmModule, settings);
|
|
89
91
|
}
|
|
90
92
|
catch (e) {
|
|
91
93
|
const message = e instanceof Error ? e.message : String(e);
|
|
@@ -18,6 +18,8 @@ import { IfcGeometryExtraction } from "../../ifc/ifc_geometry_extraction.js";
|
|
|
18
18
|
*/
|
|
19
19
|
interface IfcProxyLoadState {
|
|
20
20
|
conwaywasm: ConwayGeometry;
|
|
21
|
+
/** True when opened without extraction (createDeferred). */
|
|
22
|
+
deferred?: boolean;
|
|
21
23
|
allTimeStart: number;
|
|
22
24
|
stepHeader: StepHeader;
|
|
23
25
|
model: IfcStepModel;
|
|
@@ -49,6 +51,14 @@ export declare class IfcApiProxyIfc implements IfcApiModelPassthrough {
|
|
|
49
51
|
glmatrix.mat4
|
|
50
52
|
];
|
|
51
53
|
conwaywasm: ConwayGeometry;
|
|
54
|
+
/** The extraction behind this model (drives the deferred batch pump). */
|
|
55
|
+
private conwayGeometry_;
|
|
56
|
+
/** Was this model opened without extraction (DEFER_GEOMETRY)? */
|
|
57
|
+
private deferredMode_;
|
|
58
|
+
/** Deferred-mode product worklist (file order), lazily enumerated. */
|
|
59
|
+
private demandProducts_?;
|
|
60
|
+
/** Cursor into demandProducts_ — products before it are extracted. */
|
|
61
|
+
private demandCursor_;
|
|
52
62
|
_isCoordinated: boolean;
|
|
53
63
|
linearScalingFactor: number;
|
|
54
64
|
identity: number[];
|
|
@@ -92,6 +102,23 @@ export declare class IfcApiProxyIfc implements IfcApiModelPassthrough {
|
|
|
92
102
|
* @return {Promise<IfcApiProxyIfc>} The constructed proxy.
|
|
93
103
|
*/
|
|
94
104
|
static createStreamed(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise<IfcApiProxyIfc>;
|
|
105
|
+
/**
|
|
106
|
+
* Deferred-geometry streamed open (conway extension; slice A of
|
|
107
|
+
* Share's demand/tiled rendering — design doc
|
|
108
|
+
* demand-tiled-rendering.md): identical streamed columnar parse, but
|
|
109
|
+
* NO geometry extraction happens at open. The proxy registers with an
|
|
110
|
+
* empty scene wired to the demand-extraction seam; callers then pump
|
|
111
|
+
* {@link extractGeometryBatch} to extract products in file-order
|
|
112
|
+
* batches, receiving each batch's meshes incrementally — the scene,
|
|
113
|
+
* properties, and spatial structure work from the first batch.
|
|
114
|
+
*
|
|
115
|
+
* @param modelID The model ID being opened.
|
|
116
|
+
* @param data The IFC data buffer.
|
|
117
|
+
* @param wasmModule The wasm module.
|
|
118
|
+
* @param settings Loader settings (ON_PROGRESS is honored for parse).
|
|
119
|
+
* @return {Promise<IfcApiProxyIfc>} The constructed proxy.
|
|
120
|
+
*/
|
|
121
|
+
static createDeferred(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise<IfcApiProxyIfc>;
|
|
95
122
|
/**
|
|
96
123
|
* Log + record the header parse result on the model statistics.
|
|
97
124
|
*
|
|
@@ -343,6 +370,40 @@ export declare class IfcApiProxyIfc implements IfcApiModelPassthrough {
|
|
|
343
370
|
* @param modelID Model handle retrieved by OpenModel, model must not be closed
|
|
344
371
|
*/
|
|
345
372
|
closeModel(): void;
|
|
373
|
+
/**
|
|
374
|
+
* Deferred-mode batch pump (conway extension; Share demand/tiled
|
|
375
|
+
* rendering slice A): extract the next `batchSize` products (file
|
|
376
|
+
* order) through the per-product demand seam and emit THIS BATCH's
|
|
377
|
+
* meshes through `meshCallback` — the incremental twin of
|
|
378
|
+
* streamAllMeshes. Placed-geometry math (coordination, scaling,
|
|
379
|
+
* centering) is identical; the shared meshMap is updated so
|
|
380
|
+
* getFlatMesh keeps working. Call repeatedly until `remaining` is 0.
|
|
381
|
+
*
|
|
382
|
+
* Requires a model opened with deferred geometry
|
|
383
|
+
* (`OpenModelStreamed(data, {..., DEFER_GEOMETRY: true})`); on a
|
|
384
|
+
* fully-extracted model this is a no-op returning remaining 0.
|
|
385
|
+
*
|
|
386
|
+
* @param batchSize Max products to extract this call (min 1).
|
|
387
|
+
* @param meshCallback Receives each newly-extracted product's mesh.
|
|
388
|
+
* @return {object} `{extracted, remaining}` — products processed this
|
|
389
|
+
* call and products still pending.
|
|
390
|
+
*/
|
|
391
|
+
extractGeometryBatch(batchSize: number, meshCallback?: (mesh: FlatMesh) => void): {
|
|
392
|
+
extracted: number;
|
|
393
|
+
remaining: number;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* Walk the scene and emit FlatMeshes for the given entities only —
|
|
397
|
+
* the filtered core of streamAllMeshes with identical placed-geometry
|
|
398
|
+
* math. Also fixes a latent multi-call bug: the derived coordination
|
|
399
|
+
* matrix is stored back to the model tuple, so later batches place
|
|
400
|
+
* with the SAME coordination the first batch established
|
|
401
|
+
* (streamAllMeshes never needed this — it runs once).
|
|
402
|
+
*
|
|
403
|
+
* @param entityFilter Entity localIDs whose meshes to emit.
|
|
404
|
+
* @param meshCallback Receives one FlatMesh per matched entity.
|
|
405
|
+
*/
|
|
406
|
+
private streamMeshesForEntities_;
|
|
346
407
|
/**
|
|
347
408
|
*
|
|
348
409
|
* @param modelID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_api_proxy_ifc.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_proxy_ifc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,YAAY,MAAM,0BAA0B,CAAA;AACnD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EACX,MAAM,EACP,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAWhD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAezE;;;;;GAKG;AACH,UAAU,iBAAiB;IACzB,UAAU,EAAE,cAAc,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,YAA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;IACH,UAAU;IAIV;;;;;;;;;;;;;;;;;OAiBG;IACH,oBAAoB,CAChB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAI;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC;IA6CrF;;;;;;;;;;OAUG;IACH,OAAO,CAAC,wBAAwB;IAqJhC;;;;OAIG;IACH,eAAe,CAAE,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI;IA2NvD;;;;;OAKG;IACH,wBAAwB,CACpB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI;IA+O1C;;;;OAIG;IACH,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC;IA0RnC;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ;IAqDxC;;;;;OAKG;IACH,4BAA4B,IAAI,IAAI;CAwBrC"}
|
|
@@ -39,6 +39,10 @@ export class IfcApiProxyIfc {
|
|
|
39
39
|
this.wasmModule = wasmModule;
|
|
40
40
|
this.settings = settings;
|
|
41
41
|
this.fs = undefined;
|
|
42
|
+
/** Was this model opened without extraction (DEFER_GEOMETRY)? */
|
|
43
|
+
this.deferredMode_ = false;
|
|
44
|
+
/** Cursor into demandProducts_ — products before it are extracted. */
|
|
45
|
+
this.demandCursor_ = 0;
|
|
42
46
|
this._isCoordinated = false;
|
|
43
47
|
this.linearScalingFactor = 1;
|
|
44
48
|
this.identity = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -57,6 +61,8 @@ export class IfcApiProxyIfc {
|
|
|
57
61
|
const loadState = precomputed ??
|
|
58
62
|
IfcApiProxyIfc.parseAndExtract(modelID, data, new ConwayGeometry(wasmModule), settings);
|
|
59
63
|
this.conwaywasm = loadState.conwaywasm;
|
|
64
|
+
this.conwayGeometry_ = loadState.conwayGeometry;
|
|
65
|
+
this.deferredMode_ = loadState.deferred === true;
|
|
60
66
|
const statistics = Logger.getStatistics(modelID);
|
|
61
67
|
const { allTimeStart, stepHeader, model, scene, conwayGeometry, geometryTimeInMs: executionTimeInMs, } = loadState;
|
|
62
68
|
// get linear scaling factor
|
|
@@ -195,6 +201,26 @@ export class IfcApiProxyIfc {
|
|
|
195
201
|
const loadState = await IfcApiProxyIfc.parseColumnarAndExtractAsync(modelID, data, new ConwayGeometry(wasmModule), settings);
|
|
196
202
|
return new IfcApiProxyIfc(modelID, data, wasmModule, settings, loadState);
|
|
197
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Deferred-geometry streamed open (conway extension; slice A of
|
|
206
|
+
* Share's demand/tiled rendering — design doc
|
|
207
|
+
* demand-tiled-rendering.md): identical streamed columnar parse, but
|
|
208
|
+
* NO geometry extraction happens at open. The proxy registers with an
|
|
209
|
+
* empty scene wired to the demand-extraction seam; callers then pump
|
|
210
|
+
* {@link extractGeometryBatch} to extract products in file-order
|
|
211
|
+
* batches, receiving each batch's meshes incrementally — the scene,
|
|
212
|
+
* properties, and spatial structure work from the first batch.
|
|
213
|
+
*
|
|
214
|
+
* @param modelID The model ID being opened.
|
|
215
|
+
* @param data The IFC data buffer.
|
|
216
|
+
* @param wasmModule The wasm module.
|
|
217
|
+
* @param settings Loader settings (ON_PROGRESS is honored for parse).
|
|
218
|
+
* @return {Promise<IfcApiProxyIfc>} The constructed proxy.
|
|
219
|
+
*/
|
|
220
|
+
static async createDeferred(modelID, data, wasmModule, settings) {
|
|
221
|
+
const loadState = await IfcApiProxyIfc.parseColumnarAndExtractAsync(modelID, data, new ConwayGeometry(wasmModule), settings, true);
|
|
222
|
+
return new IfcApiProxyIfc(modelID, data, wasmModule, settings, loadState);
|
|
223
|
+
}
|
|
198
224
|
/**
|
|
199
225
|
* Log + record the header parse result on the model statistics.
|
|
200
226
|
*
|
|
@@ -393,7 +419,7 @@ export class IfcApiProxyIfc {
|
|
|
393
419
|
* @param settings Loader settings (ON_PROGRESS is honored).
|
|
394
420
|
* @return {Promise<IfcProxyLoadState>} Everything the constructor tail needs.
|
|
395
421
|
*/
|
|
396
|
-
static async parseColumnarAndExtractAsync(modelID, data, conwaywasm, settings) {
|
|
422
|
+
static async parseColumnarAndExtractAsync(modelID, data, conwaywasm, settings, deferGeometry = false) {
|
|
397
423
|
const tracker = IfcApiProxyIfc.makeTracker(settings);
|
|
398
424
|
const allTimeStart = Date.now();
|
|
399
425
|
const parser = IfcStepParser.Instance;
|
|
@@ -424,6 +450,24 @@ export class IfcApiProxyIfc {
|
|
|
424
450
|
const model = new IfcStepModel(data, columns);
|
|
425
451
|
statistics?.setParseTime(parseEndTime - parseStartTime);
|
|
426
452
|
const conwayGeometry = new IfcGeometryExtraction(conwaywasm, model);
|
|
453
|
+
// Deferred mode (createDeferred): no extraction now — prime the
|
|
454
|
+
// per-product demand seam and hand back the (empty) live scene the
|
|
455
|
+
// batch pump populates. `scene` is the same object streamAllMeshes
|
|
456
|
+
// walks, so meshes appear to consumers as batches extract.
|
|
457
|
+
if (deferGeometry) {
|
|
458
|
+
conwayGeometry.prepareDemandExtraction();
|
|
459
|
+
statistics?.setProductCount(model.typeCount(IfcProduct));
|
|
460
|
+
return {
|
|
461
|
+
conwaywasm,
|
|
462
|
+
deferred: true,
|
|
463
|
+
allTimeStart,
|
|
464
|
+
stepHeader,
|
|
465
|
+
model,
|
|
466
|
+
scene: conwayGeometry.scene,
|
|
467
|
+
conwayGeometry,
|
|
468
|
+
geometryTimeInMs: 0,
|
|
469
|
+
};
|
|
470
|
+
}
|
|
427
471
|
tracker?.beginPhase("geometry", "products");
|
|
428
472
|
const geometryTick = tracker !== void 0 ?
|
|
429
473
|
(completed, total) => {
|
|
@@ -913,6 +957,171 @@ export class IfcApiProxyIfc {
|
|
|
913
957
|
closeModel() {
|
|
914
958
|
// Null operation.
|
|
915
959
|
}
|
|
960
|
+
/**
|
|
961
|
+
* Deferred-mode batch pump (conway extension; Share demand/tiled
|
|
962
|
+
* rendering slice A): extract the next `batchSize` products (file
|
|
963
|
+
* order) through the per-product demand seam and emit THIS BATCH's
|
|
964
|
+
* meshes through `meshCallback` — the incremental twin of
|
|
965
|
+
* streamAllMeshes. Placed-geometry math (coordination, scaling,
|
|
966
|
+
* centering) is identical; the shared meshMap is updated so
|
|
967
|
+
* getFlatMesh keeps working. Call repeatedly until `remaining` is 0.
|
|
968
|
+
*
|
|
969
|
+
* Requires a model opened with deferred geometry
|
|
970
|
+
* (`OpenModelStreamed(data, {..., DEFER_GEOMETRY: true})`); on a
|
|
971
|
+
* fully-extracted model this is a no-op returning remaining 0.
|
|
972
|
+
*
|
|
973
|
+
* @param batchSize Max products to extract this call (min 1).
|
|
974
|
+
* @param meshCallback Receives each newly-extracted product's mesh.
|
|
975
|
+
* @return {object} `{extracted, remaining}` — products processed this
|
|
976
|
+
* call and products still pending.
|
|
977
|
+
*/
|
|
978
|
+
extractGeometryBatch(batchSize, meshCallback) {
|
|
979
|
+
// Fully-extracted opens have nothing to pump — re-running the
|
|
980
|
+
// per-product extraction on them would duplicate scene work.
|
|
981
|
+
if (!this.deferredMode_) {
|
|
982
|
+
return { extracted: 0, remaining: 0 };
|
|
983
|
+
}
|
|
984
|
+
if (this.demandProducts_ === void 0) {
|
|
985
|
+
const products = [];
|
|
986
|
+
for (const product of this.model[0].types(IfcProduct)) {
|
|
987
|
+
products.push(product.localID);
|
|
988
|
+
}
|
|
989
|
+
this.demandProducts_ = products;
|
|
990
|
+
this.demandCursor_ = 0;
|
|
991
|
+
}
|
|
992
|
+
const end = Math.min(this.demandCursor_ + Math.max(batchSize, 1), this.demandProducts_.length);
|
|
993
|
+
const batch = new Set();
|
|
994
|
+
for (; this.demandCursor_ < end; ++this.demandCursor_) {
|
|
995
|
+
const localID = this.demandProducts_[this.demandCursor_];
|
|
996
|
+
if (this.conwayGeometry_.extractProductGeometryByLocalID(localID)) {
|
|
997
|
+
batch.add(localID);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
if (meshCallback !== void 0 && batch.size > 0) {
|
|
1001
|
+
this.streamMeshesForEntities_(batch, meshCallback);
|
|
1002
|
+
}
|
|
1003
|
+
return {
|
|
1004
|
+
extracted: batch.size,
|
|
1005
|
+
remaining: this.demandProducts_.length - this.demandCursor_,
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Walk the scene and emit FlatMeshes for the given entities only —
|
|
1010
|
+
* the filtered core of streamAllMeshes with identical placed-geometry
|
|
1011
|
+
* math. Also fixes a latent multi-call bug: the derived coordination
|
|
1012
|
+
* matrix is stored back to the model tuple, so later batches place
|
|
1013
|
+
* with the SAME coordination the first batch established
|
|
1014
|
+
* (streamAllMeshes never needed this — it runs once).
|
|
1015
|
+
*
|
|
1016
|
+
* @param entityFilter Entity localIDs whose meshes to emit.
|
|
1017
|
+
* @param meshCallback Receives one FlatMesh per matched entity.
|
|
1018
|
+
*/
|
|
1019
|
+
streamMeshesForEntities_(entityFilter, meshCallback) {
|
|
1020
|
+
const [model, scene, meshMap, geometryMaterialTransformMap] = this.model;
|
|
1021
|
+
let coordinationMatrix = this.model[5];
|
|
1022
|
+
const emitted = new Set();
|
|
1023
|
+
// eslint-disable-next-line no-unused-vars
|
|
1024
|
+
for (const [_, nativeTransform, geometry, material, entity] of scene.walk()) {
|
|
1025
|
+
if (entity?.localID === void 0 || !entityFilter.has(entity.localID) ||
|
|
1026
|
+
entity.expressID === void 0) {
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
if (geometry.type !== CanonicalMeshType.BUFFER_GEOMETRY || geometry.temporary) {
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
const material_ = material ?? {
|
|
1033
|
+
name: "",
|
|
1034
|
+
// eslint-disable-next-line no-magic-numbers
|
|
1035
|
+
baseColor: [0.8, 0.8, 0.8, 1],
|
|
1036
|
+
// eslint-disable-next-line no-magic-numbers
|
|
1037
|
+
legacyColor: [0.8, 0.8, 0.8, 1],
|
|
1038
|
+
doubleSided: true,
|
|
1039
|
+
blend: 0,
|
|
1040
|
+
};
|
|
1041
|
+
let nativePt;
|
|
1042
|
+
if (!this._isCoordinated && this.settings?.COORDINATE_TO_ORIGIN) {
|
|
1043
|
+
nativePt = geometry.geometry.getPoint(0);
|
|
1044
|
+
}
|
|
1045
|
+
const geomCenter = glmatrix.vec3.create();
|
|
1046
|
+
const center = geometry.geometry.normalize();
|
|
1047
|
+
geomCenter[0] = center.x;
|
|
1048
|
+
geomCenter[1] = center.y;
|
|
1049
|
+
geomCenter[2] = center.z;
|
|
1050
|
+
const translationMatrixGeomMin = glmatrix.mat4.create();
|
|
1051
|
+
glmatrix.mat4.fromTranslation(translationMatrixGeomMin, geomCenter);
|
|
1052
|
+
const expressID = model.getElementByLocalID(geometry.localID)?.expressID;
|
|
1053
|
+
const geometryTransform = nativeTransform?.getValues();
|
|
1054
|
+
let newMatrix;
|
|
1055
|
+
if (geometryTransform !== void 0) {
|
|
1056
|
+
newMatrix = glmatrix.mat4.fromValues(...geometryTransform);
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
newMatrix = glmatrix.mat4.create();
|
|
1060
|
+
}
|
|
1061
|
+
if (!this._isCoordinated && this.settings?.COORDINATE_TO_ORIGIN) {
|
|
1062
|
+
const pt = [nativePt.x, nativePt.y, nativePt.z];
|
|
1063
|
+
const transformedPt = glmatrix.vec4.create();
|
|
1064
|
+
glmatrix.vec4.transformMat4(transformedPt, [pt[0], pt[1], pt[2], 1], newMatrix);
|
|
1065
|
+
coordinationMatrix = glmatrix.mat4.create();
|
|
1066
|
+
glmatrix.mat4.fromTranslation(coordinationMatrix, [-transformedPt[0], -transformedPt[1], -transformedPt[2]]);
|
|
1067
|
+
const scaleMatrix = glmatrix.mat4.create();
|
|
1068
|
+
const scaleVec = glmatrix.vec3.fromValues(this.linearScalingFactor, this.linearScalingFactor, this.linearScalingFactor);
|
|
1069
|
+
glmatrix.mat4.scale(scaleMatrix, scaleMatrix, scaleVec);
|
|
1070
|
+
glmatrix.mat4.multiply(coordinationMatrix, this.NormalizeMat, coordinationMatrix);
|
|
1071
|
+
glmatrix.mat4.multiply(coordinationMatrix, scaleMatrix, coordinationMatrix);
|
|
1072
|
+
// Persist for every later batch (and getCoordinationMatrix).
|
|
1073
|
+
this.model[5] = coordinationMatrix;
|
|
1074
|
+
this._isCoordinated = true;
|
|
1075
|
+
}
|
|
1076
|
+
const newTransform = glmatrix.mat4.create();
|
|
1077
|
+
const scaleMatrix = glmatrix.mat4.create();
|
|
1078
|
+
const scaleVec = glmatrix.vec3.fromValues(this.linearScalingFactor, this.linearScalingFactor, this.linearScalingFactor);
|
|
1079
|
+
glmatrix.mat4.scale(scaleMatrix, scaleMatrix, scaleVec);
|
|
1080
|
+
glmatrix.mat4.multiply(newTransform, coordinationMatrix, newMatrix);
|
|
1081
|
+
glmatrix.mat4.multiply(newTransform, newTransform, translationMatrixGeomMin);
|
|
1082
|
+
const newTransformArr = Array.from(newTransform);
|
|
1083
|
+
geometryMaterialTransformMap.set(expressID, [geometry.geometry, material_, newTransformArr]);
|
|
1084
|
+
const color = {
|
|
1085
|
+
x: material_.legacyColor[0],
|
|
1086
|
+
y: material_.legacyColor[1],
|
|
1087
|
+
z: material_.legacyColor[2],
|
|
1088
|
+
w: material_.legacyColor[3],
|
|
1089
|
+
};
|
|
1090
|
+
const placed = {
|
|
1091
|
+
color,
|
|
1092
|
+
geometryExpressID: expressID,
|
|
1093
|
+
flatTransformation: newTransformArr,
|
|
1094
|
+
};
|
|
1095
|
+
let mesh = meshMap.get(entity.expressID);
|
|
1096
|
+
if (mesh === void 0) {
|
|
1097
|
+
const placedArray = new Array();
|
|
1098
|
+
const placedVector = {
|
|
1099
|
+
get: (index) => placedArray[index] ?? placed,
|
|
1100
|
+
size: () => placedArray.length,
|
|
1101
|
+
push: (parameter) => {
|
|
1102
|
+
placedArray.push(parameter);
|
|
1103
|
+
},
|
|
1104
|
+
};
|
|
1105
|
+
const flatMesh = {
|
|
1106
|
+
geometries: placedVector,
|
|
1107
|
+
expressID: entity.expressID,
|
|
1108
|
+
};
|
|
1109
|
+
mesh = [placedVector, flatMesh];
|
|
1110
|
+
meshMap.set(entity.expressID, mesh);
|
|
1111
|
+
}
|
|
1112
|
+
mesh[0].push(placed);
|
|
1113
|
+
mesh[1].geometries = mesh[0];
|
|
1114
|
+
emitted.add(entity.expressID);
|
|
1115
|
+
}
|
|
1116
|
+
const vectorFlatMesh = this.model[4];
|
|
1117
|
+
for (const expressID of emitted) {
|
|
1118
|
+
const mesh = meshMap.get(expressID);
|
|
1119
|
+
if (mesh !== void 0) {
|
|
1120
|
+
vectorFlatMesh.push(mesh[1]);
|
|
1121
|
+
meshCallback(mesh[1]);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
916
1125
|
/**
|
|
917
1126
|
*
|
|
918
1127
|
* @param modelID
|
|
@@ -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 v1.
|
|
8
|
+
const versionString = 'Conway v1.422.1273';
|
|
9
9
|
export { versionString };
|