brepkit-wasm 4.7.1 → 4.9.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 +28 -1
- package/brepkit_wasm_bg.js +58 -4
- package/brepkit_wasm_bg.wasm +0 -0
- package/brepkit_wasm_node.cjs +58 -4
- package/package.json +1 -1
package/brepkit_wasm.d.ts
CHANGED
|
@@ -1103,6 +1103,19 @@ export class BrepKernel {
|
|
|
1103
1103
|
* Returns an error if the STL data is malformed or empty.
|
|
1104
1104
|
*/
|
|
1105
1105
|
importStl(data: Uint8Array): number;
|
|
1106
|
+
/**
|
|
1107
|
+
* A copy of a solid with its faces split where the given faces and edges
|
|
1108
|
+
* meet them.
|
|
1109
|
+
*
|
|
1110
|
+
* Returns a solid handle. The copy has the solid's volume.
|
|
1111
|
+
*
|
|
1112
|
+
* # Errors
|
|
1113
|
+
*
|
|
1114
|
+
* Returns an error if a handle does not resolve, a face cannot be split
|
|
1115
|
+
* along its marks, or the result would not be a valid solid of the same
|
|
1116
|
+
* volume.
|
|
1117
|
+
*/
|
|
1118
|
+
imprintFaces(solid: number, face_handles: Uint32Array, edge_handles: Uint32Array): number;
|
|
1106
1119
|
/**
|
|
1107
1120
|
* Interpolate a NURBS curve through points and create an edge.
|
|
1108
1121
|
*
|
|
@@ -1512,7 +1525,7 @@ export class BrepKernel {
|
|
|
1512
1525
|
*
|
|
1513
1526
|
* # Errors
|
|
1514
1527
|
*
|
|
1515
|
-
* Returns an error if radii are non-positive or minor
|
|
1528
|
+
* Returns an error if radii are non-positive or minor > major.
|
|
1516
1529
|
*/
|
|
1517
1530
|
makeTorus(major_radius: number, minor_radius: number, segments: number): number;
|
|
1518
1531
|
/**
|
|
@@ -1985,6 +1998,20 @@ export class BrepKernel {
|
|
|
1985
1998
|
* Returns an error if either solid handle is invalid.
|
|
1986
1999
|
*/
|
|
1987
2000
|
solidToSolidDistance(a: number, b: number): Float64Array;
|
|
2001
|
+
/**
|
|
2002
|
+
* A solid in the pieces the given faces separate it into. A face that
|
|
2003
|
+
* walls nothing off imprints instead, so a face that only dips in returns
|
|
2004
|
+
* one solid.
|
|
2005
|
+
*
|
|
2006
|
+
* Returns solid handles.
|
|
2007
|
+
*
|
|
2008
|
+
* # Errors
|
|
2009
|
+
*
|
|
2010
|
+
* Returns an error if a handle does not resolve, a face cannot be split
|
|
2011
|
+
* along its marks, or the pieces would not be valid solids summing to the
|
|
2012
|
+
* solid's volume.
|
|
2013
|
+
*/
|
|
2014
|
+
splitByFaces(solid: number, face_handles: Uint32Array): Uint32Array;
|
|
1988
2015
|
/**
|
|
1989
2016
|
* Split a solid into two halves along a plane.
|
|
1990
2017
|
*
|
package/brepkit_wasm_bg.js
CHANGED
|
@@ -2477,6 +2477,33 @@ export class BrepKernel {
|
|
|
2477
2477
|
}
|
|
2478
2478
|
return ret[0] >>> 0;
|
|
2479
2479
|
}
|
|
2480
|
+
/**
|
|
2481
|
+
* A copy of a solid with its faces split where the given faces and edges
|
|
2482
|
+
* meet them.
|
|
2483
|
+
*
|
|
2484
|
+
* Returns a solid handle. The copy has the solid's volume.
|
|
2485
|
+
*
|
|
2486
|
+
* # Errors
|
|
2487
|
+
*
|
|
2488
|
+
* Returns an error if a handle does not resolve, a face cannot be split
|
|
2489
|
+
* along its marks, or the result would not be a valid solid of the same
|
|
2490
|
+
* volume.
|
|
2491
|
+
* @param {number} solid
|
|
2492
|
+
* @param {Uint32Array} face_handles
|
|
2493
|
+
* @param {Uint32Array} edge_handles
|
|
2494
|
+
* @returns {number}
|
|
2495
|
+
*/
|
|
2496
|
+
imprintFaces(solid, face_handles, edge_handles) {
|
|
2497
|
+
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
2498
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2499
|
+
const ptr1 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
2500
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2501
|
+
const ret = wasm.brepkernel_imprintFaces(this.__wbg_ptr, solid, ptr0, len0, ptr1, len1);
|
|
2502
|
+
if (ret[2]) {
|
|
2503
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2504
|
+
}
|
|
2505
|
+
return ret[0] >>> 0;
|
|
2506
|
+
}
|
|
2480
2507
|
/**
|
|
2481
2508
|
* Interpolate a NURBS curve through points and create an edge.
|
|
2482
2509
|
*
|
|
@@ -3348,7 +3375,7 @@ export class BrepKernel {
|
|
|
3348
3375
|
*
|
|
3349
3376
|
* # Errors
|
|
3350
3377
|
*
|
|
3351
|
-
* Returns an error if radii are non-positive or minor
|
|
3378
|
+
* Returns an error if radii are non-positive or minor > major.
|
|
3352
3379
|
* @param {number} major_radius
|
|
3353
3380
|
* @param {number} minor_radius
|
|
3354
3381
|
* @param {number} segments
|
|
@@ -4446,6 +4473,33 @@ export class BrepKernel {
|
|
|
4446
4473
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
4447
4474
|
return v1;
|
|
4448
4475
|
}
|
|
4476
|
+
/**
|
|
4477
|
+
* A solid in the pieces the given faces separate it into. A face that
|
|
4478
|
+
* walls nothing off imprints instead, so a face that only dips in returns
|
|
4479
|
+
* one solid.
|
|
4480
|
+
*
|
|
4481
|
+
* Returns solid handles.
|
|
4482
|
+
*
|
|
4483
|
+
* # Errors
|
|
4484
|
+
*
|
|
4485
|
+
* Returns an error if a handle does not resolve, a face cannot be split
|
|
4486
|
+
* along its marks, or the pieces would not be valid solids summing to the
|
|
4487
|
+
* solid's volume.
|
|
4488
|
+
* @param {number} solid
|
|
4489
|
+
* @param {Uint32Array} face_handles
|
|
4490
|
+
* @returns {Uint32Array}
|
|
4491
|
+
*/
|
|
4492
|
+
splitByFaces(solid, face_handles) {
|
|
4493
|
+
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
4494
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4495
|
+
const ret = wasm.brepkernel_splitByFaces(this.__wbg_ptr, solid, ptr0, len0);
|
|
4496
|
+
if (ret[3]) {
|
|
4497
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4498
|
+
}
|
|
4499
|
+
var v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
4500
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
4501
|
+
return v2;
|
|
4502
|
+
}
|
|
4449
4503
|
/**
|
|
4450
4504
|
* Split a solid into two halves along a plane.
|
|
4451
4505
|
*
|
|
@@ -5478,16 +5532,16 @@ export function __wbg___wbindgen_debug_string_4687d8d8c2017d52(arg0, arg1) {
|
|
|
5478
5532
|
export function __wbg___wbindgen_throw_41e9ee4f547fc59a(arg0, arg1) {
|
|
5479
5533
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5480
5534
|
}
|
|
5481
|
-
export function
|
|
5535
|
+
export function __wbg_error_edd2929c907c1d29(arg0, arg1) {
|
|
5482
5536
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5483
5537
|
}
|
|
5484
5538
|
export function __wbg_getRandomValues_436a51d0629d84e1() { return handleError(function (arg0, arg1) {
|
|
5485
5539
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
5486
5540
|
}, arguments); }
|
|
5487
|
-
export function
|
|
5541
|
+
export function __wbg_log_7a6395b35b7afc30(arg0, arg1) {
|
|
5488
5542
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
5489
5543
|
}
|
|
5490
|
-
export function
|
|
5544
|
+
export function __wbg_warn_c1f48997abe88ed4(arg0, arg1) {
|
|
5491
5545
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5492
5546
|
}
|
|
5493
5547
|
export function __wbindgen_generic_0000000000000001(arg0, arg1) {
|
package/brepkit_wasm_bg.wasm
CHANGED
|
Binary file
|
package/brepkit_wasm_node.cjs
CHANGED
|
@@ -2479,6 +2479,33 @@ class BrepKernel {
|
|
|
2479
2479
|
}
|
|
2480
2480
|
return ret[0] >>> 0;
|
|
2481
2481
|
}
|
|
2482
|
+
/**
|
|
2483
|
+
* A copy of a solid with its faces split where the given faces and edges
|
|
2484
|
+
* meet them.
|
|
2485
|
+
*
|
|
2486
|
+
* Returns a solid handle. The copy has the solid's volume.
|
|
2487
|
+
*
|
|
2488
|
+
* # Errors
|
|
2489
|
+
*
|
|
2490
|
+
* Returns an error if a handle does not resolve, a face cannot be split
|
|
2491
|
+
* along its marks, or the result would not be a valid solid of the same
|
|
2492
|
+
* volume.
|
|
2493
|
+
* @param {number} solid
|
|
2494
|
+
* @param {Uint32Array} face_handles
|
|
2495
|
+
* @param {Uint32Array} edge_handles
|
|
2496
|
+
* @returns {number}
|
|
2497
|
+
*/
|
|
2498
|
+
imprintFaces(solid, face_handles, edge_handles) {
|
|
2499
|
+
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
2500
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2501
|
+
const ptr1 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
2502
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2503
|
+
const ret = wasm.brepkernel_imprintFaces(this.__wbg_ptr, solid, ptr0, len0, ptr1, len1);
|
|
2504
|
+
if (ret[2]) {
|
|
2505
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2506
|
+
}
|
|
2507
|
+
return ret[0] >>> 0;
|
|
2508
|
+
}
|
|
2482
2509
|
/**
|
|
2483
2510
|
* Interpolate a NURBS curve through points and create an edge.
|
|
2484
2511
|
*
|
|
@@ -3350,7 +3377,7 @@ class BrepKernel {
|
|
|
3350
3377
|
*
|
|
3351
3378
|
* # Errors
|
|
3352
3379
|
*
|
|
3353
|
-
* Returns an error if radii are non-positive or minor
|
|
3380
|
+
* Returns an error if radii are non-positive or minor > major.
|
|
3354
3381
|
* @param {number} major_radius
|
|
3355
3382
|
* @param {number} minor_radius
|
|
3356
3383
|
* @param {number} segments
|
|
@@ -4448,6 +4475,33 @@ class BrepKernel {
|
|
|
4448
4475
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
4449
4476
|
return v1;
|
|
4450
4477
|
}
|
|
4478
|
+
/**
|
|
4479
|
+
* A solid in the pieces the given faces separate it into. A face that
|
|
4480
|
+
* walls nothing off imprints instead, so a face that only dips in returns
|
|
4481
|
+
* one solid.
|
|
4482
|
+
*
|
|
4483
|
+
* Returns solid handles.
|
|
4484
|
+
*
|
|
4485
|
+
* # Errors
|
|
4486
|
+
*
|
|
4487
|
+
* Returns an error if a handle does not resolve, a face cannot be split
|
|
4488
|
+
* along its marks, or the pieces would not be valid solids summing to the
|
|
4489
|
+
* solid's volume.
|
|
4490
|
+
* @param {number} solid
|
|
4491
|
+
* @param {Uint32Array} face_handles
|
|
4492
|
+
* @returns {Uint32Array}
|
|
4493
|
+
*/
|
|
4494
|
+
splitByFaces(solid, face_handles) {
|
|
4495
|
+
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
4496
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4497
|
+
const ret = wasm.brepkernel_splitByFaces(this.__wbg_ptr, solid, ptr0, len0);
|
|
4498
|
+
if (ret[3]) {
|
|
4499
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4500
|
+
}
|
|
4501
|
+
var v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
4502
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
4503
|
+
return v2;
|
|
4504
|
+
}
|
|
4451
4505
|
/**
|
|
4452
4506
|
* Split a solid into two halves along a plane.
|
|
4453
4507
|
*
|
|
@@ -5492,16 +5546,16 @@ function __wbg_get_imports() {
|
|
|
5492
5546
|
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
5493
5547
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5494
5548
|
},
|
|
5495
|
-
|
|
5549
|
+
__wbg_error_edd2929c907c1d29: function(arg0, arg1) {
|
|
5496
5550
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5497
5551
|
},
|
|
5498
5552
|
__wbg_getRandomValues_436a51d0629d84e1: function() { return handleError(function (arg0, arg1) {
|
|
5499
5553
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
5500
5554
|
}, arguments); },
|
|
5501
|
-
|
|
5555
|
+
__wbg_log_7a6395b35b7afc30: function(arg0, arg1) {
|
|
5502
5556
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
5503
5557
|
},
|
|
5504
|
-
|
|
5558
|
+
__wbg_warn_c1f48997abe88ed4: function(arg0, arg1) {
|
|
5505
5559
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5506
5560
|
},
|
|
5507
5561
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
package/package.json
CHANGED