@bldrs-ai/conway 1.424.1275 → 1.426.1283
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 +56 -1
- package/compiled/examples/cli-bundled.cjs +56 -1
- package/compiled/examples/cli-step-bundled.cjs +15 -1
- package/compiled/examples/validator-bundled.cjs +56 -1
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +20 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +7 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +66 -9
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +185 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +40 -8
- 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 +115 -28
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +130 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.js +335 -0
- package/compiled/src/core/progress.d.ts +8 -1
- package/compiled/src/core/progress.d.ts.map +1 -1
- package/compiled/src/core/progress.js +22 -1
- package/compiled/src/core/progress.test.js +11 -2
- package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_model_geometry.js +15 -0
- package/compiled/src/step/parsing/columnar_index.d.ts +22 -0
- package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -1
- package/compiled/src/step/parsing/columnar_index.js +26 -0
- 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.426.1283";
|
|
34
34
|
|
|
35
35
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
36
|
var wasmType = "";
|
|
@@ -584,6 +584,20 @@ var environment_default = Environment;
|
|
|
584
584
|
|
|
585
585
|
// compiled/src/core/progress.js
|
|
586
586
|
function yieldToEventLoop() {
|
|
587
|
+
const scheduler = globalThis.scheduler;
|
|
588
|
+
if (typeof scheduler?.yield === "function") {
|
|
589
|
+
return scheduler.yield();
|
|
590
|
+
}
|
|
591
|
+
if (typeof MessageChannel === "function") {
|
|
592
|
+
return new Promise((resolve) => {
|
|
593
|
+
const channel = new MessageChannel();
|
|
594
|
+
channel.port1.onmessage = () => {
|
|
595
|
+
channel.port1.close();
|
|
596
|
+
resolve();
|
|
597
|
+
};
|
|
598
|
+
channel.port2.postMessage(null);
|
|
599
|
+
});
|
|
600
|
+
}
|
|
587
601
|
return new Promise((resolve) => {
|
|
588
602
|
setTimeout(resolve, 0);
|
|
589
603
|
});
|
|
@@ -70412,9 +70426,24 @@ var IfcModelGeometry = class {
|
|
|
70412
70426
|
/**
|
|
70413
70427
|
* Add a mesh to the geometry cache.
|
|
70414
70428
|
*
|
|
70429
|
+
* Freezes the native float vertex mirror at add time (one
|
|
70430
|
+
* GetVertexData call): consumers (the compat GetGeometry surface)
|
|
70431
|
+
* read float vertices whose frame must match the scene transforms,
|
|
70432
|
+
* which are authored against the geometry AS CREATED. Later native
|
|
70433
|
+
* mutations that keep the vertex count (normalize's centering)
|
|
70434
|
+
* deliberately do NOT refresh the mirror, so every extraction path —
|
|
70435
|
+
* whole-model walk, per-product demand pump, parse-time preview —
|
|
70436
|
+
* serves the same creation-frame floats. Without this, paths that
|
|
70437
|
+
* first read vertices only after a centering mutation serve
|
|
70438
|
+
* per-geometry-shifted vertices against unshifted transforms
|
|
70439
|
+
* (Share's demand-path "scatter").
|
|
70440
|
+
*
|
|
70415
70441
|
* @param mesh
|
|
70416
70442
|
*/
|
|
70417
70443
|
add(mesh) {
|
|
70444
|
+
if (mesh.type === CanonicalMeshType.BUFFER_GEOMETRY) {
|
|
70445
|
+
mesh.geometry.GetVertexData();
|
|
70446
|
+
}
|
|
70418
70447
|
this.meshes_.set(mesh.localID, mesh);
|
|
70419
70448
|
}
|
|
70420
70449
|
/**
|
|
@@ -70969,6 +70998,23 @@ var ColumnarIndexSink = class {
|
|
|
70969
70998
|
this.expressIdsSorted_ = true;
|
|
70970
70999
|
this.previousExpressID_ = 0;
|
|
70971
71000
|
}
|
|
71001
|
+
/**
|
|
71002
|
+
* Snapshot the columns pushed SO FAR into a self-contained prefix index,
|
|
71003
|
+
* without disturbing the sink — the parse can keep pushing afterwards and
|
|
71004
|
+
* a later snapshot/finalize sees the full data. Safe to call between the
|
|
71005
|
+
* cooperative parse's yields (the parser only suspends at top-level
|
|
71006
|
+
* record boundaries, where the sink is consistent). Top-level localIDs
|
|
71007
|
+
* are stable across snapshots (dense parse order), so consumers can carry
|
|
71008
|
+
* per-localID cursors from one snapshot to the next; inline-range
|
|
71009
|
+
* localIDs are NOT stable (the inline tail re-packs after the growing
|
|
71010
|
+
* top-level range) and must not be carried across snapshots.
|
|
71011
|
+
*
|
|
71012
|
+
* @return {StepIndexColumns} A prefix columnar index over the records
|
|
71013
|
+
* pushed so far.
|
|
71014
|
+
*/
|
|
71015
|
+
snapshot() {
|
|
71016
|
+
return this.assemble_();
|
|
71017
|
+
}
|
|
70972
71018
|
/**
|
|
70973
71019
|
* Assemble the final columns: concatenate the top-level segments (one
|
|
70974
71020
|
* column at a time, bounding transient overhead to a single column's
|
|
@@ -70978,6 +71024,15 @@ var ColumnarIndexSink = class {
|
|
|
70978
71024
|
* @return {StepIndexColumns} The finished columnar index.
|
|
70979
71025
|
*/
|
|
70980
71026
|
finalize() {
|
|
71027
|
+
return this.assemble_();
|
|
71028
|
+
}
|
|
71029
|
+
/**
|
|
71030
|
+
* Shared assembly behind {@link snapshot} and {@link finalize} — pure
|
|
71031
|
+
* over the sink's current state.
|
|
71032
|
+
*
|
|
71033
|
+
* @return {StepIndexColumns} The assembled columnar index.
|
|
71034
|
+
*/
|
|
71035
|
+
assemble_() {
|
|
70981
71036
|
const topLevel = this.count_;
|
|
70982
71037
|
const unfolded = [];
|
|
70983
71038
|
for (const entry of this.retained_.values()) {
|
|
@@ -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.426.1283";
|
|
14969
14969
|
|
|
14970
14970
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
14971
14971
|
function pThreadsAllowed() {
|
|
@@ -16310,6 +16310,20 @@ var Memory = class {
|
|
|
16310
16310
|
// compiled/src/core/progress.js
|
|
16311
16311
|
var DEFAULT_PROGRESS_INTERVAL_MS = 100;
|
|
16312
16312
|
function yieldToEventLoop() {
|
|
16313
|
+
const scheduler = globalThis.scheduler;
|
|
16314
|
+
if (typeof scheduler?.yield === "function") {
|
|
16315
|
+
return scheduler.yield();
|
|
16316
|
+
}
|
|
16317
|
+
if (typeof MessageChannel === "function") {
|
|
16318
|
+
return new Promise((resolve) => {
|
|
16319
|
+
const channel = new MessageChannel();
|
|
16320
|
+
channel.port1.onmessage = () => {
|
|
16321
|
+
channel.port1.close();
|
|
16322
|
+
resolve();
|
|
16323
|
+
};
|
|
16324
|
+
channel.port2.postMessage(null);
|
|
16325
|
+
});
|
|
16326
|
+
}
|
|
16313
16327
|
return new Promise((resolve) => {
|
|
16314
16328
|
setTimeout(resolve, 0);
|
|
16315
16329
|
});
|
|
@@ -86257,9 +86271,24 @@ var IfcModelGeometry = class {
|
|
|
86257
86271
|
/**
|
|
86258
86272
|
* Add a mesh to the geometry cache.
|
|
86259
86273
|
*
|
|
86274
|
+
* Freezes the native float vertex mirror at add time (one
|
|
86275
|
+
* GetVertexData call): consumers (the compat GetGeometry surface)
|
|
86276
|
+
* read float vertices whose frame must match the scene transforms,
|
|
86277
|
+
* which are authored against the geometry AS CREATED. Later native
|
|
86278
|
+
* mutations that keep the vertex count (normalize's centering)
|
|
86279
|
+
* deliberately do NOT refresh the mirror, so every extraction path —
|
|
86280
|
+
* whole-model walk, per-product demand pump, parse-time preview —
|
|
86281
|
+
* serves the same creation-frame floats. Without this, paths that
|
|
86282
|
+
* first read vertices only after a centering mutation serve
|
|
86283
|
+
* per-geometry-shifted vertices against unshifted transforms
|
|
86284
|
+
* (Share's demand-path "scatter").
|
|
86285
|
+
*
|
|
86260
86286
|
* @param mesh
|
|
86261
86287
|
*/
|
|
86262
86288
|
add(mesh) {
|
|
86289
|
+
if (mesh.type === CanonicalMeshType.BUFFER_GEOMETRY) {
|
|
86290
|
+
mesh.geometry.GetVertexData();
|
|
86291
|
+
}
|
|
86263
86292
|
this.meshes_.set(mesh.localID, mesh);
|
|
86264
86293
|
}
|
|
86265
86294
|
/**
|
|
@@ -86814,6 +86843,23 @@ var ColumnarIndexSink = class {
|
|
|
86814
86843
|
this.expressIdsSorted_ = true;
|
|
86815
86844
|
this.previousExpressID_ = 0;
|
|
86816
86845
|
}
|
|
86846
|
+
/**
|
|
86847
|
+
* Snapshot the columns pushed SO FAR into a self-contained prefix index,
|
|
86848
|
+
* without disturbing the sink — the parse can keep pushing afterwards and
|
|
86849
|
+
* a later snapshot/finalize sees the full data. Safe to call between the
|
|
86850
|
+
* cooperative parse's yields (the parser only suspends at top-level
|
|
86851
|
+
* record boundaries, where the sink is consistent). Top-level localIDs
|
|
86852
|
+
* are stable across snapshots (dense parse order), so consumers can carry
|
|
86853
|
+
* per-localID cursors from one snapshot to the next; inline-range
|
|
86854
|
+
* localIDs are NOT stable (the inline tail re-packs after the growing
|
|
86855
|
+
* top-level range) and must not be carried across snapshots.
|
|
86856
|
+
*
|
|
86857
|
+
* @return {StepIndexColumns} A prefix columnar index over the records
|
|
86858
|
+
* pushed so far.
|
|
86859
|
+
*/
|
|
86860
|
+
snapshot() {
|
|
86861
|
+
return this.assemble_();
|
|
86862
|
+
}
|
|
86817
86863
|
/**
|
|
86818
86864
|
* Assemble the final columns: concatenate the top-level segments (one
|
|
86819
86865
|
* column at a time, bounding transient overhead to a single column's
|
|
@@ -86823,6 +86869,15 @@ var ColumnarIndexSink = class {
|
|
|
86823
86869
|
* @return {StepIndexColumns} The finished columnar index.
|
|
86824
86870
|
*/
|
|
86825
86871
|
finalize() {
|
|
86872
|
+
return this.assemble_();
|
|
86873
|
+
}
|
|
86874
|
+
/**
|
|
86875
|
+
* Shared assembly behind {@link snapshot} and {@link finalize} — pure
|
|
86876
|
+
* over the sink's current state.
|
|
86877
|
+
*
|
|
86878
|
+
* @return {StepIndexColumns} The assembled columnar index.
|
|
86879
|
+
*/
|
|
86880
|
+
assemble_() {
|
|
86826
86881
|
const topLevel = this.count_;
|
|
86827
86882
|
const unfolded = [];
|
|
86828
86883
|
for (const entry of this.retained_.values()) {
|
|
@@ -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.426.1283";
|
|
15947
15947
|
|
|
15948
15948
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
15949
15949
|
function pThreadsAllowed() {
|
|
@@ -17287,6 +17287,20 @@ var Memory = class {
|
|
|
17287
17287
|
|
|
17288
17288
|
// compiled/src/core/progress.js
|
|
17289
17289
|
function yieldToEventLoop() {
|
|
17290
|
+
const scheduler = globalThis.scheduler;
|
|
17291
|
+
if (typeof scheduler?.yield === "function") {
|
|
17292
|
+
return scheduler.yield();
|
|
17293
|
+
}
|
|
17294
|
+
if (typeof MessageChannel === "function") {
|
|
17295
|
+
return new Promise((resolve) => {
|
|
17296
|
+
const channel = new MessageChannel();
|
|
17297
|
+
channel.port1.onmessage = () => {
|
|
17298
|
+
channel.port1.close();
|
|
17299
|
+
resolve();
|
|
17300
|
+
};
|
|
17301
|
+
channel.port2.postMessage(null);
|
|
17302
|
+
});
|
|
17303
|
+
}
|
|
17290
17304
|
return new Promise((resolve) => {
|
|
17291
17305
|
setTimeout(resolve, 0);
|
|
17292
17306
|
});
|
|
@@ -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.426.1283";
|
|
948
948
|
|
|
949
949
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
950
950
|
var wasmType = "";
|
|
@@ -1498,6 +1498,20 @@ var environment_default = Environment;
|
|
|
1498
1498
|
|
|
1499
1499
|
// compiled/src/core/progress.js
|
|
1500
1500
|
function yieldToEventLoop() {
|
|
1501
|
+
const scheduler = globalThis.scheduler;
|
|
1502
|
+
if (typeof scheduler?.yield === "function") {
|
|
1503
|
+
return scheduler.yield();
|
|
1504
|
+
}
|
|
1505
|
+
if (typeof MessageChannel === "function") {
|
|
1506
|
+
return new Promise((resolve) => {
|
|
1507
|
+
const channel = new MessageChannel();
|
|
1508
|
+
channel.port1.onmessage = () => {
|
|
1509
|
+
channel.port1.close();
|
|
1510
|
+
resolve();
|
|
1511
|
+
};
|
|
1512
|
+
channel.port2.postMessage(null);
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1501
1515
|
return new Promise((resolve) => {
|
|
1502
1516
|
setTimeout(resolve, 0);
|
|
1503
1517
|
});
|
|
@@ -70410,9 +70424,24 @@ var IfcModelGeometry = class {
|
|
|
70410
70424
|
/**
|
|
70411
70425
|
* Add a mesh to the geometry cache.
|
|
70412
70426
|
*
|
|
70427
|
+
* Freezes the native float vertex mirror at add time (one
|
|
70428
|
+
* GetVertexData call): consumers (the compat GetGeometry surface)
|
|
70429
|
+
* read float vertices whose frame must match the scene transforms,
|
|
70430
|
+
* which are authored against the geometry AS CREATED. Later native
|
|
70431
|
+
* mutations that keep the vertex count (normalize's centering)
|
|
70432
|
+
* deliberately do NOT refresh the mirror, so every extraction path —
|
|
70433
|
+
* whole-model walk, per-product demand pump, parse-time preview —
|
|
70434
|
+
* serves the same creation-frame floats. Without this, paths that
|
|
70435
|
+
* first read vertices only after a centering mutation serve
|
|
70436
|
+
* per-geometry-shifted vertices against unshifted transforms
|
|
70437
|
+
* (Share's demand-path "scatter").
|
|
70438
|
+
*
|
|
70413
70439
|
* @param mesh
|
|
70414
70440
|
*/
|
|
70415
70441
|
add(mesh) {
|
|
70442
|
+
if (mesh.type === CanonicalMeshType.BUFFER_GEOMETRY) {
|
|
70443
|
+
mesh.geometry.GetVertexData();
|
|
70444
|
+
}
|
|
70416
70445
|
this.meshes_.set(mesh.localID, mesh);
|
|
70417
70446
|
}
|
|
70418
70447
|
/**
|
|
@@ -70967,6 +70996,23 @@ var ColumnarIndexSink = class {
|
|
|
70967
70996
|
this.expressIdsSorted_ = true;
|
|
70968
70997
|
this.previousExpressID_ = 0;
|
|
70969
70998
|
}
|
|
70999
|
+
/**
|
|
71000
|
+
* Snapshot the columns pushed SO FAR into a self-contained prefix index,
|
|
71001
|
+
* without disturbing the sink — the parse can keep pushing afterwards and
|
|
71002
|
+
* a later snapshot/finalize sees the full data. Safe to call between the
|
|
71003
|
+
* cooperative parse's yields (the parser only suspends at top-level
|
|
71004
|
+
* record boundaries, where the sink is consistent). Top-level localIDs
|
|
71005
|
+
* are stable across snapshots (dense parse order), so consumers can carry
|
|
71006
|
+
* per-localID cursors from one snapshot to the next; inline-range
|
|
71007
|
+
* localIDs are NOT stable (the inline tail re-packs after the growing
|
|
71008
|
+
* top-level range) and must not be carried across snapshots.
|
|
71009
|
+
*
|
|
71010
|
+
* @return {StepIndexColumns} A prefix columnar index over the records
|
|
71011
|
+
* pushed so far.
|
|
71012
|
+
*/
|
|
71013
|
+
snapshot() {
|
|
71014
|
+
return this.assemble_();
|
|
71015
|
+
}
|
|
70970
71016
|
/**
|
|
70971
71017
|
* Assemble the final columns: concatenate the top-level segments (one
|
|
70972
71018
|
* column at a time, bounding transient overhead to a single column's
|
|
@@ -70976,6 +71022,15 @@ var ColumnarIndexSink = class {
|
|
|
70976
71022
|
* @return {StepIndexColumns} The finished columnar index.
|
|
70977
71023
|
*/
|
|
70978
71024
|
finalize() {
|
|
71025
|
+
return this.assemble_();
|
|
71026
|
+
}
|
|
71027
|
+
/**
|
|
71028
|
+
* Shared assembly behind {@link snapshot} and {@link finalize} — pure
|
|
71029
|
+
* over the sink's current state.
|
|
71030
|
+
*
|
|
71031
|
+
* @return {StepIndexColumns} The assembled columnar index.
|
|
71032
|
+
*/
|
|
71033
|
+
assemble_() {
|
|
70979
71034
|
const topLevel = this.count_;
|
|
70980
71035
|
const unfolded = [];
|
|
70981
71036
|
for (const entry of this.retained_.values()) {
|
|
@@ -5,6 +5,8 @@ import * as glmatrix from "gl-matrix";
|
|
|
5
5
|
import { StepExternalByteStore } from "../../step/step_buffer_provider.js";
|
|
6
6
|
import { IfcApiModelPassthrough } from "./ifc_api_model_passthrough.js";
|
|
7
7
|
import { Properties } from "./properties.js";
|
|
8
|
+
import type { PreviewMeshPayload } from "./streamed_preview_channel.js";
|
|
9
|
+
export type { PreviewMeshPayload } from "./streamed_preview_channel.js";
|
|
8
10
|
export * from "./ifc2x4.js";
|
|
9
11
|
export declare const UNKNOWN = 0;
|
|
10
12
|
export declare const STRING = 1;
|
|
@@ -47,6 +49,17 @@ export interface Loadersettings {
|
|
|
47
49
|
* classic open paths and by the internal streamed→classic fallback.
|
|
48
50
|
*/
|
|
49
51
|
DEFER_GEOMETRY?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Conway extension (OpenModelStreamed + DEFER_GEOMETRY only; demand/tiled
|
|
54
|
+
* rendering slice A2): receive PREVIEW mesh payloads while the parse is
|
|
55
|
+
* still running — self-contained (geometry copied out of the wasm heap),
|
|
56
|
+
* so they can be uploaded before the model exists. Preview quality:
|
|
57
|
+
* relationship records (voids, materials) live near the end of real IFC
|
|
58
|
+
* files, so previews can miss openings/materials; the durable batch pump
|
|
59
|
+
* re-extracts every product after the parse and REPLACES the preview.
|
|
60
|
+
* Consumers must treat these as disposable. Ignored everywhere else.
|
|
61
|
+
*/
|
|
62
|
+
ON_PREVIEW_MESH?: (mesh: PreviewMeshPayload) => void;
|
|
50
63
|
}
|
|
51
64
|
/**
|
|
52
65
|
* web-ifc compatible log levels (numeric values match web-ifc's enum so an
|
|
@@ -359,6 +372,13 @@ export declare class IfcAPI {
|
|
|
359
372
|
* `typeof api.ExtractGeometryBatch === 'function'`; call repeatedly
|
|
360
373
|
* until `remaining` is 0.
|
|
361
374
|
*
|
|
375
|
+
* DELTA CONTRACT: an entity may be emitted again in a LATER call with
|
|
376
|
+
* a FlatMesh containing only its NEW placed instances (shared/mapped
|
|
377
|
+
* geometry attributes instances to an entity from other products'
|
|
378
|
+
* extractions). Consumers must render/accumulate deltas additively —
|
|
379
|
+
* never key emissions by expressID with overwrite semantics. Each
|
|
380
|
+
* placed instance is emitted exactly once across all calls.
|
|
381
|
+
*
|
|
362
382
|
* @param modelID handle retrieved by OpenModelStreamed
|
|
363
383
|
* @param batchSize max products to extract this call
|
|
364
384
|
* @param meshCallback receives each newly-extracted product's mesh
|
|
@@ -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,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S,EAAE,MAAM,CAAA;KAAC;IAWrF;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAc9E;;;;;OAKG;IACH,wBAAwB,CAAC,OAAO,EAAE,MAAM,EACpC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IASjD;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAQrC;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAsElD;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ;IA6CzD;;;;;OAKG;IACH,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAyBtD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,UAAQ;IAM1C,sDAAsD;IACtD,gBAAgB,IAAI,MAAM;IAI1B,2FAA2F;IAC3F,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG;CAGpC"}
|
|
@@ -555,6 +555,13 @@ export class IfcAPI {
|
|
|
555
555
|
* `typeof api.ExtractGeometryBatch === 'function'`; call repeatedly
|
|
556
556
|
* until `remaining` is 0.
|
|
557
557
|
*
|
|
558
|
+
* DELTA CONTRACT: an entity may be emitted again in a LATER call with
|
|
559
|
+
* a FlatMesh containing only its NEW placed instances (shared/mapped
|
|
560
|
+
* geometry attributes instances to an entity from other products'
|
|
561
|
+
* extractions). Consumers must render/accumulate deltas additively —
|
|
562
|
+
* never key emissions by expressID with overwrite semantics. Each
|
|
563
|
+
* placed instance is emitted exactly once across all calls.
|
|
564
|
+
*
|
|
558
565
|
* @param modelID handle retrieved by OpenModelStreamed
|
|
559
566
|
* @param batchSize max products to extract this call
|
|
560
567
|
* @param meshCallback receives each newly-extracted product's mesh
|
|
@@ -17,8 +17,8 @@ let buffer;
|
|
|
17
17
|
* @param mesh The mesh.
|
|
18
18
|
* @return {object} Plain comparable form.
|
|
19
19
|
*/
|
|
20
|
-
function flatten(mesh) {
|
|
21
|
-
const geometries = [];
|
|
20
|
+
function flatten(mesh, previous) {
|
|
21
|
+
const geometries = previous?.geometries ?? [];
|
|
22
22
|
for (let where = 0; where < mesh.geometries.size(); ++where) {
|
|
23
23
|
const placed = mesh.geometries.get(where);
|
|
24
24
|
geometries.push({
|
|
@@ -44,19 +44,15 @@ describe("OpenModelStreamed + DEFER_GEOMETRY", () => {
|
|
|
44
44
|
expect(classic.size).toBeGreaterThan(0);
|
|
45
45
|
const deferredID = await api.OpenModelStreamed(buffer, { ...SETTINGS, DEFER_GEOMETRY: true });
|
|
46
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
47
|
// Pump in deliberately small batches; collect incremental meshes.
|
|
48
|
+
// (Deltas: an entity may re-emit with only its NEW instances —
|
|
49
|
+
// `flatten` accumulation in the map below must be additive.)
|
|
54
50
|
const streamed = new Map();
|
|
55
51
|
let firstBatchCount = 0;
|
|
56
52
|
let rounds = 0;
|
|
57
53
|
for (;;) {
|
|
58
54
|
const { extracted, remaining } = api.ExtractGeometryBatch(deferredID, 7, (mesh) => {
|
|
59
|
-
streamed.set(mesh.expressID, flatten(mesh));
|
|
55
|
+
streamed.set(mesh.expressID, flatten(mesh, streamed.get(mesh.expressID)));
|
|
60
56
|
});
|
|
61
57
|
if (rounds === 0) {
|
|
62
58
|
firstBatchCount = streamed.size;
|
|
@@ -77,6 +73,67 @@ describe("OpenModelStreamed + DEFER_GEOMETRY", () => {
|
|
|
77
73
|
api.CloseModel(classicID);
|
|
78
74
|
api.CloseModel(deferredID);
|
|
79
75
|
}, 240000);
|
|
76
|
+
test("StreamAllMeshes on a deferred model drains the pump and matches classic", async () => {
|
|
77
|
+
const classicID = api.OpenModel(buffer, SETTINGS);
|
|
78
|
+
const classic = new Map();
|
|
79
|
+
api.StreamAllMeshes(classicID, (mesh) => {
|
|
80
|
+
classic.set(mesh.expressID, flatten(mesh));
|
|
81
|
+
});
|
|
82
|
+
const deferredID = await api.OpenModelStreamed(buffer, { ...SETTINGS, DEFER_GEOMETRY: true });
|
|
83
|
+
// No pump calls at all — the whole-model consumer must still get
|
|
84
|
+
// the complete mesh set (the shim drains internally).
|
|
85
|
+
const drained = new Map();
|
|
86
|
+
api.StreamAllMeshes(deferredID, (mesh) => {
|
|
87
|
+
drained.set(mesh.expressID, flatten(mesh));
|
|
88
|
+
});
|
|
89
|
+
expect(drained.size).toBe(classic.size);
|
|
90
|
+
for (const [expressID, mesh] of classic) {
|
|
91
|
+
expect(drained.get(expressID)).toEqual(mesh);
|
|
92
|
+
}
|
|
93
|
+
api.CloseModel(classicID);
|
|
94
|
+
api.CloseModel(deferredID);
|
|
95
|
+
}, 240000);
|
|
96
|
+
test("deferred GetGeometry serves byte-identical vertex content to classic", async () => {
|
|
97
|
+
// The build multiplies GetGeometry FLOAT vertices by captured
|
|
98
|
+
// transforms, and the float mirror's frame must match the scene
|
|
99
|
+
// transforms (frozen at mesh add — see IfcModelGeometry.add). A
|
|
100
|
+
// per-geometry frame shift here renders as scattered pieces even
|
|
101
|
+
// with perfect transform parity, which transform-only assertions
|
|
102
|
+
// cannot catch.
|
|
103
|
+
//
|
|
104
|
+
// Fresh IfcAPI: CloseModel destroys the shared wasm processor, and
|
|
105
|
+
// models opened after ANY close serve empty geometry payloads (a
|
|
106
|
+
// long-standing multi-open shim quirk — browsers open one model per
|
|
107
|
+
// page). The shared `api` has closed models by the time this runs.
|
|
108
|
+
const api2 = new IfcAPI();
|
|
109
|
+
await api2.Init();
|
|
110
|
+
const classicID = api2.OpenModel(buffer, SETTINGS);
|
|
111
|
+
const geometryIDs = new Set();
|
|
112
|
+
api2.StreamAllMeshes(classicID, (mesh) => {
|
|
113
|
+
for (let where = 0; where < mesh.geometries.size(); ++where) {
|
|
114
|
+
geometryIDs.add(mesh.geometries.get(where).geometryExpressID);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
const deferredID = await api2.OpenModelStreamed(buffer, { ...SETTINGS, DEFER_GEOMETRY: true });
|
|
118
|
+
api2.StreamAllMeshes(deferredID, () => { });
|
|
119
|
+
let compared = 0;
|
|
120
|
+
for (const geometryID of geometryIDs) {
|
|
121
|
+
const classicGeometry = api2.GetGeometry(classicID, geometryID);
|
|
122
|
+
const deferredGeometry = api2.GetGeometry(deferredID, geometryID);
|
|
123
|
+
const classicSize = classicGeometry.GetVertexDataSize();
|
|
124
|
+
if (classicSize === 0) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
expect(deferredGeometry.GetVertexDataSize()).toBe(classicSize);
|
|
128
|
+
const classicVertices = api2.GetVertexArray(classicGeometry.GetVertexData(), classicSize);
|
|
129
|
+
const deferredVertices = api2.GetVertexArray(deferredGeometry.GetVertexData(), classicSize);
|
|
130
|
+
expect(deferredVertices).toEqual(classicVertices);
|
|
131
|
+
++compared;
|
|
132
|
+
}
|
|
133
|
+
expect(compared).toBeGreaterThan(0);
|
|
134
|
+
api2.CloseModel(classicID);
|
|
135
|
+
api2.CloseModel(deferredID);
|
|
136
|
+
}, 240000);
|
|
80
137
|
test("ExtractGeometryBatch is a safe no-op on non-deferred models", async () => {
|
|
81
138
|
const modelID = await api.OpenModelStreamed(buffer, SETTINGS);
|
|
82
139
|
expect(api.ExtractGeometryBatch(modelID, 8))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ifc_api_preview_channel.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_preview_channel.test.ts"],"names":[],"mappings":""}
|