brepkit-wasm 2.96.0 → 2.97.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
@@ -1247,7 +1247,12 @@ export class BrepKernel {
1247
1247
  */
1248
1248
  makeEllipsoid(rx: number, ry: number, rz: number): number;
1249
1249
  /**
1250
- * Create a planar face from a wire (computes normal from first 3 vertices).
1250
+ * Create a face from a wire.
1251
+ *
1252
+ * Samples the wire's edges and attaches a planar surface only if the
1253
+ * geometry lies within tolerance of a single plane; otherwise a
1254
+ * non-planar surface is attached, so `getSurfaceType` never reports
1255
+ * `"plane"` for a non-coplanar wire.
1251
1256
  *
1252
1257
  * Returns a face handle (`u32`).
1253
1258
  */
@@ -1264,6 +1269,16 @@ export class BrepKernel {
1264
1269
  * Returns an edge handle (`u32`).
1265
1270
  */
1266
1271
  makeNurbsEdge(start_x: number, start_y: number, start_z: number, end_x: number, end_y: number, end_z: number, degree: number, knots: Float64Array, control_points: Float64Array, weights: Float64Array): number;
1272
+ /**
1273
+ * Create a strictly planar face from a wire.
1274
+ *
1275
+ * Fails with a "wire is not planar" error if the wire's geometry does
1276
+ * not lie within tolerance of a single plane. Use this for planar-only
1277
+ * construction intent (probing whether a wire is planar).
1278
+ *
1279
+ * Returns a face handle (`u32`).
1280
+ */
1281
+ makePlanarFaceFromWire(wire: number): number;
1267
1282
  /**
1268
1283
  * Create a polygonal face from flat coordinate triples `[x,y,z, ...]`.
1269
1284
  *
@@ -2733,7 +2733,12 @@ export class BrepKernel {
2733
2733
  return ret[0] >>> 0;
2734
2734
  }
2735
2735
  /**
2736
- * Create a planar face from a wire (computes normal from first 3 vertices).
2736
+ * Create a face from a wire.
2737
+ *
2738
+ * Samples the wire's edges and attaches a planar surface only if the
2739
+ * geometry lies within tolerance of a single plane; otherwise a
2740
+ * non-planar surface is attached, so `getSurfaceType` never reports
2741
+ * `"plane"` for a non-coplanar wire.
2737
2742
  *
2738
2743
  * Returns a face handle (`u32`).
2739
2744
  * @param {number} wire
@@ -2794,6 +2799,24 @@ export class BrepKernel {
2794
2799
  }
2795
2800
  return ret[0] >>> 0;
2796
2801
  }
2802
+ /**
2803
+ * Create a strictly planar face from a wire.
2804
+ *
2805
+ * Fails with a "wire is not planar" error if the wire's geometry does
2806
+ * not lie within tolerance of a single plane. Use this for planar-only
2807
+ * construction intent (probing whether a wire is planar).
2808
+ *
2809
+ * Returns a face handle (`u32`).
2810
+ * @param {number} wire
2811
+ * @returns {number}
2812
+ */
2813
+ makePlanarFaceFromWire(wire) {
2814
+ const ret = wasm.brepkernel_makePlanarFaceFromWire(this.__wbg_ptr, wire);
2815
+ if (ret[2]) {
2816
+ throw takeFromExternrefTable0(ret[1]);
2817
+ }
2818
+ return ret[0] >>> 0;
2819
+ }
2797
2820
  /**
2798
2821
  * Create a polygonal face from flat coordinate triples `[x,y,z, ...]`.
2799
2822
  *
@@ -4673,13 +4696,13 @@ export function __wbg___wbindgen_debug_string_edece8177ad01481(arg0, arg1) {
4673
4696
  export function __wbg___wbindgen_throw_9c31b086c2b26051(arg0, arg1) {
4674
4697
  throw new Error(getStringFromWasm0(arg0, arg1));
4675
4698
  }
4676
- export function __wbg_error_0333dc6c9d8e576b(arg0, arg1) {
4699
+ export function __wbg_error_97c8e99b1630c83b(arg0, arg1) {
4677
4700
  console.error(getStringFromWasm0(arg0, arg1));
4678
4701
  }
4679
- export function __wbg_log_f21353a795692d27(arg0, arg1) {
4702
+ export function __wbg_log_8996743106ce3520(arg0, arg1) {
4680
4703
  console.log(getStringFromWasm0(arg0, arg1));
4681
4704
  }
4682
- export function __wbg_warn_c0a82906f1a61a5e(arg0, arg1) {
4705
+ export function __wbg_warn_d82abd2607c609c1(arg0, arg1) {
4683
4706
  console.warn(getStringFromWasm0(arg0, arg1));
4684
4707
  }
4685
4708
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
Binary file
@@ -2735,7 +2735,12 @@ class BrepKernel {
2735
2735
  return ret[0] >>> 0;
2736
2736
  }
2737
2737
  /**
2738
- * Create a planar face from a wire (computes normal from first 3 vertices).
2738
+ * Create a face from a wire.
2739
+ *
2740
+ * Samples the wire's edges and attaches a planar surface only if the
2741
+ * geometry lies within tolerance of a single plane; otherwise a
2742
+ * non-planar surface is attached, so `getSurfaceType` never reports
2743
+ * `"plane"` for a non-coplanar wire.
2739
2744
  *
2740
2745
  * Returns a face handle (`u32`).
2741
2746
  * @param {number} wire
@@ -2796,6 +2801,24 @@ class BrepKernel {
2796
2801
  }
2797
2802
  return ret[0] >>> 0;
2798
2803
  }
2804
+ /**
2805
+ * Create a strictly planar face from a wire.
2806
+ *
2807
+ * Fails with a "wire is not planar" error if the wire's geometry does
2808
+ * not lie within tolerance of a single plane. Use this for planar-only
2809
+ * construction intent (probing whether a wire is planar).
2810
+ *
2811
+ * Returns a face handle (`u32`).
2812
+ * @param {number} wire
2813
+ * @returns {number}
2814
+ */
2815
+ makePlanarFaceFromWire(wire) {
2816
+ const ret = wasm.brepkernel_makePlanarFaceFromWire(this.__wbg_ptr, wire);
2817
+ if (ret[2]) {
2818
+ throw takeFromExternrefTable0(ret[1]);
2819
+ }
2820
+ return ret[0] >>> 0;
2821
+ }
2799
2822
  /**
2800
2823
  * Create a polygonal face from flat coordinate triples `[x,y,z, ...]`.
2801
2824
  *
@@ -4684,13 +4707,13 @@ function __wbg_get_imports() {
4684
4707
  __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
4685
4708
  throw new Error(getStringFromWasm0(arg0, arg1));
4686
4709
  },
4687
- __wbg_error_0333dc6c9d8e576b: function(arg0, arg1) {
4710
+ __wbg_error_97c8e99b1630c83b: function(arg0, arg1) {
4688
4711
  console.error(getStringFromWasm0(arg0, arg1));
4689
4712
  },
4690
- __wbg_log_f21353a795692d27: function(arg0, arg1) {
4713
+ __wbg_log_8996743106ce3520: function(arg0, arg1) {
4691
4714
  console.log(getStringFromWasm0(arg0, arg1));
4692
4715
  },
4693
- __wbg_warn_c0a82906f1a61a5e: function(arg0, arg1) {
4716
+ __wbg_warn_d82abd2607c609c1: function(arg0, arg1) {
4694
4717
  console.warn(getStringFromWasm0(arg0, arg1));
4695
4718
  },
4696
4719
  __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.96.0",
5
+ "version": "2.97.1",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",