@ifc-lite/wasm 9.3.0 → 10.1.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": "9.3.0",
8
+ "version": "10.1.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -221,6 +221,7 @@ export class ClashRunResult {
221
221
  readonly a: Uint32Array;
222
222
  readonly b: Uint32Array;
223
223
  readonly bounds: Float64Array;
224
+ readonly depthFloor: Float64Array;
224
225
  readonly distance: Float64Array;
225
226
  readonly distanceKind: Uint8Array;
226
227
  readonly points: Float64Array;
@@ -245,11 +246,15 @@ export class ClashSession {
245
246
  ingest(positions: Float32Array, pos_ranges: Uint32Array, indices: Uint32Array, idx_ranges: Uint32Array, aabbs: Float32Array): void;
246
247
  constructor();
247
248
  /**
248
- * Run one rule. `group_a`/`group_b` are GLOBAL element indices; an empty
249
- * `group_b` means a self-clash within `group_a`. `mode`: 0 = hard,
250
- * 1 = clearance. Records carry GLOBAL element indices.
249
+ * Run one rule. `group_a`/`group_b` are GLOBAL element indices.
250
+ * OMIT `group_b` (pass `undefined`/`null`) for a self-clash within
251
+ * `group_a`; pass an array -- INCLUDING an empty one -- for a two-sided
252
+ * rule. An empty array is a B side that matched nothing and yields no
253
+ * clashes, which is why this is nullable rather than "empty means
254
+ * self" (#5354). `mode`: 0 = hard, 1 = clearance. Records carry GLOBAL
255
+ * element indices.
251
256
  */
252
- runRule(group_a: Uint32Array, group_b: Uint32Array, mode: number, tolerance: number, clearance: number, report_touch: boolean): ClashRunResult;
257
+ runRule(group_a: Uint32Array, group_b: Uint32Array | null | undefined, mode: number, tolerance: number, clearance: number, report_touch: boolean): ClashRunResult;
253
258
  }
254
259
 
255
260
  /**
@@ -2326,6 +2331,7 @@ export interface InitOutput {
2326
2331
  readonly clashrunresult_a: (a: number, b: number) => void;
2327
2332
  readonly clashrunresult_b: (a: number, b: number) => void;
2328
2333
  readonly clashrunresult_bounds: (a: number, b: number) => void;
2334
+ readonly clashrunresult_depthFloor: (a: number, b: number) => void;
2329
2335
  readonly clashrunresult_distance: (a: number, b: number) => void;
2330
2336
  readonly clashrunresult_distanceKind: (a: number, b: number) => void;
2331
2337
  readonly clashrunresult_points: (a: number, b: number) => void;
package/pkg/ifc-lite.js CHANGED
@@ -223,6 +223,22 @@ export class ClashRunResult {
223
223
  wasm.__wbindgen_add_to_stack_pointer(16);
224
224
  }
225
225
  }
226
+ /**
227
+ * @returns {Float64Array}
228
+ */
229
+ get depthFloor() {
230
+ try {
231
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
232
+ wasm.clashrunresult_depthFloor(retptr, this.__wbg_ptr);
233
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
234
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
235
+ var v1 = getArrayF64FromWasm0(r0, r1).slice();
236
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
237
+ return v1;
238
+ } finally {
239
+ wasm.__wbindgen_add_to_stack_pointer(16);
240
+ }
241
+ }
226
242
  /**
227
243
  * @returns {Float64Array}
228
244
  */
@@ -338,11 +354,15 @@ export class ClashSession {
338
354
  return this;
339
355
  }
340
356
  /**
341
- * Run one rule. `group_a`/`group_b` are GLOBAL element indices; an empty
342
- * `group_b` means a self-clash within `group_a`. `mode`: 0 = hard,
343
- * 1 = clearance. Records carry GLOBAL element indices.
357
+ * Run one rule. `group_a`/`group_b` are GLOBAL element indices.
358
+ * OMIT `group_b` (pass `undefined`/`null`) for a self-clash within
359
+ * `group_a`; pass an array -- INCLUDING an empty one -- for a two-sided
360
+ * rule. An empty array is a B side that matched nothing and yields no
361
+ * clashes, which is why this is nullable rather than "empty means
362
+ * self" (#5354). `mode`: 0 = hard, 1 = clearance. Records carry GLOBAL
363
+ * element indices.
344
364
  * @param {Uint32Array} group_a
345
- * @param {Uint32Array} group_b
365
+ * @param {Uint32Array | null | undefined} group_b
346
366
  * @param {number} mode
347
367
  * @param {number} tolerance
348
368
  * @param {number} clearance
@@ -352,8 +372,8 @@ export class ClashSession {
352
372
  runRule(group_a, group_b, mode, tolerance, clearance, report_touch) {
353
373
  const ptr0 = passArray32ToWasm0(group_a, wasm.__wbindgen_export);
354
374
  const len0 = WASM_VECTOR_LEN;
355
- const ptr1 = passArray32ToWasm0(group_b, wasm.__wbindgen_export);
356
- const len1 = WASM_VECTOR_LEN;
375
+ var ptr1 = isLikeNone(group_b) ? 0 : passArray32ToWasm0(group_b, wasm.__wbindgen_export);
376
+ var len1 = WASM_VECTOR_LEN;
357
377
  const ret = wasm.clashsession_runRule(this.__wbg_ptr, ptr0, len0, ptr1, len1, mode, tolerance, clearance, report_touch);
358
378
  return ClashRunResult.__wrap(ret);
359
379
  }
Binary file