brepkit-wasm 2.106.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
  *
@@ -1467,6 +1493,22 @@ export class BrepKernel {
1467
1493
  * Returns an error if the solid handle is invalid or the normal is zero.
1468
1494
  */
1469
1495
  mirror(solid: number, px: number, py: number, pz: number, nx: number, ny: number, nz: number): number;
1496
+ /**
1497
+ * Sweep through multiple section profiles along a spine, lofting the
1498
+ * rotation-minimizing-frame-placed profiles.
1499
+ *
1500
+ * `face_handles` and `params` are parallel arrays: each planar profile and
1501
+ * its parameter in `[0, 1]` along the spine (given as raw NURBS data).
1502
+ * `ruled` selects ruled (planar bands) vs smooth (NURBS) lofted sides.
1503
+ *
1504
+ * Returns a solid handle (`u32`).
1505
+ *
1506
+ * # Errors
1507
+ *
1508
+ * Returns an error for fewer than two sections, mismatched array lengths, a
1509
+ * non-finite or out-of-range value, a non-planar profile, or loft failure.
1510
+ */
1511
+ multiSectionSweep(face_handles: Uint32Array, params: Float64Array, spine_degree: number, spine_knots: Float64Array, spine_control_points: Float64Array, spine_weights: Float64Array, ruled: boolean): number;
1470
1512
  /**
1471
1513
  * Create a new, empty kernel.
1472
1514
  */
@@ -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
  *
@@ -3245,6 +3308,46 @@ export class BrepKernel {
3245
3308
  }
3246
3309
  return ret[0] >>> 0;
3247
3310
  }
3311
+ /**
3312
+ * Sweep through multiple section profiles along a spine, lofting the
3313
+ * rotation-minimizing-frame-placed profiles.
3314
+ *
3315
+ * `face_handles` and `params` are parallel arrays: each planar profile and
3316
+ * its parameter in `[0, 1]` along the spine (given as raw NURBS data).
3317
+ * `ruled` selects ruled (planar bands) vs smooth (NURBS) lofted sides.
3318
+ *
3319
+ * Returns a solid handle (`u32`).
3320
+ *
3321
+ * # Errors
3322
+ *
3323
+ * Returns an error for fewer than two sections, mismatched array lengths, a
3324
+ * non-finite or out-of-range value, a non-planar profile, or loft failure.
3325
+ * @param {Uint32Array} face_handles
3326
+ * @param {Float64Array} params
3327
+ * @param {number} spine_degree
3328
+ * @param {Float64Array} spine_knots
3329
+ * @param {Float64Array} spine_control_points
3330
+ * @param {Float64Array} spine_weights
3331
+ * @param {boolean} ruled
3332
+ * @returns {number}
3333
+ */
3334
+ multiSectionSweep(face_handles, params, spine_degree, spine_knots, spine_control_points, spine_weights, ruled) {
3335
+ const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
3336
+ const len0 = WASM_VECTOR_LEN;
3337
+ const ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
3338
+ const len1 = WASM_VECTOR_LEN;
3339
+ const ptr2 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
3340
+ const len2 = WASM_VECTOR_LEN;
3341
+ const ptr3 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
3342
+ const len3 = WASM_VECTOR_LEN;
3343
+ const ptr4 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
3344
+ const len4 = WASM_VECTOR_LEN;
3345
+ const ret = wasm.brepkernel_multiSectionSweep(this.__wbg_ptr, ptr0, len0, ptr1, len1, spine_degree, ptr2, len2, ptr3, len3, ptr4, len4, ruled);
3346
+ if (ret[2]) {
3347
+ throw takeFromExternrefTable0(ret[1]);
3348
+ }
3349
+ return ret[0] >>> 0;
3350
+ }
3248
3351
  /**
3249
3352
  * Create a new, empty kernel.
3250
3353
  */
@@ -4925,13 +5028,13 @@ export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
4925
5028
  export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
4926
5029
  throw new Error(getStringFromWasm0(arg0, arg1));
4927
5030
  }
