@ifc-lite/wasm 1.14.5 → 1.16.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": "1.14.5",
8
+ "version": "1.16.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
@@ -32,5 +32,8 @@
32
32
  "wasm",
33
33
  "webassembly",
34
34
  "aec"
35
- ]
35
+ ],
36
+ "scripts": {
37
+ "test": "node --test test/*.test.mjs"
38
+ }
36
39
  }
package/pkg/ifc-lite.d.ts CHANGED
@@ -254,6 +254,38 @@ export class IfcAPI {
254
254
  * ```
255
255
  */
256
256
  parseMeshesAsync(content: string, options: any): Promise<any>;
257
+ /**
258
+ * Fast pre-pass: scans for geometry entities ONLY (skips style/void/material resolution).
259
+ * Returns job list + unit scale + RTC offset in ~1-2s instead of ~6s.
260
+ * Geometry workers can start immediately with default colors + no void subtraction.
261
+ * A parallel style worker can run buildPrePassOnce for correct colors later.
262
+ */
263
+ buildPrePassFast(data: Uint8Array): any;
264
+ /**
265
+ * Run the pre-pass ONCE and return serialized results for worker distribution.
266
+ * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
267
+ */
268
+ buildPrePassOnce(data: Uint8Array): any;
269
+ /**
270
+ * Parse a subset of IFC geometry entities by index range.
271
+ *
272
+ * Performs the full pre-pass (entity index, combined style/void/brep scan)
273
+ * but only processes geometry entities whose index (in the combined
274
+ * simple + complex job list) falls within `[start_idx, end_idx)`.
275
+ *
276
+ * This enables Web Worker parallelization: each worker processes a
277
+ * disjoint slice of the entity list while sharing the same pre-pass data.
278
+ *
279
+ * Example:
280
+ * ```javascript
281
+ * const api = new IfcAPI();
282
+ * // Worker 1: entities 0..500
283
+ * const batch1 = api.parseMeshesSubset(content, 0, 500);
284
+ * // Worker 2: entities 500..1000
285
+ * const batch2 = api.parseMeshesSubset(content, 500, 1000);
286
+ * ```
287
+ */
288
+ parseMeshesSubset(content: string, start_idx: number, end_idx: number, skip_expensive: boolean): MeshCollection;
257
289
  /**
258
290
  * Parse IFC file and return GPU-ready geometry for zero-copy upload
259
291
  *
@@ -312,6 +344,11 @@ export class IfcAPI {
312
344
  * ```
313
345
  */
314
346
  parseMeshesInstanced(content: string): InstancedMeshCollection;
347
+ /**
348
+ * Process geometry for a subset of pre-scanned entities.
349
+ * Takes raw bytes and pre-pass data from buildPrePassOnce.
350
+ */
351
+ 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): MeshCollection;
315
352
  /**
316
353
  * Parse IFC file with streaming GPU-ready geometry batches
317
354
  *
@@ -397,6 +434,29 @@ export class IfcAPI {
397
434
  * ```
398
435
  */
399
436
  parseZeroCopy(content: string): ZeroCopyMesh;
437
+ /**
438
+ * Extract raw profile polygons from all building elements with `IfcExtrudedAreaSolid`
439
+ * representations.
440
+ *
441
+ * Returns a [`ProfileCollection`] whose entries each carry:
442
+ * - A 2D polygon (outer + holes) in local profile space (metres)
443
+ * - A 4 × 4 column-major transform in WebGL Y-up world space
444
+ * - Extrusion direction (world space) and depth (metres)
445
+ *
446
+ * Use [`ProfileProjector`] (TypeScript) to convert these into `DrawingLine[]`
447
+ * for clean projection without tessellation artifacts.
448
+ *
449
+ * ```javascript
450
+ * const api = new IfcAPI();
451
+ * const profiles = api.extractProfiles(ifcContent, 0);
452
+ * console.log('Profiles:', profiles.length);
453
+ * for (let i = 0; i < profiles.length; i++) {
454
+ * const p = profiles.get(i);
455
+ * console.log(p.ifcType, 'depth:', p.extrusionDepth);
456
+ * }
457
+ * ```
458
+ */
459
+ extractProfiles(content: string, model_index: number): ProfileCollection;
400
460
  /**
401
461
  * Debug: Test processing entity #953 (FacetedBrep wall)
402
462
  */
@@ -655,6 +715,63 @@ export class MeshDataJs {
655
715
  readonly positions: Float32Array;
656
716
  }
657
717
 
