@ifc-lite/wasm 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "IFC-Lite Contributors"
6
6
  ],
7
7
  "description": "WebAssembly bindings for IFC-Lite",
8
- "version": "2.2.0",
8
+ "version": "2.3.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -228,6 +228,17 @@ export class IfcAPI {
228
228
  * fail fast.
229
229
  */
230
230
  clearPrePassCache(): void;
231
+ /**
232
+ * Enable or disable per-entity geometry fingerprinting in
233
+ * `processGeometryBatch`, used by the viewer's revision-diff feature.
234
+ *
235
+ * Pass a positive `tolerance` (metres) to enable — it is the quantization
236
+ * grid the hash snaps positions to (larger = more tolerant of float noise,
237
+ * smaller = catches finer edits; the `f32` precision floor of model-local
238
+ * coordinates means values below ~1 mm mostly hash noise). Pass `null`/
239
+ * `undefined` (or a non-positive value) to disable. Default: disabled.
240
+ */
241
+ setComputeGeometryHashes(tolerance?: number | null): void;
231
242
  /**
232
243
  * Create and initialize the IFC API
233
244
  */
@@ -350,6 +361,23 @@ export class MeshCollection {
350
361
  * Returns None if no rotation was detected
351
362
  */
352
363
  readonly buildingRotation: number | undefined;
364
+ /**
365
+ * Express ids for the per-entity geometry fingerprints, parallel to
366
+ * [`Self::geometry_hash_values`]. Empty unless geometry hashing was
367
+ * enabled via `IfcAPI.setComputeGeometryHashes`.
368
+ */
369
+ readonly geometryHashIds: Uint32Array;
370
+ /**
371
+ * Number of per-entity geometry fingerprints recorded.
372
+ */
373
+ readonly geometryHashCount: number;
374
+ /**
375
+ * Per-entity geometry fingerprints as a `BigUint64Array`, parallel to
376
+ * [`Self::geometry_hash_ids`]. `u64` is exposed (not hex strings) so JS
377
+ * can compare with `===` and key maps without allocation. Empty unless
378
+ * geometry hashing was enabled.
379
+ */
380
+ readonly geometryHashValues: BigUint64Array;
353
381
  /**
354
382
  * Get number of meshes
355
383
  */
@@ -720,10 +748,14 @@ export interface InitOutput {
720
748
  readonly ifcapi_scanEntitiesFastBytes: (a: number, b: number, c: number) => number;
721
749
  readonly ifcapi_scanGeometryEntitiesFast: (a: number, b: number, c: number) => number;
722
750
  readonly ifcapi_scanRelevantEntitiesFastBytes: (a: number, b: number, c: number) => number;
751
+ readonly ifcapi_setComputeGeometryHashes: (a: number, b: number, c: number) => void;
723
752
  readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
724
753
  readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
725
754
  readonly ifcapi_version: (a: number, b: number) => void;
726
755
  readonly meshcollection_buildingRotation: (a: number, b: number) => void;
756
+ readonly meshcollection_geometryHashCount: (a: number) => number;
757
+ readonly meshcollection_geometryHashIds: (a: number) => number;
758
+ readonly meshcollection_geometryHashValues: (a: number) => number;
727
759
  readonly meshcollection_get: (a: number, b: number) => number;
728
760
  readonly meshcollection_hasRtcOffset: (a: number) => number;
729
761
  readonly meshcollection_length: (a: number) => number;
@@ -824,9 +856,9 @@ export interface InitOutput {
824
856
  readonly symbolictext_worldY: (a: number) => number;
825
857
  readonly symbolictext_x: (a: number) => number;
826
858
  readonly symbolictext_y: (a: number) => number;
827
- readonly __wasm_bindgen_func_elem_654: (a: number, b: number, c: number) => void;
828
- readonly __wasm_bindgen_func_elem_653: (a: number, b: number) => void;
829
- readonly __wasm_bindgen_func_elem_688: (a: number, b: number, c: number, d: number) => void;
859
+ readonly __wasm_bindgen_func_elem_666: (a: number, b: number, c: number) => void;
860
+ readonly __wasm_bindgen_func_elem_665: (a: number, b: number) => void;
861
+ readonly __wasm_bindgen_func_elem_700: (a: number, b: number, c: number, d: number) => void;
830
862
  readonly __wbindgen_export: (a: number) => void;
831
863
  readonly __wbindgen_export2: (a: number, b: number, c: number) => void;
832
864
  readonly __wbindgen_export3: (a: number, b: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -40,11 +40,24 @@ function getArrayU32FromWasm0(ptr, len) {
40
40
  return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
41
41
  }
42
42
 
43
+ function getArrayU64FromWasm0(ptr, len) {
44
+ ptr = ptr >>> 0;
45
+ return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
46
+ }
47
+
43
48
  function getArrayU8FromWasm0(ptr, len) {
44
49
  ptr = ptr >>> 0;
45
50
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
46
51
  }
47
52
 
53
+ let cachedBigUint64ArrayMemory0 = null;
54
+ function getBigUint64ArrayMemory0() {
55
+ if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
56
+ cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
57
+ }
58
+ return cachedBigUint64ArrayMemory0;
59
+ }
60
+
48
61
  let cachedDataViewMemory0 = null;
49
62
  function getDataViewMemory0() {
50
63
  if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
@@ -232,12 +245,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
232
245
 
233
246
  let WASM_VECTOR_LEN = 0;
234
247
 
235
- function __wasm_bindgen_func_elem_654(arg0, arg1, arg2) {
236
- wasm.__wasm_bindgen_func_elem_654(arg0, arg1, addHeapObject(arg2));
248
+ function __wasm_bindgen_func_elem_666(arg0, arg1, arg2) {
249
+ wasm.__wasm_bindgen_func_elem_666(arg0, arg1, addHeapObject(arg2));
237
250
  }
238
251
 
239
- function __wasm_bindgen_func_elem_688(arg0, arg1, arg2, arg3) {
240
- wasm.__wasm_bindgen_func_elem_688(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
252
+ function __wasm_bindgen_func_elem_700(arg0, arg1, arg2, arg3) {
253
+ wasm.__wasm_bindgen_func_elem_700(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
241
254
  }
242
255
 
243
256
  const ClashRunResultFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -886,6 +899,20 @@ export class IfcAPI {
886
899
  clearPrePassCache() {
887
900
  wasm.ifcapi_clearPrePassCache(this.__wbg_ptr);
888
901
  }
902
+ /**
903
+ * Enable or disable per-entity geometry fingerprinting in
904
+ * `processGeometryBatch`, used by the viewer's revision-diff feature.
905
+ *
906
+ * Pass a positive `tolerance` (metres) to enable — it is the quantization
907
+ * grid the hash snaps positions to (larger = more tolerant of float noise,
908
+ * smaller = catches finer edits; the `f32` precision floor of model-local
909
+ * coordinates means values below ~1 mm mostly hash noise). Pass `null`/
910
+ * `undefined` (or a non-positive value) to disable. Default: disabled.
911
+ * @param {number | null} [tolerance]
912
+ */
913
+ setComputeGeometryHashes(tolerance) {
914
+ wasm.ifcapi_setComputeGeometryHashes(this.__wbg_ptr, !isLikeNone(tolerance), isLikeNone(tolerance) ? 0 : tolerance);
915
+ }
889
916
  /**
890
917
  * Create and initialize the IFC API
891
918
  */
@@ -1148,6 +1175,35 @@ export class MeshCollection {
1148
1175
  wasm.__wbindgen_add_to_stack_pointer(16);
1149
1176
  }
1150
1177
  }
1178
+ /**
1179
+ * Express ids for the per-entity geometry fingerprints, parallel to
1180
+ * [`Self::geometry_hash_values`]. Empty unless geometry hashing was
1181
+ * enabled via `IfcAPI.setComputeGeometryHashes`.
1182
+ * @returns {Uint32Array}
1183
+ */
1184
+ get geometryHashIds() {
1185
+ const ret = wasm.meshcollection_geometryHashIds(this.__wbg_ptr);
1186
+ return takeObject(ret);
1187
+ }
1188
+ /**
1189
+ * Number of per-entity geometry fingerprints recorded.
1190
+ * @returns {number}
1191
+ */
1192
+ get geometryHashCount() {
1193
+ const ret = wasm.meshcollection_geometryHashCount(this.__wbg_ptr);
1194
+ return ret >>> 0;
1195
+ }
1196
+ /**
1197
+ * Per-entity geometry fingerprints as a `BigUint64Array`, parallel to
1198
+ * [`Self::geometry_hash_ids`]. `u64` is exposed (not hex strings) so JS
1199
+ * can compare with `===` and key maps without allocation. Empty unless
1200
+ * geometry hashing was enabled.
1201
+ * @returns {BigUint64Array}
1202
+ */
1203
+ get geometryHashValues() {
1204
+ const ret = wasm.meshcollection_geometryHashValues(this.__wbg_ptr);
1205
+ return takeObject(ret);
1206
+ }
1151
1207
  /**
1152
1208
  * Get mesh at index
1153
1209
  * @param {number} index
@@ -2379,7 +2435,7 @@ function __wbg_get_imports() {
2379
2435
  const a = state0.a;
2380
2436
  state0.a = 0;
2381
2437
  try {
2382
- return __wasm_bindgen_func_elem_688(a, state0.b, arg0, arg1);
2438
+ return __wasm_bindgen_func_elem_700(a, state0.b, arg0, arg1);
2383
2439
  } finally {
2384
2440
  state0.a = a;
2385
2441
  }
@@ -2394,6 +2450,10 @@ function __wbg_get_imports() {
2394
2450
  const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
2395
2451
  return addHeapObject(ret);
2396
2452
  };
2453
+ imports.wbg.__wbg_new_from_slice_883d10a76ca46292 = function(arg0, arg1) {
2454
+ const ret = new BigUint64Array(getArrayU64FromWasm0(arg0, arg1));
2455
+ return addHeapObject(ret);
2456
+ };
2397
2457
  imports.wbg.__wbg_new_from_slice_db0691b69e9d3891 = function(arg0, arg1) {
2398
2458
  const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
2399
2459
  return addHeapObject(ret);
@@ -2478,16 +2538,16 @@ function __wbg_get_imports() {
2478
2538
  imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
2479
2539
  console.warn(getObject(arg0));
2480
2540
  };
2541
+ imports.wbg.__wbindgen_cast_0093e2d96a856a3b = function(arg0, arg1) {
2542
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 61, function: Function { arguments: [Externref], shim_idx: 62, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2543
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_665, __wasm_bindgen_func_elem_666);
2544
+ return addHeapObject(ret);
2545
+ };
2481
2546
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2482
2547
  // Cast intrinsic for `Ref(String) -> Externref`.
2483
2548
  const ret = getStringFromWasm0(arg0, arg1);
2484
2549
  return addHeapObject(ret);
2485
2550
  };
2486
- imports.wbg.__wbindgen_cast_257c51b8abf9285e = function(arg0, arg1) {
2487
- // Cast intrinsic for `Closure(Closure { dtor_idx: 57, function: Function { arguments: [Externref], shim_idx: 58, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2488
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_653, __wasm_bindgen_func_elem_654);
2489
- return addHeapObject(ret);
2490
- };
2491
2551
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
2492
2552
  // Cast intrinsic for `U64 -> Externref`.
2493
2553
  const ret = BigInt.asUintN(64, arg0);
@@ -2512,6 +2572,7 @@ function __wbg_get_imports() {
2512
2572
  function __wbg_finalize_init(instance, module) {
2513
2573
  wasm = instance.exports;
2514
2574
  __wbg_init.__wbindgen_wasm_module = module;
2575
+ cachedBigUint64ArrayMemory0 = null;
2515
2576
  cachedDataViewMemory0 = null;
2516
2577
  cachedFloat32ArrayMemory0 = null;
2517
2578
  cachedFloat64ArrayMemory0 = null;
Binary file