4928
- export function __wbg_error_32c3f14b53b5fdcf(arg0, arg1) {
5031
+ export function __wbg_error_466a5db4a220c274(arg0, arg1) {
4929
5032
  console.error(getStringFromWasm0(arg0, arg1));
4930
5033
  }
4931
- export function __wbg_log_7dab0f19c8396a35(arg0, arg1) {
5034
+ export function __wbg_log_6dbd295f9b944582(arg0, arg1) {
4932
5035
  console.log(getStringFromWasm0(arg0, arg1));
4933
5036
  }
4934
- export function __wbg_warn_27a5a4aedfbb537f(arg0, arg1) {
5037
+ export function __wbg_warn_e4246fa70a08e9a6(arg0, arg1) {
4935
5038
  console.warn(getStringFromWasm0(arg0, arg1));
4936
5039
  }
4937
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
  *
@@ -3247,6 +3310,46 @@ class BrepKernel {
3247
3310
  }
3248
3311
  return ret[0] >>> 0;
3249
3312
  }
3313
+ /**
3314
+ * Sweep through multiple section profiles along a spine, lofting the
3315
+ * rotation-minimizing-frame-placed profiles.
3316
+ *
3317
+ * `face_handles` and `params` are parallel arrays: each planar profile and
3318
+ * its parameter in `[0, 1]` along the spine (given as raw NURBS data).
3319
+ * `ruled` selects ruled (planar bands) vs smooth (NURBS) lofted sides.
3320
+ *
3321
+ * Returns a solid handle (`u32`).
3322
+ *
3323
+ * # Errors
3324
+ *
3325
+ * Returns an error for fewer than two sections, mismatched array lengths, a
3326
+ * non-finite or out-of-range value, a non-planar profile, or loft failure.
3327
+ * @param {Uint32Array} face_handles
3328
+ * @param {Float64Array} params
3329
+ * @param {number} spine_degree
3330
+ * @param {Float64Array} spine_knots
3331
+ * @param {Float64Array} spine_control_points
3332
+ * @param {Float64Array} spine_weights
3333
+ * @param {boolean} ruled
3334
+ * @returns {number}
3335
+ */
3336
+ multiSectionSweep(face_handles, params, spine_degree, spine_knots, spine_control_points, spine_weights, ruled) {
3337
+ const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
3338
+ const len0 = WASM_VECTOR_LEN;
3339
+ const ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
3340
+ const len1 = WASM_VECTOR_LEN;
3341
+ const ptr2 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
3342
+ const len2 = WASM_VECTOR_LEN;
3343
+ const ptr3 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
3344
+ const len3 = WASM_VECTOR_LEN;
3345
+ const ptr4 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
3346
+ const len4 = WASM_VECTOR_LEN;
3347
+ const ret = wasm.brepkernel_multiSectionSweep(this.__wbg_ptr, ptr0, len0, ptr1, len1, spine_degree, ptr2, len2, ptr3, len3, ptr4, len4, ruled);
3348
+ if (ret[2]) {
3349
+ throw takeFromExternrefTable0(ret[1]);
3350
+ }
3351
+ return ret[0] >>> 0;
3352
+ }
3250
3353
  /**
3251
3354
  * Create a new, empty kernel.
3252
3355
  */
@@ -4937,13 +5040,13 @@ function __wbg_get_imports() {
4937
5040
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
4938
5041
  throw new Error(getStringFromWasm0(arg0, arg1));
4939
5042
  },
4940
- __wbg_error_32c3f14b53b5fdcf: function(arg0, arg1) {
5043
+ __wbg_error_466a5db4a220c274: function(arg0, arg1) {
4941
5044
  console.error(getStringFromWasm0(arg0, arg1));
4942
5045
  },
4943
- __wbg_log_7dab0f19c8396a35: function(arg0, arg1) {
5046
+ __wbg_log_6dbd295f9b944582: function(arg0, arg1) {
4944
5047
  console.log(getStringFromWasm0(arg0, arg1));
4945
5048
  },
4946
- __wbg_warn_27a5a4aedfbb537f: function(arg0, arg1) {
5049
+ __wbg_warn_e4246fa70a08e9a6: function(arg0, arg1) {
4947
5050
  console.warn(getStringFromWasm0(arg0, arg1));
4948
5051
  },
4949
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.106.0",
5
+ "version": "2.108.0",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",