@ifc-lite/wasm 2.13.3 → 2.14.0

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "IFC-Lite Contributors"
6
6
  ],
7
7
  "description": "WebAssembly bindings for IFC-Lite",
8
- "version": "2.13.3",
8
+ "version": "2.14.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -94,7 +94,7 @@ export class IfcAPI {
94
94
  * historical look — #1321). Optional at the boundary so older 5-arg callers
95
95
  * keep lit-by-default behaviour.
96
96
  */
97
- exportGlb(content: string, include_metadata: boolean, hidden: Uint32Array, isolated: Uint32Array, hidden_types_csv: string, lit?: boolean | null): Uint8Array;
97
+ exportGlb(content: Uint8Array, include_metadata: boolean, hidden: Uint32Array, isolated: Uint32Array, hidden_types_csv: string, lit?: boolean | null): Uint8Array;
98
98
  /**
99
99
  * Package an already-produced **GLB** + georeference into a **KMZ** (`Uint8Array`)
100
100
  * for Google Earth: a ZIP of `doc.kml` (a `<Model>` placed at `latitude`/`longitude`/
@@ -120,12 +120,7 @@ export class IfcAPI {
120
120
  * const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
121
121
  * ```
122
122
  */
123
- exportObj(content: string, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): string;
124
- /**
125
- * Run the pre-pass ONCE and return serialized results for worker distribution.
126
- * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
127
- */
128
- buildPrePassOnce(data: Uint8Array): any;
123
+ exportObj(content: Uint8Array, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): string;
129
124
  /**
130
125
  * Process geometry for a subset of pre-scanned entities → flat
131
126
  * MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
@@ -134,32 +129,6 @@ export class IfcAPI {
134
129
  * there). Output is byte-for-byte what the pre-refactor method produced.
135
130
  */
136
131
  processGeometryBatch(data: Uint8Array, jobs_flat: Uint32Array, unit_scale: number, rtc_x: number, rtc_y: number, rtc_z: number, needs_shift: boolean, void_keys: Uint32Array, void_counts: Uint32Array, void_values: Uint32Array, style_ids: Uint32Array, style_colors: Uint8Array, plane_angle_to_radians?: number | null, material_element_ids?: Uint32Array | null, material_color_counts?: Uint32Array | null, material_colors_rgba?: Uint8Array | null): MeshCollection;
137
- /**
138
- * Streaming pre-pass: emits geometry jobs in chunks via a JS callback
139
- * instead of waiting for the full file scan to complete.
140
- *
141
- * Single linear walk over the file:
142
- * 1. Builds the entity index incrementally from the same scan that
143
- * collects geometry jobs (a separate index scan would double
144
- * wall-clock).
145
- * 2. As soon as `IFCPROJECT` has been seen, the unit scale and the
146
- * first ~50 geometry jobs have been collected, resolves
147
- * `unitScale` + `rtcOffset` and emits a `meta` callback so the
148
- * JS host can spin up geometry process workers.
149
- * 3. Emits `jobs` callbacks every `chunk_size` jobs (or fewer if
150
- * the meta phase already buffered some).
151
- * 4. Emits `complete` with the total job count at end of scan.
152
- *
153
- * On a 986 MB / 14 M-entity file this drops time-to-first-geometry
154
- * from ~17 s (full pre-pass + worker spawn + first batch) to ~3 s
155
- * (first 100 K bytes scanned + meta + first chunk).
156
- *
157
- * The callback receives a single `JsValue` argument shaped as one of:
158
- * `{ type: "meta", unitScale, rtcOffset: [x,y,z], needsShift, buildingRotation? }`
159
- * `{ type: "jobs", jobs: Uint32Array }` // [id, start, end] triples
160
- * `{ type: "complete", totalJobs }`
161
- */
162
- buildPrePassStreaming(data: Uint8Array, on_event: Function, chunk_size: number, disabled_type_names: string[] | null | undefined, skip_type_geometry: boolean): any;
163
132
  /**
164
133
  * Like [`IfcAPI::process_geometry_batch`] but collates the batch's meshes
165
134
  * into a GPU-instancing shard (IFNS wire format) instead of a flat
@@ -190,6 +159,37 @@ export class IfcAPI {
190
159
  * opaque bulk. See the instanced-only follow-ups.
191
160
  */
