@ifc-lite/wasm 2.10.0 → 2.11.1

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.10.0",
8
+ "version": "2.11.1",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -82,14 +82,52 @@ export class GridAxisJs {
82
82
  export class IfcAPI {
83
83
  free(): void;
84
84
  [Symbol.dispose](): void;
85
+ /**
86
+ * Export the render geometry in `content` as a binary **GLB** (`Uint8Array`).
87
+ *
88
+ * `hidden` / `isolated` are express-id visibility filters; `hidden_types_csv` is a
89
+ * comma-separated list of IFC type names whose class toggle is off (e.g.
90
+ * `"IfcOpeningElement,IfcSpace"`). `include_metadata` attaches counts + per-node
91
+ * `expressId`. Per-mesh RTC origin rides the node translation (precision-safe).
92
+ */
93
+ exportGlb(content: string, include_metadata: boolean, hidden: Uint32Array, isolated: Uint32Array, hidden_types_csv: string): Uint8Array;
94
+ /**
95
+ * Package an already-produced **GLB** + georeference into a **KMZ** (`Uint8Array`)
96
+ * for Google Earth: a ZIP of `doc.kml` (a `<Model>` placed at `latitude`/`longitude`/
97
+ * `altitude`) + `model.glb`. `x_axis_abscissa`/`x_axis_ordinate` are the
98
+ * `IfcMapConversion` grid-north components; pass both as `undefined` for heading 0.
99
+ */
100
+ exportKmz(glb: Uint8Array, latitude: number, longitude: number, altitude: number, x_axis_abscissa: number | null | undefined, x_axis_ordinate: number | null | undefined, name: string): Uint8Array;
101
+ /**
102
+ * Assemble a **GLB** from already-produced meshes (the viewer's `MeshData`, flattened)
103
+ * — no re-meshing. Per mesh `i`: `vertex_counts[i]` verts + `index_counts[i]` indices
104
+ * taken in order from the concatenated `positions`/`normals`/`indices`; `colors` is
105
+ * RGBA per mesh, `origins` xyz per mesh, `express_ids` labels each mesh (indices are
106
+ * per-mesh local). The caller passes exactly the meshes it wants emitted.
107
+ */
108
+ exportGlbFromMeshes(positions: Float32Array, normals: Float32Array, indices: Uint32Array, vertex_counts: Uint32Array, index_counts: Uint32Array, colors: Float32Array, origins: Float64Array, express_ids: Uint32Array, include_metadata: boolean): Uint8Array;
109
+ /**
110
+ * Export the render geometry in `content` as a Wavefront **OBJ** string.
111
+ *
112
+ * `hidden` / `isolated` are express-id filters mirroring the viewer's visibility
113
+ * state (empty `isolated` ⇒ all visible). Instanced type-library shapes are skipped.
114
+ *
115
+ * ```javascript
116
+ * const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
117
+ * ```
118
+ */
119
+ exportObj(content: string, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): string;
85
120
  /**
86
121
  * Run the pre-pass ONCE and return serialized results for worker distribution.
87
122
  * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
88
123
  */
89
124
  buildPrePassOnce(data: Uint8Array): any;
90
125
  /**
91
- * Process geometry for a subset of pre-scanned entities.
92
- * Takes raw bytes and pre-pass data from buildPrePassOnce.
126
+ * Process geometry for a subset of pre-scanned entities → flat
127
+ * MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
128
+ * Thin wrapper over [`IfcAPI::produce_batch`]; converts each produced mesh
129
+ * to MeshDataJs (the IFC Z-up→WebGL Y-up swap + winding reversal happen
130
+ * there). Output is byte-for-byte what the pre-refactor method produced.
93
131
  */
94
132
  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;
95
133
  /**
@@ -118,6 +156,36 @@ export class IfcAPI {
118
156
  * `{ type: "complete", totalJobs }`
119
157
  */
120
158
  buildPrePassStreaming(data: Uint8Array, on_event: Function, chunk_size: number, disabled_type_names: string[] | null | undefined, skip_type_geometry: boolean): any;
159
+ /**
160
+ * Like [`IfcAPI::process_geometry_batch`] but collates the batch's meshes
161
+ * into a GPU-instancing shard (IFNS wire format) instead of a flat
162
+ * MeshCollection. Repeated geometry collapses to one template + per-
163
+ * occurrence transforms; non-instanceable meshes ride as flat singleton
164
+ * templates so nothing is dropped. The shard stays in the producer-native
165
+ * (IFC Z-up) frame — the renderer composes the constant Z-up→Y-up swap at
166
+ * upload. Each batch shard renders independently: affinity routing already
167
+ * co-locates identical geometry on one worker, so per-batch collation
168
+ * captures ~all the dedup and no cross-batch merge is needed. Returns empty
169
+ * bytes only when the batch produced zero non-empty meshes.
170
+ */
171
+ processGeometryBatchInstanced(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): Uint8Array;
172
+ /**
173
+ * Produce a batch ONCE and PARTITION it (the instanced-ONLY path): opaque
174
+ * ordinary occurrences (colour alpha >= 0.99 AND geometry_class == 0) are
175
+ * collated into the instanced shard; everything else (transparent glass,
176
+ * type-product geometry) goes to the flat MeshCollection. Each mesh takes
177
+ * exactly ONE route, so produce_batch runs once (no emit-both 2× meshing)
178
+ * and the renderer draws opaque occurrences via instancing instead of flat.
179
+ * Partition mirrors the renderer gates: INSTANCED_ALPHA_CUTOFF (0.99 =
180
+ * OPAQUE_ALPHA_CUTOFF) for transparency, geometry_class for the Model/Types
181
+ * split.
182
+ *
183
+ * NOTE: the renderer must be instanced-feature-complete (picking / selection
184
+ * / lens overlays on instanced geometry) before the worker calls this in
185
+ * place of processGeometryBatch — otherwise those features break for the
186
+ * opaque bulk. See the instanced-only follow-ups.
187
+ */
188
+ 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;
121
189
  /**
122
190
  * Parse the file and return structured per-axis data (tag + endpoints) in
123
191
  * the renderer's Y-up world space (RTC-subtracted, metres). Use this when
@@ -134,6 +202,43 @@ export class IfcAPI {
134
202
  * clear the overlay cheaply.
135
203
  */
136
204
  parseGridLines(content: string): Float32Array;
205
+ /**
206
+ * Export tabular **CSV**. `mode` ∈ {`"entities"`, `"properties"`, `"quantities"`,
207
+ * `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
208
+ * flattened `Pset_Prop` columns to the entities view.
209
+ */
210
+ exportCsv(content: string, mode: string, delimiter: string, include_properties: boolean): string;
211
+ /**
212
+ * Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
213
+ * only properties with an official IFC5 schema.
214
+ */
215
+ exportIfcx(content: string, only_known_properties: boolean, pretty: boolean): string;
216
+ /**
217
+ * Export structured **JSON** (array of entity objects with typed property values).
218
+ */
219
+ exportJson(content: string, pretty: boolean, include_properties: boolean, include_quantities: boolean): string;
220
+ /**
221
+ * Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
222
+ * IFC4 OWL default. `included` is an express-id isolation filter mirroring the
223
+ * OBJ/glTF/STEP exporters (empty ⇒ all entities).
224
+ */
225
+ exportJsonld(content: string, context: string, include_properties: boolean, include_quantities: boolean, pretty: boolean, included: Uint32Array): string;
226
+ /**
227
+ * Re-serialize the model in `content` to a STEP/IFC string.
228
+ *
229
+ * `schema` is the FILE_SCHEMA label to write (empty ⇒ preserve the source schema).
230
+ * `included` is an express-id allowlist (empty ⇒ whole model); when set, the forward
231
+ * `#`-reference closure is added so the subset never dangles a reference.
232
+ * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
233
+ * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
234
+ */
235
+ exportStep(content: string, schema: string, included: Uint32Array, mutations_json: string): string;
236
+ /**
237
+ * Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
238
+ * bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
239
+ * keeps its ids; later models are id-offset and their project unified to the first.
240
+ */
241
+ exportMerged(concatenated: Uint8Array, lengths: Uint32Array, schema: string): string;
137
242
  /**
138
243
  * Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
139
244
  *
@@ -496,6 +601,27 @@ export class MeshOutlineJs {
496
601
  readonly axisMin: number;
497
602
  }
498
603
 
604
+ export class PartitionedBatch {
605
+ private constructor();
606
+ free(): void;
607
+ [Symbol.dispose](): void;
608
+ /**
609
+ * The instanced IFNS shard bytes (opaque ordinary occurrences). Moves out.
610
+ */
611
+ takeShard(): Uint8Array;
612
+ /**
613
+ * The flat MeshCollection (transparent glass + type-product geometry).
614
+ * Moves out — call once.
615
+ */
616
+ takeMeshes(): MeshCollection | undefined;
617
+ /**
618
+ * Number of occurrences routed into the instanced shard this batch. The viewer
619
+ * folds this into its total mesh count so the count reflects ALL rendered
620
+ * geometry (flat + instanced), not just the flat MeshCollection.
621
+ */
622
+ readonly instancedOccurrences: number;
623
+ }
624
+
499
625
  export class ProfileCollection {
500
626
  private constructor();
501
627
  free(): void;
@@ -911,6 +1037,7 @@ export interface InitOutput {
911
1037
  readonly __wbg_meshcollection_free: (a: number, b: number) => void;
912
1038
  readonly __wbg_meshdatajs_free: (a: number, b: number) => void;
913
1039
  readonly __wbg_meshoutlinejs_free: (a: number, b: number) => void;
1040
+ readonly __wbg_partitionedbatch_free: (a: number, b: number) => void;
914
1041
  readonly __wbg_profilecollection_free: (a: number, b: number) => void;
915
1042
  readonly __wbg_profileentryjs_free: (a: number, b: number) => void;
916
1043
  readonly __wbg_spaceplatehandle_free: (a: number, b: number) => void;
@@ -939,7 +1066,17 @@ export interface InitOutput {
939
1066
  readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
940
1067
  readonly ifcapi_buildPrePassStreaming: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
941
1068
  readonly ifcapi_clearPrePassCache: (a: number) => void;
1069
+ readonly ifcapi_exportCsv: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
1070
+ 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) => void;
1071
+ 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) => void;
942
1072
  readonly ifcapi_exportHbjson: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1073
+ readonly ifcapi_exportIfcx: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1074
+ readonly ifcapi_exportJson: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1075
+ readonly ifcapi_exportJsonld: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
1076
+ readonly ifcapi_exportKmz: (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) => void;
1077
+ readonly ifcapi_exportMerged: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
1078
+ readonly ifcapi_exportObj: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
1079
+ readonly ifcapi_exportStep: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
943
1080
  readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
944
1081
  readonly ifcapi_getMemory: (a: number) => number;
945
1082
  readonly ifcapi_is_ready: (a: number) => number;
@@ -949,6 +1086,8 @@ export interface InitOutput {
949
1086
  readonly ifcapi_parseGridLines: (a: number, b: number, c: number) => number;
950
1087
  readonly ifcapi_parseSymbolicRepresentations: (a: number, b: number, c: number) => number;
951
1088
  readonly ifcapi_processGeometryBatch: (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, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number) => number;
1089
+ readonly ifcapi_processGeometryBatchInstanced: (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, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number) => void;
1090
+ readonly ifcapi_processGeometryBatchPartitioned: (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, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number) => number;
952
1091
  readonly ifcapi_scanEntitiesFast: (a: number, b: number, c: number) => number;
953
1092
  readonly ifcapi_scanEntitiesFastBytes: (a: number, b: number, c: number) => number;
954
1093
  readonly ifcapi_scanGeometryEntitiesFast: (a: number, b: number, c: number) => number;
@@ -994,6 +1133,9 @@ export interface InitOutput {
994
1133
  readonly meshoutlinejs_axisMin: (a: number) => number;
995
1134
  readonly meshoutlinejs_contour: (a: number, b: number) => number;
996
1135
  readonly meshoutlinejs_contourCount: (a: number) => number;
1136
+ readonly partitionedbatch_instancedOccurrences: (a: number) => number;
1137
+ readonly partitionedbatch_takeMeshes: (a: number) => number;
1138
+ readonly partitionedbatch_takeShard: (a: number, b: number) => void;
997
1139
  readonly profilecollection_get: (a: number, b: number) => number;
998
1140
  readonly profilecollection_length: (a: number) => number;
999
1141
  readonly profileentryjs_extrusionDepth: (a: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -262,6 +262,10 @@ const MeshOutlineJsFinalization = (typeof FinalizationRegistry === 'undefined')
262
262
  ? { register: () => {}, unregister: () => {} }
263
263
  : new FinalizationRegistry(ptr => wasm.__wbg_meshoutlinejs_free(ptr >>> 0, 1));
264
264
 
265
+ const PartitionedBatchFinalization = (typeof FinalizationRegistry === 'undefined')
266
+ ? { register: () => {}, unregister: () => {} }
267
+ : new FinalizationRegistry(ptr => wasm.__wbg_partitionedbatch_free(ptr >>> 0, 1));
268
+
265
269
  const ProfileCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
266
270
  ? { register: () => {}, unregister: () => {} }
267
271
  : new FinalizationRegistry(ptr => wasm.__wbg_profilecollection_free(ptr >>> 0, 1));
@@ -624,6 +628,155 @@ export class IfcAPI {
624
628
  const ptr = this.__destroy_into_raw();
625
629
  wasm.__wbg_ifcapi_free(ptr, 0);
626
630
  }
631
+ /**
632
+ * Export the render geometry in `content` as a binary **GLB** (`Uint8Array`).
633
+ *
634
+ * `hidden` / `isolated` are express-id visibility filters; `hidden_types_csv` is a
635
+ * comma-separated list of IFC type names whose class toggle is off (e.g.
636
+ * `"IfcOpeningElement,IfcSpace"`). `include_metadata` attaches counts + per-node
637
+ * `expressId`. Per-mesh RTC origin rides the node translation (precision-safe).
638
+ * @param {string} content
639
+ * @param {boolean} include_metadata
640
+ * @param {Uint32Array} hidden
641
+ * @param {Uint32Array} isolated
642
+ * @param {string} hidden_types_csv
643
+ * @returns {Uint8Array}
644
+ */
645
+ exportGlb(content, include_metadata, hidden, isolated, hidden_types_csv) {
646
+ try {
647
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
648
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
649
+ const len0 = WASM_VECTOR_LEN;
650
+ const ptr1 = passArray32ToWasm0(hidden, wasm.__wbindgen_export);
651
+ const len1 = WASM_VECTOR_LEN;
652
+ const ptr2 = passArray32ToWasm0(isolated, wasm.__wbindgen_export);
653
+ const len2 = WASM_VECTOR_LEN;
654
+ const ptr3 = passStringToWasm0(hidden_types_csv, wasm.__wbindgen_export, wasm.__wbindgen_export2);
655
+ const len3 = WASM_VECTOR_LEN;
656
+ wasm.ifcapi_exportGlb(retptr, this.__wbg_ptr, ptr0, len0, include_metadata, ptr1, len1, ptr2, len2, ptr3, len3);
657
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
658
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
659
+ var v5 = getArrayU8FromWasm0(r0, r1).slice();
660
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
661
+ return v5;
662
+ } finally {
663
+ wasm.__wbindgen_add_to_stack_pointer(16);
664
+ }
665
+ }
666
+ /**
667
+ * Package an already-produced **GLB** + georeference into a **KMZ** (`Uint8Array`)
668
+ * for Google Earth: a ZIP of `doc.kml` (a `<Model>` placed at `latitude`/`longitude`/
669
+ * `altitude`) + `model.glb`. `x_axis_abscissa`/`x_axis_ordinate` are the
670
+ * `IfcMapConversion` grid-north components; pass both as `undefined` for heading 0.
671
+ * @param {Uint8Array} glb
672
+ * @param {number} latitude
673
+ * @param {number} longitude
674
+ * @param {number} altitude
675
+ * @param {number | null | undefined} x_axis_abscissa
676
+ * @param {number | null | undefined} x_axis_ordinate
677
+ * @param {string} name
678
+ * @returns {Uint8Array}
679
+ */
680
+ exportKmz(glb, latitude, longitude, altitude, x_axis_abscissa, x_axis_ordinate, name) {
681
+ try {
682
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
683
+ const ptr0 = passArray8ToWasm0(glb, wasm.__wbindgen_export);
684
+ const len0 = WASM_VECTOR_LEN;
685
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
686
+ const len1 = WASM_VECTOR_LEN;
687
+ wasm.ifcapi_exportKmz(retptr, this.__wbg_ptr, ptr0, len0, latitude, longitude, altitude, !isLikeNone(x_axis_abscissa), isLikeNone(x_axis_abscissa) ? 0 : x_axis_abscissa, !isLikeNone(x_axis_ordinate), isLikeNone(x_axis_ordinate) ? 0 : x_axis_ordinate, ptr1, len1);
688
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
689
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
690
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
691
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
692
+ return v3;
693
+ } finally {
694
+ wasm.__wbindgen_add_to_stack_pointer(16);
695
+ }
696
+ }
697
+ /**
698
+ * Assemble a **GLB** from already-produced meshes (the viewer's `MeshData`, flattened)
699
+ * — no re-meshing. Per mesh `i`: `vertex_counts[i]` verts + `index_counts[i]` indices
700
+ * taken in order from the concatenated `positions`/`normals`/`indices`; `colors` is
701
+ * RGBA per mesh, `origins` xyz per mesh, `express_ids` labels each mesh (indices are
702
+ * per-mesh local). The caller passes exactly the meshes it wants emitted.
703
+ * @param {Float32Array} positions
704
+ * @param {Float32Array} normals
705
+ * @param {Uint32Array} indices
706
+ * @param {Uint32Array} vertex_counts
707
+ * @param {Uint32Array} index_counts
708
+ * @param {Float32Array} colors
709
+ * @param {Float64Array} origins
710
+ * @param {Uint32Array} express_ids
711
+ * @param {boolean} include_metadata
712
+ * @returns {Uint8Array}
713
+ */
714
+ exportGlbFromMeshes(positions, normals, indices, vertex_counts, index_counts, colors, origins, express_ids, include_metadata) {
715
+ try {
716
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
717
+ const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_export);
718
+ const len0 = WASM_VECTOR_LEN;
719
+ const ptr1 = passArrayF32ToWasm0(normals, wasm.__wbindgen_export);
720
+ const len1 = WASM_VECTOR_LEN;
721
+ const ptr2 = passArray32ToWasm0(indices, wasm.__wbindgen_export);
722
+ const len2 = WASM_VECTOR_LEN;
723
+ const ptr3 = passArray32ToWasm0(vertex_counts, wasm.__wbindgen_export);
724
+ const len3 = WASM_VECTOR_LEN;
725
+ const ptr4 = passArray32ToWasm0(index_counts, wasm.__wbindgen_export);
726
+ const len4 = WASM_VECTOR_LEN;
727
+ const ptr5 = passArrayF32ToWasm0(colors, wasm.__wbindgen_export);
728
+ const len5 = WASM_VECTOR_LEN;
729
+ const ptr6 = passArrayF64ToWasm0(origins, wasm.__wbindgen_export);
730
+ const len6 = WASM_VECTOR_LEN;
731
+ const ptr7 = passArray32ToWasm0(express_ids, wasm.__wbindgen_export);
732
+ const len7 = WASM_VECTOR_LEN;
733
+ wasm.ifcapi_exportGlbFromMeshes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, include_metadata);
734
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
735
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
736
+ var v9 = getArrayU8FromWasm0(r0, r1).slice();
737
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
738
+ return v9;
739
+ } finally {
740
+ wasm.__wbindgen_add_to_stack_pointer(16);
741
+ }
742
+ }
743
+ /**
744
+ * Export the render geometry in `content` as a Wavefront **OBJ** string.
745
+ *
746
+ * `hidden` / `isolated` are express-id filters mirroring the viewer's visibility
747
+ * state (empty `isolated` ⇒ all visible). Instanced type-library shapes are skipped.
748
+ *
749
+ * ```javascript
750
+ * const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
751
+ * ```
752
+ * @param {string} content
753
+ * @param {boolean} include_normals
754
+ * @param {Uint32Array} hidden
755
+ * @param {Uint32Array} isolated
756
+ * @returns {string}
757
+ */
758
+ exportObj(content, include_normals, hidden, isolated) {
759
+ let deferred4_0;
760
+ let deferred4_1;
761
+ try {
762
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
763
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
764
+ const len0 = WASM_VECTOR_LEN;
765
+ const ptr1 = passArray32ToWasm0(hidden, wasm.__wbindgen_export);
766
+ const len1 = WASM_VECTOR_LEN;
767
+ const ptr2 = passArray32ToWasm0(isolated, wasm.__wbindgen_export);
768
+ const len2 = WASM_VECTOR_LEN;
769
+ wasm.ifcapi_exportObj(retptr, this.__wbg_ptr, ptr0, len0, include_normals, ptr1, len1, ptr2, len2);
770
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
771
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
772
+ deferred4_0 = r0;
773
+ deferred4_1 = r1;
774
+ return getStringFromWasm0(r0, r1);
775
+ } finally {
776
+ wasm.__wbindgen_add_to_stack_pointer(16);
777
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
778
+ }
779
+ }
627
780
  /**
628
781
  * Run the pre-pass ONCE and return serialized results for worker distribution.
629
782
  * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
@@ -637,8 +790,11 @@ export class IfcAPI {
637
790
  return takeObject(ret);
638
791
  }
639
792
  /**
640
- * Process geometry for a subset of pre-scanned entities.
641
- * Takes raw bytes and pre-pass data from buildPrePassOnce.
793
+ * Process geometry for a subset of pre-scanned entities → flat
794
+ * MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
795
+ * Thin wrapper over [`IfcAPI::produce_batch`]; converts each produced mesh
796
+ * to MeshDataJs (the IFC Z-up→WebGL Y-up swap + winding reversal happen
797
+ * there). Output is byte-for-byte what the pre-refactor method produced.
642
798
  * @param {Uint8Array} data
643
799
  * @param {Uint32Array} jobs_flat
644
800
  * @param {number} unit_scale
@@ -732,6 +888,125 @@ export class IfcAPI {
732
888
  heap[stack_pointer++] = undefined;
733
889
  }
734
890
  }
891
+ /**
892
+ * Like [`IfcAPI::process_geometry_batch`] but collates the batch's meshes
893
+ * into a GPU-instancing shard (IFNS wire format) instead of a flat
894
+ * MeshCollection. Repeated geometry collapses to one template + per-
895
+ * occurrence transforms; non-instanceable meshes ride as flat singleton
896
+ * templates so nothing is dropped. The shard stays in the producer-native
897
+ * (IFC Z-up) frame — the renderer composes the constant Z-up→Y-up swap at
898
+ * upload. Each batch shard renders independently: affinity routing already
899
+ * co-locates identical geometry on one worker, so per-batch collation
900
+ * captures ~all the dedup and no cross-batch merge is needed. Returns empty
901
+ * bytes only when the batch produced zero non-empty meshes.
902
+ * @param {Uint8Array} data
903
+ * @param {Uint32Array} jobs_flat
904
+ * @param {number} unit_scale
905
+ * @param {number} rtc_x
906
+ * @param {number} rtc_y
907
+ * @param {number} rtc_z
908
+ * @param {boolean} needs_shift
909
+ * @param {Uint32Array} void_keys
910
+ * @param {Uint32Array} void_counts
911
+ * @param {Uint32Array} void_values
912
+ * @param {Uint32Array} style_ids
913
+ * @param {Uint8Array} style_colors
914
+ * @param {number | null} [plane_angle_to_radians]
915
+ * @param {Uint32Array | null} [material_element_ids]
916
+ * @param {Uint32Array | null} [material_color_counts]
917
+ * @param {Uint8Array | null} [material_colors_rgba]
918
+ * @returns {Uint8Array}
919
+ */
920
+ processGeometryBatchInstanced(data, jobs_flat, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, void_keys, void_counts, void_values, style_ids, style_colors, plane_angle_to_radians, material_element_ids, material_color_counts, material_colors_rgba) {
921
+ try {
922
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
923
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
924
+ const len0 = WASM_VECTOR_LEN;
925
+ const ptr1 = passArray32ToWasm0(jobs_flat, wasm.__wbindgen_export);
926
+ const len1 = WASM_VECTOR_LEN;
927
+ const ptr2 = passArray32ToWasm0(void_keys, wasm.__wbindgen_export);
928
+ const len2 = WASM_VECTOR_LEN;
929
+ const ptr3 = passArray32ToWasm0(void_counts, wasm.__wbindgen_export);
930
+ const len3 = WASM_VECTOR_LEN;
931
+ const ptr4 = passArray32ToWasm0(void_values, wasm.__wbindgen_export);
932
+ const len4 = WASM_VECTOR_LEN;
933
+ const ptr5 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export);
934
+ const len5 = WASM_VECTOR_LEN;
935
+ const ptr6 = passArray8ToWasm0(style_colors, wasm.__wbindgen_export);
936
+ const len6 = WASM_VECTOR_LEN;
937
+ var ptr7 = isLikeNone(material_element_ids) ? 0 : passArray32ToWasm0(material_element_ids, wasm.__wbindgen_export);
938
+ var len7 = WASM_VECTOR_LEN;
939
+ var ptr8 = isLikeNone(material_color_counts) ? 0 : passArray32ToWasm0(material_color_counts, wasm.__wbindgen_export);
940
+ var len8 = WASM_VECTOR_LEN;
941
+ var ptr9 = isLikeNone(material_colors_rgba) ? 0 : passArray8ToWasm0(material_colors_rgba, wasm.__wbindgen_export);
942
+ var len9 = WASM_VECTOR_LEN;
943
+ wasm.ifcapi_processGeometryBatchInstanced(retptr, 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);
944
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
945
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
946
+ var v11 = getArrayU8FromWasm0(r0, r1).slice();
947
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
948
+ return v11;
949
+ } finally {
950
+ wasm.__wbindgen_add_to_stack_pointer(16);
951
+ }
952
+ }
953
+ /**
954
+ * Produce a batch ONCE and PARTITION it (the instanced-ONLY path): opaque
955
+ * ordinary occurrences (colour alpha >= 0.99 AND geometry_class == 0) are
956
+ * collated into the instanced shard; everything else (transparent glass,
957
+ * type-product geometry) goes to the flat MeshCollection. Each mesh takes
958
+ * exactly ONE route, so produce_batch runs once (no emit-both 2× meshing)
959
+ * and the renderer draws opaque occurrences via instancing instead of flat.
960
+ * Partition mirrors the renderer gates: INSTANCED_ALPHA_CUTOFF (0.99 =
961
+ * OPAQUE_ALPHA_CUTOFF) for transparency, geometry_class for the Model/Types
962
+ * split.
963
+ *
964
+ * NOTE: the renderer must be instanced-feature-complete (picking / selection
965
+ * / lens overlays on instanced geometry) before the worker calls this in
966
+ * place of processGeometryBatch — otherwise those features break for the
967
+ * opaque bulk. See the instanced-only follow-ups.
968
+ * @param {Uint8Array} data
969
+ * @param {Uint32Array} jobs_flat
970
+ * @param {number} unit_scale
971
+ * @param {number} rtc_x
972
+ * @param {number} rtc_y
973
+ * @param {number} rtc_z
974
+ * @param {boolean} needs_shift
975
+ * @param {Uint32Array} void_keys
976
+ * @param {Uint32Array} void_counts
977
+ * @param {Uint32Array} void_values
978
+ * @param {Uint32Array} style_ids
979
+ * @param {Uint8Array} style_colors
980
+ * @param {number | null} [plane_angle_to_radians]
981
+ * @param {Uint32Array | null} [material_element_ids]
982
+ * @param {Uint32Array | null} [material_color_counts]
983
+ * @param {Uint8Array | null} [material_colors_rgba]
984
+ * @returns {PartitionedBatch}
985
+ */
986
+ processGeometryBatchPartitioned(data, jobs_flat, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, void_keys, void_counts, void_values, style_ids, style_colors, plane_angle_to_radians, material_element_ids, material_color_counts, material_colors_rgba) {
987
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
988
+ const len0 = WASM_VECTOR_LEN;
989
+ const ptr1 = passArray32ToWasm0(jobs_flat, wasm.__wbindgen_export);
990
+ const len1 = WASM_VECTOR_LEN;
991
+ const ptr2 = passArray32ToWasm0(void_keys, wasm.__wbindgen_export);
992
+ const len2 = WASM_VECTOR_LEN;
993
+ const ptr3 = passArray32ToWasm0(void_counts, wasm.__wbindgen_export);
994
+ const len3 = WASM_VECTOR_LEN;
995
+ const ptr4 = passArray32ToWasm0(void_values, wasm.__wbindgen_export);
996
+ const len4 = WASM_VECTOR_LEN;
997
+ const ptr5 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export);
998
+ const len5 = WASM_VECTOR_LEN;
999
+ const ptr6 = passArray8ToWasm0(style_colors, wasm.__wbindgen_export);
1000
+ const len6 = WASM_VECTOR_LEN;
1001
+ var ptr7 = isLikeNone(material_element_ids) ? 0 : passArray32ToWasm0(material_element_ids, wasm.__wbindgen_export);
1002
+ var len7 = WASM_VECTOR_LEN;
1003
+ var ptr8 = isLikeNone(material_color_counts) ? 0 : passArray32ToWasm0(material_color_counts, wasm.__wbindgen_export);
1004
+ var len8 = WASM_VECTOR_LEN;
1005
+ var ptr9 = isLikeNone(material_colors_rgba) ? 0 : passArray8ToWasm0(material_colors_rgba, wasm.__wbindgen_export);
1006
+ var len9 = WASM_VECTOR_LEN;
1007
+ 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);
1008
+ return PartitionedBatch.__wrap(ret);
1009
+ }
735
1010
  /**
736
1011
  * Parse the file and return structured per-axis data (tag + endpoints) in
737
1012
  * the renderer's Y-up world space (RTC-subtracted, metres). Use this when
@@ -762,6 +1037,193 @@ export class IfcAPI {
762
1037
  const ret = wasm.ifcapi_parseGridLines(this.__wbg_ptr, ptr0, len0);
763
1038
  return takeObject(ret);
764
1039
  }
1040
+ /**
1041
+ * Export tabular **CSV**. `mode` ∈ {`"entities"`, `"properties"`, `"quantities"`,
1042
+ * `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
1043
+ * flattened `Pset_Prop` columns to the entities view.
1044
+ * @param {string} content
1045
+ * @param {string} mode
1046
+ * @param {string} delimiter
1047
+ * @param {boolean} include_properties
1048
+ * @returns {string}
1049
+ */
1050
+ exportCsv(content, mode, delimiter, include_properties) {
1051
+ let deferred4_0;
1052
+ let deferred4_1;
1053
+ try {
1054
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1055
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1056
+ const len0 = WASM_VECTOR_LEN;
1057
+ const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1058
+ const len1 = WASM_VECTOR_LEN;
1059
+ const ptr2 = passStringToWasm0(delimiter, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1060
+ const len2 = WASM_VECTOR_LEN;
1061
+ wasm.ifcapi_exportCsv(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, include_properties);
1062
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1063
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1064
+ deferred4_0 = r0;
1065
+ deferred4_1 = r1;
1066
+ return getStringFromWasm0(r0, r1);
1067
+ } finally {
1068
+ wasm.__wbindgen_add_to_stack_pointer(16);
1069
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
1070
+ }
1071
+ }
1072
+ /**
1073
+ * Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
1074
+ * only properties with an official IFC5 schema.
1075
+ * @param {string} content
1076
+ * @param {boolean} only_known_properties
1077
+ * @param {boolean} pretty
1078
+ * @returns {string}
1079
+ */
1080
+ exportIfcx(content, only_known_properties, pretty) {
1081
+ let deferred2_0;
1082
+ let deferred2_1;
1083
+ try {
1084
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1085
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1086
+ const len0 = WASM_VECTOR_LEN;
1087
+ wasm.ifcapi_exportIfcx(retptr, this.__wbg_ptr, ptr0, len0, only_known_properties, pretty);
1088
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1089
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1090
+ deferred2_0 = r0;
1091
+ deferred2_1 = r1;
1092
+ return getStringFromWasm0(r0, r1);
1093
+ } finally {
1094
+ wasm.__wbindgen_add_to_stack_pointer(16);
1095
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1096
+ }
1097
+ }
1098
+ /**
1099
+ * Export structured **JSON** (array of entity objects with typed property values).
1100
+ * @param {string} content
1101
+ * @param {boolean} pretty
1102
+ * @param {boolean} include_properties
1103
+ * @param {boolean} include_quantities
1104
+ * @returns {string}
1105
+ */
1106
+ exportJson(content, pretty, include_properties, include_quantities) {
1107
+ let deferred2_0;
1108
+ let deferred2_1;
1109
+ try {
1110
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1111
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1112
+ const len0 = WASM_VECTOR_LEN;
1113
+ wasm.ifcapi_exportJson(retptr, this.__wbg_ptr, ptr0, len0, pretty, include_properties, include_quantities);
1114
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1115
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1116
+ deferred2_0 = r0;
1117
+ deferred2_1 = r1;
1118
+ return getStringFromWasm0(r0, r1);
1119
+ } finally {
1120
+ wasm.__wbindgen_add_to_stack_pointer(16);
1121
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1122
+ }
1123
+ }
1124
+ /**
1125
+ * Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
1126
+ * IFC4 OWL default. `included` is an express-id isolation filter mirroring the
1127
+ * OBJ/glTF/STEP exporters (empty ⇒ all entities).
1128
+ * @param {string} content
1129
+ * @param {string} context
1130
+ * @param {boolean} include_properties
1131
+ * @param {boolean} include_quantities
1132
+ * @param {boolean} pretty
1133
+ * @param {Uint32Array} included
1134
+ * @returns {string}
1135
+ */
1136
+ exportJsonld(content, context, include_properties, include_quantities, pretty, included) {
1137
+ let deferred4_0;
1138
+ let deferred4_1;
1139
+ try {
1140
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1141
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1142
+ const len0 = WASM_VECTOR_LEN;
1143
+ const ptr1 = passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1144
+ const len1 = WASM_VECTOR_LEN;
1145
+ const ptr2 = passArray32ToWasm0(included, wasm.__wbindgen_export);
1146
+ const len2 = WASM_VECTOR_LEN;
1147
+ wasm.ifcapi_exportJsonld(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, include_properties, include_quantities, pretty, ptr2, len2);
1148
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1149
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1150
+ deferred4_0 = r0;
1151
+ deferred4_1 = r1;
1152
+ return getStringFromWasm0(r0, r1);
1153
+ } finally {
1154
+ wasm.__wbindgen_add_to_stack_pointer(16);
1155
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
1156
+ }
1157
+ }
1158
+ /**
1159
+ * Re-serialize the model in `content` to a STEP/IFC string.
1160
+ *
1161
+ * `schema` is the FILE_SCHEMA label to write (empty ⇒ preserve the source schema).
1162
+ * `included` is an express-id allowlist (empty ⇒ whole model); when set, the forward
1163
+ * `#`-reference closure is added so the subset never dangles a reference.
1164
+ * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
1165
+ * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
1166
+ * @param {string} content
1167
+ * @param {string} schema
1168
+ * @param {Uint32Array} included
1169
+ * @param {string} mutations_json
1170
+ * @returns {string}
1171
+ */
1172
+ exportStep(content, schema, included, mutations_json) {
1173
+ let deferred5_0;
1174
+ let deferred5_1;
1175
+ try {
1176
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1177
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1178
+ const len0 = WASM_VECTOR_LEN;
1179
+ const ptr1 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1180
+ const len1 = WASM_VECTOR_LEN;
1181
+ const ptr2 = passArray32ToWasm0(included, wasm.__wbindgen_export);
1182
+ const len2 = WASM_VECTOR_LEN;
1183
+ const ptr3 = passStringToWasm0(mutations_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1184
+ const len3 = WASM_VECTOR_LEN;
1185
+ wasm.ifcapi_exportStep(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1186
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1187
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1188
+ deferred5_0 = r0;
1189
+ deferred5_1 = r1;
1190
+ return getStringFromWasm0(r0, r1);
1191
+ } finally {
1192
+ wasm.__wbindgen_add_to_stack_pointer(16);
1193
+ wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
1194
+ }
1195
+ }
1196
+ /**
1197
+ * Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
1198
+ * bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
1199
+ * keeps its ids; later models are id-offset and their project unified to the first.
1200
+ * @param {Uint8Array} concatenated
1201
+ * @param {Uint32Array} lengths
1202
+ * @param {string} schema
1203
+ * @returns {string}
1204
+ */
1205
+ exportMerged(concatenated, lengths, schema) {
1206
+ let deferred4_0;
1207
+ let deferred4_1;
1208
+ try {
1209
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1210
+ const ptr0 = passArray8ToWasm0(concatenated, wasm.__wbindgen_export);
1211
+ const len0 = WASM_VECTOR_LEN;
1212
+ const ptr1 = passArray32ToWasm0(lengths, wasm.__wbindgen_export);
1213
+ const len1 = WASM_VECTOR_LEN;
1214
+ const ptr2 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1215
+ const len2 = WASM_VECTOR_LEN;
1216
+ wasm.ifcapi_exportMerged(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1217
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1218
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1219
+ deferred4_0 = r0;
1220
+ deferred4_1 = r1;
1221
+ return getStringFromWasm0(r0, r1);
1222
+ } finally {
1223
+ wasm.__wbindgen_add_to_stack_pointer(16);
1224
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
1225
+ }
1226
+ }
765
1227
  /**
766
1228
  * Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
767
1229
  *
@@ -1502,6 +1964,69 @@ export class MeshOutlineJs {
1502
1964
  }
1503
1965
  if (Symbol.dispose) MeshOutlineJs.prototype[Symbol.dispose] = MeshOutlineJs.prototype.free;
1504
1966
 
1967
+ /**
1968
+ * Result of [`IfcAPI::process_geometry_batch_partitioned`]: the flat
1969
+ * MeshCollection (transparent + type geometry) and the instanced IFNS shard
1970
+ * (opaque ordinary occurrences) from ONE produce_batch. Take-once accessors so
1971
+ * the JS side moves each out without a clone.
1972
+ */
1973
+ export class PartitionedBatch {
1974
+ static __wrap(ptr) {
1975
+ ptr = ptr >>> 0;
1976
+ const obj = Object.create(PartitionedBatch.prototype);
1977
+ obj.__wbg_ptr = ptr;
1978
+ PartitionedBatchFinalization.register(obj, obj.__wbg_ptr, obj);
1979
+ return obj;
1980
+ }
1981
+ __destroy_into_raw() {
1982
+ const ptr = this.__wbg_ptr;
1983
+ this.__wbg_ptr = 0;
1984
+ PartitionedBatchFinalization.unregister(this);
1985
+ return ptr;
1986
+ }
1987
+ free() {
1988
+ const ptr = this.__destroy_into_raw();
1989
+ wasm.__wbg_partitionedbatch_free(ptr, 0);
1990
+ }
1991
+ /**
1992
+ * The instanced IFNS shard bytes (opaque ordinary occurrences). Moves out.
1993
+ * @returns {Uint8Array}
1994
+ */
1995
+ takeShard() {
1996
+ try {
1997
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1998
+ wasm.partitionedbatch_takeShard(retptr, this.__wbg_ptr);
1999
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2000
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2001
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2002
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2003
+ return v1;
2004
+ } finally {
2005
+ wasm.__wbindgen_add_to_stack_pointer(16);
2006
+ }
2007
+ }
2008
+ /**
2009
+ * The flat MeshCollection (transparent glass + type-product geometry).
2010
+ * Moves out — call once.
2011
+ * @returns {MeshCollection | undefined}
2012
+ */
2013
+ takeMeshes() {
2014
+ const ret = wasm.partitionedbatch_takeMeshes(this.__wbg_ptr);
2015
+ return ret === 0 ? undefined : MeshCollection.__wrap(ret);
2016
+ }
2017
+ /**
2018
+ * Number of occurrences routed into the instanced shard this batch. The viewer
2019
+ * folds this into its total mesh count so the count reflects ALL rendered
2020
+ * geometry (flat + instanced), not just the flat MeshCollection.
2021
+ * @returns {number}
2022
+ */
2023
+ get instancedOccurrences() {
2024
+ const ret = wasm.partitionedbatch_instancedOccurrences(this.__wbg_ptr);
2025
+ return ret >>> 0;
2026
+ }
2027
+ }
2028
+ if (Symbol.dispose) PartitionedBatch.prototype[Symbol.dispose] = PartitionedBatch.prototype.free;
2029
+
1505
2030
  /**
1506
2031
  * A collection of extracted profiles.
1507
2032
  */
Binary file