brepkit-wasm 2.107.0 → 2.108.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/brepkit_wasm.d.ts CHANGED
@@ -947,6 +947,20 @@ export class BrepKernel {
947
947
  * Produces `count_x × count_y` copies arranged in a rectangular grid.
948
948
  */
949
949
  gridPattern(solid: number, dir_x_x: number, dir_x_y: number, dir_x_z: number, dir_y_x: number, dir_y_y: number, dir_y_z: number, spacing_x: number, spacing_y: number, count_x: number, count_y: number): number;
950
+ /**
951
+ * Guided (two-rail) sweep: sweep `face` along a spine, orienting the
952
+ * profile so its up-vector tracks an auxiliary spine.
953
+ *
954
+ * The spine and auxiliary spine are each passed as raw NURBS data
955
+ * (`degree`, `knots`, flat `control_points`, `weights`). Returns a solid
956
+ * handle (`u32`).
957
+ *
958
+ * # Errors
959
+ *
960
+ * Returns an error for a non-finite or malformed curve, a non-planar
961
+ * profile, or a degenerate path.
962
+ */
963
+ guidedSweep(face: number, spine_degree: number, spine_knots: Float64Array, spine_control_points: Float64Array, spine_weights: Float64Array, aux_degree: number, aux_knots: Float64Array, aux_control_points: Float64Array, aux_weights: Float64Array): number;
950
964
  /**
951
965
  * Heal a solid topology.
952
966
  *
@@ -1457,6 +1471,18 @@ export class BrepKernel {
1457
1471
  * Useful for debugging topology.
1458
1472
  */
1459
1473
  meshEdgesAll(solid: number, deflection: number): JsEdgeLines;
1474
+ /**
1475
+ * Convex Minkowski sum of two solids (`A ⊕ B`).
1476
+ *
1477
+ * Returns the convex hull of all pairwise vertex sums — exact for convex
1478
+ * inputs (boxes, or a tessellated-sphere rolling tool), a convex
1479
+ * over-approximation otherwise. Returns a solid handle (`u32`).
1480
+ *
1481
+ * # Errors
1482
+ *
1483
+ * Returns an error if either handle is invalid or either solid is empty.
1484
+ */
1485
+ minkowskiSum(solid_a: number, solid_b: number): number;
1460
1486
  /**
1461
1487
  * Mirror a solid across a plane.
1462
1488
  *
@@ -2085,6 +2085,48 @@ export class BrepKernel {
2085
2085
  }
2086
2086
  return ret[0] >>> 0;
2087
2087
  }
2088
+ /**
2089
+ * Guided (two-rail) sweep: sweep `face` along a spine, orienting the
2090
+ * profile so its up-vector tracks an auxiliary spine.
2091
+ *
2092
+ * The spine and auxiliary spine are each passed as raw NURBS data
2093
+ * (`degree`, `knots`, flat `control_points`, `weights`). Returns a solid
2094
+ * handle (`u32`).
2095
+ *
2096
+ * # Errors
2097
+ *
2098
+ * Returns an error for a non-finite or malformed curve, a non-planar
2099
+ * profile, or a degenerate path.
2100
+ * @param {number} face
2101
+ * @param {number} spine_degree
2102
+ * @param {Float64Array} spine_knots
2103
+ * @param {Float64Array} spine_control_points
2104
+ * @param {Float64Array} spine_weights
2105
+ * @param {number} aux_degree
2106
+ * @param {Float64Array} aux_knots
2107
+ * @param {Float64Array} aux_control_points
2108
+ * @param {Float64Array} aux_weights
2109
+ * @returns {number}
2110
+ */
2111
+ guidedSweep(face, spine_degree, spine_knots, spine_control_points, spine_weights, aux_degree, aux_knots, aux_control_points, aux_weights) {
2112
+ const ptr0 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
2113
+ const len0 = WASM_VECTOR_LEN;
2114
+ const ptr1 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
2115
+ const len1 = WASM_VECTOR_LEN;
2116
+ const ptr2 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
2117
+ const len2 = WASM_VECTOR_LEN;
2118
+ const ptr3 = passArrayF64ToWasm0(aux_knots, wasm.__wbindgen_malloc);
2119
+ const len3 = WASM_VECTOR_LEN;
2120
+ const ptr4 = passArrayF64ToWasm0(aux_control_points, wasm.__wbindgen_malloc);
2121
+ const len4 = WASM_VECTOR_LEN;
2122
+ const ptr5 = passArrayF64ToWasm0(aux_weights, wasm.__wbindgen_malloc);
2123
+ const len5 = WASM_VECTOR_LEN;
2124
+ const ret = wasm.brepkernel_guidedSweep(this.__wbg_ptr, face, spine_degree, ptr0, len0, ptr1, len1, ptr2, len2, aux_degree, ptr3, len3, ptr4, len4, ptr5, len5);
2125
+ if (ret[2]) {
2126
+ throw takeFromExternrefTable0(ret[1]);
2127
+ }
2128
+ return ret[0] >>> 0;
2129
+ }
2088
2130
  /**
2089
2131
  * Heal a solid topology.
2090
2132
  *
@@ -3221,6 +3263,27 @@ export class BrepKernel {
3221
3263
  }
3222
3264
  return JsEdgeLines.__wrap(ret[0]);
3223
3265
  }
3266
+ /**
3267
+ * Convex Minkowski sum of two solids (`A ⊕ B`).
3268
+ *
3269
+ * Returns the convex hull of all pairwise vertex sums — exact for convex
3270
+ * inputs (boxes, or a tessellated-sphere rolling tool), a convex
3271
+ * over-approximation otherwise. Returns a solid handle (`u32`).
3272
+ *
3273
+ * # Errors
3274
+ *
3275
+ * Returns an error if either handle is invalid or either solid is empty.
3276
+ * @param {number} solid_a
3277
+ * @param {number} solid_b
3278
+ * @returns {number}
3279
+ */
3280
+ minkowskiSum(solid_a, solid_b) {
3281
+ const ret = wasm.brepkernel_minkowskiSum(this.__wbg_ptr, solid_a, solid_b);
3282
+ if (ret[2]) {
3283
+ throw takeFromExternrefTable0(ret[1]);
3284
+ }
3285
+ return ret[0] >>> 0;
3286
+ }
3224
3287
  /**
3225
3288
  * Mirror a solid across a plane.
3226
3289
  *
@@ -4965,13 +5028,13 @@ export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
4965
5028
  export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
4966
5029
  throw new Error(getStringFromWasm0(arg0, arg1));
4967
5030
  }
4968
- export function __wbg_error_7dea289e6e83cdf7(arg0, arg1) {
5031
+ export function __wbg_error_466a5db4a220c274(arg0, arg1) {
4969
5032
  console.error(getStringFromWasm0(arg0, arg1));
4970
5033
  }
4971
- export function __wbg_log_e5ff6852bee07cc4(arg0, arg1) {
5034
+ export function __wbg_log_6dbd295f9b944582(arg0, arg1) {
4972
5035
  console.log(getStringFromWasm0(arg0, arg1));
4973
5036
  }
4974
- export function __wbg_warn_5089fa8b44e22e7b(arg0, arg1) {
5037
+ export function __wbg_warn_e4246fa70a08e9a6(arg0, arg1) {
4975
5038
  console.warn(getStringFromWasm0(arg0, arg1));
4976
5039
  }
4977
5040
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
Binary file
@@ -2087,6 +2087,48 @@ class BrepKernel {
2087
2087
  }
2088
2088
  return ret[0] >>> 0;
2089
2089
  }
2090
+ /**
2091
+ * Guided (two-rail) sweep: sweep `face` along a spine, orienting the
2092
+ * profile so its up-vector tracks an auxiliary spine.
2093
+ *
2094
+ * The spine and auxiliary spine are each passed as raw NURBS data
2095
+ * (`degree`, `knots`, flat `control_points`, `weights`). Returns a solid
2096
+ * handle (`u32`).
2097
+ *
2098
+ * # Errors
2099
+ *
2100
+ * Returns an error for a non-finite or malformed curve, a non-planar
2101
+ * profile, or a degenerate path.
2102
+ * @param {number} face
2103
+ * @param {number} spine_degree
2104
+ * @param {Float64Array} spine_knots
2105
+ * @param {Float64Array} spine_control_points
2106
+ * @param {Float64Array} spine_weights
2107
+ * @param {number} aux_degree
2108
+ * @param {Float64Array} aux_knots
2109
+ * @param {Float64Array} aux_control_points
2110
+ * @param {Float64Array} aux_weights
2111
+ * @returns {number}
2112
+ */
2113
+ guidedSweep(face, spine_degree, spine_knots, spine_control_points, spine_weights, aux_degree, aux_knots, aux_control_points, aux_weights) {
2114
+ const ptr0 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
2115
+ const len0 = WASM_VECTOR_LEN;
2116
+ const ptr1 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
2117
+ const len1 = WASM_VECTOR_LEN;
2118
+ const ptr2 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
2119
+ const len2 = WASM_VECTOR_LEN;
2120
+ const ptr3 = passArrayF64ToWasm0(aux_knots, wasm.__wbindgen_malloc);
2121
+ const len3 = WASM_VECTOR_LEN;
2122
+ const ptr4 = passArrayF64ToWasm0(aux_control_points, wasm.__wbindgen_malloc);
2123
+ const len4 = WASM_VECTOR_LEN;
2124
+ const ptr5 = passArrayF64ToWasm0(aux_weights, wasm.__wbindgen_malloc);
2125
+ const len5 = WASM_VECTOR_LEN;
2126
+ const ret = wasm.brepkernel_guidedSweep(this.__wbg_ptr, face, spine_degree, ptr0, len0, ptr1, len1, ptr2, len2, aux_degree, ptr3, len3, ptr4, len4, ptr5, len5);
2127
+ if (ret[2]) {
2128
+ throw takeFromExternrefTable0(ret[1]);
2129
+ }
2130
+ return ret[0] >>> 0;
2131
+ }
2090
2132
  /**
2091
2133
  * Heal a solid topology.
2092
2134
  *
@@ -3223,6 +3265,27 @@ class BrepKernel {
3223
3265
  }
3224
3266
  return JsEdgeLines.__wrap(ret[0]);
3225
3267
  }
3268
+ /**
3269
+ * Convex Minkowski sum of two solids (`A ⊕ B`).
3270
+ *
3271
+ * Returns the convex hull of all pairwise vertex sums — exact for convex
3272
+ * inputs (boxes, or a tessellated-sphere rolling tool), a convex
3273
+ * over-approximation otherwise. Returns a solid handle (`u32`).
3274
+ *
3275
+ * # Errors
3276
+ *
3277
+ * Returns an error if either handle is invalid or either solid is empty.
3278
+ * @param {number} solid_a
3279
+ * @param {number} solid_b
3280
+ * @returns {number}
3281
+ */
3282
+ minkowskiSum(solid_a, solid_b) {
3283
+ const ret = wasm.brepkernel_minkowskiSum(this.__wbg_ptr, solid_a, solid_b);
3284
+ if (ret[2]) {
3285
+ throw takeFromExternrefTable0(ret[1]);
3286
+ }
3287
+ return ret[0] >>> 0;
3288
+ }
3226
3289
  /**
3227
3290
  * Mirror a solid across a plane.
3228
3291
  *
@@ -4977,13 +5040,13 @@ function __wbg_get_imports() {
4977
5040
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
4978
5041
  throw new Error(getStringFromWasm0(arg0, arg1));
4979
5042
  },
4980
- __wbg_error_7dea289e6e83cdf7: function(arg0, arg1) {
5043
+ __wbg_error_466a5db4a220c274: function(arg0, arg1) {
4981
5044
  console.error(getStringFromWasm0(arg0, arg1));
4982
5045
  },
4983
- __wbg_log_e5ff6852bee07cc4: function(arg0, arg1) {
5046
+ __wbg_log_6dbd295f9b944582: function(arg0, arg1) {
4984
5047
  console.log(getStringFromWasm0(arg0, arg1));
4985
5048
  },
4986
- __wbg_warn_5089fa8b44e22e7b: function(arg0, arg1) {
5049
+ __wbg_warn_e4246fa70a08e9a6: function(arg0, arg1) {
4987
5050
  console.warn(getStringFromWasm0(arg0, arg1));
4988
5051
  },
4989
5052
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "brepkit-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for brepkit — browser-native B-Rep solid modeling",
5
- "version": "2.107.0",
5
+ "version": "2.108.0",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",