192
161
  processGeometryBatchPartitioned(data: Uint8Array, jobs_flat: Uint32Array, unit_scale: number, rtc_x: number, rtc_y: number, rtc_z: number, needs_shift: boolean, void_keys: Uint32Array, void_counts: Uint32Array, void_values: Uint32Array, style_ids: Uint32Array, style_colors: Uint8Array, plane_angle_to_radians?: number | null, material_element_ids?: Uint32Array | null, material_color_counts?: Uint32Array | null, material_colors_rgba?: Uint8Array | null): PartitionedBatch;
162
+ /**
163
+ * Run the pre-pass ONCE and return serialized results for worker distribution.
164
+ * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
165
+ */
166
+ buildPrePassOnce(data: Uint8Array): any;
167
+ /**
168
+ * Streaming pre-pass: emits geometry jobs in chunks via a JS callback
169
+ * instead of waiting for the full file scan to complete.
170
+ *
171
+ * Single linear walk over the file:
172
+ * 1. Builds the entity index incrementally from the same scan that
173
+ * collects geometry jobs (a separate index scan would double
174
+ * wall-clock).
175
+ * 2. As soon as `IFCPROJECT` has been seen, the unit scale and the
176
+ * first ~50 geometry jobs have been collected, resolves
177
+ * `unitScale` + `rtcOffset` and emits a `meta` callback so the
178
+ * JS host can spin up geometry process workers.
179
+ * 3. Emits `jobs` callbacks every `chunk_size` jobs (or fewer if
180
+ * the meta phase already buffered some).
181
+ * 4. Emits `complete` with the total job count at end of scan.
182
+ *
183
+ * On a 986 MB / 14 M-entity file this drops time-to-first-geometry
184
+ * from ~17 s (full pre-pass + worker spawn + first batch) to ~3 s
185
+ * (first 100 K bytes scanned + meta + first chunk).
186
+ *
187
+ * The callback receives a single `JsValue` argument shaped as one of:
188
+ * `{ type: "meta", unitScale, rtcOffset: [x,y,z], needsShift, buildingRotation? }`
189
+ * `{ type: "jobs", jobs: Uint32Array }` // [id, start, end] triples
190
+ * `{ type: "complete", totalJobs }`
191
+ */
192
+ buildPrePassStreaming(data: Uint8Array, on_event: Function, chunk_size: number, disabled_type_names: string[] | null | undefined, skip_type_geometry: boolean): any;
193
193
  /**
194
194
  * Parse the file and return structured per-axis data (tag + endpoints) in
195
195
  * the renderer's Y-up world space (RTC-subtracted, metres). Use this when
@@ -211,22 +211,22 @@ export class IfcAPI {
211
211
  * `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
212
212
  * flattened `Pset_Prop` columns to the entities view.
213
213
  */
214
- exportCsv(content: string, mode: string, delimiter: string, include_properties: boolean): string;
214
+ exportCsv(content: Uint8Array, mode: string, delimiter: string, include_properties: boolean): string;
215
215
  /**
216
216
  * Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
217
217
  * only properties with an official IFC5 schema.
218
218
  */
219
- exportIfcx(content: string, only_known_properties: boolean, pretty: boolean): string;
219
+ exportIfcx(content: Uint8Array, only_known_properties: boolean, pretty: boolean): string;
220
220
  /**
221
221
  * Export structured **JSON** (array of entity objects with typed property values).
222
222
  */
