brepkit-wasm 3.0.0 → 3.0.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/README.md +18 -13
- package/brepkit_wasm_bg.js +3 -3
- package/brepkit_wasm_bg.wasm +0 -0
- package/brepkit_wasm_node.cjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -147,25 +147,30 @@ Layered Cargo workspace. Each crate depends only on the same or lower layers, an
|
|
|
147
147
|
|
|
148
148
|
## Performance
|
|
149
149
|
|
|
150
|
-
Median times from
|
|
150
|
+
Median times from [brepkit-bench](https://github.com/andymai/brepkit-bench), the public repro harness (5 iterations, Node.js, Linux x86_64). WASM is single-threaded. Native benchmarks use criterion. Reproduce the WASM columns yourself:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
git clone https://github.com/andymai/brepkit-bench && cd brepkit-bench
|
|
154
|
+
npm ci && npm run bench
|
|
155
|
+
```
|
|
151
156
|
|
|
152
157
|
| Operation | brepkit (WASM) | OCCT (WASM) | Speedup | brepkit (native) |
|
|
153
158
|
| ------------------------ | -------------- | ----------- | ------- | ---------------- |
|
|
154
|
-
| fuse(box, box) (×10) | 0.
|
|
155
|
-
| cut(box, cylinder) (×10) |
|
|
156
|
-
| box + chamfer | 0.
|
|
157
|
-
| box + fillet | 0.
|
|
158
|
-
| intersect(box, sphere) (×10) | 0.
|
|
159
|
-
| multi-boolean (16 holes) | 4.
|
|
160
|
-
| mesh sphere (tol=0.01) |
|
|
161
|
-
| volume (box) (×100) | 0.18 ms | 8
|
|
162
|
-
| exportSTEP (×10) | 0.
|
|
163
|
-
|
|
164
|
-
Every
|
|
159
|
+
| fuse(box, box) (×10) | 0.43 ms | 44.9 ms | 103x | 122 µs |
|
|
160
|
+
| cut(box, cylinder) (×10) | 19.2 ms | 64.9 ms | 3.4x | 9.3 ms |
|
|
161
|
+
| box + chamfer | 0.10 ms | 5.6 ms | 55x | 46 µs |
|
|
162
|
+
| box + fillet | 0.33 ms | 6.1 ms | 18x | 127 µs |
|
|
163
|
+
| intersect(box, sphere) (×10) | 0.23 ms | 59.1 ms | 252x | 98 µs |
|
|
164
|
+
| multi-boolean (16 holes) | 4.6 ms | 30.3 ms | 6.6x | 2.8 ms |
|
|
165
|
+
| mesh sphere (tol=0.01) | 6.2 ms | 49.4 ms | 7.9x | 6.0 ms |
|
|
166
|
+
| volume (box) (×100) | 0.18 ms | 9.8 ms | 54x | 56 µs |
|
|
167
|
+
| exportSTEP (×10) | 0.85 ms | 14.3 ms | 17x | n/a |
|
|
168
|
+
|
|
169
|
+
Every row is output-verified before timing, enforced by the harness itself: it refuses to time a row whose result is wrong. Fuse, chamfer, and box volumes must match exactly; cut, fillet, and multi-boolean volumes are checked against closed-form or cross-kernel values (measured fillet agreement: 0.004%); the intersect result must match the closed-form spherical-octant volume (also pinned by a regression test); exported STEP must re-import to the correct volume. The sphere mesh densities are comparable at equal tolerance (9,800 triangles vs 10,176).
|
|
165
170
|
|
|
166
171
|
Booleans preserve analytic surfaces, so face counts stay low across chained operations. A nine-step compound boolean settles at 72 faces while a mesh-based approach would reach roughly 7,000. The same holds for blends: a straight edge filleted between two planar faces keeps an exact cylindrical wall rather than a NURBS approximation of one.
|
|
167
172
|
|
|
168
|
-
> The OCCT comparison uses [occt-wasm](https://www.npmjs.com/package/occt-wasm), an OpenCASCADE build compiled to WebAssembly. Both kernels run single-threaded in Node.js. Boolean and `exportSTEP` rows are timed as batches of ten operations. WASM figures
|
|
173
|
+
> The OCCT comparison uses [occt-wasm](https://www.npmjs.com/package/occt-wasm), an OpenCASCADE build compiled to WebAssembly. Both kernels run single-threaded in Node.js through the same [brepjs](https://github.com/andymai/brepjs) adapter layer, so adapter overhead is identical on both sides. Boolean and `exportSTEP` rows are timed as batches of ten operations. Speedups are computed from unrounded medians. WASM figures measured 2026-08-07 via [brepkit-bench](https://github.com/andymai/brepkit-bench) on the released npm packages, exact-pinned in its lockfile: `brepkit-wasm` 3.0.0, `occt-wasm` 3.8.3, `brepjs` 18.120.0. Native figures: `cargo bench -p brepkit-operations --bench cad_operations`, except the mesh-sphere row, which is measured at the same parameters as the WASM row (`tessellate_solid_with_tolerance`, deflection 0.01, angular 0.1 rad) via `crates/operations/examples/perf_probe.rs` — the criterion suite's sphere case meshes per-face and is not comparable.
|
|
169
174
|
|
|
170
175
|
## Data Exchange
|
|
171
176
|
|
package/brepkit_wasm_bg.js
CHANGED
|
@@ -5202,13 +5202,13 @@ export function __wbg___wbindgen_debug_string_c25d447a39f5578f(arg0, arg1) {
|
|
|
5202
5202
|
export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
|
|
5203
5203
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5204
5204
|
}
|
|
5205
|
-
export function
|
|
5205
|
+
export function __wbg_error_3af138b8302c8683(arg0, arg1) {
|
|
5206
5206
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5207
5207
|
}
|
|
5208
|
-
export function
|
|
5208
|
+
export function __wbg_log_06260087600e4997(arg0, arg1) {
|
|
5209
5209
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
5210
5210
|
}
|
|
5211
|
-
export function
|
|
5211
|
+
export function __wbg_warn_78cf9e8f576306bc(arg0, arg1) {
|
|
5212
5212
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5213
5213
|
}
|
|
5214
5214
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
package/brepkit_wasm_bg.wasm
CHANGED
|
Binary file
|
package/brepkit_wasm_node.cjs
CHANGED
|
@@ -5216,13 +5216,13 @@ function __wbg_get_imports() {
|
|
|
5216
5216
|
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
5217
5217
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5218
5218
|
},
|
|
5219
|
-
|
|
5219
|
+
__wbg_error_3af138b8302c8683: function(arg0, arg1) {
|
|
5220
5220
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5221
5221
|
},
|
|
5222
|
-
|
|
5222
|
+
__wbg_log_06260087600e4997: function(arg0, arg1) {
|
|
5223
5223
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
5224
5224
|
},
|
|
5225
|
-
|
|
5225
|
+
__wbg_warn_78cf9e8f576306bc: function(arg0, arg1) {
|
|
5226
5226
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5227
5227
|
},
|
|
5228
5228
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
package/package.json
CHANGED