718
+ export class ProfileCollection {
719
+ private constructor();
720
+ free(): void;
721
+ [Symbol.dispose](): void;
722
+ /**
723
+ * Get profile at `index`. Returns `undefined` for out-of-bounds index.
724
+ */
725
+ get(index: number): ProfileEntryJs | undefined;
726
+ /**
727
+ * Number of profiles.
728
+ */
729
+ readonly length: number;
730
+ }
731
+
732
+ export class ProfileEntryJs {
733
+ private constructor();
734
+ free(): void;
735
+ [Symbol.dispose](): void;
736
+ /**
737
+ * Express ID of the building element.
738
+ */
739
+ readonly expressId: number;
740
+ /**
741
+ * Number of points per hole.
742
+ */
743
+ readonly holeCounts: Uint32Array;
744
+ /**
745
+ * All hole points concatenated: `[x0, y0, x1, y1, …]` (metres).
746
+ */
747
+ readonly holePoints: Float32Array;
748
+ /**
749
+ * Model index for multi-model federation.
750
+ */
751
+ readonly modelIndex: number;
752
+ /**
753
+ * Outer boundary: flat `[x0, y0, x1, y1, …]` in local profile space (metres).
754
+ */
755
+ readonly outerPoints: Float32Array;
756
+ /**
757
+ * Extrusion direction `[dx, dy, dz]` in WebGL Y-up world space (unit vector).
758
+ */
759
+ readonly extrusionDir: Float32Array;
760
+ /**
761
+ * Extrusion depth (metres).
762
+ */
763
+ readonly extrusionDepth: number;
764
+ /**
765
+ * IFC type name (e.g., `"IfcWall"`).
766
+ */
767
+ readonly ifcType: string;
768
+ /**
769
+ * 4 × 4 column-major transform in WebGL Y-up world space.
770
+ * `M * [x, y, 0, 1]ᵀ` gives the world position.
771
+ */
772
+ readonly transform: Float32Array;
773
+ }
774
+
658
775
  export class RtcOffsetJs {
659
776
  private constructor();
660
777
  free(): void;
@@ -830,8 +947,6 @@ export function get_memory(): any;
830
947
  */
831
948
  export function init(): void;
832
949
 
833
- export function initThreadPool(num_threads: number): Promise<any>;
834
-
835
950
  /**
836
951
  * Get the version of IFC-Lite.
837
952
  *
@@ -847,20 +962,10 @@ export function initThreadPool(num_threads: number): Promise<any>;
847
962
  */
848
963
  export function version(): string;
849
964
 
850
- export class wbg_rayon_PoolBuilder {
851
- private constructor();
852
- free(): void;
853
- [Symbol.dispose](): void;
854
- numThreads(): number;
855
- build(): void;
856
- receiver(): number;
857
- }
858
-
859
- export function wbg_rayon_start_worker(receiver: number): void;
860
-
861
965
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
862
966
 
863
967
  export interface InitOutput {
968
+ readonly memory: WebAssembly.Memory;
864
969
  readonly __wbg_georeferencejs_free: (a: number, b: number) => void;
865
970
  readonly __wbg_get_georeferencejs_eastings: (a: number) => number;
866
971
  readonly __wbg_get_georeferencejs_northings: (a: number) => number;
@@ -879,6 +984,8 @@ export interface InitOutput {
879
984
  readonly __wbg_meshcollection_free: (a: number, b: number) => void;
880
985
  readonly __wbg_meshcollectionwithrtc_free: (a: number, b: number) => void;
881
986
  readonly __wbg_meshdatajs_free: (a: number, b: number) => void;
987
+ readonly __wbg_profilecollection_free: (a: number, b: number) => void;
988
+ readonly __wbg_profileentryjs_free: (a: number, b: number) => void;
882
989
  readonly __wbg_rtcoffsetjs_free: (a: number, b: number) => void;
883
990
  readonly __wbg_set_georeferencejs_eastings: (a: number, b: number) => void;
884
991
  readonly __wbg_set_georeferencejs_northings: (a: number, b: number) => void;
@@ -938,8 +1045,11 @@ export interface InitOutput {
938
1045
  readonly gpumeshmetadata_indexOffset: (a: number) => number;
939
1046
  readonly gpumeshmetadata_vertexCount: (a: number) => number;
940
1047
  readonly gpumeshmetadata_vertexOffset: (a: number) => number;
1048
+ readonly ifcapi_buildPrePassFast: (a: number, b: number, c: number) => number;
1049
+ readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
941
1050
  readonly ifcapi_debugProcessEntity953: (a: number, b: number, c: number, d: number) => void;
942
1051
  readonly ifcapi_debugProcessFirstWall: (a: number, b: number, c: number, d: number) => void;
1052
+ readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
943
1053
  readonly ifcapi_getGeoReference: (a: number, b: number, c: number) => number;
944
1054
  readonly ifcapi_getMemory: (a: number) => number;
945
1055
  readonly ifcapi_is_ready: (a: number) => number;
@@ -949,6 +1059,7 @@ export interface InitOutput {
949
1059
  readonly ifcapi_parseMeshesAsync: (a: number, b: number, c: number, d: number) => number;
950
1060
  readonly ifcapi_parseMeshesInstanced: (a: number, b: number, c: number) => number;
951
1061
  readonly ifcapi_parseMeshesInstancedAsync: (a: number, b: number, c: number, d: number) => number;
1062
+ readonly ifcapi_parseMeshesSubset: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
952
1063
  readonly ifcapi_parseMeshesWithRtc: (a: number, b: number, c: number) => number;
953
1064
  readonly ifcapi_parseStreaming: (a: number, b: number, c: number, d: number) => number;
954
1065
  readonly ifcapi_parseSymbolicRepresentations: (a: number, b: number, c: number) => number;
@@ -956,6 +1067,7 @@ export interface InitOutput {
956
1067
  readonly ifcapi_parseToGpuGeometryAsync: (a: number, b: number, c: number, d: number) => number;
957
1068
  readonly ifcapi_parseToGpuInstancedGeometry: (a: number, b: number, c: number) => number;
958
1069
  readonly ifcapi_parseZeroCopy: (a: number, b: number, c: number) => number;
1070
+ 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) => number;
959
1071
  readonly ifcapi_scanEntitiesFast: (a: number, b: number, c: number) => number;
960
1072
  readonly ifcapi_scanEntitiesFastBytes: (a: number, b: number, c: number) => number;
961
1073
  readonly ifcapi_scanGeometryEntitiesFast: (a: number, b: number, c: number) => number;
@@ -990,6 +1102,16 @@ export interface InitOutput {
990
1102
  readonly meshdatajs_positions: (a: number) => number;
991
1103
  readonly meshdatajs_triangleCount: (a: number) => number;
992
1104
  readonly meshdatajs_vertexCount: (a: number) => number;
1105
+ readonly profilecollection_get: (a: number, b: number) => number;
1106
+ readonly profilecollection_length: (a: number) => number;
1107
+ readonly profileentryjs_extrusionDepth: (a: number) => number;
1108
+ readonly profileentryjs_extrusionDir: (a: number) => number;
1109
+ readonly profileentryjs_holeCounts: (a: number) => number;
1110
+ readonly profileentryjs_holePoints: (a: number) => number;
1111
+ readonly profileentryjs_ifcType: (a: number, b: number) => void;
1112
+ readonly profileentryjs_modelIndex: (a: number) => number;
1113
+ readonly profileentryjs_outerPoints: (a: number) => number;
1114
+ readonly profileentryjs_transform: (a: number) => number;
993
1115
  readonly rtcoffsetjs_isSignificant: (a: number) => number;
994
1116
  readonly rtcoffsetjs_toWorld: (a: number, b: number, c: number, d: number, e: number) => void;
995
1117
  readonly symboliccircle_centerX: (a: number) => number;
@@ -1022,6 +1144,7 @@ export interface InitOutput {
1022
1144
  readonly zerocopymesh_positions_len: (a: number) => number;
1023
1145
  readonly zerocopymesh_positions_ptr: (a: number) => number;
1024
1146
  readonly zerocopymesh_vertex_count: (a: number) => number;
1147
+ readonly init: () => void;
1025
1148
  readonly gpuinstancedgeometryref_indicesLen: (a: number) => number;
1026
1149
  readonly gpuinstancedgeometryref_instanceCount: (a: number) => number;
1027
1150
  readonly gpuinstancedgeometryref_instanceDataLen: (a: number) => number;
@@ -1030,7 +1153,6 @@ export interface InitOutput {
1030
1153
  readonly instancedmeshcollection_totalGeometries: (a: number) => number;
1031
1154
  readonly meshcollectionwithrtc_length: (a: number) => number;
1032
1155
  readonly zerocopymesh_indices_len: (a: number) => number;
1033
- readonly init: () => void;
1034
1156
  readonly __wbg_set_rtcoffsetjs_x: (a: number, b: number) => void;
1035
1157
  readonly __wbg_set_rtcoffsetjs_y: (a: number, b: number) => void;
1036
1158
  readonly __wbg_set_rtcoffsetjs_z: (a: number, b: number) => void;
@@ -1052,27 +1174,18 @@ export interface InitOutput {
1052
1174
  readonly gpuinstancedgeometryref_geometryId: (a: number) => bigint;
1053
1175
  readonly instancedgeometry_geometryId: (a: number) => bigint;
1054
1176
  readonly meshcollection_rtcOffsetX: (a: number) => number;
1177
+ readonly profileentryjs_expressId: (a: number) => number;
1055
1178
  readonly symboliccircle_expressId: (a: number) => number;
1056
1179
  readonly __wbg_gpuinstancedgeometryref_free: (a: number, b: number) => void;
1057
- readonly __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
1058
- readonly initThreadPool: (a: number) => number;
1059
- readonly wbg_rayon_poolbuilder_build: (a: number) => void;
1060
- readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
1061
- readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
1062
- readonly wbg_rayon_start_worker: (a: number) => void;
1063
- readonly __wasm_bindgen_func_elem_959: (a: number, b: number, c: number) => void;
1064
- readonly __wasm_bindgen_func_elem_958: (a: number, b: number) => void;
1065
- readonly __wasm_bindgen_func_elem_498: (a: number, b: number) => void;
1066
- readonly __wasm_bindgen_func_elem_497: (a: number, b: number) => void;
1067
- readonly __wasm_bindgen_func_elem_1230: (a: number, b: number, c: number, d: number) => void;
1068
- readonly memory: WebAssembly.Memory;
1180
+ readonly __wasm_bindgen_func_elem_1127: (a: number, b: number, c: number) => void;
1181
+ readonly __wasm_bindgen_func_elem_1126: (a: number, b: number) => void;
1182
+ readonly __wasm_bindgen_func_elem_1167: (a: number, b: number, c: number, d: number) => void;
1069
1183
  readonly __wbindgen_export: (a: number) => void;
1070
1184
  readonly __wbindgen_export2: (a: number, b: number, c: number) => void;
1071
1185
  readonly __wbindgen_export3: (a: number, b: number) => number;
1072
1186
  readonly __wbindgen_export4: (a: number, b: number, c: number, d: number) => number;
1073
1187
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
1074
- readonly __wbindgen_thread_destroy: (a?: number, b?: number, c?: number) => void;
1075
- readonly __wbindgen_start: (a: number) => void;
1188
+ readonly __wbindgen_start: () => void;
1076
1189
  }
1077
1190
 
1078
1191
  export type SyncInitInput = BufferSource | WebAssembly.Module;
@@ -1081,20 +1194,18 @@ export type SyncInitInput = BufferSource | WebAssembly.Module;
1081
1194
  * Instantiates the given `module`, which can either be bytes or
1082
1195
  * a precompiled `WebAssembly.Module`.
1083
1196
  *
1084
- * @param {{ module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number }} module - Passing `SyncInitInput` directly is deprecated.
1085
- * @param {WebAssembly.Memory} memory - Deprecated.
1197
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
1086
1198
  *
1087
1199
  * @returns {InitOutput}
1088
1200
  */
1089
- export function initSync(module: { module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number } | SyncInitInput, memory?: WebAssembly.Memory): InitOutput;
1201
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
1090
1202
 
1091
1203
  /**
1092
1204
  * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
1093
1205
  * for everything else, calls `WebAssembly.instantiate` directly.
1094
1206
  *
1095
- * @param {{ module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number }} module_or_path - Passing `InitInput` directly is deprecated.
1096
- * @param {WebAssembly.Memory} memory - Deprecated.
1207
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
1097
1208
  *
1098
1209
  * @returns {Promise<InitOutput>}
1099
1210
  */
1100
- export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number } | InitInput | Promise<InitInput>, memory?: WebAssembly.Memory): Promise<InitOutput>;
1211
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
package/pkg/ifc-lite.js CHANGED
@@ -1,5 +1,3 @@
1
- import { startWorkers } from './snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js';
2
-
3
1
  let wasm;
4
2
 
5
3
  function addHeapObject(obj) {
@@ -38,7 +36,7 @@ function getArrayU32FromWasm0(ptr, len) {
38
36
 
39
37
  let cachedDataViewMemory0 = null;
40
38
  function getDataViewMemory0() {
41
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
39
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
42
40
  cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
43
41
  }
44
42
  return cachedDataViewMemory0;
@@ -46,7 +44,7 @@ function getDataViewMemory0() {
46
44
 
47
45
  let cachedFloat32ArrayMemory0 = null;
48
46
  function getFloat32ArrayMemory0() {
49
- if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.buffer !== wasm.memory.buffer) {
47
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
50
48
  cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
51
49
  }
52
50
  return cachedFloat32ArrayMemory0;
@@ -54,7 +52,7 @@ function getFloat32ArrayMemory0() {
54
52
 
55
53
  let cachedFloat64ArrayMemory0 = null;
56
54
  function getFloat64ArrayMemory0() {
57
- if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.buffer !== wasm.memory.buffer) {
55
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
58
56
  cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
59
57
  }
60
58
  return cachedFloat64ArrayMemory0;
@@ -67,7 +65,7 @@ function getStringFromWasm0(ptr, len) {
67
65
 
68
66
  let cachedUint32ArrayMemory0 = null;
69
67
  function getUint32ArrayMemory0() {
70
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.buffer !== wasm.memory.buffer) {
68
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
71
69
  cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
72
70
  }
73
71
  return cachedUint32ArrayMemory0;
@@ -75,7 +73,7 @@ function getUint32ArrayMemory0() {
75
73
 
76
74
  let cachedUint8ArrayMemory0 = null;
77
75
  function getUint8ArrayMemory0() {
78
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
76
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
79
77
  cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
80
78
  }
81
79
  return cachedUint8ArrayMemory0;
@@ -128,6 +126,13 @@ function makeMutClosure(arg0, arg1, dtor, f) {
128
126
  return real;
129
127
  }
130
128
 
129
+ function passArray32ToWasm0(arg, malloc) {
130
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
131
+ getUint32ArrayMemory0().set(arg, ptr / 4);
132
+ WASM_VECTOR_LEN = arg.length;
133
+ return ptr;
134
+ }
135
+
131
136
  function passArray8ToWasm0(arg, malloc) {
132
137
  const ptr = malloc(arg.length * 1, 1) >>> 0;
133
138
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -178,9 +183,8 @@ function takeObject(idx) {
178
183
  return ret;
179
184
  }
180
185
 
181
- let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
182
- if (cachedTextDecoder) cachedTextDecoder.decode();
183
-
186
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
187
+ cachedTextDecoder.decode();
184
188
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
185
189
  let numBytesDecoded = 0;
186
190
  function decodeText(ptr, len) {
@@ -190,12 +194,12 @@ function decodeText(ptr, len) {
190
194
  cachedTextDecoder.decode();
191
195
  numBytesDecoded = len;
192
196
  }
193
- return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
197
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
194
198
  }
195
199
 
196
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
200
+ const cachedTextEncoder = new TextEncoder();
197
201
 
198
- if (cachedTextEncoder) {
202
+ if (!('encodeInto' in cachedTextEncoder)) {
199
203
  cachedTextEncoder.encodeInto = function (arg, view) {
200
204
  const buf = cachedTextEncoder.encode(arg);
201
205
  view.set(buf);
@@ -208,16 +212,12 @@ if (cachedTextEncoder) {
208
212
 
209
213
  let WASM_VECTOR_LEN = 0;
210
214
 
211
- function __wasm_bindgen_func_elem_959(arg0, arg1, arg2) {
212
- wasm.__wasm_bindgen_func_elem_959(arg0, arg1, addHeapObject(arg2));
213
- }
214
-
215
- function __wasm_bindgen_func_elem_498(arg0, arg1) {
216
- wasm.__wasm_bindgen_func_elem_498(arg0, arg1);
215
+ function __wasm_bindgen_func_elem_1127(arg0, arg1, arg2) {
216
+ wasm.__wasm_bindgen_func_elem_1127(arg0, arg1, addHeapObject(arg2));
217
217
  }
218
218
 
219
- function __wasm_bindgen_func_elem_1230(arg0, arg1, arg2, arg3) {
220
- wasm.__wasm_bindgen_func_elem_1230(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
219
+ function __wasm_bindgen_func_elem_1167(arg0, arg1, arg2, arg3) {
220
+ wasm.__wasm_bindgen_func_elem_1167(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
221
221
  }
222
222
 
223
223
  const GeoReferenceJsFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -272,6 +272,14 @@ const MeshDataJsFinalization = (typeof FinalizationRegistry === 'undefined')
272
272
  ? { register: () => {}, unregister: () => {} }
273
273
  : new FinalizationRegistry(ptr => wasm.__wbg_meshdatajs_free(ptr >>> 0, 1));
274
274
 
275
+ const ProfileCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
276
+ ? { register: () => {}, unregister: () => {} }
277
+ : new FinalizationRegistry(ptr => wasm.__wbg_profilecollection_free(ptr >>> 0, 1));
278
+
279
+ const ProfileEntryJsFinalization = (typeof FinalizationRegistry === 'undefined')
280
+ ? { register: () => {}, unregister: () => {} }
281
+ : new FinalizationRegistry(ptr => wasm.__wbg_profileentryjs_free(ptr >>> 0, 1));
282
+
275
283
  const RtcOffsetJsFinalization = (typeof FinalizationRegistry === 'undefined')
276
284
  ? { register: () => {}, unregister: () => {} }
277
285
  : new FinalizationRegistry(ptr => wasm.__wbg_rtcoffsetjs_free(ptr >>> 0, 1));
@@ -292,10 +300,6 @@ const ZeroCopyMeshFinalization = (typeof FinalizationRegistry === 'undefined')
292
300
  ? { register: () => {}, unregister: () => {} }
293
301
  : new FinalizationRegistry(ptr => wasm.__wbg_zerocopymesh_free(ptr >>> 0, 1));
294
302
 
295
- const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
296
- ? { register: () => {}, unregister: () => {} }
297
- : new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr >>> 0, 1));
298
-
299
303
  /**
300
304
  * Georeferencing information exposed to JavaScript
301
305
  */
@@ -1154,6 +1158,62 @@ export class IfcAPI {
1154
1158
  const ret = wasm.ifcapi_parseMeshesAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
1155
1159
  return takeObject(ret);
1156
1160
  }
1161
+ /**
1162
+ * Fast pre-pass: scans for geometry entities ONLY (skips style/void/material resolution).
1163
+ * Returns job list + unit scale + RTC offset in ~1-2s instead of ~6s.
1164
+ * Geometry workers can start immediately with default colors + no void subtraction.
1165
+ * A parallel style worker can run buildPrePassOnce for correct colors later.
1166
+ * @param {Uint8Array} data
1167
+ * @returns {any}
1168
+ */
1169
+ buildPrePassFast(data) {
1170
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
1171
+ const len0 = WASM_VECTOR_LEN;
1172
+ const ret = wasm.ifcapi_buildPrePassFast(this.__wbg_ptr, ptr0, len0);
1173
+ return takeObject(ret);
1174
+ }
1175
+ /**
1176
+ * Run the pre-pass ONCE and return serialized results for worker distribution.
1177
+ * Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
1178
+ * @param {Uint8Array} data
1179
+ * @returns {any}
1180
+ */
1181
+ buildPrePassOnce(data) {
1182
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
1183
+ const len0 = WASM_VECTOR_LEN;
1184
+ const ret = wasm.ifcapi_buildPrePassOnce(this.__wbg_ptr, ptr0, len0);
1185
+ return takeObject(ret);
1186
+ }
1187
+ /**
1188
+ * Parse a subset of IFC geometry entities by index range.
1189
+ *
1190
+ * Performs the full pre-pass (entity index, combined style/void/brep scan)
1191
+ * but only processes geometry entities whose index (in the combined
1192
+ * simple + complex job list) falls within `[start_idx, end_idx)`.
1193
+ *
1194
+ * This enables Web Worker parallelization: each worker processes a
1195
+ * disjoint slice of the entity list while sharing the same pre-pass data.
1196
+ *
1197
+ * Example:
1198
+ * ```javascript
1199
+ * const api = new IfcAPI();
1200
+ * // Worker 1: entities 0..500
1201
+ * const batch1 = api.parseMeshesSubset(content, 0, 500);
1202
+ * // Worker 2: entities 500..1000
1203
+ * const batch2 = api.parseMeshesSubset(content, 500, 1000);
1204
+ * ```
1205
+ * @param {string} content
1206
+ * @param {number} start_idx
1207
+ * @param {number} end_idx
1208
+ * @param {boolean} skip_expensive
1209
+ * @returns {MeshCollection}
1210
+ */
1211
+ parseMeshesSubset(content, start_idx, end_idx, skip_expensive) {
1212
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
1213
+ const len0 = WASM_VECTOR_LEN;
1214
+ const ret = wasm.ifcapi_parseMeshesSubset(this.__wbg_ptr, ptr0, len0, start_idx, end_idx, skip_expensive);
1215
+ return MeshCollection.__wrap(ret);
1216
+ }
1157
1217
  /**
1158
1218
  * Parse IFC file and return GPU-ready geometry for zero-copy upload
1159
1219
  *
@@ -1226,6 +1286,41 @@ export class IfcAPI {
1226
1286
  const ret = wasm.ifcapi_parseMeshesInstanced(this.__wbg_ptr, ptr0, len0);
1227
1287
  return InstancedMeshCollection.__wrap(ret);
1228
1288
  }
1289
+ /**
1290
+ * Process geometry for a subset of pre-scanned entities.
1291
+ * Takes raw bytes and pre-pass data from buildPrePassOnce.
1292
+ * @param {Uint8Array} data
1293
+ * @param {Uint32Array} jobs_flat
1294
+ * @param {number} unit_scale
1295
+ * @param {number} rtc_x
1296
+ * @param {number} rtc_y
1297
+ * @param {number} rtc_z
1298
+ * @param {boolean} needs_shift
1299
+ * @param {Uint32Array} void_keys
1300
+ * @param {Uint32Array} void_counts
1301
+ * @param {Uint32Array} void_values
1302
+ * @param {Uint32Array} style_ids
1303
+ * @param {Uint8Array} style_colors
1304
+ * @returns {MeshCollection}
1305
+ */
1306
+ processGeometryBatch(data, jobs_flat, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, void_keys, void_counts, void_values, style_ids, style_colors) {
1307
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
1308
+ const len0 = WASM_VECTOR_LEN;
1309
+ const ptr1 = passArray32ToWasm0(jobs_flat, wasm.__wbindgen_export3);
1310
+ const len1 = WASM_VECTOR_LEN;
1311
+ const ptr2 = passArray32ToWasm0(void_keys, wasm.__wbindgen_export3);
1312
+ const len2 = WASM_VECTOR_LEN;
1313
+ const ptr3 = passArray32ToWasm0(void_counts, wasm.__wbindgen_export3);
1314
+ const len3 = WASM_VECTOR_LEN;
1315
+ const ptr4 = passArray32ToWasm0(void_values, wasm.__wbindgen_export3);
1316
+ const len4 = WASM_VECTOR_LEN;
1317
+ const ptr5 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export3);
1318
+ const len5 = WASM_VECTOR_LEN;
1319
+ const ptr6 = passArray8ToWasm0(style_colors, wasm.__wbindgen_export3);
1320
+ const len6 = WASM_VECTOR_LEN;
1321
+ 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);
1322
+ return MeshCollection.__wrap(ret);
1323
+ }
1229
1324
  /**
1230
1325
  * Parse IFC file with streaming GPU-ready geometry batches
1231
1326
  *
@@ -1341,6 +1436,37 @@ export class IfcAPI {
1341
1436
  const ret = wasm.ifcapi_parseZeroCopy(this.__wbg_ptr, ptr0, len0);
1342
1437
  return ZeroCopyMesh.__wrap(ret);
1343
1438
  }
1439
+ /**
1440
+ * Extract raw profile polygons from all building elements with `IfcExtrudedAreaSolid`
1441
+ * representations.
1442
+ *
1443
+ * Returns a [`ProfileCollection`] whose entries each carry:
1444
+ * - A 2D polygon (outer + holes) in local profile space (metres)
1445
+ * - A 4 × 4 column-major transform in WebGL Y-up world space
1446
+ * - Extrusion direction (world space) and depth (metres)
1447
+ *
1448
+ * Use [`ProfileProjector`] (TypeScript) to convert these into `DrawingLine[]`
1449
+ * for clean projection without tessellation artifacts.
1450
+ *
1451
+ * ```javascript
1452
+ * const api = new IfcAPI();
1453
+ * const profiles = api.extractProfiles(ifcContent, 0);
1454
+ * console.log('Profiles:', profiles.length);
1455
+ * for (let i = 0; i < profiles.length; i++) {
1456
+ * const p = profiles.get(i);
1457
+ * console.log(p.ifcType, 'depth:', p.extrusionDepth);
1458
+ * }
1459
+ * ```
1460
+ * @param {string} content
1461
+ * @param {number} model_index
1462
+ * @returns {ProfileCollection}
1463
+ */
1464
+ extractProfiles(content, model_index) {
1465
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
1466
+ const len0 = WASM_VECTOR_LEN;
1467
+ const ret = wasm.ifcapi_extractProfiles(this.__wbg_ptr, ptr0, len0, model_index);
1468
+ return ProfileCollection.__wrap(ret);
1469
+ }
1344
1470
  /**
1345
1471
  * Debug: Test processing entity #953 (FacetedBrep wall)
1346
1472
  * @param {string} content
@@ -2051,6 +2177,159 @@ export class MeshDataJs {
2051
2177
  }
2052
2178
  if (Symbol.dispose) MeshDataJs.prototype[Symbol.dispose] = MeshDataJs.prototype.free;
2053
2179
 
2180
+ /**
2181
+ * A collection of extracted profiles.
2182
+ */
2183
+ export class ProfileCollection {
2184
+ static __wrap(ptr) {
2185
+ ptr = ptr >>> 0;
2186
+ const obj = Object.create(ProfileCollection.prototype);
2187
+ obj.__wbg_ptr = ptr;
2188
+ ProfileCollectionFinalization.register(obj, obj.__wbg_ptr, obj);
2189
+ return obj;
2190
+ }
2191
+ __destroy_into_raw() {
2192
+ const ptr = this.__wbg_ptr;
2193
+ this.__wbg_ptr = 0;
2194
+ ProfileCollectionFinalization.unregister(this);
2195
+ return ptr;
2196
+ }
2197
+ free() {
2198
+ const ptr = this.__destroy_into_raw();
2199
+ wasm.__wbg_profilecollection_free(ptr, 0);
2200
+ }
2201
+ /**
2202
+ * Get profile at `index`. Returns `undefined` for out-of-bounds index.
2203
+ * @param {number} index
2204
+ * @returns {ProfileEntryJs | undefined}
2205
+ */
2206
+ get(index) {
2207
+ const ret = wasm.profilecollection_get(this.__wbg_ptr, index);
2208
+ return ret === 0 ? undefined : ProfileEntryJs.__wrap(ret);
2209
+ }
2210
+ /**
2211
+ * Number of profiles.
2212
+ * @returns {number}
2213
+ */
2214
+ get length() {
2215
+ const ret = wasm.profilecollection_length(this.__wbg_ptr);
2216
+ return ret >>> 0;
2217
+ }
2218
+ }
2219
+ if (Symbol.dispose) ProfileCollection.prototype[Symbol.dispose] = ProfileCollection.prototype.free;
2220
+
2221
+ /**
2222
+ * A single profile entry – raw 2D polygon + world transform.
2223
+ *
2224
+ * Profile points are in **local 2D profile space** (metres).
2225
+ * Apply `transform` to `[x, y, 0, 1]` to get WebGL Y-up world coordinates.
2226
+ */
2227
+ export class ProfileEntryJs {
2228
+ static __wrap(ptr) {
2229
+ ptr = ptr >>> 0;
2230
+ const obj = Object.create(ProfileEntryJs.prototype);
2231
+ obj.__wbg_ptr = ptr;
2232
+ ProfileEntryJsFinalization.register(obj, obj.__wbg_ptr, obj);
2233
+ return obj;
2234
+ }
2235
+ __destroy_into_raw() {
2236
+ const ptr = this.__wbg_ptr;
2237
+ this.__wbg_ptr = 0;
2238
+ ProfileEntryJsFinalization.unregister(this);
2239
+ return ptr;
2240
+ }
2241
+ free() {
2242
+ const ptr = this.__destroy_into_raw();
2243
+ wasm.__wbg_profileentryjs_free(ptr, 0);
2244
+ }
2245
+ /**
2246
+ * Express ID of the building element.
2247
+ * @returns {number}
2248
+ */
2249
+ get expressId() {
2250
+ const ret = wasm.meshdatajs_expressId(this.__wbg_ptr);
2251
+ return ret >>> 0;
2252
+ }
2253
+ /**
2254
+ * Number of points per hole.
2255
+ * @returns {Uint32Array}
2256
+ */
2257
+ get holeCounts() {
2258
+ const ret = wasm.profileentryjs_holeCounts(this.__wbg_ptr);
2259
+ return takeObject(ret);
2260
+ }
2261
+ /**
2262
+ * All hole points concatenated: `[x0, y0, x1, y1, …]` (metres).
2263
+ * @returns {Float32Array}
2264
+ */
2265
+ get holePoints() {
2266
+ const ret = wasm.profileentryjs_holePoints(this.__wbg_ptr);
2267
+ return takeObject(ret);
2268
+ }
2269
+ /**
2270
+ * Model index for multi-model federation.
2271
+ * @returns {number}
2272
+ */
2273
+ get modelIndex() {
2274
+ const ret = wasm.profileentryjs_modelIndex(this.__wbg_ptr);
2275
+ return ret >>> 0;
2276
+ }
2277
+ /**
2278
+ * Outer boundary: flat `[x0, y0, x1, y1, …]` in local profile space (metres).
2279
+ * @returns {Float32Array}
2280
+ */
2281
+ get outerPoints() {
2282
+ const ret = wasm.profileentryjs_outerPoints(this.__wbg_ptr);
2283
+ return takeObject(ret);
2284
+ }
2285
+ /**
2286
+ * Extrusion direction `[dx, dy, dz]` in WebGL Y-up world space (unit vector).
2287
+ * @returns {Float32Array}
2288
+ */
2289
+ get extrusionDir() {
2290
+ const ret = wasm.profileentryjs_extrusionDir(this.__wbg_ptr);
2291
+ return takeObject(ret);
2292
+ }
2293
+ /**
2294
+ * Extrusion depth (metres).
2295
+ * @returns {number}
2296
+ */
2297
+ get extrusionDepth() {
2298
+ const ret = wasm.profileentryjs_extrusionDepth(this.__wbg_ptr);
2299
+ return ret;
2300
+ }
2301
+ /**
2302
+ * IFC type name (e.g., `"IfcWall"`).
2303
+ * @returns {string}
2304
+ */
2305
+ get ifcType() {
2306
+ let deferred1_0;
2307
+ let deferred1_1;
2308
+ try {
2309
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2310
+ wasm.profileentryjs_ifcType(retptr, this.__wbg_ptr);
2311
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2312
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2313
+ deferred1_0 = r0;
2314
+ deferred1_1 = r1;
2315
+ return getStringFromWasm0(r0, r1);
2316
+ } finally {
2317
+ wasm.__wbindgen_add_to_stack_pointer(16);
2318
+ wasm.__wbindgen_export2(deferred1_0, deferred1_1, 1);
2319
+ }
2320
+ }
2321
+ /**
2322
+ * 4 × 4 column-major transform in WebGL Y-up world space.
2323
+ * `M * [x, y, 0, 1]ᵀ` gives the world position.
2324
+ * @returns {Float32Array}
2325
+ */
2326
+ get transform() {
2327
+ const ret = wasm.profileentryjs_transform(this.__wbg_ptr);
2328
+ return takeObject(ret);
2329
+ }
2330
+ }
2331
+ if (Symbol.dispose) ProfileEntryJs.prototype[Symbol.dispose] = ProfileEntryJs.prototype.free;
2332
+
2054
2333
  /**
2055
2334
  * RTC offset information exposed to JavaScript
2056
2335
  */
@@ -2607,15 +2886,6 @@ export function init() {
2607
2886
  wasm.init();
2608
2887
  }
2609
2888
 
2610
- /**
2611
- * @param {number} num_threads
2612
- * @returns {Promise<any>}
2613
- */
2614
- export function initThreadPool(num_threads) {
2615
- const ret = wasm.initThreadPool(num_threads);
2616
- return takeObject(ret);
2617
- }
2618
-
2619
2889
  /**
2620
2890
  * Get the version of IFC-Lite.
2621
2891
  *
@@ -2647,51 +2917,6 @@ export function version() {
2647
2917
  }
2648
2918
  }
2649
2919
 
2650
- export class wbg_rayon_PoolBuilder {
2651
- static __wrap(ptr) {
2652
- ptr = ptr >>> 0;
2653
- const obj = Object.create(wbg_rayon_PoolBuilder.prototype);
2654
- obj.__wbg_ptr = ptr;
2655
- wbg_rayon_PoolBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
2656
- return obj;
2657
- }
2658
- __destroy_into_raw() {
2659
- const ptr = this.__wbg_ptr;
2660
- this.__wbg_ptr = 0;
2661
- wbg_rayon_PoolBuilderFinalization.unregister(this);
2662
- return ptr;
2663
- }
2664
- free() {
2665
- const ptr = this.__destroy_into_raw();
2666
- wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 0);
2667
- }
2668
- /**
2669
- * @returns {number}
2670
- */
2671
- numThreads() {
2672
- const ret = wasm.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr);
2673
- return ret >>> 0;
2674
- }
2675
- build() {
2676
- wasm.wbg_rayon_poolbuilder_build(this.__wbg_ptr);
2677
- }
2678
- /**
2679
- * @returns {number}
2680
- */
2681
- receiver() {
2682
- const ret = wasm.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr);
2683
- return ret >>> 0;
2684
- }
2685
- }
2686
- if (Symbol.dispose) wbg_rayon_PoolBuilder.prototype[Symbol.dispose] = wbg_rayon_PoolBuilder.prototype.free;
2687
-
2688
- /**
2689
- * @param {number} receiver
2690
- */
2691
- export function wbg_rayon_start_worker(receiver) {
2692
- wasm.wbg_rayon_start_worker(receiver);
2693
- }
2694
-
2695
2920
  const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
2696
2921
 
2697
2922
  async function __wbg_load(module, imports) {
@@ -2724,7 +2949,7 @@ async function __wbg_load(module, imports) {
2724
2949
  }
2725
2950
  }
2726
2951
 
2727
- function __wbg_get_imports(memory) {
2952
+ function __wbg_get_imports() {
2728
2953
  const imports = {};
2729
2954
  imports.wbg = {};
2730
2955
  imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
@@ -2743,33 +2968,18 @@ function __wbg_get_imports(memory) {
2743
2968
  const ret = wasm.memory;
2744
2969
  return addHeapObject(ret);
2745
2970
  };
2746
- imports.wbg.__wbg___wbindgen_module_967adef62ea6cbf8 = function() {
2747
- const ret = __wbg_init.__wbindgen_wasm_module;
2748
- return addHeapObject(ret);
2749
- };
2750
2971
  imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
2751
2972
  const obj = getObject(arg1);
2752
2973
  const ret = typeof(obj) === 'number' ? obj : undefined;
2753
2974
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2754
2975
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2755
2976
  };
2756
- imports.wbg.__wbg___wbindgen_rethrow_78714972834ecdf1 = function(arg0) {
2757
- throw takeObject(arg0);
2758
- };
2759
2977
  imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
2760
2978
  throw new Error(getStringFromWasm0(arg0, arg1));
2761
2979
  };
2762
2980
  imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
2763
2981
  getObject(arg0)._wbg_cb_unref();
2764
2982
  };
2765
- imports.wbg.__wbg_async_bba5a2ac54b734df = function(arg0) {
2766
- const ret = getObject(arg0).async;
2767
- return ret;
2768
- };
2769
- imports.wbg.__wbg_buffer_063cd102cc769a1c = function(arg0) {
2770
- const ret = getObject(arg0).buffer;
2771
- return addHeapObject(ret);
2772
- };
2773
2983
  imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
2774
2984
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2775
2985
  return addHeapObject(ret);
@@ -2782,14 +2992,6 @@ function __wbg_get_imports(memory) {
2782
2992
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
2783
2993
  return addHeapObject(ret);
2784
2994
  }, arguments) };
2785
- imports.wbg.__wbg_clearTimeout_5a54f8841c30079a = function(arg0) {
2786
- const ret = clearTimeout(takeObject(arg0));
2787
- return addHeapObject(ret);
2788
- };
2789
- imports.wbg.__wbg_data_8bf4ae669a78a688 = function(arg0) {
2790
- const ret = getObject(arg0).data;
2791
- return addHeapObject(ret);
2792
- };
2793
2995
  imports.wbg.__wbg_debug_9d0c87ddda3dc485 = function(arg0) {
2794
2996
  console.debug(getObject(arg0));
2795
2997
  };
@@ -2816,16 +3018,6 @@ function __wbg_get_imports(memory) {
2816
3018
  const ret = InstancedGeometry.__wrap(arg0);
2817
3019
  return addHeapObject(ret);
2818
3020
  };
2819
- imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) {
2820
- let result;
2821
- try {
2822
- result = getObject(arg0) instanceof Window;
2823
- } catch (_) {
2824
- result = false;
2825
- }
2826
- const ret = result;
2827
- return ret;
2828
- };
2829
3021
  imports.wbg.__wbg_length_86ce4877baf913bb = function(arg0) {
2830
3022
  const ret = getObject(arg0).length;
2831
3023
  return ret;
@@ -2846,18 +3038,10 @@ function __wbg_get_imports(memory) {
2846
3038
  const ret = new Array();
2847
3039
  return addHeapObject(ret);
2848
3040
  };
2849
- imports.wbg.__wbg_new_53cb1e86c1ef5d2a = function() { return handleError(function (arg0, arg1) {
2850
- const ret = new Worker(getStringFromWasm0(arg0, arg1));
2851
- return addHeapObject(ret);
2852
- }, arguments) };
2853
3041
  imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
2854
3042
  const ret = new Error();
2855
3043
  return addHeapObject(ret);
2856
3044
  };
2857
- imports.wbg.__wbg_new_de1e660b88fc921f = function(arg0) {
2858
- const ret = new Int32Array(getObject(arg0));
2859
- return addHeapObject(ret);
2860
- };
2861
3045
  imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
2862
3046
  try {
2863
3047
  var state0 = {a: arg0, b: arg1};
@@ -2865,7 +3049,7 @@ function __wbg_get_imports(memory) {
2865
3049
  const a = state0.a;
2866
3050
  state0.a = 0;
2867
3051
  try {
2868
- return __wasm_bindgen_func_elem_1230(a, state0.b, arg0, arg1);
3052
+ return __wasm_bindgen_func_elem_1167(a, state0.b, arg0, arg1);
2869
3053
  } finally {
2870
3054
  state0.a = a;
2871
3055
  }
@@ -2888,13 +3072,18 @@ function __wbg_get_imports(memory) {
2888
3072
  const ret = new Function(getStringFromWasm0(arg0, arg1));
2889
3073
  return addHeapObject(ret);
2890
3074
  };
2891
- imports.wbg.__wbg_of_7779827fa663eec8 = function(arg0, arg1, arg2) {
2892
- const ret = Array.of(getObject(arg0), getObject(arg1), getObject(arg2));
3075
+ imports.wbg.__wbg_new_with_length_202b3db94ba5fc86 = function(arg0) {
3076
+ const ret = new Uint32Array(arg0 >>> 0);
3077
+ return addHeapObject(ret);
3078
+ };
3079
+ imports.wbg.__wbg_new_with_length_806b9e5b8290af7c = function(arg0) {
3080
+ const ret = new Float64Array(arg0 >>> 0);
3081
+ return addHeapObject(ret);
3082
+ };
3083
+ imports.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
3084
+ const ret = new Uint8Array(arg0 >>> 0);
2893
3085
  return addHeapObject(ret);
2894
3086
  };
2895
- imports.wbg.__wbg_postMessage_07504dbe15265d5c = function() { return handleError(function (arg0, arg1) {
2896
- getObject(arg0).postMessage(getObject(arg1));
2897
- }, arguments) };
2898
3087
  imports.wbg.__wbg_prototypesetcall_96cc7097487b926d = function(arg0, arg1, arg2) {
2899
3088
  Float32Array.prototype.set.call(getArrayF32FromWasm0(arg0, arg1), getObject(arg2));
2900
3089
  };
@@ -2913,10 +3102,6 @@ function __wbg_get_imports(memory) {
2913
3102
  const ret = Promise.resolve(getObject(arg0));
2914
3103
  return addHeapObject(ret);
2915
3104
  };
2916
- imports.wbg.__wbg_setTimeout_db2dbaeefb6f39c7 = function() { return handleError(function (arg0, arg1) {
2917
- const ret = setTimeout(getObject(arg0), arg1);
2918
- return addHeapObject(ret);
2919
- }, arguments) };
2920
3105
  imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
2921
3106
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2922
3107
  };
@@ -2927,8 +3112,14 @@ function __wbg_get_imports(memory) {
2927
3112
  imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
2928
3113
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2929
3114
  };
2930
- imports.wbg.__wbg_set_onmessage_deb94985de696ac7 = function(arg0, arg1) {
2931
- getObject(arg0).onmessage = getObject(arg1);
3115
+ imports.wbg.__wbg_set_index_021489b2916af13e = function(arg0, arg1, arg2) {
3116
+ getObject(arg0)[arg1 >>> 0] = arg2;
3117
+ };
3118
+ imports.wbg.__wbg_set_index_04c4b93e64d08a52 = function(arg0, arg1, arg2) {
3119
+ getObject(arg0)[arg1 >>> 0] = arg2;
3120
+ };
3121
+ imports.wbg.__wbg_set_index_42abe35f117e614e = function(arg0, arg1, arg2) {
3122
+ getObject(arg0)[arg1 >>> 0] = arg2 >>> 0;
2932
3123
  };
2933
3124
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2934
3125
  const ret = getObject(arg1).stack;
@@ -2937,10 +3128,6 @@ function __wbg_get_imports(memory) {
2937
3128
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2938
3129
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2939
3130
  };
2940
- imports.wbg.__wbg_startWorkers_2ca11761e08ff5d5 = function(arg0, arg1, arg2) {
2941
- const ret = startWorkers(takeObject(arg0), takeObject(arg1), wbg_rayon_PoolBuilder.__wrap(arg2));
2942
- return addHeapObject(ret);
2943
- };
2944
3131
  imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
2945
3132
  const ret = typeof global === 'undefined' ? null : global;
2946
3133
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
@@ -2961,26 +3148,9 @@ function __wbg_get_imports(memory) {
2961
3148
  const ret = getObject(arg0).then(getObject(arg1));
2962
3149
  return addHeapObject(ret);
2963
3150
  };
2964
- imports.wbg.__wbg_value_4cd497eeadba94bd = function(arg0) {
2965
- const ret = getObject(arg0).value;
2966
- return addHeapObject(ret);
2967
- };
2968
- imports.wbg.__wbg_waitAsync_8afec80ffd213eca = function(arg0, arg1, arg2) {
2969
- const ret = Atomics.waitAsync(getObject(arg0), arg1 >>> 0, arg2);
2970
- return addHeapObject(ret);
2971
- };
2972
- imports.wbg.__wbg_waitAsync_c186cb97ffacd552 = function() {
2973
- const ret = Atomics.waitAsync;
2974
- return addHeapObject(ret);
2975
- };
2976
3151
  imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
2977
3152
  console.warn(getObject(arg0));
2978
3153
  };
2979
- imports.wbg.__wbindgen_cast_188ff5bafa3120b4 = function(arg0, arg1) {
2980
- // Cast intrinsic for `Closure(Closure { dtor_idx: 56, function: Function { arguments: [], shim_idx: 57, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2981
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_497, __wasm_bindgen_func_elem_498);
2982
- return addHeapObject(ret);
2983
- };
2984
3154
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2985
3155
  // Cast intrinsic for `Ref(String) -> Externref`.
2986
3156
  const ret = getStringFromWasm0(arg0, arg1);
@@ -2991,14 +3161,9 @@ function __wbg_get_imports(memory) {
2991
3161
  const ret = BigInt.asUintN(64, arg0);
2992
3162
  return addHeapObject(ret);
2993
3163
  };
2994
- imports.wbg.__wbindgen_cast_72f2309ca88b7133 = function(arg0, arg1) {
2995
- // Cast intrinsic for `Closure(Closure { dtor_idx: 161, function: Function { arguments: [Externref], shim_idx: 162, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2996
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_958, __wasm_bindgen_func_elem_959);
2997
- return addHeapObject(ret);
2998
- };
2999
- imports.wbg.__wbindgen_cast_96f117460864886d = function(arg0, arg1) {
3000
- // Cast intrinsic for `Closure(Closure { dtor_idx: 161, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 162, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3001
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_958, __wasm_bindgen_func_elem_959);
3164
+ imports.wbg.__wbindgen_cast_8410bcb836a2825d = function(arg0, arg1) {
3165
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 145, function: Function { arguments: [Externref], shim_idx: 146, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3166
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1126, __wasm_bindgen_func_elem_1127);
3002
3167
  return addHeapObject(ret);
3003
3168
  };
3004
3169
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
@@ -3006,20 +3171,6 @@ function __wbg_get_imports(memory) {
3006
3171
  const ret = arg0;
3007
3172
  return addHeapObject(ret);
3008
3173
  };
3009
- imports.wbg.__wbindgen_link_203404ece0e9bab9 = function(arg0) {
3010
- const val = `onmessage = function (ev) {
3011
- let [ia, index, value] = ev.data;
3012
- ia = new Int32Array(ia.buffer);
3013
- let result = Atomics.wait(ia, index, value);
3014
- postMessage(result);
3015
- };
3016
- `;
3017
- const ret = typeof URL.createObjectURL === 'undefined' ? "data:application/javascript," + encodeURIComponent(val) : URL.createObjectURL(new Blob([val], { type: "text/javascript" }));
3018
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
3019
- const len1 = WASM_VECTOR_LEN;
3020
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3021
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3022
- };
3023
3174
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
3024
3175
  const ret = getObject(arg0);
3025
3176
  return addHeapObject(ret);
@@ -3027,12 +3178,11 @@ function __wbg_get_imports(memory) {
3027
3178
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
3028
3179
  takeObject(arg0);
3029
3180
  };
3030
- imports.wbg.memory = memory || new WebAssembly.Memory({initial:20,maximum:65536,shared:true});
3031
3181
 
3032
3182
  return imports;
3033
3183
  }
3034
3184
 
3035
- function __wbg_finalize_init(instance, module, thread_stack_size) {
3185
+ function __wbg_finalize_init(instance, module) {
3036
3186
  wasm = instance.exports;
3037
3187
  __wbg_init.__wbindgen_wasm_module = module;
3038
3188
  cachedDataViewMemory0 = null;
@@ -3041,38 +3191,38 @@ function __wbg_finalize_init(instance, module, thread_stack_size) {
3041
3191
  cachedUint32ArrayMemory0 = null;
3042
3192
  cachedUint8ArrayMemory0 = null;
3043
3193
 
3044
- if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % 65536 !== 0)) { throw 'invalid stack size' }
3045
- wasm.__wbindgen_start(thread_stack_size);
3194
+
3195
+ wasm.__wbindgen_start();
3046
3196
  return wasm;
3047
3197
  }
3048
3198
 
3049
- function initSync(module, memory) {
3199
+ function initSync(module) {
3050
3200
  if (wasm !== undefined) return wasm;
3051
3201
 
3052
- let thread_stack_size
3202
+
3053
3203
  if (typeof module !== 'undefined') {
3054
3204
  if (Object.getPrototypeOf(module) === Object.prototype) {
3055
- ({module, memory, thread_stack_size} = module)
3205
+ ({module} = module)
3056
3206
  } else {
3057
3207
  console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
3058
3208
  }
3059
3209
  }
3060
3210
 
3061
- const imports = __wbg_get_imports(memory);
3211
+ const imports = __wbg_get_imports();
3062
3212
  if (!(module instanceof WebAssembly.Module)) {
3063
3213
  module = new WebAssembly.Module(module);
3064
3214
  }
3065
3215
  const instance = new WebAssembly.Instance(module, imports);
3066
- return __wbg_finalize_init(instance, module, thread_stack_size);
3216
+ return __wbg_finalize_init(instance, module);
3067
3217
  }
3068
3218
 
3069
- async function __wbg_init(module_or_path, memory) {
3219
+ async function __wbg_init(module_or_path) {
3070
3220
  if (wasm !== undefined) return wasm;
3071
3221
 
3072
- let thread_stack_size
3222
+
3073
3223
  if (typeof module_or_path !== 'undefined') {
3074
3224
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
3075
- ({module_or_path, memory, thread_stack_size} = module_or_path)
3225
+ ({module_or_path} = module_or_path)
3076
3226
  } else {
3077
3227
  console.warn('using deprecated parameters for the initialization function; pass a single object instead')
3078
3228
  }
@@ -3081,7 +3231,7 @@ async function __wbg_init(module_or_path, memory) {
3081
3231
  if (typeof module_or_path === 'undefined') {
3082
3232
  module_or_path = new URL('ifc-lite_bg.wasm', import.meta.url);
3083
3233
  }
3084
- const imports = __wbg_get_imports(memory);
3234
+ const imports = __wbg_get_imports();
3085
3235
 
3086
3236
  if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
3087
3237
  module_or_path = fetch(module_or_path);
@@ -3089,7 +3239,7 @@ async function __wbg_init(module_or_path, memory) {
3089
3239
 
3090
3240
  const { instance, module } = await __wbg_load(await module_or_path, imports);
3091
3241
 
3092
- return __wbg_finalize_init(instance, module, thread_stack_size);
3242
+ return __wbg_finalize_init(instance, module);
3093
3243
  }
3094
3244
 
3095
3245
  export { initSync };
Binary file