223
- exportJson(content: string, pretty: boolean, include_properties: boolean, include_quantities: boolean): string;
223
+ exportJson(content: Uint8Array, pretty: boolean, include_properties: boolean, include_quantities: boolean): string;
224
224
  /**
225
225
  * Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
226
226
  * IFC4 OWL default. `included` is an express-id isolation filter mirroring the
227
227
  * OBJ/glTF/STEP exporters (empty ⇒ all entities).
228
228
  */
229
- exportJsonld(content: string, context: string, include_properties: boolean, include_quantities: boolean, pretty: boolean, included: Uint32Array): string;
229
+ exportJsonld(content: Uint8Array, context: string, include_properties: boolean, include_quantities: boolean, pretty: boolean, included: Uint32Array): string;
230
230
  /**
231
231
  * Re-serialize the model in `content` to a STEP/IFC string.
232
232
  *
@@ -236,7 +236,7 @@ export class IfcAPI {
236
236
  * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
237
237
  * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
238
238
  */
239
- exportStep(content: string, schema: string, included: Uint32Array, mutations_json: string): string;
239
+ exportStep(content: Uint8Array, schema: string, included: Uint32Array, mutations_json: string): string;
240
240
  /**
241
241
  * Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
242
242
  * bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
@@ -255,7 +255,7 @@ export class IfcAPI {
255
255
  * const hbjson = api.exportHbjson(ifcContent, "my_model");
256
256
  * ```
257
257
  */
258
- exportHbjson(content: string, name: string): string;
258
+ exportHbjson(content: Uint8Array, name: string): string;
259
259
  /**
260
260
  * Parse the file and return every `IfcAlignment` directrix as a flat
261
261
  * `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
@@ -331,6 +331,17 @@ export class IfcAPI {
331
331
  * Default is `false`. Pass `true` before calling `processGeometryBatch`.
332
332
  */
333
333
  setMergeLayers(enabled: boolean): void;
334
+ /**
335
+ * Toggle the tier-independent small-cut skip (#1286). When `true`,
336
+ * `processGeometryBatch` drops `IfcBooleanResult` differences whose cutter is
337
+ * tiny relative to its host (steel copes/notches) while keeping the
338
+ * tessellation tier — so curves stay full-density. The viewer enables this for
339
+ * the on-screen load; exports/drawings leave it off so their geometry keeps
340
+ * every cut. Default off ⇒ byte-identical to before.
341
+ *
342
+ * Set BEFORE processing — meshes already emitted are not regenerated.
343
+ */
344
+ setSkipSmallCuts(on: boolean): void;
334
345
  /**
335
346
  * Clear the cached entity index (call between loads when reusing
336
347
  * the same `IfcAPI` instance — e.g. the parser worker keeps one
@@ -404,6 +415,14 @@ export class IfcAPI {
404
415
  * Much faster than scanning all entities (3x speedup for large files)
405
416
  */
406
417
  scanGeometryEntitiesFast(content: string): any;
418
+ /**
419
+ * Run geometry extraction on `content` and return its typed CSG / opening
420
+ * diagnostics (the `GeometryDiagnostics` contract) as a JS object, or
421
+ * `undefined` when nothing diagnostic-worthy happened (no openings, no
422
+ * failures). Takes the raw IFC bytes (`Uint8Array`) so there is no input-size
423
+ * cap. The produced meshes are dropped; only the diagnostics are returned.
424
+ */
425
+ diagnoseGeometry(content: Uint8Array): any;
407
426
  /**
408
427
  * Parse IFC file and extract symbolic representations (Plan,
409
428
  * Annotation, FootPrint, Axis). These are 2D curves used for
@@ -453,6 +472,13 @@ export class MeshCollection {
453
472
  * it twice for the same index yields the second call an empty mesh.
454
473
  */
455
474
  takeMesh(index: number): MeshDataJs | undefined;
