@ifc-lite/wasm 2.14.0 → 3.0.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.14.0",
8
+ "version": "3.0.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -93,6 +93,12 @@ export class IfcAPI {
93
93
  * `true` ⇒ lit (the default), `false` ⇒ flat `KHR_materials_unlit` (the
94
94
  * historical look — #1321). Optional at the boundary so older 5-arg callers
95
95
  * keep lit-by-default behaviour.
96
+ *
97
+ * Fails CLOSED: when the visible mesh set is empty this throws an `Error`
98
+ * whose message starts with `NO_RENDER_GEOMETRY`, instead of returning a
99
+ * structurally valid but empty GLB. #1438 put that guard only in the TS
100
+ * CLI/MCP wrappers; making the boundary itself refuse means SDK/viewer/
101
+ * direct callers inherit it too (the TS guards stay as defense-in-depth).
96
102
  */
97
103
  exportGlb(content: Uint8Array, include_metadata: boolean, hidden: Uint32Array, isolated: Uint32Array, hidden_types_csv: string, lit?: boolean | null): Uint8Array;
98
104
  /**
@@ -111,7 +117,11 @@ export class IfcAPI {
111
117
  */
112
118
  exportGlbFromMeshes(positions: Float32Array, normals: Float32Array, indices: Uint32Array, vertex_counts: Uint32Array, index_counts: Uint32Array, colors: Float32Array, origins: Float64Array, express_ids: Uint32Array, include_metadata: boolean, lit?: boolean | null): Uint8Array;
113
119
  /**
114
- * Export the render geometry in `content` as a Wavefront **OBJ** string.
120
+ * Export the render geometry in `content` as Wavefront **OBJ** UTF-8 bytes.
121
+ *
122
+ * Returned as UTF-8 bytes (`Uint8Array`) so output is not capped by the
123
+ * V8 max-string ceiling (~512 MB); decode with `TextDecoder` when a string
124
+ * is genuinely needed.
115
125
  *
116
126
  * `hidden` / `isolated` are express-id filters mirroring the viewer's visibility
117
127
  * state (empty `isolated` ⇒ all visible). Instanced type-library shapes are skipped.
@@ -120,7 +130,7 @@ export class IfcAPI {
120
130
  * const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
121
131
  * ```
122
132
  */
123
- exportObj(content: Uint8Array, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): string;
133
+ exportObj(content: Uint8Array, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): Uint8Array;
124
134
  /**
125
135
  * Process geometry for a subset of pre-scanned entities → flat
126
136
  * MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
@@ -211,24 +221,28 @@ export class IfcAPI {
211
221
  * `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
212
222
  * flattened `Pset_Prop` columns to the entities view.
213
223
  */
214
- exportCsv(content: Uint8Array, mode: string, delimiter: string, include_properties: boolean): string;
224
+ exportCsv(content: Uint8Array, mode: string, delimiter: string, include_properties: boolean): Uint8Array;
215
225
  /**
216
226
  * Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
217
227
  * only properties with an official IFC5 schema.
218
228
  */
219
- exportIfcx(content: Uint8Array, only_known_properties: boolean, pretty: boolean): string;
229
+ exportIfcx(content: Uint8Array, only_known_properties: boolean, pretty: boolean): Uint8Array;
220
230
  /**
221
231
  * Export structured **JSON** (array of entity objects with typed property values).
222
232
  */
223
- exportJson(content: Uint8Array, pretty: boolean, include_properties: boolean, include_quantities: boolean): string;
233
+ exportJson(content: Uint8Array, pretty: boolean, include_properties: boolean, include_quantities: boolean): Uint8Array;
224
234
  /**
225
235
  * Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
226
236
  * IFC4 OWL default. `included` is an express-id isolation filter mirroring the
227
237
  * OBJ/glTF/STEP exporters (empty ⇒ all entities).
228
238
  */
229
- exportJsonld(content: Uint8Array, context: string, include_properties: boolean, include_quantities: boolean, pretty: boolean, included: Uint32Array): string;
239
+ exportJsonld(content: Uint8Array, context: string, include_properties: boolean, include_quantities: boolean, pretty: boolean, included: Uint32Array): Uint8Array;
230
240
  /**
231
- * Re-serialize the model in `content` to a STEP/IFC string.
241
+ * Re-serialize the model in `content` to STEP/IFC UTF-8 bytes.
242
+ *
243
+ * Returned as UTF-8 bytes (`Uint8Array`) so output is not capped by the
244
+ * V8 max-string ceiling (~512 MB); decode with `TextDecoder` when a string
245
+ * is genuinely needed.
232
246
  *
233
247
  * `schema` is the FILE_SCHEMA label to write (empty ⇒ preserve the source schema).
234
248
  * `included` is an express-id allowlist (empty ⇒ whole model); when set, the forward
@@ -236,15 +250,20 @@ export class IfcAPI {
236
250
  * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
237
251
  * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
238
252
  */
239
- exportStep(content: Uint8Array, schema: string, included: Uint32Array, mutations_json: string): string;
253
+ exportStep(content: Uint8Array, schema: string, included: Uint32Array, mutations_json: string): Uint8Array;
240
254
  /**
241
- * Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
255
+ * Merge several IFC models into one STEP/IFC UTF-8 byte buffer (`Uint8Array`).
256
+ * `concatenated` is every model's
242
257
  * bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
243
258
  * keeps its ids; later models are id-offset and their project unified to the first.
244
259
  */
245
- exportMerged(concatenated: Uint8Array, lengths: Uint32Array, schema: string): string;
260
+ exportMerged(concatenated: Uint8Array, lengths: Uint32Array, schema: string): Uint8Array;
246
261
  /**
247
- * Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
262
+ * Export the `IfcSpace` volumes in `content` as Honeybee **HBJSON** UTF-8 bytes.
263
+ *
264
+ * Returned as UTF-8 bytes (`Uint8Array`) so output is not capped by the
265
+ * V8 max-string ceiling (~512 MB); decode with `TextDecoder` when a string
266
+ * is genuinely needed.
248
267
  *
249
268
  * Rooms are built analytically from extruded-area profiles (watertight by construction);
250
269
  * faces are typed Floor / RoofCeiling / Wall with outward normals. The result loads via
@@ -255,7 +274,7 @@ export class IfcAPI {
255
274
  * const hbjson = api.exportHbjson(ifcContent, "my_model");
256
275
  * ```
257
276
  */
258
- exportHbjson(content: Uint8Array, name: string): string;
277
+ exportHbjson(content: Uint8Array, name: string): Uint8Array;
259
278
  /**
260
279
  * Parse the file and return every `IfcAlignment` directrix as a flat
261
280
  * `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
@@ -290,6 +309,15 @@ export class IfcAPI {
290
309
  * ```
291
310
  */
292
311
  extractProfiles(content: string, model_index: number): ProfileCollection;
312
+ /**
313
+ * Structured pipeline diagnostics accumulated across every
314
+ * `processGeometryBatch*` call since the last load reset
315
+ * (`clearPrePassCache` / `setEntityIndex`), as a JS object with a
316
+ * `schemaVersion` field — or `undefined` when no batch has run yet.
317
+ * Includes per-batch summed geometry wall time, mesh/triangle counts,
318
+ * the degenerate-backstop drop count, and the CSG failure aggregates.
319
+ */
320
+ getPipelineDiagnostics(): any;
293
321
  /**
294
322
  * Get WASM memory for zero-copy access
295
323
  */
@@ -357,12 +385,13 @@ export class IfcAPI {
357
385
  * Enable or disable the PARAMETRIC rectangular-opening fast path (the
358
386
  * placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
359
387
  *
360
- * DEFAULT OFF. This is the wasm-side toggle that lets native and wasm flip the
361
- * flag in LOCKSTEP the byte-identical native==wasm contract requires both
362
- * targets take the same path, and wasm has no env to read `IFC_LITE_RECT_PARAM`.
388
+ * DEFAULT ON (corpus-validated; native defaults ON too, and wasm has no env to
389
+ * read `IFC_LITE_RECT_PARAM`, so both targets default in LOCKSTEP -- the
390
+ * byte-identical native==wasm contract requires both take the same path). This
391
+ * toggle is the wasm-side escape hatch mirroring `IFC_LITE_RECT_PARAM=0`.
363
392
  * The path subtracts rectangular openings as exact parametric boxes in the host's
364
393
  * own placement frame (rotated walls included), deferring any non-clean case to
365
- * the exact kernel. Pass `true` before `processGeometryBatch`.
394
+ * the exact kernel. Pass `false` before `processGeometryBatch` to opt out.
366
395
  */
367
396
  setRectParamFastPath(enabled: boolean): void;
368
397
  /**
@@ -540,6 +569,12 @@ export class MeshDataJs {
540
569
  * True when this mesh carries a surface texture (#961).
541
570
  */
542
571
  readonly hasTexture: boolean;
572
+ /**
573
+ * Local (pre-placement, object-space) AABB (issue #1474), WebGL Y-up,
574
+ * `[minX,minY,minZ,maxX,maxY,maxZ]`. `undefined` when not captured
575
+ * (wasm-bindgen maps `Option::None` to `undefined`, not `null`).
576
+ */
577
+ readonly localBounds: Float32Array | undefined;
543
578
  /**
544
579
  * Decoded RGBA8 texture bytes (`width*height*4`). Empty when untextured.
545
580
  */
@@ -561,6 +596,12 @@ export class MeshDataJs {
561
596
  * type geometry (hidden in Model mode, shown in Types mode).
562
597
  */
563
598
  readonly geometryClass: number;
599
+ /**
600
+ * The resolved `IfcLocalPlacement` chain for this mesh (issue #1474),
601
+ * row-major 4×4, WebGL Y-up. `undefined` when not captured (see
602
+ * `local_bounds` above).
603
+ */
604
+ readonly localToWorld: Float64Array | undefined;
564
605
  readonly textureHeight: number;
565
606
  /**
566
607
  * Get triangle count
@@ -1110,6 +1151,7 @@ export interface InitOutput {
1110
1151
  readonly ifcapi_exportStep: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
1111
1152
  readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
1112
1153
  readonly ifcapi_getMemory: (a: number) => number;
1154
+ readonly ifcapi_getPipelineDiagnostics: (a: number) => number;
1113
1155
  readonly ifcapi_is_ready: (a: number) => number;
1114
1156
  readonly ifcapi_new: () => number;
1115
1157
  readonly ifcapi_parseAlignmentLines: (a: number, b: number, c: number) => number;
@@ -1150,6 +1192,8 @@ export interface InitOutput {
1150
1192
  readonly meshdatajs_hasTexture: (a: number) => number;
1151
1193
  readonly meshdatajs_ifcType: (a: number, b: number) => void;
1152
1194
  readonly meshdatajs_indices: (a: number) => number;
1195
+ readonly meshdatajs_localBounds: (a: number, b: number) => void;
1196
+ readonly meshdatajs_localToWorld: (a: number, b: number) => void;
1153
1197
  readonly meshdatajs_normals: (a: number) => number;
1154
1198
  readonly meshdatajs_origin: (a: number) => number;
1155
1199
  readonly meshdatajs_positions: (a: number) => number;
@@ -1171,6 +1215,7 @@ export interface InitOutput {
1171
1215
  readonly partitionedbatch_takeShard: (a: number, b: number) => void;
1172
1216
  readonly profilecollection_get: (a: number, b: number) => number;
1173
1217
  readonly profilecollection_length: (a: number) => number;
1218
+ readonly profileentryjs_expressId: (a: number) => number;
1174
1219
  readonly profileentryjs_extrusionDepth: (a: number) => number;
1175
1220
  readonly profileentryjs_extrusionDir: (a: number) => number;
1176
1221
  readonly profileentryjs_holeCounts: (a: number) => number;
@@ -1253,7 +1298,6 @@ export interface InitOutput {
1253
1298
  readonly init: () => void;
1254
1299
  readonly symbolicpolyline_pointCount: (a: number) => number;
1255
1300
  readonly get_memory: () => number;
1256
- readonly profileentryjs_expressId: (a: number) => number;
1257
1301
  readonly symbolicfillarea_expressId: (a: number) => number;
1258
1302
  readonly symbolicpolyline_worldY: (a: number) => number;
1259
1303
  readonly symbolictext_colorB: (a: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -639,6 +639,12 @@ 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
+ *
643
+ * Fails CLOSED: when the visible mesh set is empty this throws an `Error`
644
+ * whose message starts with `NO_RENDER_GEOMETRY`, instead of returning a
645
+ * structurally valid but empty GLB. #1438 put that guard only in the TS
646
+ * CLI/MCP wrappers; making the boundary itself refuse means SDK/viewer/
647
+ * direct callers inherit it too (the TS guards stay as defense-in-depth).
642
648
  * @param {Uint8Array} content
643
649
  * @param {boolean} include_metadata
644
650
  * @param {Uint32Array} hidden
@@ -661,6 +667,11 @@ export class IfcAPI {
661
667
  wasm.ifcapi_exportGlb(retptr, this.__wbg_ptr, ptr0, len0, include_metadata, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(lit) ? 0xFFFFFF : lit ? 1 : 0);
662
668
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
663
669
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
670
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
671
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
672
+ if (r3) {
673
+ throw takeObject(r2);
674
+ }
664
675
  var v5 = getArrayU8FromWasm0(r0, r1).slice();
665
676
  wasm.__wbindgen_export4(r0, r1 * 1, 1);
666
677
  return v5;
@@ -747,7 +758,11 @@ export class IfcAPI {
747
758
  }
748
759
  }
749
760
  /**
750
- * Export the render geometry in `content` as a Wavefront **OBJ** string.
761
+ * Export the render geometry in `content` as Wavefront **OBJ** UTF-8 bytes.
762
+ *
763
+ * Returned as UTF-8 bytes (`Uint8Array`) so output is not capped by the
764
+ * V8 max-string ceiling (~512 MB); decode with `TextDecoder` when a string
765
+ * is genuinely needed.
751
766
  *
752
767
  * `hidden` / `isolated` are express-id filters mirroring the viewer's visibility
753
768
  * state (empty `isolated` ⇒ all visible). Instanced type-library shapes are skipped.
@@ -759,11 +774,9 @@ export class IfcAPI {
759
774
  * @param {boolean} include_normals
760
775
  * @param {Uint32Array} hidden
761
776
  * @param {Uint32Array} isolated
762
- * @returns {string}
777
+ * @returns {Uint8Array}
763
778
  */
764
779
  exportObj(content, include_normals, hidden, isolated) {
765
- let deferred4_0;
766
- let deferred4_1;
767
780
  try {
768
781
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
769
782
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -775,12 +788,11 @@ export class IfcAPI {
775
788
  wasm.ifcapi_exportObj(retptr, this.__wbg_ptr, ptr0, len0, include_normals, ptr1, len1, ptr2, len2);
776
789
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
777
790
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
778
- deferred4_0 = r0;
779
- deferred4_1 = r1;
780
- return getStringFromWasm0(r0, r1);
791
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
792
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
793
+ return v4;
781
794
  } finally {
782
795
  wasm.__wbindgen_add_to_stack_pointer(16);
783
- wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
784
796
  }
785
797
  }
786
798
  /**
@@ -1051,11 +1063,9 @@ export class IfcAPI {
1051
1063
  * @param {string} mode
1052
1064
  * @param {string} delimiter
1053
1065
  * @param {boolean} include_properties
1054
- * @returns {string}
1066
+ * @returns {Uint8Array}
1055
1067
  */
1056
1068
  exportCsv(content, mode, delimiter, include_properties) {
1057
- let deferred4_0;
1058
- let deferred4_1;
1059
1069
  try {
1060
1070
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1061
1071
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -1067,12 +1077,11 @@ export class IfcAPI {
1067
1077
  wasm.ifcapi_exportCsv(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, include_properties);
1068
1078
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1069
1079
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1070
- deferred4_0 = r0;
1071
- deferred4_1 = r1;
1072
- return getStringFromWasm0(r0, r1);
1080
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
1081
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1082
+ return v4;
1073
1083
  } finally {
1074
1084
  wasm.__wbindgen_add_to_stack_pointer(16);
1075
- wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
1076
1085
  }
1077
1086
  }
1078
1087
  /**
@@ -1081,11 +1090,9 @@ export class IfcAPI {
1081
1090
  * @param {Uint8Array} content
1082
1091
  * @param {boolean} only_known_properties
1083
1092
  * @param {boolean} pretty
1084
- * @returns {string}
1093
+ * @returns {Uint8Array}
1085
1094
  */
1086
1095
  exportIfcx(content, only_known_properties, pretty) {
1087
- let deferred2_0;
1088
- let deferred2_1;
1089
1096
  try {
1090
1097
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1091
1098
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -1093,12 +1100,11 @@ export class IfcAPI {
1093
1100
  wasm.ifcapi_exportIfcx(retptr, this.__wbg_ptr, ptr0, len0, only_known_properties, pretty);
1094
1101
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1095
1102
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1096
- deferred2_0 = r0;
1097
- deferred2_1 = r1;
1098
- return getStringFromWasm0(r0, r1);
1103
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
1104
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1105
+ return v2;
1099
1106
  } finally {
1100
1107
  wasm.__wbindgen_add_to_stack_pointer(16);
1101
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1102
1108
  }
1103
1109
  }
1104
1110
  /**
@@ -1107,11 +1113,9 @@ export class IfcAPI {
1107
1113
  * @param {boolean} pretty
1108
1114
  * @param {boolean} include_properties
1109
1115
  * @param {boolean} include_quantities
1110
- * @returns {string}
1116
+ * @returns {Uint8Array}
1111
1117
  */
1112
1118
  exportJson(content, pretty, include_properties, include_quantities) {
1113
- let deferred2_0;
1114
- let deferred2_1;
1115
1119
  try {
1116
1120
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1117
1121
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -1119,12 +1123,11 @@ export class IfcAPI {
1119
1123
  wasm.ifcapi_exportJson(retptr, this.__wbg_ptr, ptr0, len0, pretty, include_properties, include_quantities);
1120
1124
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1121
1125
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1122
- deferred2_0 = r0;
1123
- deferred2_1 = r1;
1124
- return getStringFromWasm0(r0, r1);
1126
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
1127
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1128
+ return v2;
1125
1129
  } finally {
1126
1130
  wasm.__wbindgen_add_to_stack_pointer(16);
1127
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1128
1131
  }
1129
1132
  }
1130
1133
  /**
@@ -1137,11 +1140,9 @@ export class IfcAPI {
1137
1140
  * @param {boolean} include_quantities
1138
1141
  * @param {boolean} pretty
1139
1142
  * @param {Uint32Array} included
1140
- * @returns {string}
1143
+ * @returns {Uint8Array}
1141
1144
  */
1142
1145
  exportJsonld(content, context, include_properties, include_quantities, pretty, included) {
1143
- let deferred4_0;
1144
- let deferred4_1;
1145
1146
  try {
1146
1147
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1147
1148
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -1153,16 +1154,19 @@ export class IfcAPI {
1153
1154
  wasm.ifcapi_exportJsonld(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, include_properties, include_quantities, pretty, ptr2, len2);
1154
1155
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1155
1156
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1156
- deferred4_0 = r0;
1157
- deferred4_1 = r1;
1158
- return getStringFromWasm0(r0, r1);
1157
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
1158
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1159
+ return v4;
1159
1160
  } finally {
1160
1161
  wasm.__wbindgen_add_to_stack_pointer(16);
1161
- wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
1162
1162
  }
1163
1163
  }
1164
1164
  /**
1165
- * Re-serialize the model in `content` to a STEP/IFC string.
1165
+ * Re-serialize the model in `content` to STEP/IFC UTF-8 bytes.
1166
+ *
1167
+ * Returned as UTF-8 bytes (`Uint8Array`) so output is not capped by the
1168
+ * V8 max-string ceiling (~512 MB); decode with `TextDecoder` when a string
1169
+ * is genuinely needed.
1166
1170
  *
1167
1171
  * `schema` is the FILE_SCHEMA label to write (empty ⇒ preserve the source schema).
1168
1172
  * `included` is an express-id allowlist (empty ⇒ whole model); when set, the forward
@@ -1173,11 +1177,9 @@ export class IfcAPI {
1173
1177
  * @param {string} schema
1174
1178
  * @param {Uint32Array} included
1175
1179
  * @param {string} mutations_json
1176
- * @returns {string}
1180
+ * @returns {Uint8Array}
1177
1181
  */
1178
1182
  exportStep(content, schema, included, mutations_json) {
1179
- let deferred5_0;
1180
- let deferred5_1;
1181
1183
  try {
1182
1184
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1183
1185
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -1191,26 +1193,24 @@ export class IfcAPI {
1191
1193
  wasm.ifcapi_exportStep(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1192
1194
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1193
1195
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1194
- deferred5_0 = r0;
1195
- deferred5_1 = r1;
1196
- return getStringFromWasm0(r0, r1);
1196
+ var v5 = getArrayU8FromWasm0(r0, r1).slice();
1197
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1198
+ return v5;
1197
1199
  } finally {
1198
1200
  wasm.__wbindgen_add_to_stack_pointer(16);
1199
- wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
1200
1201
  }
1201
1202
  }
1202
1203
  /**
1203
- * Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
1204
+ * Merge several IFC models into one STEP/IFC UTF-8 byte buffer (`Uint8Array`).
1205
+ * `concatenated` is every model's
1204
1206
  * bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
1205
1207
  * keeps its ids; later models are id-offset and their project unified to the first.
1206
1208
  * @param {Uint8Array} concatenated
1207
1209
  * @param {Uint32Array} lengths
1208
1210
  * @param {string} schema
1209
- * @returns {string}
1211
+ * @returns {Uint8Array}
1210
1212
  */
1211
1213
  exportMerged(concatenated, lengths, schema) {
1212
- let deferred4_0;
1213
- let deferred4_1;
1214
1214
  try {
1215
1215
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1216
1216
  const ptr0 = passArray8ToWasm0(concatenated, wasm.__wbindgen_export);
@@ -1222,16 +1222,19 @@ export class IfcAPI {
1222
1222
  wasm.ifcapi_exportMerged(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1223
1223
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1224
1224
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1225
- deferred4_0 = r0;
1226
- deferred4_1 = r1;
1227
- return getStringFromWasm0(r0, r1);
1225
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
1226
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1227
+ return v4;
1228
1228
  } finally {
1229
1229
  wasm.__wbindgen_add_to_stack_pointer(16);
1230
- wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
1231
1230
  }
1232
1231
  }
1233
1232
  /**
1234
- * Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
1233
+ * Export the `IfcSpace` volumes in `content` as Honeybee **HBJSON** UTF-8 bytes.
1234
+ *
1235
+ * Returned as UTF-8 bytes (`Uint8Array`) so output is not capped by the
1236
+ * V8 max-string ceiling (~512 MB); decode with `TextDecoder` when a string
1237
+ * is genuinely needed.
1235
1238
  *
1236
1239
  * Rooms are built analytically from extruded-area profiles (watertight by construction);
1237
1240
  * faces are typed Floor / RoofCeiling / Wall with outward normals. The result loads via
@@ -1243,11 +1246,9 @@ export class IfcAPI {
1243
1246
  * ```
1244
1247
  * @param {Uint8Array} content
1245
1248
  * @param {string} name
1246
- * @returns {string}
1249
+ * @returns {Uint8Array}
1247
1250
  */
1248
1251
  exportHbjson(content, name) {
1249
- let deferred3_0;
1250
- let deferred3_1;
1251
1252
  try {
1252
1253
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1253
1254
  const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
@@ -1257,12 +1258,11 @@ export class IfcAPI {
1257
1258
  wasm.ifcapi_exportHbjson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1258
1259
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1259
1260
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1260
- deferred3_0 = r0;
1261
- deferred3_1 = r1;
1262
- return getStringFromWasm0(r0, r1);
1261
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
1262
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1263
+ return v3;
1263
1264
  } finally {
1264
1265
  wasm.__wbindgen_add_to_stack_pointer(16);
1265
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1266
1266
  }
1267
1267
  }
1268
1268
  /**
@@ -1314,6 +1314,19 @@ export class IfcAPI {
1314
1314
  const ret = wasm.ifcapi_extractProfiles(this.__wbg_ptr, ptr0, len0, model_index);
1315
1315
  return ProfileCollection.__wrap(ret);
1316
1316
  }
1317
+ /**
1318
+ * Structured pipeline diagnostics accumulated across every
1319
+ * `processGeometryBatch*` call since the last load reset
1320
+ * (`clearPrePassCache` / `setEntityIndex`), as a JS object with a
1321
+ * `schemaVersion` field — or `undefined` when no batch has run yet.
1322
+ * Includes per-batch summed geometry wall time, mesh/triangle counts,
1323
+ * the degenerate-backstop drop count, and the CSG failure aggregates.
1324
+ * @returns {any}
1325
+ */
1326
+ getPipelineDiagnostics() {
1327
+ const ret = wasm.ifcapi_getPipelineDiagnostics(this.__wbg_ptr);
1328
+ return takeObject(ret);
1329
+ }
1317
1330
  /**
1318
1331
  * Get WASM memory for zero-copy access
1319
1332
  * @returns {any}
@@ -1404,12 +1417,13 @@ export class IfcAPI {
1404
1417
  * Enable or disable the PARAMETRIC rectangular-opening fast path (the
1405
1418
  * placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
1406
1419
  *
1407
- * DEFAULT OFF. This is the wasm-side toggle that lets native and wasm flip the
1408
- * flag in LOCKSTEP the byte-identical native==wasm contract requires both
1409
- * targets take the same path, and wasm has no env to read `IFC_LITE_RECT_PARAM`.
1420
+ * DEFAULT ON (corpus-validated; native defaults ON too, and wasm has no env to
1421
+ * read `IFC_LITE_RECT_PARAM`, so both targets default in LOCKSTEP -- the
1422
+ * byte-identical native==wasm contract requires both take the same path). This
1423
+ * toggle is the wasm-side escape hatch mirroring `IFC_LITE_RECT_PARAM=0`.
1410
1424
  * The path subtracts rectangular openings as exact parametric boxes in the host's
1411
1425
  * own placement frame (rotated walls included), deferring any non-clean case to
1412
- * the exact kernel. Pass `true` before `processGeometryBatch`.
1426
+ * the exact kernel. Pass `false` before `processGeometryBatch` to opt out.
1413
1427
  * @param {boolean} enabled
1414
1428
  */
1415
1429
  setRectParamFastPath(enabled) {
@@ -1777,6 +1791,28 @@ export class MeshDataJs {
1777
1791
  const ret = wasm.meshdatajs_hasTexture(this.__wbg_ptr);
1778
1792
  return ret !== 0;
1779
1793
  }
1794
+ /**
1795
+ * Local (pre-placement, object-space) AABB (issue #1474), WebGL Y-up,
1796
+ * `[minX,minY,minZ,maxX,maxY,maxZ]`. `undefined` when not captured
1797
+ * (wasm-bindgen maps `Option::None` to `undefined`, not `null`).
1798
+ * @returns {Float32Array | undefined}
1799
+ */
1800
+ get localBounds() {
1801
+ try {
1802
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1803
+ wasm.meshdatajs_localBounds(retptr, this.__wbg_ptr);
1804
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1805
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1806
+ let v1;
1807
+ if (r0 !== 0) {
1808
+ v1 = getArrayF32FromWasm0(r0, r1).slice();
1809
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1810
+ }
1811
+ return v1;
1812
+ } finally {
1813
+ wasm.__wbindgen_add_to_stack_pointer(16);
1814
+ }
1815
+ }
1780
1816
  /**
1781
1817
  * Decoded RGBA8 texture bytes (`width*height*4`). Empty when untextured.
1782
1818
  * @returns {Uint8Array}
@@ -1832,6 +1868,28 @@ export class MeshDataJs {
1832
1868
  const ret = wasm.meshdatajs_geometryClass(this.__wbg_ptr);
1833
1869
  return ret;
1834
1870
  }
1871
+ /**
1872
+ * The resolved `IfcLocalPlacement` chain for this mesh (issue #1474),
1873
+ * row-major 4×4, WebGL Y-up. `undefined` when not captured (see
1874
+ * `local_bounds` above).
1875
+ * @returns {Float64Array | undefined}
1876
+ */
1877
+ get localToWorld() {
1878
+ try {
1879
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1880
+ wasm.meshdatajs_localToWorld(retptr, this.__wbg_ptr);
1881
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1882
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1883
+ let v1;
1884
+ if (r0 !== 0) {
1885
+ v1 = getArrayF64FromWasm0(r0, r1).slice();
1886
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
1887
+ }
1888
+ return v1;
1889
+ } finally {
1890
+ wasm.__wbindgen_add_to_stack_pointer(16);
1891
+ }
1892
+ }
1835
1893
  /**
1836
1894
  * @returns {number}
1837
1895
  */
@@ -2143,7 +2201,7 @@ export class ProfileEntryJs {
2143
2201
  * @returns {number}
2144
2202
  */
2145
2203
  get expressId() {
2146
- const ret = wasm.meshdatajs_textureWidth(this.__wbg_ptr);
2204
+ const ret = wasm.profileentryjs_expressId(this.__wbg_ptr);
2147
2205
  return ret >>> 0;
2148
2206
  }
2149
2207
  /**
@@ -2835,7 +2893,7 @@ export class SymbolicFillArea {
2835
2893
  * @returns {number}
2836
2894
  */
2837
2895
  get expressId() {
2838
- const ret = wasm.meshdatajs_textureWidth(this.__wbg_ptr);
2896
+ const ret = wasm.profileentryjs_expressId(this.__wbg_ptr);
2839
2897
  return ret >>> 0;
2840
2898
  }
2841
2899
  /**
@@ -3243,7 +3301,7 @@ export class SymbolicText {
3243
3301
  * @returns {number}
3244
3302
  */
3245
3303
  get expressId() {
3246
- const ret = wasm.meshdatajs_textureWidth(this.__wbg_ptr);
3304
+ const ret = wasm.profileentryjs_expressId(this.__wbg_ptr);
3247
3305
  return ret >>> 0;
3248
3306
  }
3249
3307
  /**
@@ -3606,6 +3664,10 @@ function __wbg_get_imports() {
3606
3664
  const ret = new Float64Array(arg0 >>> 0);
3607
3665
  return addHeapObject(ret);
3608
3666
  };
3667
+ imports.wbg.__wbg_now_69d776cd24f5215b = function() {
3668
+ const ret = Date.now();
3669
+ return ret;
3670
+ };
3609
3671
  imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
3610
3672
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3611
3673
  };
Binary file