okgeometry-api 1.59.0 → 1.60.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "okgeometry-api",
3
- "version": "1.59.0",
3
+ "version": "1.60.0",
4
4
  "description": "Geometry engine API for AEC applications - NURBS, meshes, booleans, intersections. Powered by Rust/WASM.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -326,6 +326,42 @@ export class WallNetwork {
326
326
  this.mod.wall_network_set_openings(this.id, wall, buf);
327
327
  }
328
328
 
329
+ /**
330
+ * Replace one element's FREE-FORM void cutter list (okdraw VOIDS-PLAN
331
+ * §3.3) — walls AND floors share the element index space. Cutter meshes
332
+ * are WORLD-space closed triangle soups; an empty list clears. Derived
333
+ * state like openings: never recorded, the host re-derives on load/undo.
334
+ * Wire: the network's first mesh-valued input, count-prefixed flat pack
335
+ * `[cutterCount, (vertexCount, indexCount, xyz…, indices…)×N]`.
336
+ * Returns the number of cutters applied (0 = cleared, refused slot, or
337
+ * malformed input — see geometryLastError).
338
+ */
339
+ setCutters(
340
+ element: number,
341
+ cutters: Array<{ positions: Float64Array | number[]; indices: Uint32Array | number[] }>,
342
+ ): number {
343
+ let words = 1;
344
+ for (const c of cutters) {
345
+ words += 2 + c.positions.length + c.indices.length;
346
+ }
347
+ const buf = new Float64Array(words);
348
+ buf[0] = cutters.length;
349
+ let o = 1;
350
+ for (const c of cutters) {
351
+ const vc = Math.floor(c.positions.length / 3);
352
+ buf[o] = vc;
353
+ buf[o + 1] = c.indices.length;
354
+ o += 2;
355
+ buf.set(c.positions as ArrayLike<number>, o);
356
+ o += c.positions.length;
357
+ for (let k = 0; k < c.indices.length; k++) {
358
+ buf[o + k] = c.indices[k];
359
+ }
360
+ o += c.indices.length;
361
+ }
362
+ return this.mod.wall_network_set_cutters(this.id, element, buf);
363
+ }
364
+
329
365
  /**
330
366
  * Solve + re-emit dirty chunks; pulls every rebuilt chunk's buffers and
331
367
  * DRAINS the kernel-side packed copies (chunk buffers are scratch — the