475
+ /**
476
+ * The batch's typed CSG / opening diagnostics as a JS object (the
477
+ * `GeometryDiagnostics` contract), or `undefined` if none were recorded. The
478
+ * worker merges these across batches. One serialized value keeps the rich
479
+ * nested shape as a single FFI crossing instead of dozens of getters.
480
+ */
481
+ readonly diagnostics: any;
456
482
  /**
457
483
  * Get RTC offset X (for converting local coords back to world coords)
458
484
  * Add this to local X coordinates to get world X coordinates
@@ -1070,6 +1096,7 @@ export interface InitOutput {
1070
1096
  readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
1071
1097
  readonly ifcapi_buildPrePassStreaming: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
1072
1098
  readonly ifcapi_clearPrePassCache: (a: number) => void;
1099
+ readonly ifcapi_diagnoseGeometry: (a: number, b: number, c: number) => number;
1073
1100
  readonly ifcapi_exportCsv: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
1074
1101
  readonly ifcapi_exportGlb: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
1075
1102
  readonly ifcapi_exportGlbFromMeshes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number) => void;
@@ -1099,10 +1126,12 @@ export interface InitOutput {
1099
1126
  readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1100
1127
  readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
1101
1128
  readonly ifcapi_setRectParamFastPath: (a: number, b: number) => void;
1129
+ readonly ifcapi_setSkipSmallCuts: (a: number, b: number) => void;
1102
1130
  readonly ifcapi_setTessellationQuality: (a: number, b: number, c: number, d: number) => void;
1103
1131
  readonly ifcapi_version: (a: number, b: number) => void;
1104
1132
  readonly meshOutline2d: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
1105
1133
  readonly meshcollection_buildingRotation: (a: number, b: number) => void;
1134
+ readonly meshcollection_diagnostics: (a: number) => number;
1106
1135
  readonly meshcollection_geometryHashCount: (a: number) => number;
1107
1136
  readonly meshcollection_geometryHashIds: (a: number) => number;
1108
1137
  readonly meshcollection_geometryHashValues: (a: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -639,7 +639,7 @@ export class IfcAPI {
639
639
  * `true` ⇒ lit (the default), `false` ⇒ flat `KHR_materials_unlit` (the
640
640
  * historical look — #1321). Optional at the boundary so older 5-arg callers
641
641
  * keep lit-by-default behaviour.
642
- * @param {string} content
642
+ * @param {Uint8Array} content
643
643
  * @param {boolean} include_metadata
644
644
  * @param {Uint32Array} hidden
645
645
  * @param {Uint32Array} isolated
@@ -650,7 +650,7 @@ export class IfcAPI {
650
650
  exportGlb(content, include_metadata, hidden, isolated, hidden_types_csv, lit) {
651
651
  try {
652
652
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
653
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
653
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
654
654
  const len0 = WASM_VECTOR_LEN;
655
655
  const ptr1 = passArray32ToWasm0(hidden, wasm.__wbindgen_export);
656
656
  const len1 = WASM_VECTOR_LEN;
@@ -755,7 +755,7 @@ export class IfcAPI {
755
755
  * ```javascript
756
756
  * const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
757
757
  * ```
758
- * @param {string} content
758
+ * @param {Uint8Array} content
759
759
  * @param {boolean} include_normals
760
760
  * @param {Uint32Array} hidden
761
761
  * @param {Uint32Array} isolated
@@ -766,7 +766,7 @@ export class IfcAPI {
766
766
  let deferred4_1;
767
767
  try {
768
768
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
769
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
769
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
770
770
  const len0 = WASM_VECTOR_LEN;
771
771
  const ptr1 = passArray32ToWasm0(hidden, wasm.__wbindgen_export);
772
772
  const len1 = WASM_VECTOR_LEN;
@@ -783,18 +783,6 @@ export class IfcAPI {
783
783
  wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
784
784
  }
785
785
  }
786
- /**
787
- * Run the pre-pass ONCE and return serialized results for worker distribution.
788
- * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
789
- * @param {Uint8Array} data
790
- * @returns {any}
791
- */
792
- buildPrePassOnce(data) {
793
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
794
- const len0 = WASM_VECTOR_LEN;
795
- const ret = wasm.ifcapi_buildPrePassOnce(this.__wbg_ptr, ptr0, len0);
796
- return takeObject(ret);
797
- }
798
786
  /**
799
787
  * Process geometry for a subset of pre-scanned entities → flat
800
788
  * MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
@@ -843,57 +831,6 @@ export class IfcAPI {
843
831
  const ret = wasm.ifcapi_processGeometryBatch(this.__wbg_ptr, ptr0, len0, ptr1, len1, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, !isLikeNone(plane_angle_to_radians), isLikeNone(plane_angle_to_radians) ? 0 : plane_angle_to_radians, ptr7, len7, ptr8, len8, ptr9, len9);
844
832
  return MeshCollection.__wrap(ret);
845
833
  }
846
- /**
847
- * Streaming pre-pass: emits geometry jobs in chunks via a JS callback
848
- * instead of waiting for the full file scan to complete.
849
- *
850
- * Single linear walk over the file:
851
- * 1. Builds the entity index incrementally from the same scan that
852
- * collects geometry jobs (a separate index scan would double
853
- * wall-clock).
854
- * 2. As soon as `IFCPROJECT` has been seen, the unit scale and the
855
- * first ~50 geometry jobs have been collected, resolves
856
- * `unitScale` + `rtcOffset` and emits a `meta` callback so the
857
- * JS host can spin up geometry process workers.
858
- * 3. Emits `jobs` callbacks every `chunk_size` jobs (or fewer if
859
- * the meta phase already buffered some).
860
- * 4. Emits `complete` with the total job count at end of scan.
861
- *
862
- * On a 986 MB / 14 M-entity file this drops time-to-first-geometry
863
- * from ~17 s (full pre-pass + worker spawn + first batch) to ~3 s
864
- * (first 100 K bytes scanned + meta + first chunk).
865
- *
866
- * The callback receives a single `JsValue` argument shaped as one of:
867
- * `{ type: "meta", unitScale, rtcOffset: [x,y,z], needsShift, buildingRotation? }`
868
- * `{ type: "jobs", jobs: Uint32Array }` // [id, start, end] triples
869
- * `{ type: "complete", totalJobs }`
870
- * @param {Uint8Array} data
871
- * @param {Function} on_event
872
- * @param {number} chunk_size
873
- * @param {string[] | null | undefined} disabled_type_names
874
- * @param {boolean} skip_type_geometry
875
- * @returns {any}
876
- */
877
- buildPrePassStreaming(data, on_event, chunk_size, disabled_type_names, skip_type_geometry) {
878
- try {
879
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
880
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
881
- const len0 = WASM_VECTOR_LEN;
882
- var ptr1 = isLikeNone(disabled_type_names) ? 0 : passArrayJsValueToWasm0(disabled_type_names, wasm.__wbindgen_export);
883
- var len1 = WASM_VECTOR_LEN;
884
- wasm.ifcapi_buildPrePassStreaming(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(on_event), chunk_size, ptr1, len1, skip_type_geometry);
885
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
886
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
887
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
888
- if (r2) {
889
- throw takeObject(r1);
890
- }
891
- return takeObject(r0);
892
- } finally {
893
- wasm.__wbindgen_add_to_stack_pointer(16);
894
- heap[stack_pointer++] = undefined;
895
- }
896
- }
897
834
  /**
898
835
  * Like [`IfcAPI::process_geometry_batch`] but collates the batch's meshes
899
836
  * into a GPU-instancing shard (IFNS wire format) instead of a flat
@@ -1013,6 +950,69 @@ export class IfcAPI {
1013
950
  const ret = wasm.ifcapi_processGeometryBatchPartitioned(this.__wbg_ptr, ptr0, len0, ptr1, len1, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, !isLikeNone(plane_angle_to_radians), isLikeNone(plane_angle_to_radians) ? 0 : plane_angle_to_radians, ptr7, len7, ptr8, len8, ptr9, len9);
1014
951
  return PartitionedBatch.__wrap(ret);
1015
952
  }
953
+ /**
954
+ * Run the pre-pass ONCE and return serialized results for worker distribution.
955
+ * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
956
+ * @param {Uint8Array} data
957
+ * @returns {any}
958
+ */
959
+ buildPrePassOnce(data) {
960
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
961
+ const len0 = WASM_VECTOR_LEN;
962
+ const ret = wasm.ifcapi_buildPrePassOnce(this.__wbg_ptr, ptr0, len0);
963
+ return takeObject(ret);
964
+ }
965
+ /**
966
+ * Streaming pre-pass: emits geometry jobs in chunks via a JS callback
967
+ * instead of waiting for the full file scan to complete.
968
+ *
969
+ * Single linear walk over the file:
970
+ * 1. Builds the entity index incrementally from the same scan that
971
+ * collects geometry jobs (a separate index scan would double
972
+ * wall-clock).
973
+ * 2. As soon as `IFCPROJECT` has been seen, the unit scale and the
974
+ * first ~50 geometry jobs have been collected, resolves
975
+ * `unitScale` + `rtcOffset` and emits a `meta` callback so the
976
+ * JS host can spin up geometry process workers.
977
+ * 3. Emits `jobs` callbacks every `chunk_size` jobs (or fewer if
978
+ * the meta phase already buffered some).
979
+ * 4. Emits `complete` with the total job count at end of scan.
980
+ *
981
+ * On a 986 MB / 14 M-entity file this drops time-to-first-geometry
982
+ * from ~17 s (full pre-pass + worker spawn + first batch) to ~3 s
983
+ * (first 100 K bytes scanned + meta + first chunk).
984
+ *
985
+ * The callback receives a single `JsValue` argument shaped as one of:
986
+ * `{ type: "meta", unitScale, rtcOffset: [x,y,z], needsShift, buildingRotation? }`
987
+ * `{ type: "jobs", jobs: Uint32Array }` // [id, start, end] triples
988
+ * `{ type: "complete", totalJobs }`
989
+ * @param {Uint8Array} data
990
+ * @param {Function} on_event
991
+ * @param {number} chunk_size
992
+ * @param {string[] | null | undefined} disabled_type_names
993
+ * @param {boolean} skip_type_geometry
994
+ * @returns {any}
995
+ */
996
+ buildPrePassStreaming(data, on_event, chunk_size, disabled_type_names, skip_type_geometry) {
997
+ try {
998
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
999
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
1000
+ const len0 = WASM_VECTOR_LEN;
1001
+ var ptr1 = isLikeNone(disabled_type_names) ? 0 : passArrayJsValueToWasm0(disabled_type_names, wasm.__wbindgen_export);
1002
+ var len1 = WASM_VECTOR_LEN;
1003
+ wasm.ifcapi_buildPrePassStreaming(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(on_event), chunk_size, ptr1, len1, skip_type_geometry);
1004
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1005
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1006
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1007
+ if (r2) {
1008
+ throw takeObject(r1);
1009
+ }
1010
+ return takeObject(r0);
1011
+ } finally {
1012
+ wasm.__wbindgen_add_to_stack_pointer(16);
1013
+ heap[stack_pointer++] = undefined;
1014
+ }
1015
+ }
1016
1016
  /**
1017
1017
  * Parse the file and return structured per-axis data (tag + endpoints) in
1018
1018
  * the renderer's Y-up world space (RTC-subtracted, metres). Use this when
@@ -1047,7 +1047,7 @@ export class IfcAPI {
1047
1047
  * Export tabular **CSV**. `mode` ∈ {`"entities"`, `"properties"`, `"quantities"`,
1048
1048
  * `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
1049
1049
  * flattened `Pset_Prop` columns to the entities view.
1050
- * @param {string} content
1050
+ * @param {Uint8Array} content
1051
1051
  * @param {string} mode
1052
1052
  * @param {string} delimiter
1053
1053
  * @param {boolean} include_properties
@@ -1058,7 +1058,7 @@ export class IfcAPI {
1058
1058
  let deferred4_1;
1059
1059
  try {
1060
1060
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1061
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1061
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1062
1062
  const len0 = WASM_VECTOR_LEN;
1063
1063
  const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1064
1064
  const len1 = WASM_VECTOR_LEN;
@@ -1078,7 +1078,7 @@ export class IfcAPI {
1078
1078
  /**
1079
1079
  * Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
1080
1080
  * only properties with an official IFC5 schema.
1081
- * @param {string} content
1081
+ * @param {Uint8Array} content
1082
1082
  * @param {boolean} only_known_properties
1083
1083
  * @param {boolean} pretty
1084
1084
  * @returns {string}
@@ -1088,7 +1088,7 @@ export class IfcAPI {
1088
1088
  let deferred2_1;
1089
1089
  try {
1090
1090
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1091
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1091
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1092
1092
  const len0 = WASM_VECTOR_LEN;
1093
1093
  wasm.ifcapi_exportIfcx(retptr, this.__wbg_ptr, ptr0, len0, only_known_properties, pretty);
1094
1094
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -1103,7 +1103,7 @@ export class IfcAPI {
1103
1103
  }
1104
1104
  /**
1105
1105
  * Export structured **JSON** (array of entity objects with typed property values).
1106
- * @param {string} content
1106
+ * @param {Uint8Array} content
1107
1107
  * @param {boolean} pretty
1108
1108
  * @param {boolean} include_properties
1109
1109
  * @param {boolean} include_quantities
@@ -1114,7 +1114,7 @@ export class IfcAPI {
1114
1114
  let deferred2_1;
1115
1115
  try {
1116
1116
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1117
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1117
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1118
1118
  const len0 = WASM_VECTOR_LEN;
1119
1119
  wasm.ifcapi_exportJson(retptr, this.__wbg_ptr, ptr0, len0, pretty, include_properties, include_quantities);
1120
1120
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -1131,7 +1131,7 @@ export class IfcAPI {
1131
1131
  * Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
1132
1132
  * IFC4 OWL default. `included` is an express-id isolation filter mirroring the
1133
1133
  * OBJ/glTF/STEP exporters (empty ⇒ all entities).
1134
- * @param {string} content
1134
+ * @param {Uint8Array} content
1135
1135
  * @param {string} context
1136
1136
  * @param {boolean} include_properties
1137
1137
  * @param {boolean} include_quantities
@@ -1144,7 +1144,7 @@ export class IfcAPI {
1144
1144
  let deferred4_1;
1145
1145
  try {
1146
1146
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1147
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1147
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1148
1148
  const len0 = WASM_VECTOR_LEN;
1149
1149
  const ptr1 = passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1150
1150
  const len1 = WASM_VECTOR_LEN;
@@ -1169,7 +1169,7 @@ export class IfcAPI {
1169
1169
  * `#`-reference closure is added so the subset never dangles a reference.
1170
1170
  * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
1171
1171
  * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
1172
- * @param {string} content
1172
+ * @param {Uint8Array} content
1173
1173
  * @param {string} schema
1174
1174
  * @param {Uint32Array} included
1175
1175
  * @param {string} mutations_json
@@ -1180,7 +1180,7 @@ export class IfcAPI {
1180
1180
  let deferred5_1;
1181
1181
  try {
1182
1182
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1183
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1183
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1184
1184
  const len0 = WASM_VECTOR_LEN;
1185
1185
  const ptr1 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1186
1186
  const len1 = WASM_VECTOR_LEN;
@@ -1241,7 +1241,7 @@ export class IfcAPI {
1241
1241
  * const api = new IfcAPI();
1242
1242
  * const hbjson = api.exportHbjson(ifcContent, "my_model");
1243
1243
  * ```
1244
- * @param {string} content
1244
+ * @param {Uint8Array} content
1245
1245
  * @param {string} name
1246
1246
  * @returns {string}
1247
1247
  */
