brepkit-wasm 2.108.0 → 2.109.1

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
@@ -1475,12 +1475,13 @@ export class BrepKernel {
1475
1475
  * Convex Minkowski sum of two solids (`A ⊕ B`).
1476
1476
  *
1477
1477
  * Returns the convex hull of all pairwise vertex sums — exact for convex
1478
- * inputs (boxes, or a tessellated-sphere rolling tool), a convex
1478
+ * polytopes (boxes, or a tessellated-sphere rolling tool), a convex
1479
1479
  * over-approximation otherwise. Returns a solid handle (`u32`).
1480
1480
  *
1481
1481
  * # Errors
1482
1482
  *
1483
- * Returns an error if either handle is invalid or either solid is empty.
1483
+ * Returns an error if either handle is invalid, either solid is empty, or
1484
+ * the summed points are degenerate so no hull can be built.
1484
1485
  */
1485
1486
  minkowskiSum(solid_a: number, solid_b: number): number;
1486
1487
  /**
@@ -1643,6 +1644,20 @@ export class BrepKernel {
1643
1644
  * or if any edges cross.
1644
1645
  */
1645
1646
  polygonsIntersect2d(coords_a: Float64Array, coords_b: Float64Array): boolean;
1647
+ /**
1648
+ * Project a solid's edges onto a view plane with hidden-line removal.
1649
+ *
1650
+ * Viewed along `dir` (orthographic) through `origin`, with in-plane x-axis
1651
+ * `x_axis`. Returns a JSON string `{"visible": [[x,y,…]], "hidden": [[…]]}`
1652
+ * — flat 2D polylines in view coordinates. `hidden_lines = false` drops the
1653
+ * hidden set. Occlusion is an exact point-in-solid test.
1654
+ *
1655
+ * # Errors
1656
+ *
1657
+ * Returns an error for an invalid handle, a non-positive `deflection`, or a
1658
+ * degenerate `dir`/`x_axis`.
1659
+ */
1660
+ 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;
1646
1661
  /**
1647
1662
  * Project a 3D point onto a face surface using Newton iteration.
1648
1663
  *
@@ -3267,12 +3267,13 @@ export class BrepKernel {
3267
3267
  * Convex Minkowski sum of two solids (`A ⊕ B`).
3268
3268
  *
3269
3269
  * Returns the convex hull of all pairwise vertex sums — exact for convex
3270
- * inputs (boxes, or a tessellated-sphere rolling tool), a convex
3270
+ * polytopes (boxes, or a tessellated-sphere rolling tool), a convex
3271
3271
  * over-approximation otherwise. Returns a solid handle (`u32`).
3272
3272
  *
3273
3273
  * # Errors
3274
3274
  *
3275
- * Returns an error if either handle is invalid or either solid is empty.
3275
+ * Returns an error if either handle is invalid, either solid is empty, or
3276
+ * the summed points are degenerate so no hull can be built.
3276
3277
  * @param {number} solid_a
3277
3278
  * @param {number} solid_b
3278
3279
  * @returns {number}
@@ -3644,6 +3645,39 @@ export class BrepKernel {
3644
3645
  }
3645
3646
  return ret[0] !== 0;
3646
3647
  }
3648
+ /**
3649
+ * Project a solid's edges onto a view plane with hidden-line removal.
3650
+ *
3651
+ * Viewed along `dir` (orthographic) through `origin`, with in-plane x-axis
3652
+ * `x_axis`. Returns a JSON string `{"visible": [[x,y,…]], "hidden": [[…]]}`
3653
+ * — flat 2D polylines in view coordinates. `hidden_lines = false` drops the
3654
+ * hidden set. Occlusion is an exact point-in-solid test.
3655
+ *
3656
+ * # Errors
3657
+ *
3658
+ * Returns an error for an invalid handle, a non-positive `deflection`, or a
3659
+ * degenerate `dir`/`x_axis`.
3660
+ * @param {number} solid
3661
+ * @param {number} origin_x
3662
+ * @param {number} origin_y
3663
+ * @param {number} origin_z
3664
+ * @param {number} dir_x
3665
+ * @param {number} dir_y
3666
+ * @param {number} dir_z
3667
+ * @param {number} x_axis_x
3668
+ * @param {number} x_axis_y
3669
+ * @param {number} x_axis_z
3670
+ * @param {boolean} hidden_lines
3671
+ * @param {number} deflection
3672
+ * @returns {any}
3673
+ */
3674
+ 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) {
3675
+ 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);
3676
+ if (ret[2]) {
3677
+ throw takeFromExternrefTable0(ret[1]);
3678
+ }
3679
+ return takeFromExternrefTable0(ret[0]);
3680
+ }
3647
3681
  /**
3648
3682
  * Project a 3D point onto a face surface using Newton iteration.
3649
3683
  *
@@ -5028,13 +5062,13 @@ export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
5028
5062
  export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
5029
5063
  throw new Error(getStringFromWasm0(arg0, arg1));
5030
5064
  }
5031
- export function __wbg_error_466a5db4a220c274(arg0, arg1) {
5065
+ export function __wbg_error_7bbef3537899b2e1(arg0, arg1) {
5032
5066
  console.error(getStringFromWasm0(arg0, arg1));
5033
5067
  }
5034
- export function __wbg_log_6dbd295f9b944582(arg0, arg1) {
5068
+ export function __wbg_log_2a6e9f59e26fd4df(arg0, arg1) {
5035
5069
  console.log(getStringFromWasm0(arg0, arg1));
5036
5070
  }
5037
- export function __wbg_warn_e4246fa70a08e9a6(arg0, arg1) {
5071
+ export function __wbg_warn_23c0d36e90a2667c(arg0, arg1) {
5038
5072
  console.warn(getStringFromWasm0(arg0, arg1));
5039
5073
  }
5040
5074
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
Binary file
@@ -3269,12 +3269,13 @@ class BrepKernel {
3269
3269
  * Convex Minkowski sum of two solids (`A ⊕ B`).
3270
3270
  *
3271
3271
  * Returns the convex hull of all pairwise vertex sums — exact for convex
3272
- * inputs (boxes, or a tessellated-sphere rolling tool), a convex
3272
+ * polytopes (boxes, or a tessellated-sphere rolling tool), a convex
3273
3273
  * over-approximation otherwise. Returns a solid handle (`u32`).
3274
3274
  *
3275
3275
  * # Errors
3276
3276
  *
3277
- * Returns an error if either handle is invalid or either solid is empty.
3277
+ * Returns an error if either handle is invalid, either solid is empty, or
3278
+ * the summed points are degenerate so no hull can be built.
3278
3279
  * @param {number} solid_a
3279
3280
  * @param {number} solid_b
3280
3281
  * @returns {number}
@@ -3646,6 +3647,39 @@ class BrepKernel {
3646
3647
  }
3647
3648
  return ret[0] !== 0;
3648
3649
  }
3650
+ /**
3651
+ * Project a solid's edges onto a view plane with hidden-line removal.
3652
+ *
3653
+ * Viewed along `dir` (orthographic) through `origin`, with in-plane x-axis
3654
+ * `x_axis`. Returns a JSON string `{"visible": [[x,y,…]], "hidden": [[…]]}`
3655
+ * — flat 2D polylines in view coordinates. `hidden_lines = false` drops the
3656
+ * hidden set. Occlusion is an exact point-in-solid test.
3657
+ *
3658
+ * # Errors
3659
+ *
3660
+ * Returns an error for an invalid handle, a non-positive `deflection`, or a
3661
+ * degenerate `dir`/`x_axis`.
3662
+ * @param {number} solid
3663
+ * @param {number} origin_x
3664
+ * @param {number} origin_y
3665
+ * @param {number} origin_z
3666
+ * @param {number} dir_x
3667
+ * @param {number} dir_y
3668
+ * @param {number} dir_z
3669
+ * @param {number} x_axis_x
3670
+ * @param {number} x_axis_y
3671
+ * @param {number} x_axis_z
3672
+ * @param {boolean} hidden_lines
3673
+ * @param {number} deflection
3674
+ * @returns {any}
3675
+ */
3676
+ 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) {
3677
+ 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);
3678
+ if (ret[2]) {
3679
+ throw takeFromExternrefTable0(ret[1]);
3680
+ }
3681
+ return takeFromExternrefTable0(ret[0]);
3682
+ }
3649
3683
  /**
3650
3684
  * Project a 3D point onto a face surface using Newton iteration.
3651
3685
  *
@@ -5040,13 +5074,13 @@ function __wbg_get_imports() {
5040
5074
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
5041
5075
  throw new Error(getStringFromWasm0(arg0, arg1));
5042
5076
  },
5043
- __wbg_error_466a5db4a220c274: function(arg0, arg1) {
5077
+ __wbg_error_7bbef3537899b2e1: function(arg0, arg1) {
5044
5078
  console.error(getStringFromWasm0(arg0, arg1));
5045
5079
  },
5046
- __wbg_log_6dbd295f9b944582: function(arg0, arg1) {
5080
+ __wbg_log_2a6e9f59e26fd4df: function(arg0, arg1) {
5047
5081
  console.log(getStringFromWasm0(arg0, arg1));
5048
5082
  },
5049
- __wbg_warn_e4246fa70a08e9a6: function(arg0, arg1) {
5083
+ __wbg_warn_23c0d36e90a2667c: function(arg0, arg1) {
5050
5084
  console.warn(getStringFromWasm0(arg0, arg1));
5051
5085
  },
5052
5086
  __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.108.0",
5
+ "version": "2.109.1",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",