brepkit-wasm 2.107.0 → 2.109.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
  *
@@ -1617,6 +1643,20 @@ export class BrepKernel {
1617
1643
  * or if any edges cross.
1618
1644
  */
1619
1645
  polygonsIntersect2d(coords_a: Float64Array, coords_b: Float64Array): boolean;
1646
+ /**
1647
+ * Project a solid's edges onto a view plane with hidden-line removal.
1648
+ *
1649
+ * Viewed along `dir` (orthographic) through `origin`, with in-plane x-axis
1650
+ * `x_axis`. Returns a JSON string `{"visible": [[x,y,…]], "hidden": [[…]]}`
1651
+ * — flat 2D polylines in view coordinates. `hidden_lines = false` drops the
1652
+ * hidden set. Occlusion is an exact point-in-solid test.
1653
+ *
1654
+ * # Errors
1655
+ *
1656
+ * Returns an error for an invalid handle, a non-positive `deflection`, or a
1657
+ * degenerate `dir`/`x_axis`.
1658
+ */
1659
+ projectEdges(solid: number, origin_x: number, origin_y: number, origin_z: number, dir_x: number, dir_y: number, dir_z: number, x_axis_x: number, x_axis_y: number, x_axis_z: number, hidden_lines: boolean, deflection: number): any;
1620
1660
  /**
1621
1661
  * Project a 3D point onto a face surface using Newton iteration.
1622
1662
  *
@@ -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
  *
@@ -3581,6 +3644,39 @@ export class BrepKernel {
3581
3644
  }
3582
3645
  return ret[0] !== 0;
3583
3646
  }
3647
+ /**
3648
+ * Project a solid's edges onto a view plane with hidden-line removal.
3649
+ *
3650
+ * Viewed along `dir` (orthographic) through `origin`, with in-plane x-axis
3651
+ * `x_axis`. Returns a JSON string `{"visible": [[x,y,…]], "hidden": [[…]]}`
3652
+ * — flat 2D polylines in view coordinates. `hidden_lines = false` drops the
3653
+ * hidden set. Occlusion is an exact point-in-solid test.
3654
+ *
3655
+ * # Errors
3656
+ *
3657
+ * Returns an error for an invalid handle, a non-positive `deflection`, or a
3658
+ * degenerate `dir`/`x_axis`.
3659
+ * @param {number} solid
3660
+ * @param {number} origin_x
3661
+ * @param {number} origin_y
3662
+ * @param {number} origin_z
3663
+ * @param {number} dir_x
3664
+ * @param {number} dir_y
3665
+ * @param {number} dir_z
3666
+ * @param {number} x_axis_x
3667
+ * @param {number} x_axis_y
3668
+ * @param {number} x_axis_z
3669
+ * @param {boolean} hidden_lines
3670
+ * @param {number} deflection
3671
+ * @returns {any}
3672
+ */
3673
+ projectEdges(solid, origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, x_axis_x, x_axis_y, x_axis_z, hidden_lines, deflection) {
3674
+ const ret = wasm.brepkernel_projectEdges(this.__wbg_ptr, solid, origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, x_axis_x, x_axis_y, x_axis_z, hidden_lines, deflection);
3675
+ if (ret[2]) {
3676
+ throw takeFromExternrefTable0(ret[1]);
3677
+ }
3678
+ return takeFromExternrefTable0(ret[0]);
3679
+ }
3584
3680
  /**
3585
3681
  * Project a 3D point onto a face surface using Newton iteration.
3586
3682
  *
@@ -4965,13 +5061,13 @@ export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
4965
5061
  export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
4966
5062
  throw new Error(getStringFromWasm0(arg0, arg1));
4967
5063
  }
4968
- export function __wbg_error_7dea289e6e83cdf7(arg0, arg1) {
5064
+ export function __wbg_error_b90644cfaa2e7810(arg0, arg1) {
4969
5065
  console.error(getStringFromWasm0(arg0, arg1));
4970
5066
  }
4971
- export function __wbg_log_e5ff6852bee07cc4(arg0, arg1) {
5067
+ export function __wbg_log_09b8ace0eff11254(arg0, arg1) {
4972
5068
  console.log(getStringFromWasm0(arg0, arg1));
4973
5069
  }
4974
- export function __wbg_warn_5089fa8b44e22e7b(arg0, arg1) {
5070
+ export function __wbg_warn_60c69ccb1a8dba56(arg0, arg1) {
4975
5071
  console.warn(getStringFromWasm0(arg0, arg1));
4976
5072
  }
4977
5073
  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
  *
@@ -3583,6 +3646,39 @@ class BrepKernel {
3583
3646
  }
3584
3647
  return ret[0] !== 0;
3585
3648
  }
3649
+ /**
3650
+ * Project a solid's edges onto a view plane with hidden-line removal.
3651
+ *
3652
+ * Viewed along `dir` (orthographic) through `origin`, with in-plane x-axis
3653
+ * `x_axis`. Returns a JSON string `{"visible": [[x,y,…]], "hidden": [[…]]}`
3654
+ * — flat 2D polylines in view coordinates. `hidden_lines = false` drops the
3655
+ * hidden set. Occlusion is an exact point-in-solid test.
3656
+ *
3657
+ * # Errors
3658
+ *
3659
+ * Returns an error for an invalid handle, a non-positive `deflection`, or a
3660
+ * degenerate `dir`/`x_axis`.
3661
+ * @param {number} solid
3662
+ * @param {number} origin_x
3663
+ * @param {number} origin_y
3664
+ * @param {number} origin_z
3665
+ * @param {number} dir_x
3666
+ * @param {number} dir_y
3667
+ * @param {number} dir_z
3668
+ * @param {number} x_axis_x
3669
+ * @param {number} x_axis_y
3670
+ * @param {number} x_axis_z
3671
+ * @param {boolean} hidden_lines
3672
+ * @param {number} deflection
3673
+ * @returns {any}
3674
+ */
3675
+ projectEdges(solid, origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, x_axis_x, x_axis_y, x_axis_z, hidden_lines, deflection) {
3676
+ const ret = wasm.brepkernel_projectEdges(this.__wbg_ptr, solid, origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, x_axis_x, x_axis_y, x_axis_z, hidden_lines, deflection);
3677
+ if (ret[2]) {
3678
+ throw takeFromExternrefTable0(ret[1]);
3679
+ }
3680
+ return takeFromExternrefTable0(ret[0]);
3681
+ }
3586
3682
  /**
3587
3683
  * Project a 3D point onto a face surface using Newton iteration.
3588
3684
  *
@@ -4977,13 +5073,13 @@ function __wbg_get_imports() {
4977
5073
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
4978
5074
  throw new Error(getStringFromWasm0(arg0, arg1));
4979
5075
  },
4980
- __wbg_error_7dea289e6e83cdf7: function(arg0, arg1) {
5076
+ __wbg_error_b90644cfaa2e7810: function(arg0, arg1) {
4981
5077
  console.error(getStringFromWasm0(arg0, arg1));
4982
5078
  },
4983
- __wbg_log_e5ff6852bee07cc4: function(arg0, arg1) {
5079
+ __wbg_log_09b8ace0eff11254: function(arg0, arg1) {
4984
5080
  console.log(getStringFromWasm0(arg0, arg1));
4985
5081
  },
4986
- __wbg_warn_5089fa8b44e22e7b: function(arg0, arg1) {
5082
+ __wbg_warn_60c69ccb1a8dba56: function(arg0, arg1) {
4987
5083
  console.warn(getStringFromWasm0(arg0, arg1));
4988
5084
  },
4989
5085
  __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.109.0",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",