brepkit-wasm 2.114.11 → 2.114.13

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
@@ -389,6 +389,14 @@ export class BrepKernel {
389
389
  * Returns a new solid handle.
390
390
  */
391
391
  defeature(solid: number, face_handles: Uint32Array): number;
392
+ /**
393
+ * Reconstruct a solid from a buffer produced by [`Self::serialize_solid`].
394
+ *
395
+ * # Errors
396
+ *
397
+ * Returns an error if the buffer is malformed or reconstruction fails.
398
+ */
399
+ deserializeSolid(data: Uint8Array): number;
392
400
  /**
393
401
  * Detect surface-level coincident face pairs between two solids
394
402
  * without performing a boolean operation.
@@ -1758,6 +1766,23 @@ export class BrepKernel {
1758
1766
  * intersect the solid.
1759
1767
  */
1760
1768
  section(solid: number, px: number, py: number, pz: number, nx: number, ny: number, nz: number): Uint32Array;
1769
+ /**
1770
+ * Serialize a solid's complete in-memory topology sub-arena to bytes.
1771
+ *
1772
+ * Captures every vertex, edge, wire, face, shell reachable from the
1773
+ * solid with byte-exact f64 values (no geometry re-derivation or
1774
+ * tolerance normalization). Unlike STEP/IGES export, this preserves the
1775
+ * kernel's exact in-memory state — intended for capturing live operands
1776
+ * and replaying them in a native Rust harness to reproduce
1777
+ * sub-ULP-sensitive boolean behavior.
1778
+ *
1779
+ * Returns a `Uint8Array` consumable by `brepkit_io::arena_io::deserialize_solid`.
1780
+ *
1781
+ * # Errors
1782
+ *
1783
+ * Returns an error if the solid handle is invalid or serialization fails.
1784
+ */
1785
+ serializeSolid(solid: number): Uint8Array;
1761
1786
  /**
1762
1787
  * Sew loose faces into a connected solid.
1763
1788
  *
@@ -818,6 +818,24 @@ export class BrepKernel {
818
818
  }
819
819
  return ret[0] >>> 0;
820
820
  }
821
+ /**
822
+ * Reconstruct a solid from a buffer produced by [`Self::serialize_solid`].
823
+ *
824
+ * # Errors
825
+ *
826
+ * Returns an error if the buffer is malformed or reconstruction fails.
827
+ * @param {Uint8Array} data
828
+ * @returns {number}
829
+ */
830
+ deserializeSolid(data) {
831
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
832
+ const len0 = WASM_VECTOR_LEN;
833
+ const ret = wasm.brepkernel_deserializeSolid(this.__wbg_ptr, ptr0, len0);
834
+ if (ret[2]) {
835
+ throw takeFromExternrefTable0(ret[1]);
836
+ }
837
+ return ret[0] >>> 0;
838
+ }
821
839
  /**
822
840
  * Detect surface-level coincident face pairs between two solids
823
841
  * without performing a boolean operation.
@@ -3905,6 +3923,33 @@ export class BrepKernel {
3905
3923
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3906
3924
  return v1;
3907
3925
  }
3926
+ /**
3927
+ * Serialize a solid's complete in-memory topology sub-arena to bytes.
3928
+ *
3929
+ * Captures every vertex, edge, wire, face, shell reachable from the
3930
+ * solid with byte-exact f64 values (no geometry re-derivation or
3931
+ * tolerance normalization). Unlike STEP/IGES export, this preserves the
3932
+ * kernel's exact in-memory state — intended for capturing live operands
3933
+ * and replaying them in a native Rust harness to reproduce
3934
+ * sub-ULP-sensitive boolean behavior.
3935
+ *
3936
+ * Returns a `Uint8Array` consumable by `brepkit_io::arena_io::deserialize_solid`.
3937
+ *
3938
+ * # Errors
3939
+ *
3940
+ * Returns an error if the solid handle is invalid or serialization fails.
3941
+ * @param {number} solid
3942
+ * @returns {Uint8Array}
3943
+ */
3944
+ serializeSolid(solid) {
3945
+ const ret = wasm.brepkernel_serializeSolid(this.__wbg_ptr, solid);
3946
+ if (ret[3]) {
3947
+ throw takeFromExternrefTable0(ret[2]);
3948
+ }
3949
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3950
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3951
+ return v1;
3952
+ }
3908
3953
  /**
3909
3954
  * Sew loose faces into a connected solid.
3910
3955
  *
@@ -5104,13 +5149,13 @@ export function __wbg___wbindgen_debug_string_0accd80f45e5faa2(arg0, arg1) {
5104
5149
  export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
5105
5150
  throw new Error(getStringFromWasm0(arg0, arg1));
5106
5151
  }
5107
- export function __wbg_error_a16ed827fdacba07(arg0, arg1) {
5152
+ export function __wbg_error_a22bab04d728297a(arg0, arg1) {
5108
5153
  console.error(getStringFromWasm0(arg0, arg1));
5109
5154
  }
5110
- export function __wbg_log_7cbcfc70ecd69224(arg0, arg1) {
5155
+ export function __wbg_log_df81b528f644883c(arg0, arg1) {
5111
5156
  console.log(getStringFromWasm0(arg0, arg1));
5112
5157
  }
5113
- export function __wbg_warn_d61886a52e5e17d3(arg0, arg1) {
5158
+ export function __wbg_warn_71bda13b2a6de1f7(arg0, arg1) {
5114
5159
  console.warn(getStringFromWasm0(arg0, arg1));
5115
5160
  }
5116
5161
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
Binary file
@@ -820,6 +820,24 @@ class BrepKernel {
820
820
  }
821
821
  return ret[0] >>> 0;
822
822
  }
823
+ /**
824
+ * Reconstruct a solid from a buffer produced by [`Self::serialize_solid`].
825
+ *
826
+ * # Errors
827
+ *
828
+ * Returns an error if the buffer is malformed or reconstruction fails.
829
+ * @param {Uint8Array} data
830
+ * @returns {number}
831
+ */
832
+ deserializeSolid(data) {
833
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
834
+ const len0 = WASM_VECTOR_LEN;
835
+ const ret = wasm.brepkernel_deserializeSolid(this.__wbg_ptr, ptr0, len0);
836
+ if (ret[2]) {
837
+ throw takeFromExternrefTable0(ret[1]);
838
+ }
839
+ return ret[0] >>> 0;
840
+ }
823
841
  /**
824
842
  * Detect surface-level coincident face pairs between two solids
825
843
  * without performing a boolean operation.
@@ -3907,6 +3925,33 @@ class BrepKernel {
3907
3925
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3908
3926
  return v1;
3909
3927
  }
3928
+ /**
3929
+ * Serialize a solid's complete in-memory topology sub-arena to bytes.
3930
+ *
3931
+ * Captures every vertex, edge, wire, face, shell reachable from the
3932
+ * solid with byte-exact f64 values (no geometry re-derivation or
3933
+ * tolerance normalization). Unlike STEP/IGES export, this preserves the
3934
+ * kernel's exact in-memory state — intended for capturing live operands
3935
+ * and replaying them in a native Rust harness to reproduce
3936
+ * sub-ULP-sensitive boolean behavior.
3937
+ *
3938
+ * Returns a `Uint8Array` consumable by `brepkit_io::arena_io::deserialize_solid`.
3939
+ *
3940
+ * # Errors
3941
+ *
3942
+ * Returns an error if the solid handle is invalid or serialization fails.
3943
+ * @param {number} solid
3944
+ * @returns {Uint8Array}
3945
+ */
3946
+ serializeSolid(solid) {
3947
+ const ret = wasm.brepkernel_serializeSolid(this.__wbg_ptr, solid);
3948
+ if (ret[3]) {
3949
+ throw takeFromExternrefTable0(ret[2]);
3950
+ }
3951
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3952
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3953
+ return v1;
3954
+ }
3910
3955
  /**
3911
3956
  * Sew loose faces into a connected solid.
3912
3957
  *
@@ -5116,13 +5161,13 @@ function __wbg_get_imports() {
5116
5161
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
5117
5162
  throw new Error(getStringFromWasm0(arg0, arg1));
5118
5163
  },
5119
- __wbg_error_a16ed827fdacba07: function(arg0, arg1) {
5164
+ __wbg_error_a22bab04d728297a: function(arg0, arg1) {
5120
5165
  console.error(getStringFromWasm0(arg0, arg1));
5121
5166
  },
5122
- __wbg_log_7cbcfc70ecd69224: function(arg0, arg1) {
5167
+ __wbg_log_df81b528f644883c: function(arg0, arg1) {
5123
5168
  console.log(getStringFromWasm0(arg0, arg1));
5124
5169
  },
5125
- __wbg_warn_d61886a52e5e17d3: function(arg0, arg1) {
5170
+ __wbg_warn_71bda13b2a6de1f7: function(arg0, arg1) {
5126
5171
  console.warn(getStringFromWasm0(arg0, arg1));
5127
5172
  },
5128
5173
  __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.114.11",
5
+ "version": "2.114.13",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",