@@ -1250,7 +1250,7 @@ export class IfcAPI {
1250
1250
  let deferred3_1;
1251
1251
  try {
1252
1252
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1253
- const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1253
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1254
1254
  const len0 = WASM_VECTOR_LEN;
1255
1255
  const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1256
1256
  const len1 = WASM_VECTOR_LEN;
@@ -1373,6 +1373,20 @@ export class IfcAPI {
1373
1373
  setMergeLayers(enabled) {
1374
1374
  wasm.ifcapi_setMergeLayers(this.__wbg_ptr, enabled);
1375
1375
  }
1376
+ /**
1377
+ * Toggle the tier-independent small-cut skip (#1286). When `true`,
1378
+ * `processGeometryBatch` drops `IfcBooleanResult` differences whose cutter is
1379
+ * tiny relative to its host (steel copes/notches) while keeping the
1380
+ * tessellation tier — so curves stay full-density. The viewer enables this for
1381
+ * the on-screen load; exports/drawings leave it off so their geometry keeps
1382
+ * every cut. Default off ⇒ byte-identical to before.
1383
+ *
1384
+ * Set BEFORE processing — meshes already emitted are not regenerated.
1385
+ * @param {boolean} on
1386
+ */
1387
+ setSkipSmallCuts(on) {
1388
+ wasm.ifcapi_setSkipSmallCuts(this.__wbg_ptr, on);
1389
+ }
1376
1390
  /**
1377
1391
  * Clear the cached entity index (call between loads when reusing
1378
1392
  * the same `IfcAPI` instance — e.g. the parser worker keeps one
@@ -1523,6 +1537,21 @@ export class IfcAPI {
1523
1537
  const ret = wasm.ifcapi_scanGeometryEntitiesFast(this.__wbg_ptr, ptr0, len0);
1524
1538
  return takeObject(ret);
1525
1539
  }
1540
+ /**
1541
+ * Run geometry extraction on `content` and return its typed CSG / opening
1542
+ * diagnostics (the `GeometryDiagnostics` contract) as a JS object, or
1543
+ * `undefined` when nothing diagnostic-worthy happened (no openings, no
1544
+ * failures). Takes the raw IFC bytes (`Uint8Array`) so there is no input-size
1545
+ * cap. The produced meshes are dropped; only the diagnostics are returned.
1546
+ * @param {Uint8Array} content
1547
+ * @returns {any}
1548
+ */
1549
+ diagnoseGeometry(content) {
1550
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1551
+ const len0 = WASM_VECTOR_LEN;
1552
+ const ret = wasm.ifcapi_diagnoseGeometry(this.__wbg_ptr, ptr0, len0);
1553
+ return takeObject(ret);
1554
+ }
1526
1555
  /**
1527
1556
  * Parse IFC file and extract symbolic representations (Plan,
1528
1557
  * Annotation, FootPrint, Axis). These are 2D curves used for
@@ -1571,6 +1600,17 @@ export class MeshCollection {
1571
1600
  const ptr = this.__destroy_into_raw();
1572
1601
  wasm.__wbg_meshcollection_free(ptr, 0);
1573
1602
  }
1603
+ /**
1604
+ * The batch's typed CSG / opening diagnostics as a JS object (the
1605
+ * `GeometryDiagnostics` contract), or `undefined` if none were recorded. The
1606
+ * worker merges these across batches. One serialized value keeps the rich
1607
+ * nested shape as a single FFI crossing instead of dozens of getters.
1608
+ * @returns {any}
1609
+ */
1610
+ get diagnostics() {
1611
+ const ret = wasm.meshcollection_diagnostics(this.__wbg_ptr);
1612
+ return takeObject(ret);
1613
+ }
1574
1614
  /**
1575
1615
  * Get RTC offset X (for converting local coords back to world coords)
1576
1616
  * Add this to local X coordinates to get world X coordinates
Binary file