okgeometry-api 1.4.0 → 1.5.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.
@@ -191,6 +191,16 @@ export function make_nurbs_curves_compatible(curves_data: Float64Array): Float64
191
191
  */
192
192
  export function mesh_apply_matrix(vertex_count: number, buffer: Float64Array, matrix: Float64Array): Float64Array;
193
193
 
194
+ /**
195
+ * Subtract all cutter meshes from the host in one WASM call.
196
+ *
197
+ * `packed` layout matches `mesh_boolean_union_all`; the FIRST mesh is the
198
+ * host and every following mesh is a cutter.
199
+ * `flags`: `""` or `"trustedInput"`.
200
+ * Returns a standard result mesh buffer, or an empty vector on failure.
201
+ */
202
+ export function mesh_boolean_difference_all(packed: Float64Array, flags: string): Float64Array;
203
+
194
204
  /**
195
205
  * Perform boolean intersection on two meshes
196
206
  */
@@ -268,6 +278,15 @@ export function mesh_boolean_subtraction(vertex_count_a: number, buffer_a: Float
268
278
  */
269
279
  export function mesh_boolean_union(vertex_count_a: number, buffer_a: Float64Array, vertex_count_b: number, buffer_b: Float64Array): Float64Array;
270
280
 
281
+ /**
282
+ * Union all meshes in the packed buffer into a single mesh in one WASM call.
283
+ *
284
+ * `packed` layout: `[meshCount, (bufferLen, [vertexCount, positions..., indices...])...]`.
285
+ * `flags`: `""` or `"trustedInput"`.
286
+ * Returns a standard result mesh buffer, or an empty vector on failure.
287
+ */
288
+ export function mesh_boolean_union_all(packed: Float64Array, flags: string): Float64Array;
289
+
271
290
  /**
272
291
  * Extract boundary (perimeter) edges from a mesh as polylines.
273
292
  * Returns polyline buffer: [num_polylines, n1, x,y,z,..., n2, x,y,z,...]
@@ -742,6 +761,7 @@ export interface InitOutput {
742
761
  readonly loft_profiles: (a: number, b: number, c: number, d: number) => [number, number];
743
762
  readonly make_nurbs_curves_compatible: (a: number, b: number) => [number, number];
744
763
  readonly mesh_apply_matrix: (a: number, b: number, c: number, d: number, e: number) => [number, number];
764
+ readonly mesh_boolean_difference_all: (a: number, b: number, c: number, d: number) => [number, number];
745
765
  readonly mesh_boolean_intersection: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
746
766
  readonly mesh_boolean_kernel_mesh_debug: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
747
767
  readonly mesh_boolean_last_debug_marker: () => number;
@@ -766,6 +786,7 @@ export interface InitOutput {
766
786
  readonly mesh_boolean_split: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
767
787
  readonly mesh_boolean_subtraction: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
768
788
  readonly mesh_boolean_union: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
789
+ readonly mesh_boolean_union_all: (a: number, b: number, c: number, d: number) => [number, number];
769
790
  readonly mesh_boundary_polylines: (a: number, b: number, c: number) => [number, number];
770
791
  readonly mesh_build_coplanar_connected_face_groups: (a: number, b: number, c: number) => [number, number];
771
792
  readonly mesh_build_render_buffers: (a: number, b: number, c: number, d: number) => [number, number];
@@ -505,6 +505,28 @@ export function mesh_apply_matrix(vertex_count, buffer, matrix) {
505
505
  return v3;
506
506
  }
507
507
 
508
+ /**
509
+ * Subtract all cutter meshes from the host in one WASM call.
510
+ *
511
+ * `packed` layout matches `mesh_boolean_union_all`; the FIRST mesh is the
512
+ * host and every following mesh is a cutter.
513
+ * `flags`: `""` or `"trustedInput"`.
514
+ * Returns a standard result mesh buffer, or an empty vector on failure.
515
+ * @param {Float64Array} packed
516
+ * @param {string} flags
517
+ * @returns {Float64Array}
518
+ */
519
+ export function mesh_boolean_difference_all(packed, flags) {
520
+ const ptr0 = passArrayF64ToWasm0(packed, wasm.__wbindgen_malloc);
521
+ const len0 = WASM_VECTOR_LEN;
522
+ const ptr1 = passStringToWasm0(flags, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
523
+ const len1 = WASM_VECTOR_LEN;
524
+ const ret = wasm.mesh_boolean_difference_all(ptr0, len0, ptr1, len1);
525
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
526
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
527
+ return v3;
528
+ }
529
+
508
530
  /**
509
531
  * Perform boolean intersection on two meshes
510
532
  * @param {number} vertex_count_a
@@ -1105,6 +1127,27 @@ export function mesh_boolean_union(vertex_count_a, buffer_a, vertex_count_b, buf
1105
1127
  return v3;
1106
1128
  }
1107
1129
 
1130
+ /**
1131
+ * Union all meshes in the packed buffer into a single mesh in one WASM call.
1132
+ *
1133
+ * `packed` layout: `[meshCount, (bufferLen, [vertexCount, positions..., indices...])...]`.
1134
+ * `flags`: `""` or `"trustedInput"`.
1135
+ * Returns a standard result mesh buffer, or an empty vector on failure.
1136
+ * @param {Float64Array} packed
1137
+ * @param {string} flags
1138
+ * @returns {Float64Array}
1139
+ */
1140
+ export function mesh_boolean_union_all(packed, flags) {
1141
+ const ptr0 = passArrayF64ToWasm0(packed, wasm.__wbindgen_malloc);
1142
+ const len0 = WASM_VECTOR_LEN;
1143
+ const ptr1 = passStringToWasm0(flags, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1144
+ const len1 = WASM_VECTOR_LEN;
1145
+ const ret = wasm.mesh_boolean_union_all(ptr0, len0, ptr1, len1);
1146
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1147
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
1148
+ return v3;
1149
+ }
1150
+
1108
1151
  /**
1109
1152
  * Extract boundary (perimeter) edges from a mesh as polylines.
1110
1153
  * Returns polyline buffer: [num_polylines, n1, x,y,z,..., n2, x,y,z,...]