@bldrs-ai/conway 1.426.1283 → 1.428.1289
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 +175 -21
- package/compiled/examples/validator-bundled.cjs +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +69 -0
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +187 -31
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
- 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 +19 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +2 -2
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +105 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +360 -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 +2 -2
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +111 -38
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/streamed_preview_channel.js +176 -106
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,11 @@ import { StepHeader } from "../../step/parsing/step_parser.js";
|
|
|
17
17
|
*/
|
|
18
18
|
interface Ap214ProxyLoadState {
|
|
19
19
|
conwaywasm: ConwayGeometry;
|
|
20
|
+
/** True when opened without extraction (createDeferred). */
|
|
21
|
+
deferred?: boolean;
|
|
22
|
+
/** Coordination matrix the parse-time preview channel derived —
|
|
23
|
+
* adopted by the durable capture so both share one frame. */
|
|
24
|
+
previewCoordinationMatrix?: glmatrix.mat4;
|
|
20
25
|
allTimeStart: number;
|
|
21
26
|
stepHeader: StepHeader;
|
|
22
27
|
model: AP214StepModel;
|
|
@@ -47,6 +52,24 @@ export declare class IfcApiProxyAP214 implements IfcApiModelPassthrough {
|
|
|
47
52
|
glmatrix.mat4
|
|
48
53
|
];
|
|
49
54
|
conwaywasm: ConwayGeometry;
|
|
55
|
+
/** The extraction behind this model (drives the deferred unit pump). */
|
|
56
|
+
private conwayGeometry_;
|
|
57
|
+
/** Was this model opened without extraction (DEFER_GEOMETRY)? */
|
|
58
|
+
private deferredMode_;
|
|
59
|
+
/** Has finishDemandExtraction run (deferred models, once)? */
|
|
60
|
+
private demandFinished_;
|
|
61
|
+
/**
|
|
62
|
+
* Deferred capture watermarks: entity localID -> how many of its
|
|
63
|
+
* placed instances (scene-walk order) have been captured — mirrors
|
|
64
|
+
* the IFC proxy's delta capture; see its demandCapturedCounts_ note.
|
|
65
|
+
*/
|
|
66
|
+
private readonly demandCapturedCounts_;
|
|
67
|
+
/**
|
|
68
|
+
* Coordination matrix the deferred capture derived. Internal
|
|
69
|
+
* multi-call memory only — getCoordinationMatrix keeps the classic
|
|
70
|
+
* identity contract (see the IFC proxy's demandCoordination_ note).
|
|
71
|
+
*/
|
|
72
|
+
private demandCoordination_?;
|
|
50
73
|
_isCoordinated: boolean;
|
|
51
74
|
linearScalingFactor: number;
|
|
52
75
|
identity: number[];
|
|
@@ -119,6 +142,52 @@ export declare class IfcApiProxyAP214 implements IfcApiModelPassthrough {
|
|
|
119
142
|
* @return {Promise<IfcApiProxyAP214>} The constructed proxy.
|
|
120
143
|
*/
|
|
121
144
|
static createAsync(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise<IfcApiProxyAP214>;
|
|
145
|
+
/**
|
|
146
|
+
* Streamed columnar construction (conway extension, used by
|
|
147
|
+
* OpenModelStreamed): the data parse runs through the streaming
|
|
148
|
+
* columnar indexer over a moving window instead of the per-record
|
|
149
|
+
* object parse, so the index is columnar from birth — the AP214 twin
|
|
150
|
+
* of IfcApiProxyIfc.createStreamed (STEP demand parity phase 1).
|
|
151
|
+
* Geometry extraction stays the classic whole-model thunk-tree walk;
|
|
152
|
+
* the deferred pump and preview channel follow in later phases.
|
|
153
|
+
* Throws when the streamed parse is anything but COMPLETE — the
|
|
154
|
+
* factory falls back to the classic open.
|
|
155
|
+
*
|
|
156
|
+
* @param modelID The model ID being opened.
|
|
157
|
+
* @param data The STEP data buffer.
|
|
158
|
+
* @param wasmModule The wasm module.
|
|
159
|
+
* @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored).
|
|
160
|
+
* @return {Promise<IfcApiProxyAP214>} The constructed proxy.
|
|
161
|
+
*/
|
|
162
|
+
static createStreamed(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise<IfcApiProxyAP214>;
|
|
163
|
+
/**
|
|
164
|
+
* Deferred streamed construction (STEP demand parity phase 2): the
|
|
165
|
+
* streamed columnar parse runs, the assembly tree is prepared, but NO
|
|
166
|
+
* geometry units execute — the batch pump (extractGeometryBatch)
|
|
167
|
+
* extracts them progressively afterwards. The AP214 twin of
|
|
168
|
+
* IfcApiProxyIfc.createDeferred.
|
|
169
|
+
*
|
|
170
|
+
* @param modelID The model ID being opened.
|
|
171
|
+
* @param data The STEP data buffer.
|
|
172
|
+
* @param wasmModule The wasm module.
|
|
173
|
+
* @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored).
|
|
174
|
+
* @return {Promise<IfcApiProxyAP214>} The constructed proxy.
|
|
175
|
+
*/
|
|
176
|
+
static createDeferred(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise<IfcApiProxyAP214>;
|
|
177
|
+
/**
|
|
178
|
+
* Streamed twin of parseAndExtractAsync: cooperative columnar index
|
|
179
|
+
* build (periodic event-loop yields, absolute byte-cursor progress),
|
|
180
|
+
* then the model adopts the columns directly — no per-record object
|
|
181
|
+
* phase. Mirrors IfcApiProxyIfc.parseColumnarAndExtractAsync minus
|
|
182
|
+
* the deferred branch.
|
|
183
|
+
*
|
|
184
|
+
* @param modelID The model ID being opened.
|
|
185
|
+
* @param data The STEP data buffer.
|
|
186
|
+
* @param conwaywasm The conway geometry wasm wrapper.
|
|
187
|
+
* @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored).
|
|
188
|
+
* @return {Promise<Ap214ProxyLoadState>} Everything the constructor tail needs.
|
|
189
|
+
*/
|
|
190
|
+
private static parseColumnarAndExtractAsync;
|
|
122
191
|
/**
|
|
123
192
|
* Log + record the header parse result on the model statistics.
|
|
124
193
|
*
|
|
@@ -280,6 +349,42 @@ export declare class IfcApiProxyAP214 implements IfcApiModelPassthrough {
|
|
|
280
349
|
* @param modelID
|
|
281
350
|
* @param meshCallback
|
|
282
351
|
*/
|
|
352
|
+
/**
|
|
353
|
+
* Deferred-mode unit pump (STEP demand parity phase 2; conway
|
|
354
|
+
* extension consumed through ExtractGeometryBatch): execute the next
|
|
355
|
+
* `batchSize` assembly-tree units and emit THIS BATCH's meshes as
|
|
356
|
+
* per-entity DELTA FlatMeshes — the AP214 twin of the IFC proxy's
|
|
357
|
+
* pump, same delta contract. On a fully-extracted model this is a
|
|
358
|
+
* no-op returning remaining 0.
|
|
359
|
+
*
|
|
360
|
+
* @param batchSize Max units to execute this call (min 1).
|
|
361
|
+
* @param meshCallback Receives each newly-captured delta mesh.
|
|
362
|
+
* @return {object} `{extracted, remaining}` — units executed this
|
|
363
|
+
* call and units still pending.
|
|
364
|
+
*/
|
|
365
|
+
extractGeometryBatch(batchSize: number, meshCallback?: (mesh: FlatMesh) => void): {
|
|
366
|
+
extracted: number;
|
|
367
|
+
remaining: number;
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Walk the scene and emit every not-yet-captured placed instance as
|
|
371
|
+
* per-entity DELTA FlatMeshes — the incremental core of
|
|
372
|
+
* streamAllMeshes with identical placed-geometry math (bare
|
|
373
|
+
* coordination x nativeTransform composition, occurrence paths),
|
|
374
|
+
* processed in walk order exactly once per instance. The shared
|
|
375
|
+
* meshMap accumulates each entity's FULL vector so getFlatMesh stays
|
|
376
|
+
* whole-model correct; the derived coordination matrix is remembered
|
|
377
|
+
* across calls (demandCoordination_) without leaking through
|
|
378
|
+
* getCoordinationMatrix (classic identity contract).
|
|
379
|
+
*
|
|
380
|
+
* @param meshCallback Receives one delta FlatMesh per entity that
|
|
381
|
+
* gained instances this call.
|
|
382
|
+
*/
|
|
383
|
+
private streamNewMeshes_;
|
|
384
|
+
/**
|
|
385
|
+
*
|
|
386
|
+
* @param meshCallback
|
|
387
|
+
*/
|
|
283
388
|
streamAllMeshes(meshCallback: (mesh: FlatMesh) => void): void;
|
|
284
389
|
/**
|
|
285
390
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_api_proxy_ap214.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_proxy_ap214.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,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,s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SAAS,EAAE,MAAM,GAC/E,YAAY,GAAG,WAAW;IAK5B;;;;OAIG;IACH,UAAU;IAIV;;;;OAIG;IACH;;;;;;;;;;;;OAYG;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;IA8BrF;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,gBAAgB;IAkKxB;;;OAGG;IACH,eAAe,CAAE,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI;IA8OvD;;;;;OAKG;IACH,wBAAwB,CACpB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI;IAI1C;;;;OAIG;IACH,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC;IAmRnC;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ;IAqDxC;;;;;OAKG;IACH,4BAA4B,IAAI,IAAI;CAwBrC"}
|
|
@@ -6,6 +6,7 @@ import { ExtractResult } from "../../index.js";
|
|
|
6
6
|
import { ParseResult } from "../../index.js";
|
|
7
7
|
import Memory from "../../memory/memory.js";
|
|
8
8
|
import { CanonicalMeshType } from "../../index.js";
|
|
9
|
+
import AP214StepModel from "../../AP214E3_2010/ap214_step_model.js";
|
|
9
10
|
import { AP214GeometryExtraction } from "../../AP214E3_2010/ap214_geometry_extraction.js";
|
|
10
11
|
import AP214StepParser from "../../AP214E3_2010/ap214_step_parser.js";
|
|
11
12
|
import { AP214Properties } from "./ap214_properties.js";
|
|
@@ -13,6 +14,22 @@ import { EntityTypesAP214Count } from "../../AP214E3_2010/AP214E3_2010_gen/entit
|
|
|
13
14
|
import { ProgressTracker } from "../../core/progress.js";
|
|
14
15
|
import { formatModelLine } from "../../core/progress_log.js";
|
|
15
16
|
import { extractModelInfo } from "../../loaders/loading_utilities.js";
|
|
17
|
+
import { BufferByteSource } from "../../step/parsing/byte_source.js";
|
|
18
|
+
import { ColumnarIndexSink } from "../../step/parsing/columnar_index.js";
|
|
19
|
+
import { buildIndexStreamingAsync, } from "../../step/parsing/streaming_index_builder.js";
|
|
20
|
+
import { ap214PreviewAdapter, StreamedPreviewChannel, } from "./streamed_preview_channel.js";
|
|
21
|
+
/* Moving-window size for the streamed columnar parse (matches the IFC
|
|
22
|
+
* proxy; the window bounds parse-time scratch, not the source buffer,
|
|
23
|
+
* which the model keeps resident here). */
|
|
24
|
+
// eslint-disable-next-line no-magic-numbers
|
|
25
|
+
const STREAMED_PARSE_POOL_BYTES = 1024 * 1024;
|
|
26
|
+
// Units drained per call when a whole-model consumer (streamAllMeshes)
|
|
27
|
+
// finishes a deferred model synchronously.
|
|
28
|
+
const DEFERRED_DRAIN_BATCH_AP214 = 256;
|
|
29
|
+
// Divisor mapping consumer batch sizes (tuned for IFC's per-product
|
|
30
|
+
// granularity) onto AP214's chunkier per-part units — see
|
|
31
|
+
// extractGeometryBatch.
|
|
32
|
+
const AP214_UNITS_PER_PRODUCT_BATCH = 16;
|
|
16
33
|
/**
|
|
17
34
|
*/
|
|
18
35
|
export class IfcApiProxyAP214 {
|
|
@@ -81,6 +98,16 @@ export class IfcApiProxyAP214 {
|
|
|
81
98
|
this.wasmModule = wasmModule;
|
|
82
99
|
this.settings = settings;
|
|
83
100
|
this.fs = undefined;
|
|
101
|
+
/** Was this model opened without extraction (DEFER_GEOMETRY)? */
|
|
102
|
+
this.deferredMode_ = false;
|
|
103
|
+
/** Has finishDemandExtraction run (deferred models, once)? */
|
|
104
|
+
this.demandFinished_ = false;
|
|
105
|
+
/**
|
|
106
|
+
* Deferred capture watermarks: entity localID -> how many of its
|
|
107
|
+
* placed instances (scene-walk order) have been captured — mirrors
|
|
108
|
+
* the IFC proxy's delta capture; see its demandCapturedCounts_ note.
|
|
109
|
+
*/
|
|
110
|
+
this.demandCapturedCounts_ = new Map();
|
|
84
111
|
this._isCoordinated = false;
|
|
85
112
|
this.linearScalingFactor = 1;
|
|
86
113
|
this.identity = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -99,6 +126,8 @@ export class IfcApiProxyAP214 {
|
|
|
99
126
|
const loadState = precomputed ??
|
|
100
127
|
IfcApiProxyAP214.parseAndExtract(modelID, data, new ConwayGeometry(wasmModule), settings);
|
|
101
128
|
this.conwaywasm = loadState.conwaywasm;
|
|
129
|
+
this.conwayGeometry_ = loadState.conwayGeometry;
|
|
130
|
+
this.deferredMode_ = loadState.deferred === true;
|
|
102
131
|
const statistics = Logger.getStatistics(modelID);
|
|
103
132
|
const { allTimeStart, stepHeader, model, scene, conwayGeometry, geometryTimeInMs: executionTimeInMs, } = loadState;
|
|
104
133
|
// get linear scaling factor
|
|
@@ -174,6 +203,14 @@ export class IfcApiProxyAP214 {
|
|
|
174
203
|
];
|
|
175
204
|
// save settings
|
|
176
205
|
this.settings = settings;
|
|
206
|
+
// Deferred opens whose preview channel already established the
|
|
207
|
+
// coordination frame: adopt it so the durable capture places
|
|
208
|
+
// exactly where the preview did (internal only — see
|
|
209
|
+
// demandCoordination_).
|
|
210
|
+
if (this.deferredMode_ && loadState.previewCoordinationMatrix !== void 0) {
|
|
211
|
+
this.demandCoordination_ = loadState.previewCoordinationMatrix;
|
|
212
|
+
this._isCoordinated = true;
|
|
213
|
+
}
|
|
177
214
|
let FILE_NAME = stepHeader.headers.get("FILE_NAME");
|
|
178
215
|
if (FILE_NAME !== void 0) {
|
|
179
216
|
// strip start / end parenthesis
|
|
@@ -220,6 +257,143 @@ export class IfcApiProxyAP214 {
|
|
|
220
257
|
const loadState = await IfcApiProxyAP214.parseAndExtractAsync(modelID, data, new ConwayGeometry(wasmModule), settings);
|
|
221
258
|
return new IfcApiProxyAP214(modelID, data, wasmModule, settings, loadState);
|
|
222
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Streamed columnar construction (conway extension, used by
|
|
262
|
+
* OpenModelStreamed): the data parse runs through the streaming
|
|
263
|
+
* columnar indexer over a moving window instead of the per-record
|
|
264
|
+
* object parse, so the index is columnar from birth — the AP214 twin
|
|
265
|
+
* of IfcApiProxyIfc.createStreamed (STEP demand parity phase 1).
|
|
266
|
+
* Geometry extraction stays the classic whole-model thunk-tree walk;
|
|
267
|
+
* the deferred pump and preview channel follow in later phases.
|
|
268
|
+
* Throws when the streamed parse is anything but COMPLETE — the
|
|
269
|
+
* factory falls back to the classic open.
|
|
270
|
+
*
|
|
271
|
+
* @param modelID The model ID being opened.
|
|
272
|
+
* @param data The STEP data buffer.
|
|
273
|
+
* @param wasmModule The wasm module.
|
|
274
|
+
* @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored).
|
|
275
|
+
* @return {Promise<IfcApiProxyAP214>} The constructed proxy.
|
|
276
|
+
*/
|
|
277
|
+
static async createStreamed(modelID, data, wasmModule, settings) {
|
|
278
|
+
const loadState = await IfcApiProxyAP214.parseColumnarAndExtractAsync(modelID, data, new ConwayGeometry(wasmModule), settings);
|
|
279
|
+
return new IfcApiProxyAP214(modelID, data, wasmModule, settings, loadState);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Deferred streamed construction (STEP demand parity phase 2): the
|
|
283
|
+
* streamed columnar parse runs, the assembly tree is prepared, but NO
|
|
284
|
+
* geometry units execute — the batch pump (extractGeometryBatch)
|
|
285
|
+
* extracts them progressively afterwards. The AP214 twin of
|
|
286
|
+
* IfcApiProxyIfc.createDeferred.
|
|
287
|
+
*
|
|
288
|
+
* @param modelID The model ID being opened.
|
|
289
|
+
* @param data The STEP data buffer.
|
|
290
|
+
* @param wasmModule The wasm module.
|
|
291
|
+
* @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored).
|
|
292
|
+
* @return {Promise<IfcApiProxyAP214>} The constructed proxy.
|
|
293
|
+
*/
|
|
294
|
+
static async createDeferred(modelID, data, wasmModule, settings) {
|
|
295
|
+
const loadState = await IfcApiProxyAP214.parseColumnarAndExtractAsync(modelID, data, new ConwayGeometry(wasmModule), settings, true);
|
|
296
|
+
return new IfcApiProxyAP214(modelID, data, wasmModule, settings, loadState);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Streamed twin of parseAndExtractAsync: cooperative columnar index
|
|
300
|
+
* build (periodic event-loop yields, absolute byte-cursor progress),
|
|
301
|
+
* then the model adopts the columns directly — no per-record object
|
|
302
|
+
* phase. Mirrors IfcApiProxyIfc.parseColumnarAndExtractAsync minus
|
|
303
|
+
* the deferred branch.
|
|
304
|
+
*
|
|
305
|
+
* @param modelID The model ID being opened.
|
|
306
|
+
* @param data The STEP data buffer.
|
|
307
|
+
* @param conwaywasm The conway geometry wasm wrapper.
|
|
308
|
+
* @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored).
|
|
309
|
+
* @return {Promise<Ap214ProxyLoadState>} Everything the constructor tail needs.
|
|
310
|
+
*/
|
|
311
|
+
static async parseColumnarAndExtractAsync(modelID, data, conwaywasm, settings, deferGeometry = false) {
|
|
312
|
+
const tracker = IfcApiProxyAP214.makeTracker(settings);
|
|
313
|
+
const allTimeStart = Date.now();
|
|
314
|
+
const parser = AP214StepParser.Instance;
|
|
315
|
+
const bufferInput = new ParsingBuffer(data);
|
|
316
|
+
tracker?.beginPhase("headerParse", "bytes", data.length);
|
|
317
|
+
// Header parsed standalone first so the model line fires before the
|
|
318
|
+
// full parse (the columnar build re-reads the tiny header
|
|
319
|
+
// internally; the cost is negligible).
|
|
320
|
+
const [stepHeader, result0] = parser.parseHeader(bufferInput);
|
|
321
|
+
Logger.createStatistics(modelID);
|
|
322
|
+
const statistics = Logger.getStatistics(modelID);
|
|
323
|
+
IfcApiProxyAP214.reportHeaderParseResult(result0, bufferInput, modelID);
|
|
324
|
+
const modelInfo = extractModelInfo(stepHeader, data.length);
|
|
325
|
+
Logger.info(formatModelLine(modelInfo));
|
|
326
|
+
settings?.ON_MODEL_INFO?.(modelInfo);
|
|
327
|
+
tracker?.beginPhase("dataParse", "bytes", data.length);
|
|
328
|
+
const parseTick = tracker !== void 0 ?
|
|
329
|
+
(cursorBytes) => tracker.update(cursorBytes) : void 0;
|
|
330
|
+
const parseStartTime = Date.now();
|
|
331
|
+
const sink = new ColumnarIndexSink();
|
|
332
|
+
// Parse-time preview channel (slice A2, STEP demand parity phase
|
|
333
|
+
// 3): ticks between the cooperative parse's yields, emitting
|
|
334
|
+
// preview payloads from throwaway prefix extractions.
|
|
335
|
+
const previewChannel = deferGeometry && settings?.ON_PREVIEW_MESH !== void 0 ?
|
|
336
|
+
new StreamedPreviewChannel(data, conwaywasm, sink, ap214PreviewAdapter(), settings.COORDINATE_TO_ORIGIN === true, settings.ON_PREVIEW_MESH) : void 0;
|
|
337
|
+
previewChannel?.start();
|
|
338
|
+
let result;
|
|
339
|
+
try {
|
|
340
|
+
({ result } = await buildIndexStreamingAsync(new BufferByteSource(data), parser, STREAMED_PARSE_POOL_BYTES, void 0, sink, parseTick));
|
|
341
|
+
}
|
|
342
|
+
finally {
|
|
343
|
+
previewChannel?.stop();
|
|
344
|
+
}
|
|
345
|
+
const columns = sink.finalize();
|
|
346
|
+
const parseEndTime = Date.now();
|
|
347
|
+
tracker?.endPhase(data.length);
|
|
348
|
+
if (result !== ParseResult.COMPLETE) {
|
|
349
|
+
Logger.warning(`[OpenModelStreamed]: streamed parse result ${result}`);
|
|
350
|
+
statistics?.setLoadStatus("PARSE_FAIL");
|
|
351
|
+
throw new Error("Streamed parse did not complete");
|
|
352
|
+
}
|
|
353
|
+
const model = new AP214StepModel(data, columns);
|
|
354
|
+
statistics?.setParseTime(parseEndTime - parseStartTime);
|
|
355
|
+
const conwayGeometry = new AP214GeometryExtraction(conwaywasm, model);
|
|
356
|
+
// Deferred mode (createDeferred): build the assembly tree and the
|
|
357
|
+
// ordered unit list but execute nothing — the batch pump populates
|
|
358
|
+
// the scene progressively. `scene` is the same object the deferred
|
|
359
|
+
// capture walks, so meshes appear to consumers as units extract.
|
|
360
|
+
if (deferGeometry) {
|
|
361
|
+
conwayGeometry.prepareDemandExtraction();
|
|
362
|
+
return {
|
|
363
|
+
conwaywasm,
|
|
364
|
+
deferred: true,
|
|
365
|
+
previewCoordinationMatrix: previewChannel?.coordinationMatrix,
|
|
366
|
+
allTimeStart,
|
|
367
|
+
stepHeader,
|
|
368
|
+
model,
|
|
369
|
+
scene: conwayGeometry.scene,
|
|
370
|
+
conwayGeometry,
|
|
371
|
+
geometryTimeInMs: 0,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
// Heartbeat only: the AP214 thunk-tree extraction has no flat
|
|
375
|
+
// product loop to tick from yet.
|
|
376
|
+
tracker?.beginPhase("geometry", "products");
|
|
377
|
+
const startTime = Date.now();
|
|
378
|
+
const [extractionResult, scene] = conwayGeometry.extractAP214GeometryData();
|
|
379
|
+
const endTime = Date.now();
|
|
380
|
+
tracker?.endPhase();
|
|
381
|
+
if (extractionResult !== ExtractResult.COMPLETE) {
|
|
382
|
+
Logger.error("[OpenModelStreamed]: Error extracting geometry, exiting...");
|
|
383
|
+
statistics?.setLoadStatus("FAIL");
|
|
384
|
+
throw new Error("Couldn't extract model");
|
|
385
|
+
}
|
|
386
|
+
statistics?.setGeometryTypeCounts(conwayGeometry.geometryTypeCounts);
|
|
387
|
+
return {
|
|
388
|
+
conwaywasm,
|
|
389
|
+
allTimeStart,
|
|
390
|
+
stepHeader,
|
|
391
|
+
model,
|
|
392
|
+
scene,
|
|
393
|
+
conwayGeometry,
|
|
394
|
+
geometryTimeInMs: endTime - startTime,
|
|
395
|
+
};
|
|
396
|
+
}
|
|
223
397
|
/**
|
|
224
398
|
* Log + record the header parse result on the model statistics.
|
|
225
399
|
*
|
|
@@ -704,7 +878,193 @@ export class IfcApiProxyAP214 {
|
|
|
704
878
|
* @param modelID
|
|
705
879
|
* @param meshCallback
|
|
706
880
|
*/
|
|
881
|
+
/**
|
|
882
|
+
* Deferred-mode unit pump (STEP demand parity phase 2; conway
|
|
883
|
+
* extension consumed through ExtractGeometryBatch): execute the next
|
|
884
|
+
* `batchSize` assembly-tree units and emit THIS BATCH's meshes as
|
|
885
|
+
* per-entity DELTA FlatMeshes — the AP214 twin of the IFC proxy's
|
|
886
|
+
* pump, same delta contract. On a fully-extracted model this is a
|
|
887
|
+
* no-op returning remaining 0.
|
|
888
|
+
*
|
|
889
|
+
* @param batchSize Max units to execute this call (min 1).
|
|
890
|
+
* @param meshCallback Receives each newly-captured delta mesh.
|
|
891
|
+
* @return {object} `{extracted, remaining}` — units executed this
|
|
892
|
+
* call and units still pending.
|
|
893
|
+
*/
|
|
894
|
+
extractGeometryBatch(batchSize, meshCallback) {
|
|
895
|
+
if (!this.deferredMode_) {
|
|
896
|
+
return { extracted: 0, remaining: 0 };
|
|
897
|
+
}
|
|
898
|
+
const extraction = this.conwayGeometry_;
|
|
899
|
+
// Consumers tune batchSize for IFC's fine-grained products (Share
|
|
900
|
+
// pumps 64); AP214 units are whole parts/subassemblies — orders of
|
|
901
|
+
// magnitude chunkier (Arty: ~57 units for ~12s of geometry). Scale
|
|
902
|
+
// the requested batch down so STEP loads stay progressive without
|
|
903
|
+
// any consumer knowing the schema.
|
|
904
|
+
const units = Math.max(1, Math.floor(batchSize / AP214_UNITS_PER_PRODUCT_BATCH));
|
|
905
|
+
const extracted = extraction.extractDemandUnitBatch(units);
|
|
906
|
+
const remaining = extraction.demandUnitCount - extraction.demandUnitCursor;
|
|
907
|
+
if (remaining === 0 && !this.demandFinished_) {
|
|
908
|
+
this.demandFinished_ = true;
|
|
909
|
+
extraction.finishDemandExtraction();
|
|
910
|
+
}
|
|
911
|
+
if (meshCallback !== void 0) {
|
|
912
|
+
this.streamNewMeshes_(meshCallback);
|
|
913
|
+
}
|
|
914
|
+
return { extracted, remaining };
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Walk the scene and emit every not-yet-captured placed instance as
|
|
918
|
+
* per-entity DELTA FlatMeshes — the incremental core of
|
|
919
|
+
* streamAllMeshes with identical placed-geometry math (bare
|
|
920
|
+
* coordination x nativeTransform composition, occurrence paths),
|
|
921
|
+
* processed in walk order exactly once per instance. The shared
|
|
922
|
+
* meshMap accumulates each entity's FULL vector so getFlatMesh stays
|
|
923
|
+
* whole-model correct; the derived coordination matrix is remembered
|
|
924
|
+
* across calls (demandCoordination_) without leaking through
|
|
925
|
+
* getCoordinationMatrix (classic identity contract).
|
|
926
|
+
*
|
|
927
|
+
* @param meshCallback Receives one delta FlatMesh per entity that
|
|
928
|
+
* gained instances this call.
|
|
929
|
+
*/
|
|
930
|
+
streamNewMeshes_(meshCallback) {
|
|
931
|
+
const [model, scene, meshMap, geometryMaterialTransformMap] = this.model;
|
|
932
|
+
let coordinationMatrix = this.demandCoordination_ ?? glmatrix.mat4.create();
|
|
933
|
+
const seenThisPass = new Map();
|
|
934
|
+
const deltas = new Map();
|
|
935
|
+
const deltaExpressIDs = new Map();
|
|
936
|
+
// eslint-disable-next-line no-unused-vars
|
|
937
|
+
for (const [_, nativeTransform, geometry, material, entity, occurrencePath] of scene.walkWithOccurrence()) {
|
|
938
|
+
if (entity?.localID === void 0 || entity.expressID === void 0) {
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
const walkIndex = seenThisPass.get(entity.localID) ?? 0;
|
|
942
|
+
seenThisPass.set(entity.localID, walkIndex + 1);
|
|
943
|
+
if (walkIndex < (this.demandCapturedCounts_.get(entity.localID) ?? 0)) {
|
|
944
|
+
continue;
|
|
945
|
+
}
|
|
946
|
+
this.demandCapturedCounts_.set(entity.localID, walkIndex + 1);
|
|
947
|
+
if (geometry.type !== CanonicalMeshType.BUFFER_GEOMETRY || geometry.temporary) {
|
|
948
|
+
continue;
|
|
949
|
+
}
|
|
950
|
+
const material_ = material ?? {
|
|
951
|
+
name: "",
|
|
952
|
+
// eslint-disable-next-line no-magic-numbers
|
|
953
|
+
baseColor: [0.8, 0.8, 0.8, 1],
|
|
954
|
+
// eslint-disable-next-line no-magic-numbers
|
|
955
|
+
legacyColor: [0.8, 0.8, 0.8, 1],
|
|
956
|
+
doubleSided: true,
|
|
957
|
+
blend: 0,
|
|
958
|
+
};
|
|
959
|
+
let nativePt;
|
|
960
|
+
if (!this._isCoordinated && this.settings?.COORDINATE_TO_ORIGIN) {
|
|
961
|
+
nativePt = geometry.geometry.getPoint(0);
|
|
962
|
+
}
|
|
963
|
+
const expressID = model.getElementByLocalID(geometry.localID)?.expressID;
|
|
964
|
+
const geometryTransform = nativeTransform?.getValues();
|
|
965
|
+
let newMatrix;
|
|
966
|
+
if (geometryTransform !== void 0) {
|
|
967
|
+
newMatrix = glmatrix.mat4.fromValues(...geometryTransform);
|
|
968
|
+
}
|
|
969
|
+
else {
|
|
970
|
+
newMatrix = glmatrix.mat4.create();
|
|
971
|
+
}
|
|
972
|
+
if (!this._isCoordinated && this.settings?.COORDINATE_TO_ORIGIN) {
|
|
973
|
+
const transformedPt = glmatrix.vec4.create();
|
|
974
|
+
glmatrix.vec4.transformMat4(transformedPt, [nativePt.x, nativePt.y, nativePt.z, 1], newMatrix);
|
|
975
|
+
coordinationMatrix = glmatrix.mat4.create();
|
|
976
|
+
glmatrix.mat4.fromTranslation(coordinationMatrix, [-transformedPt[0], -transformedPt[1], -transformedPt[2]]);
|
|
977
|
+
const scaleMatrix = glmatrix.mat4.create();
|
|
978
|
+
const scaleVec = glmatrix.vec3.fromValues(this.linearScalingFactor, this.linearScalingFactor, this.linearScalingFactor);
|
|
979
|
+
glmatrix.mat4.scale(scaleMatrix, scaleMatrix, scaleVec);
|
|
980
|
+
glmatrix.mat4.multiply(coordinationMatrix, this.NormalizeMat, coordinationMatrix);
|
|
981
|
+
glmatrix.mat4.multiply(coordinationMatrix, scaleMatrix, coordinationMatrix);
|
|
982
|
+
this.demandCoordination_ = coordinationMatrix;
|
|
983
|
+
this._isCoordinated = true;
|
|
984
|
+
}
|
|
985
|
+
// Bare composition — no per-leaf recenter (issue #308: AP214
|
|
986
|
+
// instances share one geometry buffer), matching streamAllMeshes.
|
|
987
|
+
const newTransform = glmatrix.mat4.create();
|
|
988
|
+
glmatrix.mat4.multiply(newTransform, coordinationMatrix, newMatrix);
|
|
989
|
+
const newTransformArr = Array.from(newTransform);
|
|
990
|
+
geometryMaterialTransformMap.set(expressID, [geometry.geometry, material_, newTransformArr]);
|
|
991
|
+
const color = {
|
|
992
|
+
x: material_.legacyColor[0],
|
|
993
|
+
y: material_.legacyColor[1],
|
|
994
|
+
z: material_.legacyColor[2],
|
|
995
|
+
w: material_.legacyColor[3],
|
|
996
|
+
};
|
|
997
|
+
const placed = {
|
|
998
|
+
color,
|
|
999
|
+
geometryExpressID: expressID,
|
|
1000
|
+
flatTransformation: newTransformArr,
|
|
1001
|
+
occurrencePath,
|
|
1002
|
+
};
|
|
1003
|
+
let mesh = meshMap.get(entity.localID);
|
|
1004
|
+
if (mesh === void 0) {
|
|
1005
|
+
const placedArray = new Array();
|
|
1006
|
+
const placedVector = {
|
|
1007
|
+
get: (index) => placedArray[index] ?? placed,
|
|
1008
|
+
size: () => placedArray.length,
|
|
1009
|
+
push: (parameter) => {
|
|
1010
|
+
placedArray.push(parameter);
|
|
1011
|
+
},
|
|
1012
|
+
};
|
|
1013
|
+
const flatMesh = {
|
|
1014
|
+
geometries: placedVector,
|
|
1015
|
+
expressID: entity.expressID,
|
|
1016
|
+
};
|
|
1017
|
+
mesh = [placedVector, flatMesh];
|
|
1018
|
+
meshMap.set(entity.localID, mesh);
|
|
1019
|
+
}
|
|
1020
|
+
mesh[0].push(placed);
|
|
1021
|
+
mesh[1].geometries = mesh[0];
|
|
1022
|
+
let delta = deltas.get(entity.localID);
|
|
1023
|
+
if (delta === void 0) {
|
|
1024
|
+
delta = [];
|
|
1025
|
+
deltas.set(entity.localID, delta);
|
|
1026
|
+
deltaExpressIDs.set(entity.localID, entity.expressID);
|
|
1027
|
+
}
|
|
1028
|
+
delta.push(placed);
|
|
1029
|
+
}
|
|
1030
|
+
const vectorFlatMesh = this.model[4];
|
|
1031
|
+
for (const [localID, placedList] of deltas) {
|
|
1032
|
+
const placedVector = {
|
|
1033
|
+
get: (index) => placedList[index] ?? placedList[0],
|
|
1034
|
+
size: () => placedList.length,
|
|
1035
|
+
push: (parameter) => {
|
|
1036
|
+
placedList.push(parameter);
|
|
1037
|
+
},
|
|
1038
|
+
};
|
|
1039
|
+
const deltaMesh = {
|
|
1040
|
+
geometries: placedVector,
|
|
1041
|
+
expressID: deltaExpressIDs.get(localID),
|
|
1042
|
+
};
|
|
1043
|
+
vectorFlatMesh.push(deltaMesh);
|
|
1044
|
+
meshCallback(deltaMesh);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
*
|
|
1049
|
+
* @param meshCallback
|
|
1050
|
+
*/
|
|
707
1051
|
streamAllMeshes(meshCallback) {
|
|
1052
|
+
// Deferred models: pump any remainder to completion and serve the
|
|
1053
|
+
// accumulated full per-entity meshes — re-running the classic walk
|
|
1054
|
+
// would push every instance a second time (mirrors the IFC proxy).
|
|
1055
|
+
if (this.deferredMode_) {
|
|
1056
|
+
const noCallback = void 0;
|
|
1057
|
+
while (this.extractGeometryBatch(DEFERRED_DRAIN_BATCH_AP214, noCallback).remaining > 0) {
|
|
1058
|
+
// draining
|
|
1059
|
+
}
|
|
1060
|
+
this.streamNewMeshes_(() => { });
|
|
1061
|
+
const [, , meshMap, , vectorFlatMesh] = this.model;
|
|
1062
|
+
meshMap.forEach((mesh) => {
|
|
1063
|
+
vectorFlatMesh.push(mesh[1]);
|
|
1064
|
+
meshCallback(mesh[1]);
|
|
1065
|
+
});
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
708
1068
|
const [model, scene, meshMap, geometryMaterialTransformMap, vectorFlatMesh] = this.model;
|
|
709
1069
|
let coordinationMatrix = this.model[5];
|
|
710
1070
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -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;
|
|
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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I,MAAM,CAAC,QAAQ,CAAC;IA0RnC;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ;IAqDxC;;;;;OAKG;IACH,4BAA4B,IAAI,IAAI;CAwBrC"}
|
|
@@ -11,7 +11,7 @@ import ParsingBuffer from "../../parsing/parsing_buffer.js";
|
|
|
11
11
|
import { BufferByteSource } from "../../step/parsing/byte_source.js";
|
|
12
12
|
import { buildIndexStreamingAsync, } from "../../step/parsing/streaming_index_builder.js";
|
|
13
13
|
import { ColumnarIndexSink } from "../../step/parsing/columnar_index.js";
|
|
14
|
-
import { StreamedPreviewChannel } from "./streamed_preview_channel.js";
|
|
14
|
+
import { ifcPreviewAdapter, StreamedPreviewChannel, } from "./streamed_preview_channel.js";
|
|
15
15
|
import { ExtractResult } from "../../index.js";
|
|
16
16
|
import { IfcGeometryExtraction } from "../../ifc/ifc_geometry_extraction.js";
|
|
17
17
|
import { ParseResult } from "../../index.js";
|
|
@@ -467,7 +467,7 @@ export class IfcApiProxyIfc {
|
|
|
467
467
|
// and snapshot prefix models between the parse's cooperative yields.
|
|
468
468
|
const sink = new ColumnarIndexSink();
|
|
469
469
|
const previewChannel = deferGeometry && settings?.ON_PREVIEW_MESH !== void 0 ?
|
|
470
|
-
new StreamedPreviewChannel(data, conwaywasm, sink, settings.COORDINATE_TO_ORIGIN === true, settings.ON_PREVIEW_MESH) : void 0;
|
|
470
|
+
new StreamedPreviewChannel(data, conwaywasm, sink, ifcPreviewAdapter(), settings.COORDINATE_TO_ORIGIN === true, settings.ON_PREVIEW_MESH) : void 0;
|
|
471
471
|
previewChannel?.start();
|
|
472
472
|
let result;
|
|
473
473
|
try {
|