okgeometry-api 1.19.0 → 1.20.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.
@@ -923,6 +923,15 @@ export function mesh_polyline_intersection_points(vertex_count: number, buffer:
923
923
  */
924
924
  export function mesh_prepare_boolean_cutter_curve(coords: Float64Array, closed: boolean, nx: number, ny: number, nz: number, height: number): Float64Array;
925
925
 
926
+ /**
927
+ * Host-aware boolean cutter preparation: like
928
+ * `mesh_prepare_boolean_cutter_curve`, but the bias is raised past the
929
+ * measured host-surface deviation under the cutter footprint (sculpted /
930
+ * non-planar faces). The host arrives as a standard triangulated buffer.
931
+ * Returns [height, epsilon, pointCount, x,y,z,...]
932
+ */
933
+ export function mesh_prepare_hosted_boolean_cutter(host_vertex_count: number, host_buffer: Float64Array, coords: Float64Array, closed: boolean, nx: number, ny: number, nz: number, height: number): Float64Array;
934
+
926
935
  /**
927
936
  * Raycast against mesh and return closest hit.
928
937
  * Output: [] when no hit, otherwise [pointX,pointY,pointZ, normalX,normalY,normalZ, faceIndex, distance]
@@ -1328,6 +1337,16 @@ export function sculpt_session_create(vertex_count: number, buffer: Float64Array
1328
1337
  */
1329
1338
  export function sculpt_session_dab(id: number, cx: number, cy: number, cz: number, vx: number, vy: number, vz: number, dragx: number, dragy: number, dragz: number, pressure: number): Float32Array;
1330
1339
 
1340
+ /**
1341
+ * Locally REDUCE point density in the given triangle group (constrained
1342
+ * edge collapse of interior vertices; the group boundary is preserved)
1343
+ * until the group has at most `target_points` unique vertices or no safe
1344
+ * collapse remains. Returns 1 when at least one collapse happened, 0
1345
+ * otherwise. Clears session undo history; callers must refetch
1346
+ * `sculpt_session_render_data` afterwards.
1347
+ */
1348
+ export function sculpt_session_decimate_faces(id: number, triangles: Uint32Array, target_points: number): number;
1349
+
1331
1350
  /**
1332
1351
  * Finish the active stroke (pushes one undo entry).
1333
1352
  */
@@ -1584,6 +1603,7 @@ export interface InitOutput {
1584
1603
  readonly mesh_plane_intersect: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1585
1604
  readonly mesh_polyline_intersection_points: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
1586
1605
  readonly mesh_prepare_boolean_cutter_curve: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1606
+ readonly mesh_prepare_hosted_boolean_cutter: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
1587
1607
  readonly mesh_raycast: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
1588
1608
  readonly mesh_raycast_all: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
1589
1609
  readonly mesh_raycast_many: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number];
@@ -1637,6 +1657,7 @@ export interface InitOutput {
1637
1657
  readonly sculpt_session_begin_stroke: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
1638
1658
  readonly sculpt_session_create: (a: number, b: number, c: number) => number;
1639
1659
  readonly sculpt_session_dab: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
1660
+ readonly sculpt_session_decimate_faces: (a: number, b: number, c: number, d: number) => number;
1640
1661
  readonly sculpt_session_end_stroke: (a: number) => void;
1641
1662
  readonly sculpt_session_face_group: (a: number, b: number, c: number) => [number, number];
1642
1663
  readonly sculpt_session_info: (a: number) => [number, number];
@@ -2830,6 +2830,33 @@ export function mesh_prepare_boolean_cutter_curve(coords, closed, nx, ny, nz, he
2830
2830
  return v2;
2831
2831
  }
2832
2832
 
2833
+ /**
2834
+ * Host-aware boolean cutter preparation: like
2835
+ * `mesh_prepare_boolean_cutter_curve`, but the bias is raised past the
2836
+ * measured host-surface deviation under the cutter footprint (sculpted /
2837
+ * non-planar faces). The host arrives as a standard triangulated buffer.
2838
+ * Returns [height, epsilon, pointCount, x,y,z,...]
2839
+ * @param {number} host_vertex_count
2840
+ * @param {Float64Array} host_buffer
2841
+ * @param {Float64Array} coords
2842
+ * @param {boolean} closed
2843
+ * @param {number} nx
2844
+ * @param {number} ny
2845
+ * @param {number} nz
2846
+ * @param {number} height
2847
+ * @returns {Float64Array}
2848
+ */
2849
+ export function mesh_prepare_hosted_boolean_cutter(host_vertex_count, host_buffer, coords, closed, nx, ny, nz, height) {
2850
+ const ptr0 = passArrayF64ToWasm0(host_buffer, wasm.__wbindgen_malloc);
2851
+ const len0 = WASM_VECTOR_LEN;
2852
+ const ptr1 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
2853
+ const len1 = WASM_VECTOR_LEN;
2854
+ const ret = wasm.mesh_prepare_hosted_boolean_cutter(host_vertex_count, ptr0, len0, ptr1, len1, closed, nx, ny, nz, height);
2855
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
2856
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
2857
+ return v3;
2858
+ }
2859
+
2833
2860
  /**
2834
2861
  * Raycast against mesh and return closest hit.
2835
2862
  * Output: [] when no hit, otherwise [pointX,pointY,pointZ, normalX,normalY,normalZ, faceIndex, distance]
@@ -3943,6 +3970,25 @@ export function sculpt_session_dab(id, cx, cy, cz, vx, vy, vz, dragx, dragy, dra
3943
3970
  return v1;
3944
3971
  }
3945
3972
 
3973
+ /**
3974
+ * Locally REDUCE point density in the given triangle group (constrained
3975
+ * edge collapse of interior vertices; the group boundary is preserved)
3976
+ * until the group has at most `target_points` unique vertices or no safe
3977
+ * collapse remains. Returns 1 when at least one collapse happened, 0
3978
+ * otherwise. Clears session undo history; callers must refetch
3979
+ * `sculpt_session_render_data` afterwards.
3980
+ * @param {number} id
3981
+ * @param {Uint32Array} triangles
3982
+ * @param {number} target_points
3983
+ * @returns {number}
3984
+ */
3985
+ export function sculpt_session_decimate_faces(id, triangles, target_points) {
3986
+ const ptr0 = passArray32ToWasm0(triangles, wasm.__wbindgen_malloc);
3987
+ const len0 = WASM_VECTOR_LEN;
3988
+ const ret = wasm.sculpt_session_decimate_faces(id, ptr0, len0, target_points);
3989
+ return ret >>> 0;
3990
+ }
3991
+
3946
3992
  /**
3947
3993
  * Finish the active stroke (pushes one undo entry).
3948
3994
  * @param {number} id