brepkit-wasm 3.4.0 → 3.4.2
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 +217 -217
- package/brepkit_wasm_bg.js +407 -407
- package/brepkit_wasm_bg.wasm +0 -0
- package/brepkit_wasm_node.cjs +407 -407
- package/package.json +1 -1
package/brepkit_wasm_bg.js
CHANGED
|
@@ -51,38 +51,38 @@ export class BrepKernel {
|
|
|
51
51
|
return v1;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Approximate a curve through points (
|
|
54
|
+
* Approximate a curve through points using LSPIA (progressive iteration).
|
|
55
55
|
*
|
|
56
56
|
* Returns an edge handle.
|
|
57
57
|
* @param {Float64Array} coords
|
|
58
58
|
* @param {number} degree
|
|
59
59
|
* @param {number} num_control_points
|
|
60
|
+
* @param {number} tolerance
|
|
61
|
+
* @param {number} max_iterations
|
|
60
62
|
* @returns {number}
|
|
61
63
|
*/
|
|
62
|
-
|
|
64
|
+
approximateCurveLspia(coords, degree, num_control_points, tolerance, max_iterations) {
|
|
63
65
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
64
66
|
const len0 = WASM_VECTOR_LEN;
|
|
65
|
-
const ret = wasm.
|
|
67
|
+
const ret = wasm.brepkernel_approximateCurveLspia(this.__wbg_ptr, ptr0, len0, degree, num_control_points, tolerance, max_iterations);
|
|
66
68
|
if (ret[2]) {
|
|
67
69
|
throw takeFromExternrefTable0(ret[1]);
|
|
68
70
|
}
|
|
69
71
|
return ret[0] >>> 0;
|
|
70
72
|
}
|
|
71
73
|
/**
|
|
72
|
-
* Approximate a curve through points
|
|
74
|
+
* Approximate a curve through points (least-squares).
|
|
73
75
|
*
|
|
74
76
|
* Returns an edge handle.
|
|
75
77
|
* @param {Float64Array} coords
|
|
76
78
|
* @param {number} degree
|
|
77
79
|
* @param {number} num_control_points
|
|
78
|
-
* @param {number} tolerance
|
|
79
|
-
* @param {number} max_iterations
|
|
80
80
|
* @returns {number}
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
approximateCurve(coords, degree, num_control_points) {
|
|
83
83
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
84
84
|
const len0 = WASM_VECTOR_LEN;
|
|
85
|
-
const ret = wasm.
|
|
85
|
+
const ret = wasm.brepkernel_approximateCurve(this.__wbg_ptr, ptr0, len0, degree, num_control_points);
|
|
86
86
|
if (ret[2]) {
|
|
87
87
|
throw takeFromExternrefTable0(ret[1]);
|
|
88
88
|
}
|
|
@@ -257,28 +257,6 @@ export class BrepKernel {
|
|
|
257
257
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
258
258
|
return v1;
|
|
259
259
|
}
|
|
260
|
-
/**
|
|
261
|
-
* Chamfer edges of a solid.
|
|
262
|
-
*
|
|
263
|
-
* `edge_handles` is an array of edge handles. Returns a solid handle.
|
|
264
|
-
*
|
|
265
|
-
* # Errors
|
|
266
|
-
*
|
|
267
|
-
* Returns an error if distance is non-positive or edges are invalid.
|
|
268
|
-
* @param {number} solid
|
|
269
|
-
* @param {Uint32Array} edge_handles
|
|
270
|
-
* @param {number} distance
|
|
271
|
-
* @returns {number}
|
|
272
|
-
*/
|
|
273
|
-
chamfer(solid, edge_handles, distance) {
|
|
274
|
-
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
275
|
-
const len0 = WASM_VECTOR_LEN;
|
|
276
|
-
const ret = wasm.brepkernel_chamfer(this.__wbg_ptr, solid, ptr0, len0, distance);
|
|
277
|
-
if (ret[2]) {
|
|
278
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
279
|
-
}
|
|
280
|
-
return ret[0] >>> 0;
|
|
281
|
-
}
|
|
282
260
|
/**
|
|
283
261
|
* Cut corners of a 2D polygon with flat bevels.
|
|
284
262
|
*
|
|
@@ -349,18 +327,26 @@ export class BrepKernel {
|
|
|
349
327
|
return ret[0] >>> 0;
|
|
350
328
|
}
|
|
351
329
|
/**
|
|
352
|
-
*
|
|
330
|
+
* Chamfer edges of a solid.
|
|
353
331
|
*
|
|
354
|
-
*
|
|
355
|
-
* `restore` or `discardCheckpoint`.
|
|
332
|
+
* `edge_handles` is an array of edge handles. Returns a solid handle.
|
|
356
333
|
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
334
|
+
* # Errors
|
|
335
|
+
*
|
|
336
|
+
* Returns an error if distance is non-positive or edges are invalid.
|
|
337
|
+
* @param {number} solid
|
|
338
|
+
* @param {Uint32Array} edge_handles
|
|
339
|
+
* @param {number} distance
|
|
359
340
|
* @returns {number}
|
|
360
341
|
*/
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
|
|
342
|
+
chamfer(solid, edge_handles, distance) {
|
|
343
|
+
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
344
|
+
const len0 = WASM_VECTOR_LEN;
|
|
345
|
+
const ret = wasm.brepkernel_chamfer(this.__wbg_ptr, solid, ptr0, len0, distance);
|
|
346
|
+
if (ret[2]) {
|
|
347
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
348
|
+
}
|
|
349
|
+
return ret[0] >>> 0;
|
|
364
350
|
}
|
|
365
351
|
/**
|
|
366
352
|
* Returns the number of saved checkpoints.
|
|
@@ -370,6 +356,20 @@ export class BrepKernel {
|
|
|
370
356
|
const ret = wasm.brepkernel_checkpointCount(this.__wbg_ptr);
|
|
371
357
|
return ret >>> 0;
|
|
372
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Save a snapshot of the current kernel state.
|
|
361
|
+
*
|
|
362
|
+
* Returns a checkpoint ID (zero-based index) that can be passed to
|
|
363
|
+
* `restore` or `discardCheckpoint`.
|
|
364
|
+
*
|
|
365
|
+
* The snapshot is a clone of all topology, assembly, and sketch state.
|
|
366
|
+
* Existing entity handles remain valid after restore.
|
|
367
|
+
* @returns {number}
|
|
368
|
+
*/
|
|
369
|
+
checkpoint() {
|
|
370
|
+
const ret = wasm.brepkernel_checkpoint(this.__wbg_ptr);
|
|
371
|
+
return ret >>> 0;
|
|
372
|
+
}
|
|
373
373
|
/**
|
|
374
374
|
* Create a circular pattern of a solid around an axis.
|
|
375
375
|
*
|
|
@@ -389,13 +389,9 @@ export class BrepKernel {
|
|
|
389
389
|
return ret[0] >>> 0;
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
392
|
-
* Classify a point
|
|
393
|
-
*
|
|
394
|
-
* Returns `"inside"`, `"outside"`, or `"boundary"`.
|
|
395
|
-
*
|
|
396
|
-
* # Errors
|
|
392
|
+
* Classify a point using robust dual-method (winding + ray casting).
|
|
397
393
|
*
|
|
398
|
-
* Returns
|
|
394
|
+
* Returns "inside", "outside", or "boundary".
|
|
399
395
|
* @param {number} solid
|
|
400
396
|
* @param {number} x
|
|
401
397
|
* @param {number} y
|
|
@@ -403,11 +399,11 @@ export class BrepKernel {
|
|
|
403
399
|
* @param {number} tolerance
|
|
404
400
|
* @returns {string}
|
|
405
401
|
*/
|
|
406
|
-
|
|
402
|
+
classifyPointRobust(solid, x, y, z, tolerance) {
|
|
407
403
|
let deferred2_0;
|
|
408
404
|
let deferred2_1;
|
|
409
405
|
try {
|
|
410
|
-
const ret = wasm.
|
|
406
|
+
const ret = wasm.brepkernel_classifyPointRobust(this.__wbg_ptr, solid, x, y, z, tolerance);
|
|
411
407
|
var ptr1 = ret[0];
|
|
412
408
|
var len1 = ret[1];
|
|
413
409
|
if (ret[3]) {
|
|
@@ -422,7 +418,7 @@ export class BrepKernel {
|
|
|
422
418
|
}
|
|
423
419
|
}
|
|
424
420
|
/**
|
|
425
|
-
* Classify a point
|
|
421
|
+
* Classify a point relative to a solid using generalized winding numbers.
|
|
426
422
|
*
|
|
427
423
|
* Returns "inside", "outside", or "boundary".
|
|
428
424
|
* @param {number} solid
|
|
@@ -432,11 +428,11 @@ export class BrepKernel {
|
|
|
432
428
|
* @param {number} tolerance
|
|
433
429
|
* @returns {string}
|
|
434
430
|
*/
|
|
435
|
-
|
|
431
|
+
classifyPointWinding(solid, x, y, z, tolerance) {
|
|
436
432
|
let deferred2_0;
|
|
437
433
|
let deferred2_1;
|
|
438
434
|
try {
|
|
439
|
-
const ret = wasm.
|
|
435
|
+
const ret = wasm.brepkernel_classifyPointWinding(this.__wbg_ptr, solid, x, y, z, tolerance);
|
|
440
436
|
var ptr1 = ret[0];
|
|
441
437
|
var len1 = ret[1];
|
|
442
438
|
if (ret[3]) {
|
|
@@ -451,9 +447,13 @@ export class BrepKernel {
|
|
|
451
447
|
}
|
|
452
448
|
}
|
|
453
449
|
/**
|
|
454
|
-
* Classify a point relative to a solid
|
|
450
|
+
* Classify a point relative to a solid: inside, outside, or on boundary.
|
|
455
451
|
*
|
|
456
|
-
* Returns "inside"
|
|
452
|
+
* Returns `"inside"`, `"outside"`, or `"boundary"`.
|
|
453
|
+
*
|
|
454
|
+
* # Errors
|
|
455
|
+
*
|
|
456
|
+
* Returns an error if the solid handle is invalid.
|
|
457
457
|
* @param {number} solid
|
|
458
458
|
* @param {number} x
|
|
459
459
|
* @param {number} y
|
|
@@ -461,11 +461,11 @@ export class BrepKernel {
|
|
|
461
461
|
* @param {number} tolerance
|
|
462
462
|
* @returns {string}
|
|
463
463
|
*/
|
|
464
|
-
|
|
464
|
+
classifyPoint(solid, x, y, z, tolerance) {
|
|
465
465
|
let deferred2_0;
|
|
466
466
|
let deferred2_1;
|
|
467
467
|
try {
|
|
468
|
-
const ret = wasm.
|
|
468
|
+
const ret = wasm.brepkernel_classifyPoint(this.__wbg_ptr, solid, x, y, z, tolerance);
|
|
469
469
|
var ptr1 = ret[0];
|
|
470
470
|
var len1 = ret[1];
|
|
471
471
|
if (ret[3]) {
|
|
@@ -761,9 +761,9 @@ export class BrepKernel {
|
|
|
761
761
|
return v1;
|
|
762
762
|
}
|
|
763
763
|
/**
|
|
764
|
-
* Cut (subtract) solid `b` from solid `a
|
|
764
|
+
* Cut (subtract) solid `b` from solid `a` and return evolution tracking data.
|
|
765
765
|
*
|
|
766
|
-
* Returns a
|
|
766
|
+
* Returns a JSON string: `{"solid": <u32>, "evolution": {...}}`.
|
|
767
767
|
*
|
|
768
768
|
* # Errors
|
|
769
769
|
*
|
|
@@ -771,19 +771,17 @@ export class BrepKernel {
|
|
|
771
771
|
* produces an empty or non-manifold result.
|
|
772
772
|
* @param {number} a
|
|
773
773
|
* @param {number} b
|
|
774
|
-
* @returns {
|
|
774
|
+
* @returns {any}
|
|
775
775
|
*/
|
|
776
|
-
|
|
777
|
-
const ret = wasm.
|
|
776
|
+
cutWithEvolution(a, b) {
|
|
777
|
+
const ret = wasm.brepkernel_cutWithEvolution(this.__wbg_ptr, a, b);
|
|
778
778
|
if (ret[2]) {
|
|
779
779
|
throw takeFromExternrefTable0(ret[1]);
|
|
780
780
|
}
|
|
781
|
-
return ret[0]
|
|
781
|
+
return takeFromExternrefTable0(ret[0]);
|
|
782
782
|
}
|
|
783
783
|
/**
|
|
784
|
-
* Cut (subtract) solid `b` from solid `a`
|
|
785
|
-
*
|
|
786
|
-
* Returns a JSON string: `{"solid": <u32>, "evolution": {...}}`.
|
|
784
|
+
* Cut (subtract) solid `b` from solid `a` with post-processing options.
|
|
787
785
|
*
|
|
788
786
|
* # Errors
|
|
789
787
|
*
|
|
@@ -791,17 +789,20 @@ export class BrepKernel {
|
|
|
791
789
|
* produces an empty or non-manifold result.
|
|
792
790
|
* @param {number} a
|
|
793
791
|
* @param {number} b
|
|
794
|
-
* @
|
|
792
|
+
* @param {boolean} simplify
|
|
793
|
+
* @returns {number}
|
|
795
794
|
*/
|
|
796
|
-
|
|
797
|
-
const ret = wasm.
|
|
795
|
+
cutWithOptions(a, b, simplify) {
|
|
796
|
+
const ret = wasm.brepkernel_cutWithOptions(this.__wbg_ptr, a, b, simplify);
|
|
798
797
|
if (ret[2]) {
|
|
799
798
|
throw takeFromExternrefTable0(ret[1]);
|
|
800
799
|
}
|
|
801
|
-
return
|
|
800
|
+
return ret[0] >>> 0;
|
|
802
801
|
}
|
|
803
802
|
/**
|
|
804
|
-
* Cut (subtract) solid `b` from solid `a
|
|
803
|
+
* Cut (subtract) solid `b` from solid `a`.
|
|
804
|
+
*
|
|
805
|
+
* Returns a new solid handle (`u32`).
|
|
805
806
|
*
|
|
806
807
|
* # Errors
|
|
807
808
|
*
|
|
@@ -809,11 +810,10 @@ export class BrepKernel {
|
|
|
809
810
|
* produces an empty or non-manifold result.
|
|
810
811
|
* @param {number} a
|
|
811
812
|
* @param {number} b
|
|
812
|
-
* @param {boolean} simplify
|
|
813
813
|
* @returns {number}
|
|
814
814
|
*/
|
|
815
|
-
|
|
816
|
-
const ret = wasm.
|
|
815
|
+
cut(a, b) {
|
|
816
|
+
const ret = wasm.brepkernel_cut(this.__wbg_ptr, a, b);
|
|
817
817
|
if (ret[2]) {
|
|
818
818
|
throw takeFromExternrefTable0(ret[1]);
|
|
819
819
|
}
|
|
@@ -998,15 +998,15 @@ export class BrepKernel {
|
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
1000
|
/**
|
|
1001
|
-
* Evaluate a point on an edge curve at parameter `t`.
|
|
1001
|
+
* Evaluate a point and tangent on an edge curve at parameter `t`.
|
|
1002
1002
|
*
|
|
1003
|
-
* Returns `[
|
|
1003
|
+
* Returns `[px, py, pz, tx, ty, tz]`.
|
|
1004
1004
|
* @param {number} edge
|
|
1005
1005
|
* @param {number} t
|
|
1006
1006
|
* @returns {Float64Array}
|
|
1007
1007
|
*/
|
|
1008
|
-
|
|
1009
|
-
const ret = wasm.
|
|
1008
|
+
evaluateEdgeCurveD1(edge, t) {
|
|
1009
|
+
const ret = wasm.brepkernel_evaluateEdgeCurveD1(this.__wbg_ptr, edge, t);
|
|
1010
1010
|
if (ret[3]) {
|
|
1011
1011
|
throw takeFromExternrefTable0(ret[2]);
|
|
1012
1012
|
}
|
|
@@ -1015,15 +1015,15 @@ export class BrepKernel {
|
|
|
1015
1015
|
return v1;
|
|
1016
1016
|
}
|
|
1017
1017
|
/**
|
|
1018
|
-
* Evaluate a point
|
|
1018
|
+
* Evaluate a point on an edge curve at parameter `t`.
|
|
1019
1019
|
*
|
|
1020
|
-
* Returns `[
|
|
1020
|
+
* Returns `[x, y, z]`.
|
|
1021
1021
|
* @param {number} edge
|
|
1022
1022
|
* @param {number} t
|
|
1023
1023
|
* @returns {Float64Array}
|
|
1024
1024
|
*/
|
|
1025
|
-
|
|
1026
|
-
const ret = wasm.
|
|
1025
|
+
evaluateEdgeCurve(edge, t) {
|
|
1026
|
+
const ret = wasm.brepkernel_evaluateEdgeCurve(this.__wbg_ptr, edge, t);
|
|
1027
1027
|
if (ret[3]) {
|
|
1028
1028
|
throw takeFromExternrefTable0(ret[2]);
|
|
1029
1029
|
}
|
|
@@ -1032,16 +1032,16 @@ export class BrepKernel {
|
|
|
1032
1032
|
return v1;
|
|
1033
1033
|
}
|
|
1034
1034
|
/**
|
|
1035
|
-
* Evaluate a
|
|
1035
|
+
* Evaluate a surface normal at (u, v) on a face.
|
|
1036
1036
|
*
|
|
1037
|
-
* Returns `[
|
|
1037
|
+
* Returns `[nx, ny, nz]`.
|
|
1038
1038
|
* @param {number} face
|
|
1039
1039
|
* @param {number} u
|
|
1040
1040
|
* @param {number} v
|
|
1041
1041
|
* @returns {Float64Array}
|
|
1042
1042
|
*/
|
|
1043
|
-
|
|
1044
|
-
const ret = wasm.
|
|
1043
|
+
evaluateSurfaceNormal(face, u, v) {
|
|
1044
|
+
const ret = wasm.brepkernel_evaluateSurfaceNormal(this.__wbg_ptr, face, u, v);
|
|
1045
1045
|
if (ret[3]) {
|
|
1046
1046
|
throw takeFromExternrefTable0(ret[2]);
|
|
1047
1047
|
}
|
|
@@ -1050,16 +1050,16 @@ export class BrepKernel {
|
|
|
1050
1050
|
return v1;
|
|
1051
1051
|
}
|
|
1052
1052
|
/**
|
|
1053
|
-
* Evaluate a surface
|
|
1053
|
+
* Evaluate a point on a face surface at (u, v).
|
|
1054
1054
|
*
|
|
1055
|
-
* Returns `[
|
|
1055
|
+
* Returns `[x, y, z]`.
|
|
1056
1056
|
* @param {number} face
|
|
1057
1057
|
* @param {number} u
|
|
1058
1058
|
* @param {number} v
|
|
1059
1059
|
* @returns {Float64Array}
|
|
1060
1060
|
*/
|
|
1061
|
-
|
|
1062
|
-
const ret = wasm.
|
|
1061
|
+
evaluateSurface(face, u, v) {
|
|
1062
|
+
const ret = wasm.brepkernel_evaluateSurface(this.__wbg_ptr, face, u, v);
|
|
1063
1063
|
if (ret[3]) {
|
|
1064
1064
|
throw takeFromExternrefTable0(ret[2]);
|
|
1065
1065
|
}
|
|
@@ -1226,9 +1226,9 @@ export class BrepKernel {
|
|
|
1226
1226
|
return v1;
|
|
1227
1227
|
}
|
|
1228
1228
|
/**
|
|
1229
|
-
* Export a solid to
|
|
1229
|
+
* Export a solid to STL ASCII format.
|
|
1230
1230
|
*
|
|
1231
|
-
* Returns
|
|
1231
|
+
* Returns the ASCII STL as UTF-8 bytes.
|
|
1232
1232
|
*
|
|
1233
1233
|
* # Errors
|
|
1234
1234
|
*
|
|
@@ -1237,8 +1237,8 @@ export class BrepKernel {
|
|
|
1237
1237
|
* @param {number} deflection
|
|
1238
1238
|
* @returns {Uint8Array}
|
|
1239
1239
|
*/
|
|
1240
|
-
|
|
1241
|
-
const ret = wasm.
|
|
1240
|
+
exportStlAscii(solid, deflection) {
|
|
1241
|
+
const ret = wasm.brepkernel_exportStlAscii(this.__wbg_ptr, solid, deflection);
|
|
1242
1242
|
if (ret[3]) {
|
|
1243
1243
|
throw takeFromExternrefTable0(ret[2]);
|
|
1244
1244
|
}
|
|
@@ -1247,9 +1247,9 @@ export class BrepKernel {
|
|
|
1247
1247
|
return v1;
|
|
1248
1248
|
}
|
|
1249
1249
|
/**
|
|
1250
|
-
* Export a solid to STL
|
|
1250
|
+
* Export a solid to binary STL format.
|
|
1251
1251
|
*
|
|
1252
|
-
* Returns
|
|
1252
|
+
* Returns a `Uint8Array` containing the `.stl` file.
|
|
1253
1253
|
*
|
|
1254
1254
|
* # Errors
|
|
1255
1255
|
*
|
|
@@ -1258,8 +1258,8 @@ export class BrepKernel {
|
|
|
1258
1258
|
* @param {number} deflection
|
|
1259
1259
|
* @returns {Uint8Array}
|
|
1260
1260
|
*/
|
|
1261
|
-
|
|
1262
|
-
const ret = wasm.
|
|
1261
|
+
exportStl(solid, deflection) {
|
|
1262
|
+
const ret = wasm.brepkernel_exportStl(this.__wbg_ptr, solid, deflection);
|
|
1263
1263
|
if (ret[3]) {
|
|
1264
1264
|
throw takeFromExternrefTable0(ret[2]);
|
|
1265
1265
|
}
|
|
@@ -1359,29 +1359,6 @@ export class BrepKernel {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
return ret[0] >>> 0;
|
|
1361
1361
|
}
|
|
1362
|
-
/**
|
|
1363
|
-
* Fillet (round) edges of a solid.
|
|
1364
|
-
*
|
|
1365
|
-
* `edge_handles` is an array of edge handles. Returns a solid handle.
|
|
1366
|
-
*
|
|
1367
|
-
* # Errors
|
|
1368
|
-
*
|
|
1369
|
-
* Returns an error if radius is non-positive, edges are invalid, or no
|
|
1370
|
-
* fillet engine can produce a valid changed solid.
|
|
1371
|
-
* @param {number} solid
|
|
1372
|
-
* @param {Uint32Array} edge_handles
|
|
1373
|
-
* @param {number} radius
|
|
1374
|
-
* @returns {number}
|
|
1375
|
-
*/
|
|
1376
|
-
fillet(solid, edge_handles, radius) {
|
|
1377
|
-
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
1378
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1379
|
-
const ret = wasm.brepkernel_fillet(this.__wbg_ptr, solid, ptr0, len0, radius);
|
|
1380
|
-
if (ret[2]) {
|
|
1381
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1382
|
-
}
|
|
1383
|
-
return ret[0] >>> 0;
|
|
1384
|
-
}
|
|
1385
1362
|
/**
|
|
1386
1363
|
* Round corners of a 2D polygon by inserting arc-approximation vertices.
|
|
1387
1364
|
*
|
|
@@ -1475,6 +1452,29 @@ export class BrepKernel {
|
|
|
1475
1452
|
}
|
|
1476
1453
|
return takeFromExternrefTable0(ret[0]);
|
|
1477
1454
|
}
|
|
1455
|
+
/**
|
|
1456
|
+
* Fillet (round) edges of a solid.
|
|
1457
|
+
*
|
|
1458
|
+
* `edge_handles` is an array of edge handles. Returns a solid handle.
|
|
1459
|
+
*
|
|
1460
|
+
* # Errors
|
|
1461
|
+
*
|
|
1462
|
+
* Returns an error if radius is non-positive, edges are invalid, or no
|
|
1463
|
+
* fillet engine can produce a valid changed solid.
|
|
1464
|
+
* @param {number} solid
|
|
1465
|
+
* @param {Uint32Array} edge_handles
|
|
1466
|
+
* @param {number} radius
|
|
1467
|
+
* @returns {number}
|
|
1468
|
+
*/
|
|
1469
|
+
fillet(solid, edge_handles, radius) {
|
|
1470
|
+
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
1471
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1472
|
+
const ret = wasm.brepkernel_fillet(this.__wbg_ptr, solid, ptr0, len0, radius);
|
|
1473
|
+
if (ret[2]) {
|
|
1474
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1475
|
+
}
|
|
1476
|
+
return ret[0] >>> 0;
|
|
1477
|
+
}
|
|
1478
1478
|
/**
|
|
1479
1479
|
* Fix face orientations to ensure consistent outward normals.
|
|
1480
1480
|
*
|
|
@@ -1514,26 +1514,6 @@ export class BrepKernel {
|
|
|
1514
1514
|
}
|
|
1515
1515
|
return ret[0] >>> 0;
|
|
1516
1516
|
}
|
|
1517
|
-
/**
|
|
1518
|
-
* Fuse (union) two solids into one.
|
|
1519
|
-
*
|
|
1520
|
-
* Returns a new solid handle (`u32`).
|
|
1521
|
-
*
|
|
1522
|
-
* # Errors
|
|
1523
|
-
*
|
|
1524
|
-
* Returns an error if either solid handle is invalid or the operation
|
|
1525
|
-
* produces an empty or non-manifold result.
|
|
1526
|
-
* @param {number} a
|
|
1527
|
-
* @param {number} b
|
|
1528
|
-
* @returns {number}
|
|
1529
|
-
*/
|
|
1530
|
-
fuse(a, b) {
|
|
1531
|
-
const ret = wasm.brepkernel_fuse(this.__wbg_ptr, a, b);
|
|
1532
|
-
if (ret[2]) {
|
|
1533
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1534
|
-
}
|
|
1535
|
-
return ret[0] >>> 0;
|
|
1536
|
-
}
|
|
1537
1517
|
/**
|
|
1538
1518
|
* Fuse (union) many solids into one in a single call.
|
|
1539
1519
|
*
|
|
@@ -1602,7 +1582,27 @@ export class BrepKernel {
|
|
|
1602
1582
|
return ret[0] >>> 0;
|
|
1603
1583
|
}
|
|
1604
1584
|
/**
|
|
1605
|
-
*
|
|
1585
|
+
* Fuse (union) two solids into one.
|
|
1586
|
+
*
|
|
1587
|
+
* Returns a new solid handle (`u32`).
|
|
1588
|
+
*
|
|
1589
|
+
* # Errors
|
|
1590
|
+
*
|
|
1591
|
+
* Returns an error if either solid handle is invalid or the operation
|
|
1592
|
+
* produces an empty or non-manifold result.
|
|
1593
|
+
* @param {number} a
|
|
1594
|
+
* @param {number} b
|
|
1595
|
+
* @returns {number}
|
|
1596
|
+
*/
|
|
1597
|
+
fuse(a, b) {
|
|
1598
|
+
const ret = wasm.brepkernel_fuse(this.__wbg_ptr, a, b);
|
|
1599
|
+
if (ret[2]) {
|
|
1600
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1601
|
+
}
|
|
1602
|
+
return ret[0] >>> 0;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Get the analytic surface parameters of a face.
|
|
1606
1606
|
*
|
|
1607
1607
|
* Returns a JSON string with surface-type-specific parameters.
|
|
1608
1608
|
* @param {number} face
|
|
@@ -1878,22 +1878,23 @@ export class BrepKernel {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
1880
|
/**
|
|
1881
|
-
*
|
|
1881
|
+
* Type-gated read-only B-Spline/NURBS surface data for a face.
|
|
1882
1882
|
*
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1885
|
-
*
|
|
1886
|
-
*
|
|
1887
|
-
*
|
|
1888
|
-
* `
|
|
1883
|
+
* Unlike `getNurbsSurfaceData`, this never converts analytic surfaces:
|
|
1884
|
+
* faces backed by a plane, cylinder, cone, sphere, or torus return the
|
|
1885
|
+
* JSON literal `null`. Only intrinsically free-form (B-Spline/NURBS) faces
|
|
1886
|
+
* yield a record with `degreeU`/`degreeV`, `nbPolesU`/`nbPolesV`, the
|
|
1887
|
+
* row-major `poles` grid (u-major, v-minor) with the matching `weights`
|
|
1888
|
+
* grid, distinct `knotsU`/`knotsV` paired with `multiplicitiesU`/
|
|
1889
|
+
* `multiplicitiesV`, `isPeriodicU`/`isPeriodicV`, and `isRational`.
|
|
1889
1890
|
* @param {number} face
|
|
1890
1891
|
* @returns {string}
|
|
1891
1892
|
*/
|
|
1892
|
-
|
|
1893
|
+
getNurbsSurfaceDataParity(face) {
|
|
1893
1894
|
let deferred2_0;
|
|
1894
1895
|
let deferred2_1;
|
|
1895
1896
|
try {
|
|
1896
|
-
const ret = wasm.
|
|
1897
|
+
const ret = wasm.brepkernel_getNurbsSurfaceDataParity(this.__wbg_ptr, face);
|
|
1897
1898
|
var ptr1 = ret[0];
|
|
1898
1899
|
var len1 = ret[1];
|
|
1899
1900
|
if (ret[3]) {
|
|
@@ -1908,23 +1909,22 @@ export class BrepKernel {
|
|
|
1908
1909
|
}
|
|
1909
1910
|
}
|
|
1910
1911
|
/**
|
|
1911
|
-
*
|
|
1912
|
+
* Read-only canonical NURBS data for the surface underlying a face.
|
|
1912
1913
|
*
|
|
1913
|
-
*
|
|
1914
|
-
*
|
|
1915
|
-
*
|
|
1916
|
-
*
|
|
1917
|
-
*
|
|
1918
|
-
*
|
|
1919
|
-
* `multiplicitiesV`, `isPeriodicU`/`isPeriodicV`, and `isRational`.
|
|
1914
|
+
* Analytic surfaces are converted to NURBS (planes/cylinders exact;
|
|
1915
|
+
* cones/spheres/tori via the exact rational forms). Returns a JSON
|
|
1916
|
+
* string with `degreeU`/`degreeV`, the row-major `controlPoints` grid,
|
|
1917
|
+
* the matching `weights` grid, flat `knotsU`/`knotsV`, compressed
|
|
1918
|
+
* distinct-knots/multiplicities per direction, `rational`,
|
|
1919
|
+
* `periodicU`/`periodicV`, and `domainU`/`domainV`.
|
|
1920
1920
|
* @param {number} face
|
|
1921
1921
|
* @returns {string}
|
|
1922
1922
|
*/
|
|
1923
|
-
|
|
1923
|
+
getNurbsSurfaceData(face) {
|
|
1924
1924
|
let deferred2_0;
|
|
1925
1925
|
let deferred2_1;
|
|
1926
1926
|
try {
|
|
1927
|
-
const ret = wasm.
|
|
1927
|
+
const ret = wasm.brepkernel_getNurbsSurfaceData(this.__wbg_ptr, face);
|
|
1928
1928
|
var ptr1 = ret[0];
|
|
1929
1929
|
var len1 = ret[1];
|
|
1930
1930
|
if (ret[3]) {
|
|
@@ -2439,26 +2439,6 @@ export class BrepKernel {
|
|
|
2439
2439
|
}
|
|
2440
2440
|
return ret[0] >>> 0;
|
|
2441
2441
|
}
|
|
2442
|
-
/**
|
|
2443
|
-
* Intersect two solids, keeping only their common volume.
|
|
2444
|
-
*
|
|
2445
|
-
* Returns a new solid handle (`u32`).
|
|
2446
|
-
*
|
|
2447
|
-
* # Errors
|
|
2448
|
-
*
|
|
2449
|
-
* Returns an error if either solid handle is invalid or the operation
|
|
2450
|
-
* produces an empty result.
|
|
2451
|
-
* @param {number} a
|
|
2452
|
-
* @param {number} b
|
|
2453
|
-
* @returns {number}
|
|
2454
|
-
*/
|
|
2455
|
-
intersect(a, b) {
|
|
2456
|
-
const ret = wasm.brepkernel_intersect(this.__wbg_ptr, a, b);
|
|
2457
|
-
if (ret[2]) {
|
|
2458
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2459
|
-
}
|
|
2460
|
-
return ret[0] >>> 0;
|
|
2461
|
-
}
|
|
2462
2442
|
/**
|
|
2463
2443
|
* Compute the boolean intersection of two 2D polygons.
|
|
2464
2444
|
*
|
|
@@ -2523,6 +2503,26 @@ export class BrepKernel {
|
|
|
2523
2503
|
}
|
|
2524
2504
|
return ret[0] >>> 0;
|
|
2525
2505
|
}
|
|
2506
|
+
/**
|
|
2507
|
+
* Intersect two solids, keeping only their common volume.
|
|
2508
|
+
*
|
|
2509
|
+
* Returns a new solid handle (`u32`).
|
|
2510
|
+
*
|
|
2511
|
+
* # Errors
|
|
2512
|
+
*
|
|
2513
|
+
* Returns an error if either solid handle is invalid or the operation
|
|
2514
|
+
* produces an empty result.
|
|
2515
|
+
* @param {number} a
|
|
2516
|
+
* @param {number} b
|
|
2517
|
+
* @returns {number}
|
|
2518
|
+
*/
|
|
2519
|
+
intersect(a, b) {
|
|
2520
|
+
const ret = wasm.brepkernel_intersect(this.__wbg_ptr, a, b);
|
|
2521
|
+
if (ret[2]) {
|
|
2522
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2523
|
+
}
|
|
2524
|
+
return ret[0] >>> 0;
|
|
2525
|
+
}
|
|
2526
2526
|
/**
|
|
2527
2527
|
* Check if an edge is forward-oriented in a given wire.
|
|
2528
2528
|
*
|
|
@@ -2606,27 +2606,6 @@ export class BrepKernel {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
return ret[0] >>> 0;
|
|
2608
2608
|
}
|
|
2609
|
-
/**
|
|
2610
|
-
* Loft two or more profile faces into a solid.
|
|
2611
|
-
*
|
|
2612
|
-
* Takes an array of face handles. Returns a solid handle (`u32`).
|
|
2613
|
-
*
|
|
2614
|
-
* # Errors
|
|
2615
|
-
*
|
|
2616
|
-
* Returns an error if fewer than 2 faces or profiles have
|
|
2617
|
-
* different vertex counts.
|
|
2618
|
-
* @param {Uint32Array} faces
|
|
2619
|
-
* @returns {number}
|
|
2620
|
-
*/
|
|
2621
|
-
loft(faces) {
|
|
2622
|
-
const ptr0 = passArray32ToWasm0(faces, wasm.__wbindgen_malloc);
|
|
2623
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2624
|
-
const ret = wasm.brepkernel_loft(this.__wbg_ptr, ptr0, len0);
|
|
2625
|
-
if (ret[2]) {
|
|
2626
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
2627
|
-
}
|
|
2628
|
-
return ret[0] >>> 0;
|
|
2629
|
-
}
|
|
2630
2609
|
/**
|
|
2631
2610
|
* Loft profiles with smooth NURBS interpolation.
|
|
2632
2611
|
*
|
|
@@ -2675,41 +2654,41 @@ export class BrepKernel {
|
|
|
2675
2654
|
return ret[0] >>> 0;
|
|
2676
2655
|
}
|
|
2677
2656
|
/**
|
|
2678
|
-
*
|
|
2657
|
+
* Loft two or more profile faces into a solid.
|
|
2679
2658
|
*
|
|
2680
|
-
* Returns a solid handle (`u32`).
|
|
2659
|
+
* Takes an array of face handles. Returns a solid handle (`u32`).
|
|
2681
2660
|
*
|
|
2682
2661
|
* # Errors
|
|
2683
2662
|
*
|
|
2684
|
-
* Returns an error if
|
|
2685
|
-
*
|
|
2686
|
-
* @param {
|
|
2687
|
-
* @param {number} dz
|
|
2663
|
+
* Returns an error if fewer than 2 faces or profiles have
|
|
2664
|
+
* different vertex counts.
|
|
2665
|
+
* @param {Uint32Array} faces
|
|
2688
2666
|
* @returns {number}
|
|
2689
2667
|
*/
|
|
2690
|
-
|
|
2691
|
-
const
|
|
2668
|
+
loft(faces) {
|
|
2669
|
+
const ptr0 = passArray32ToWasm0(faces, wasm.__wbindgen_malloc);
|
|
2670
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2671
|
+
const ret = wasm.brepkernel_loft(this.__wbg_ptr, ptr0, len0);
|
|
2692
2672
|
if (ret[2]) {
|
|
2693
2673
|
throw takeFromExternrefTable0(ret[1]);
|
|
2694
2674
|
}
|
|
2695
2675
|
return ret[0] >>> 0;
|
|
2696
2676
|
}
|
|
2697
2677
|
/**
|
|
2698
|
-
* Create a
|
|
2678
|
+
* Create a box solid with the given dimensions, centered at the origin.
|
|
2699
2679
|
*
|
|
2700
|
-
*
|
|
2701
|
-
* approximated by `segments` straight edges.
|
|
2702
|
-
* Returns a face handle (`u32`).
|
|
2680
|
+
* Returns a solid handle (`u32`).
|
|
2703
2681
|
*
|
|
2704
2682
|
* # Errors
|
|
2705
2683
|
*
|
|
2706
|
-
* Returns an error if
|
|
2707
|
-
* @param {number}
|
|
2708
|
-
* @param {number}
|
|
2684
|
+
* Returns an error if any dimension is non-positive or non-finite.
|
|
2685
|
+
* @param {number} dx
|
|
2686
|
+
* @param {number} dy
|
|
2687
|
+
* @param {number} dz
|
|
2709
2688
|
* @returns {number}
|
|
2710
2689
|
*/
|
|
2711
|
-
|
|
2712
|
-
const ret = wasm.
|
|
2690
|
+
makeBox(dx, dy, dz) {
|
|
2691
|
+
const ret = wasm.brepkernel_makeBox(this.__wbg_ptr, dx, dy, dz);
|
|
2713
2692
|
if (ret[2]) {
|
|
2714
2693
|
throw takeFromExternrefTable0(ret[1]);
|
|
2715
2694
|
}
|
|
@@ -2745,19 +2724,25 @@ export class BrepKernel {
|
|
|
2745
2724
|
return ret[0] >>> 0;
|
|
2746
2725
|
}
|
|
2747
2726
|
/**
|
|
2748
|
-
* Create a closed circular edge with
|
|
2727
|
+
* Create a closed circular edge with a caller-supplied reference x-direction.
|
|
2749
2728
|
*
|
|
2750
|
-
*
|
|
2751
|
-
*
|
|
2752
|
-
*
|
|
2753
|
-
*
|
|
2729
|
+
* Like [`makeCircleEdge`](Self::make_circle_edge), but `ref_dir = (rx, ry, rz)`
|
|
2730
|
+
* is projected onto the plane perpendicular to the normal to fix the
|
|
2731
|
+
* circle's `u_axis` — which controls the seam vertex position at
|
|
2732
|
+
* `circle.evaluate(0.0)`. Use when downstream code (PCurve computation,
|
|
2733
|
+
* extrusion frame) depends on a specific seam placement.
|
|
2734
|
+
*
|
|
2735
|
+
* `ref_dir` must be non-zero (rejected at this boundary) and ideally
|
|
2736
|
+
* not parallel to the normal — `Frame3::from_normal_and_ref` falls
|
|
2737
|
+
* back to an arbitrary perpendicular when the projection of `ref_dir`
|
|
2738
|
+
* onto the plane is degenerate, defeating the purpose of this call.
|
|
2754
2739
|
*
|
|
2755
2740
|
* Returns an edge handle (`u32`).
|
|
2756
2741
|
*
|
|
2757
2742
|
* # Errors
|
|
2758
2743
|
*
|
|
2759
2744
|
* Returns an error if any coordinate is NaN/infinite, `radius` is
|
|
2760
|
-
* non-positive, or the normal vector is zero.
|
|
2745
|
+
* non-positive, or the normal vector or `ref_dir` is zero.
|
|
2761
2746
|
* @param {number} cx
|
|
2762
2747
|
* @param {number} cy
|
|
2763
2748
|
* @param {number} cz
|
|
@@ -2765,35 +2750,32 @@ export class BrepKernel {
|
|
|
2765
2750
|
* @param {number} ny
|
|
2766
2751
|
* @param {number} nz
|
|
2767
2752
|
* @param {number} radius
|
|
2753
|
+
* @param {number} rx
|
|
2754
|
+
* @param {number} ry
|
|
2755
|
+
* @param {number} rz
|
|
2768
2756
|
* @returns {number}
|
|
2769
2757
|
*/
|
|
2770
|
-
|
|
2771
|
-
const ret = wasm.
|
|
2758
|
+
makeCircleEdgeWithRef(cx, cy, cz, nx, ny, nz, radius, rx, ry, rz) {
|
|
2759
|
+
const ret = wasm.brepkernel_makeCircleEdgeWithRef(this.__wbg_ptr, cx, cy, cz, nx, ny, nz, radius, rx, ry, rz);
|
|
2772
2760
|
if (ret[2]) {
|
|
2773
2761
|
throw takeFromExternrefTable0(ret[1]);
|
|
2774
2762
|
}
|
|
2775
2763
|
return ret[0] >>> 0;
|
|
2776
2764
|
}
|
|
2777
2765
|
/**
|
|
2778
|
-
* Create a closed circular edge with
|
|
2779
|
-
*
|
|
2780
|
-
* Like [`makeCircleEdge`](Self::make_circle_edge), but `ref_dir = (rx, ry, rz)`
|
|
2781
|
-
* is projected onto the plane perpendicular to the normal to fix the
|
|
2782
|
-
* circle's `u_axis` — which controls the seam vertex position at
|
|
2783
|
-
* `circle.evaluate(0.0)`. Use when downstream code (PCurve computation,
|
|
2784
|
-
* extrusion frame) depends on a specific seam placement.
|
|
2766
|
+
* Create a closed circular edge with true `Circle` curve geometry.
|
|
2785
2767
|
*
|
|
2786
|
-
* `
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2789
|
-
*
|
|
2768
|
+
* Unlike `makeCircle` (which returns a polygon face approximation),
|
|
2769
|
+
* this creates a single closed edge with an [`EdgeCurve::Circle`]
|
|
2770
|
+
* backing curve and parameter domain `[0, 2π]`. The start and end
|
|
2771
|
+
* vertex are shared at the seam point `circle.evaluate(0.0)`.
|
|
2790
2772
|
*
|
|
2791
2773
|
* Returns an edge handle (`u32`).
|
|
2792
2774
|
*
|
|
2793
2775
|
* # Errors
|
|
2794
2776
|
*
|
|
2795
2777
|
* Returns an error if any coordinate is NaN/infinite, `radius` is
|
|
2796
|
-
* non-positive, or the normal vector
|
|
2778
|
+
* non-positive, or the normal vector is zero.
|
|
2797
2779
|
* @param {number} cx
|
|
2798
2780
|
* @param {number} cy
|
|
2799
2781
|
* @param {number} cz
|
|
@@ -2801,13 +2783,10 @@ export class BrepKernel {
|
|
|
2801
2783
|
* @param {number} ny
|
|
2802
2784
|
* @param {number} nz
|
|
2803
2785
|
* @param {number} radius
|
|
2804
|
-
* @param {number} rx
|
|
2805
|
-
* @param {number} ry
|
|
2806
|
-
* @param {number} rz
|
|
2807
2786
|
* @returns {number}
|
|
2808
2787
|
*/
|
|
2809
|
-
|
|
2810
|
-
const ret = wasm.
|
|
2788
|
+
makeCircleEdge(cx, cy, cz, nx, ny, nz, radius) {
|
|
2789
|
+
const ret = wasm.brepkernel_makeCircleEdge(this.__wbg_ptr, cx, cy, cz, nx, ny, nz, radius);
|
|
2811
2790
|
if (ret[2]) {
|
|
2812
2791
|
throw takeFromExternrefTable0(ret[1]);
|
|
2813
2792
|
}
|
|
@@ -2828,6 +2807,27 @@ export class BrepKernel {
|
|
|
2828
2807
|
}
|
|
2829
2808
|
return ret[0] >>> 0;
|
|
2830
2809
|
}
|
|
2810
|
+
/**
|
|
2811
|
+
* Create a circular polygon approximation on the XY plane.
|
|
2812
|
+
*
|
|
2813
|
+
* The circle is centered at the origin with the given `radius`,
|
|
2814
|
+
* approximated by `segments` straight edges.
|
|
2815
|
+
* Returns a face handle (`u32`).
|
|
2816
|
+
*
|
|
2817
|
+
* # Errors
|
|
2818
|
+
*
|
|
2819
|
+
* Returns an error if fewer than 3 segments are specified.
|
|
2820
|
+
* @param {number} radius
|
|
2821
|
+
* @param {number} segments
|
|
2822
|
+
* @returns {number}
|
|
2823
|
+
*/
|
|
2824
|
+
makeCircle(radius, segments) {
|
|
2825
|
+
const ret = wasm.brepkernel_makeCircle(this.__wbg_ptr, radius, segments);
|
|
2826
|
+
if (ret[2]) {
|
|
2827
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2828
|
+
}
|
|
2829
|
+
return ret[0] >>> 0;
|
|
2830
|
+
}
|
|
2831
2831
|
/**
|
|
2832
2832
|
* Create a compound from multiple solid handles.
|
|
2833
2833
|
*
|
|
@@ -2926,11 +2926,20 @@ export class BrepKernel {
|
|
|
2926
2926
|
return ret[0] >>> 0;
|
|
2927
2927
|
}
|
|
2928
2928
|
/**
|
|
2929
|
-
* Create a closed elliptical edge with
|
|
2929
|
+
* Create a closed elliptical edge with a caller-supplied reference major-axis.
|
|
2930
2930
|
*
|
|
2931
|
-
*
|
|
2932
|
-
*
|
|
2933
|
-
*
|
|
2931
|
+
* Like [`makeEllipseEdge`](Self::make_ellipse_edge), but `ref_dir = (rx, ry, rz)`
|
|
2932
|
+
* is projected onto the plane perpendicular to the normal to fix the
|
|
2933
|
+
* ellipse's major-axis direction (`u_axis`, carrying `semi_major`).
|
|
2934
|
+
* Use this when the caller has an intended major-axis orientation —
|
|
2935
|
+
* otherwise the default-frame variant chooses an arbitrary
|
|
2936
|
+
* perpendicular, which can cause adapters to fall back to NURBS
|
|
2937
|
+
* approximations to preserve their requested orientation.
|
|
2938
|
+
*
|
|
2939
|
+
* `ref_dir` must be non-zero (rejected at this boundary) and ideally
|
|
2940
|
+
* not parallel to the normal — `Frame3::from_normal_and_ref` falls
|
|
2941
|
+
* back to an arbitrary perpendicular when the projection of `ref_dir`
|
|
2942
|
+
* onto the plane is degenerate, defeating the purpose of this call.
|
|
2934
2943
|
*
|
|
2935
2944
|
* Returns an edge handle (`u32`).
|
|
2936
2945
|
*
|
|
@@ -2938,7 +2947,7 @@ export class BrepKernel {
|
|
|
2938
2947
|
*
|
|
2939
2948
|
* Returns an error if any coordinate is NaN/infinite, either
|
|
2940
2949
|
* semi-axis is non-positive, `semi_minor` exceeds `semi_major`, or
|
|
2941
|
-
* the normal vector is zero.
|
|
2950
|
+
* the normal vector or `ref_dir` is zero.
|
|
2942
2951
|
* @param {number} cx
|
|
2943
2952
|
* @param {number} cy
|
|
2944
2953
|
* @param {number} cz
|
|
@@ -2947,30 +2956,24 @@ export class BrepKernel {
|
|
|
2947
2956
|
* @param {number} nz
|
|
2948
2957
|
* @param {number} semi_major
|
|
2949
2958
|
* @param {number} semi_minor
|
|
2959
|
+
* @param {number} rx
|
|
2960
|
+
* @param {number} ry
|
|
2961
|
+
* @param {number} rz
|
|
2950
2962
|
* @returns {number}
|
|
2951
2963
|
*/
|
|
2952
|
-
|
|
2953
|
-
const ret = wasm.
|
|
2964
|
+
makeEllipseEdgeWithRef(cx, cy, cz, nx, ny, nz, semi_major, semi_minor, rx, ry, rz) {
|
|
2965
|
+
const ret = wasm.brepkernel_makeEllipseEdgeWithRef(this.__wbg_ptr, cx, cy, cz, nx, ny, nz, semi_major, semi_minor, rx, ry, rz);
|
|
2954
2966
|
if (ret[2]) {
|
|
2955
2967
|
throw takeFromExternrefTable0(ret[1]);
|
|
2956
2968
|
}
|
|
2957
2969
|
return ret[0] >>> 0;
|
|
2958
2970
|
}
|
|
2959
2971
|
/**
|
|
2960
|
-
* Create a closed elliptical edge with
|
|
2961
|
-
*
|
|
2962
|
-
* Like [`makeEllipseEdge`](Self::make_ellipse_edge), but `ref_dir = (rx, ry, rz)`
|
|
2963
|
-
* is projected onto the plane perpendicular to the normal to fix the
|
|
2964
|
-
* ellipse's major-axis direction (`u_axis`, carrying `semi_major`).
|
|
2965
|
-
* Use this when the caller has an intended major-axis orientation —
|
|
2966
|
-
* otherwise the default-frame variant chooses an arbitrary
|
|
2967
|
-
* perpendicular, which can cause adapters to fall back to NURBS
|
|
2968
|
-
* approximations to preserve their requested orientation.
|
|
2972
|
+
* Create a closed elliptical edge with true `Ellipse` curve geometry.
|
|
2969
2973
|
*
|
|
2970
|
-
*
|
|
2971
|
-
*
|
|
2972
|
-
*
|
|
2973
|
-
* onto the plane is degenerate, defeating the purpose of this call.
|
|
2974
|
+
* Creates a single closed edge with an [`EdgeCurve::Ellipse`] backing
|
|
2975
|
+
* curve and parameter domain `[0, 2π]`. The start and end vertex are
|
|
2976
|
+
* shared at the seam point `ellipse.evaluate(0.0)`.
|
|
2974
2977
|
*
|
|
2975
2978
|
* Returns an edge handle (`u32`).
|
|
2976
2979
|
*
|
|
@@ -2978,7 +2981,7 @@ export class BrepKernel {
|
|
|
2978
2981
|
*
|
|
2979
2982
|
* Returns an error if any coordinate is NaN/infinite, either
|
|
2980
2983
|
* semi-axis is non-positive, `semi_minor` exceeds `semi_major`, or
|
|
2981
|
-
* the normal vector
|
|
2984
|
+
* the normal vector is zero.
|
|
2982
2985
|
* @param {number} cx
|
|
2983
2986
|
* @param {number} cy
|
|
2984
2987
|
* @param {number} cz
|
|
@@ -2987,13 +2990,10 @@ export class BrepKernel {
|
|
|
2987
2990
|
* @param {number} nz
|
|
2988
2991
|
* @param {number} semi_major
|
|
2989
2992
|
* @param {number} semi_minor
|
|
2990
|
-
* @param {number} rx
|
|
2991
|
-
* @param {number} ry
|
|
2992
|
-
* @param {number} rz
|
|
2993
2993
|
* @returns {number}
|
|
2994
2994
|
*/
|
|
2995
|
-
|
|
2996
|
-
const ret = wasm.
|
|
2995
|
+
makeEllipseEdge(cx, cy, cz, nx, ny, nz, semi_major, semi_minor) {
|
|
2996
|
+
const ret = wasm.brepkernel_makeEllipseEdge(this.__wbg_ptr, cx, cy, cz, nx, ny, nz, semi_major, semi_minor);
|
|
2997
2997
|
if (ret[2]) {
|
|
2998
2998
|
throw takeFromExternrefTable0(ret[1]);
|
|
2999
2999
|
}
|
|
@@ -3097,8 +3097,24 @@ export class BrepKernel {
|
|
|
3097
3097
|
* @param {number} wire
|
|
3098
3098
|
* @returns {number}
|
|
3099
3099
|
*/
|
|
3100
|
-
makePlanarFaceFromWire(wire) {
|
|
3101
|
-
const ret = wasm.brepkernel_makePlanarFaceFromWire(this.__wbg_ptr, wire);
|
|
3100
|
+
makePlanarFaceFromWire(wire) {
|
|
3101
|
+
const ret = wasm.brepkernel_makePlanarFaceFromWire(this.__wbg_ptr, wire);
|
|
3102
|
+
if (ret[2]) {
|
|
3103
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3104
|
+
}
|
|
3105
|
+
return ret[0] >>> 0;
|
|
3106
|
+
}
|
|
3107
|
+
/**
|
|
3108
|
+
* Create a closed polygon wire from flat coordinates.
|
|
3109
|
+
*
|
|
3110
|
+
* Returns a wire handle.
|
|
3111
|
+
* @param {Float64Array} coords
|
|
3112
|
+
* @returns {number}
|
|
3113
|
+
*/
|
|
3114
|
+
makePolygonWire(coords) {
|
|
3115
|
+
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
3116
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3117
|
+
const ret = wasm.brepkernel_makePolygonWire(this.__wbg_ptr, ptr0, len0);
|
|
3102
3118
|
if (ret[2]) {
|
|
3103
3119
|
throw takeFromExternrefTable0(ret[1]);
|
|
3104
3120
|
}
|
|
@@ -3126,22 +3142,6 @@ export class BrepKernel {
|
|
|
3126
3142
|
}
|
|
3127
3143
|
return ret[0] >>> 0;
|
|
3128
3144
|
}
|
|
3129
|
-
/**
|
|
3130
|
-
* Create a closed polygon wire from flat coordinates.
|
|
3131
|
-
*
|
|
3132
|
-
* Returns a wire handle.
|
|
3133
|
-
* @param {Float64Array} coords
|
|
3134
|
-
* @returns {number}
|
|
3135
|
-
*/
|
|
3136
|
-
makePolygonWire(coords) {
|
|
3137
|
-
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
3138
|
-
const len0 = WASM_VECTOR_LEN;
|
|
3139
|
-
const ret = wasm.brepkernel_makePolygonWire(this.__wbg_ptr, ptr0, len0);
|
|
3140
|
-
if (ret[2]) {
|
|
3141
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
3142
|
-
}
|
|
3143
|
-
return ret[0] >>> 0;
|
|
3144
|
-
}
|
|
3145
3145
|
/**
|
|
3146
3146
|
* Create a rectangular face on the XY plane centered at the origin.
|
|
3147
3147
|
*
|
|
@@ -3374,38 +3374,38 @@ export class BrepKernel {
|
|
|
3374
3374
|
return JsMesh.__wrap(ret[0]);
|
|
3375
3375
|
}
|
|
3376
3376
|
/**
|
|
3377
|
-
* Sample edges of a solid
|
|
3378
|
-
*
|
|
3379
|
-
* Returns a `JsEdgeLines` containing flattened positions and per-edge
|
|
3380
|
-
* offset indices. The `deflection` parameter controls sampling density.
|
|
3377
|
+
* Sample ALL edges of a solid (no smooth-edge filtering).
|
|
3381
3378
|
*
|
|
3382
|
-
*
|
|
3383
|
-
*
|
|
3384
|
-
* arise from boolean face-splitting and don't represent visible creases.
|
|
3379
|
+
* Same as `meshEdges` but includes edges between co-surface faces.
|
|
3380
|
+
* Useful for debugging topology.
|
|
3385
3381
|
* @param {number} solid
|
|
3386
3382
|
* @param {number} deflection
|
|
3387
3383
|
* @param {number | null} [angular_tolerance]
|
|
3388
3384
|
* @returns {JsEdgeLines}
|
|
3389
3385
|
*/
|
|
3390
|
-
|
|
3391
|
-
const ret = wasm.
|
|
3386
|
+
meshEdgesAll(solid, deflection, angular_tolerance) {
|
|
3387
|
+
const ret = wasm.brepkernel_meshEdgesAll(this.__wbg_ptr, solid, deflection, !isLikeNone(angular_tolerance), isLikeNone(angular_tolerance) ? 0 : angular_tolerance);
|
|
3392
3388
|
if (ret[2]) {
|
|
3393
3389
|
throw takeFromExternrefTable0(ret[1]);
|
|
3394
3390
|
}
|
|
3395
3391
|
return JsEdgeLines.__wrap(ret[0]);
|
|
3396
3392
|
}
|
|
3397
3393
|
/**
|
|
3398
|
-
* Sample
|
|
3394
|
+
* Sample edges of a solid into polylines for wireframe rendering.
|
|
3399
3395
|
*
|
|
3400
|
-
*
|
|
3401
|
-
*
|
|
3396
|
+
* Returns a `JsEdgeLines` containing flattened positions and per-edge
|
|
3397
|
+
* offset indices. The `deflection` parameter controls sampling density.
|
|
3398
|
+
*
|
|
3399
|
+
* Smooth edges (between faces on the same underlying surface) are
|
|
3400
|
+
* automatically filtered out to reduce wireframe clutter. These edges
|
|
3401
|
+
* arise from boolean face-splitting and don't represent visible creases.
|
|
3402
3402
|
* @param {number} solid
|
|
3403
3403
|
* @param {number} deflection
|
|
3404
3404
|
* @param {number | null} [angular_tolerance]
|
|
3405
3405
|
* @returns {JsEdgeLines}
|
|
3406
3406
|
*/
|
|
3407
|
-
|
|
3408
|
-
const ret = wasm.
|
|
3407
|
+
meshEdges(solid, deflection, angular_tolerance) {
|
|
3408
|
+
const ret = wasm.brepkernel_meshEdges(this.__wbg_ptr, solid, deflection, !isLikeNone(angular_tolerance), isLikeNone(angular_tolerance) ? 0 : angular_tolerance);
|
|
3409
3409
|
if (ret[2]) {
|
|
3410
3410
|
throw takeFromExternrefTable0(ret[1]);
|
|
3411
3411
|
}
|
|
@@ -3564,25 +3564,6 @@ export class BrepKernel {
|
|
|
3564
3564
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
3565
3565
|
return v2;
|
|
3566
3566
|
}
|
|
3567
|
-
/**
|
|
3568
|
-
* Offset (shell) a solid by a distance.
|
|
3569
|
-
*
|
|
3570
|
-
* Returns a new solid handle.
|
|
3571
|
-
*
|
|
3572
|
-
* # Errors
|
|
3573
|
-
*
|
|
3574
|
-
* Returns an error if the distance is zero or the solid is invalid.
|
|
3575
|
-
* @param {number} solid
|
|
3576
|
-
* @param {number} distance
|
|
3577
|
-
* @returns {number}
|
|
3578
|
-
*/
|
|
3579
|
-
offsetSolid(solid, distance) {
|
|
3580
|
-
const ret = wasm.brepkernel_offsetSolid(this.__wbg_ptr, solid, distance);
|
|
3581
|
-
if (ret[2]) {
|
|
3582
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
3583
|
-
}
|
|
3584
|
-
return ret[0] >>> 0;
|
|
3585
|
-
}
|
|
3586
3567
|
/**
|
|
3587
3568
|
* Offset all faces of a solid outward or inward (V2 pipeline).
|
|
3588
3569
|
*
|
|
@@ -3603,15 +3584,19 @@ export class BrepKernel {
|
|
|
3603
3584
|
return ret[0] >>> 0;
|
|
3604
3585
|
}
|
|
3605
3586
|
/**
|
|
3606
|
-
* Offset a
|
|
3587
|
+
* Offset (shell) a solid by a distance.
|
|
3607
3588
|
*
|
|
3608
|
-
* Returns a new
|
|
3609
|
-
*
|
|
3589
|
+
* Returns a new solid handle.
|
|
3590
|
+
*
|
|
3591
|
+
* # Errors
|
|
3592
|
+
*
|
|
3593
|
+
* Returns an error if the distance is zero or the solid is invalid.
|
|
3594
|
+
* @param {number} solid
|
|
3610
3595
|
* @param {number} distance
|
|
3611
3596
|
* @returns {number}
|
|
3612
3597
|
*/
|
|
3613
|
-
|
|
3614
|
-
const ret = wasm.
|
|
3598
|
+
offsetSolid(solid, distance) {
|
|
3599
|
+
const ret = wasm.brepkernel_offsetSolid(this.__wbg_ptr, solid, distance);
|
|
3615
3600
|
if (ret[2]) {
|
|
3616
3601
|
throw takeFromExternrefTable0(ret[1]);
|
|
3617
3602
|
}
|
|
@@ -3673,6 +3658,21 @@ export class BrepKernel {
|
|
|
3673
3658
|
}
|
|
3674
3659
|
return ret[0] >>> 0;
|
|
3675
3660
|
}
|
|
3661
|
+
/**
|
|
3662
|
+
* Offset a wire on a planar face.
|
|
3663
|
+
*
|
|
3664
|
+
* Returns a new wire handle.
|
|
3665
|
+
* @param {number} face
|
|
3666
|
+
* @param {number} distance
|
|
3667
|
+
* @returns {number}
|
|
3668
|
+
*/
|
|
3669
|
+
offsetWire(face, distance) {
|
|
3670
|
+
const ret = wasm.brepkernel_offsetWire(this.__wbg_ptr, face, distance);
|
|
3671
|
+
if (ret[2]) {
|
|
3672
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3673
|
+
}
|
|
3674
|
+
return ret[0] >>> 0;
|
|
3675
|
+
}
|
|
3676
3676
|
/**
|
|
3677
3677
|
* Pipe sweep: sweep a profile along a NURBS path (no guide).
|
|
3678
3678
|
*
|
|
@@ -4320,41 +4320,6 @@ export class BrepKernel {
|
|
|
4320
4320
|
}
|
|
4321
4321
|
return ret[0];
|
|
4322
4322
|
}
|
|
4323
|
-
/**
|
|
4324
|
-
* Sweep a planar face along a NURBS curve path to create a solid.
|
|
4325
|
-
*
|
|
4326
|
-
* The path is specified as flat arrays for JS interop:
|
|
4327
|
-
* - `path_degree` — polynomial degree of the path curve
|
|
4328
|
-
* - `path_knots` — knot vector
|
|
4329
|
-
* - `path_control_points` — flat `[x,y,z, ...]` control point coordinates
|
|
4330
|
-
* - `path_weights` — per-control-point weights
|
|
4331
|
-
*
|
|
4332
|
-
* Returns a solid handle (`u32`).
|
|
4333
|
-
*
|
|
4334
|
-
* # Errors
|
|
4335
|
-
*
|
|
4336
|
-
* Returns an error if the face handle is invalid, the NURBS arrays have
|
|
4337
|
-
* inconsistent lengths, or the sweep operation fails.
|
|
4338
|
-
* @param {number} face
|
|
4339
|
-
* @param {number} path_degree
|
|
4340
|
-
* @param {Float64Array} path_knots
|
|
4341
|
-
* @param {Float64Array} path_control_points
|
|
4342
|
-
* @param {Float64Array} path_weights
|
|
4343
|
-
* @returns {number}
|
|
4344
|
-
*/
|
|
4345
|
-
sweep(face, path_degree, path_knots, path_control_points, path_weights) {
|
|
4346
|
-
const ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
|
|
4347
|
-
const len0 = WASM_VECTOR_LEN;
|
|
4348
|
-
const ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
|
|
4349
|
-
const len1 = WASM_VECTOR_LEN;
|
|
4350
|
-
const ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
|
|
4351
|
-
const len2 = WASM_VECTOR_LEN;
|
|
4352
|
-
const ret = wasm.brepkernel_sweep(this.__wbg_ptr, face, path_degree, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
4353
|
-
if (ret[2]) {
|
|
4354
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
4355
|
-
}
|
|
4356
|
-
return ret[0] >>> 0;
|
|
4357
|
-
}
|
|
4358
4323
|
/**
|
|
4359
4324
|
* Sweep a face along a path defined by a chain of edges.
|
|
4360
4325
|
*
|
|
@@ -4441,6 +4406,41 @@ export class BrepKernel {
|
|
|
4441
4406
|
}
|
|
4442
4407
|
return ret[0] >>> 0;
|
|
4443
4408
|
}
|
|
4409
|
+
/**
|
|
4410
|
+
* Sweep a planar face along a NURBS curve path to create a solid.
|
|
4411
|
+
*
|
|
4412
|
+
* The path is specified as flat arrays for JS interop:
|
|
4413
|
+
* - `path_degree` — polynomial degree of the path curve
|
|
4414
|
+
* - `path_knots` — knot vector
|
|
4415
|
+
* - `path_control_points` — flat `[x,y,z, ...]` control point coordinates
|
|
4416
|
+
* - `path_weights` — per-control-point weights
|
|
4417
|
+
*
|
|
4418
|
+
* Returns a solid handle (`u32`).
|
|
4419
|
+
*
|
|
4420
|
+
* # Errors
|
|
4421
|
+
*
|
|
4422
|
+
* Returns an error if the face handle is invalid, the NURBS arrays have
|
|
4423
|
+
* inconsistent lengths, or the sweep operation fails.
|
|
4424
|
+
* @param {number} face
|
|
4425
|
+
* @param {number} path_degree
|
|
4426
|
+
* @param {Float64Array} path_knots
|
|
4427
|
+
* @param {Float64Array} path_control_points
|
|
4428
|
+
* @param {Float64Array} path_weights
|
|
4429
|
+
* @returns {number}
|
|
4430
|
+
*/
|
|
4431
|
+
sweep(face, path_degree, path_knots, path_control_points, path_weights) {
|
|
4432
|
+
const ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
|
|
4433
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4434
|
+
const ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
|
|
4435
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4436
|
+
const ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
|
|
4437
|
+
const len2 = WASM_VECTOR_LEN;
|
|
4438
|
+
const ret = wasm.brepkernel_sweep(this.__wbg_ptr, face, path_degree, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
4439
|
+
if (ret[2]) {
|
|
4440
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4441
|
+
}
|
|
4442
|
+
return ret[0] >>> 0;
|
|
4443
|
+
}
|
|
4444
4444
|
/**
|
|
4445
4445
|
* Tessellate an edge curve into polyline segments.
|
|
4446
4446
|
*
|
|
@@ -4480,9 +4480,13 @@ export class BrepKernel {
|
|
|
4480
4480
|
return JsMesh.__wrap(ret[0]);
|
|
4481
4481
|
}
|
|
4482
4482
|
/**
|
|
4483
|
-
* Tessellate
|
|
4483
|
+
* Tessellate a solid with per-face grouping, returned as packed binary
|
|
4484
|
+
* buffers ([`JsGroupedMesh`]) instead of a JSON string.
|
|
4484
4485
|
*
|
|
4485
|
-
*
|
|
4486
|
+
* Identical geometry to [`tessellate_solid_grouped`](Self::tessellate_solid_grouped),
|
|
4487
|
+
* but the mesh crosses the WASM boundary as `Float32Array`/`Uint32Array`
|
|
4488
|
+
* bulk copies rather than a (potentially multi-megabyte) JSON string that
|
|
4489
|
+
* the caller must `JSON.parse` and re-pack — far cheaper for large meshes.
|
|
4486
4490
|
*
|
|
4487
4491
|
* # Errors
|
|
4488
4492
|
*
|
|
@@ -4490,14 +4494,14 @@ export class BrepKernel {
|
|
|
4490
4494
|
* @param {number} solid
|
|
4491
4495
|
* @param {number} deflection
|
|
4492
4496
|
* @param {number | null} [angular_tolerance]
|
|
4493
|
-
* @returns {
|
|
4497
|
+
* @returns {JsGroupedMesh}
|
|
4494
4498
|
*/
|
|
4495
|
-
|
|
4496
|
-
const ret = wasm.
|
|
4499
|
+
tessellateSolidGroupedBinary(solid, deflection, angular_tolerance) {
|
|
4500
|
+
const ret = wasm.brepkernel_tessellateSolidGroupedBinary(this.__wbg_ptr, solid, deflection, !isLikeNone(angular_tolerance), isLikeNone(angular_tolerance) ? 0 : angular_tolerance);
|
|
4497
4501
|
if (ret[2]) {
|
|
4498
4502
|
throw takeFromExternrefTable0(ret[1]);
|
|
4499
4503
|
}
|
|
4500
|
-
return
|
|
4504
|
+
return JsGroupedMesh.__wrap(ret[0]);
|
|
4501
4505
|
}
|
|
4502
4506
|
/**
|
|
4503
4507
|
* Tessellate a solid with per-face triangle grouping.
|
|
@@ -4522,13 +4526,12 @@ export class BrepKernel {
|
|
|
4522
4526
|
return takeFromExternrefTable0(ret[0]);
|
|
4523
4527
|
}
|
|
4524
4528
|
/**
|
|
4525
|
-
* Tessellate a solid
|
|
4526
|
-
* buffers ([`JsGroupedMesh`]) instead of a JSON string.
|
|
4529
|
+
* Tessellate a solid and include per-vertex UV coordinates.
|
|
4527
4530
|
*
|
|
4528
|
-
*
|
|
4529
|
-
*
|
|
4530
|
-
*
|
|
4531
|
-
*
|
|
4531
|
+
* Returns a JSON string containing `{ positions, normals, indices, uvs }`.
|
|
4532
|
+
* `uvs` is a flat array of `[u0, v0, u1, v1, ...]` values, two per vertex.
|
|
4533
|
+
* For analytic and NURBS surfaces, these are the parametric (u, v) values.
|
|
4534
|
+
* For planar faces, UVs are computed by projection onto the face plane.
|
|
4532
4535
|
*
|
|
4533
4536
|
* # Errors
|
|
4534
4537
|
*
|
|
@@ -4536,22 +4539,19 @@ export class BrepKernel {
|
|
|
4536
4539
|
* @param {number} solid
|
|
4537
4540
|
* @param {number} deflection
|
|
4538
4541
|
* @param {number | null} [angular_tolerance]
|
|
4539
|
-
* @returns {
|
|
4542
|
+
* @returns {any}
|
|
4540
4543
|
*/
|
|
4541
|
-
|
|
4542
|
-
const ret = wasm.
|
|
4544
|
+
tessellateSolidUV(solid, deflection, angular_tolerance) {
|
|
4545
|
+
const ret = wasm.brepkernel_tessellateSolidUV(this.__wbg_ptr, solid, deflection, !isLikeNone(angular_tolerance), isLikeNone(angular_tolerance) ? 0 : angular_tolerance);
|
|
4543
4546
|
if (ret[2]) {
|
|
4544
4547
|
throw takeFromExternrefTable0(ret[1]);
|
|
4545
4548
|
}
|
|
4546
|
-
return
|
|
4549
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4547
4550
|
}
|
|
4548
4551
|
/**
|
|
4549
|
-
* Tessellate a solid
|
|
4552
|
+
* Tessellate all faces of a solid into a single merged triangle mesh.
|
|
4550
4553
|
*
|
|
4551
|
-
*
|
|
4552
|
-
* `uvs` is a flat array of `[u0, v0, u1, v1, ...]` values, two per vertex.
|
|
4553
|
-
* For analytic and NURBS surfaces, these are the parametric (u, v) values.
|
|
4554
|
-
* For planar faces, UVs are computed by projection onto the face plane.
|
|
4554
|
+
* Includes both the outer shell and any inner shells (voids).
|
|
4555
4555
|
*
|
|
4556
4556
|
* # Errors
|
|
4557
4557
|
*
|
|
@@ -4559,14 +4559,14 @@ export class BrepKernel {
|
|
|
4559
4559
|
* @param {number} solid
|
|
4560
4560
|
* @param {number} deflection
|
|
4561
4561
|
* @param {number | null} [angular_tolerance]
|
|
4562
|
-
* @returns {
|
|
4562
|
+
* @returns {JsMesh}
|
|
4563
4563
|
*/
|
|
4564
|
-
|
|
4565
|
-
const ret = wasm.
|
|
4564
|
+
tessellateSolid(solid, deflection, angular_tolerance) {
|
|
4565
|
+
const ret = wasm.brepkernel_tessellateSolid(this.__wbg_ptr, solid, deflection, !isLikeNone(angular_tolerance), isLikeNone(angular_tolerance) ? 0 : angular_tolerance);
|
|
4566
4566
|
if (ret[2]) {
|
|
4567
4567
|
throw takeFromExternrefTable0(ret[1]);
|
|
4568
4568
|
}
|
|
4569
|
-
return
|
|
4569
|
+
return JsMesh.__wrap(ret[0]);
|
|
4570
4570
|
}
|
|
4571
4571
|
/**
|
|
4572
4572
|
* Thicken a face into a solid by offsetting it by the given distance.
|
|
@@ -4716,24 +4716,6 @@ export class BrepKernel {
|
|
|
4716
4716
|
}
|
|
4717
4717
|
return ret[0] >>> 0;
|
|
4718
4718
|
}
|
|
4719
|
-
/**
|
|
4720
|
-
* Validate a solid, returning the number of errors found.
|
|
4721
|
-
*
|
|
4722
|
-
* Returns 0 if the solid is valid.
|
|
4723
|
-
*
|
|
4724
|
-
* # Errors
|
|
4725
|
-
*
|
|
4726
|
-
* Returns an error if the solid handle is invalid.
|
|
4727
|
-
* @param {number} solid
|
|
4728
|
-
* @returns {number}
|
|
4729
|
-
*/
|
|
4730
|
-
validateSolid(solid) {
|
|
4731
|
-
const ret = wasm.brepkernel_validateSolid(this.__wbg_ptr, solid);
|
|
4732
|
-
if (ret[2]) {
|
|
4733
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
4734
|
-
}
|
|
4735
|
-
return ret[0] >>> 0;
|
|
4736
|
-
}
|
|
4737
4719
|
/**
|
|
4738
4720
|
* Validate a solid with relaxed checks suitable for assembled geometry.
|
|
4739
4721
|
*
|
|
@@ -4781,6 +4763,24 @@ export class BrepKernel {
|
|
|
4781
4763
|
}
|
|
4782
4764
|
return ret[0] >>> 0;
|
|
4783
4765
|
}
|
|
4766
|
+
/**
|
|
4767
|
+
* Validate a solid, returning the number of errors found.
|
|
4768
|
+
*
|
|
4769
|
+
* Returns 0 if the solid is valid.
|
|
4770
|
+
*
|
|
4771
|
+
* # Errors
|
|
4772
|
+
*
|
|
4773
|
+
* Returns an error if the solid handle is invalid.
|
|
4774
|
+
* @param {number} solid
|
|
4775
|
+
* @returns {number}
|
|
4776
|
+
*/
|
|
4777
|
+
validateSolid(solid) {
|
|
4778
|
+
const ret = wasm.brepkernel_validateSolid(this.__wbg_ptr, solid);
|
|
4779
|
+
if (ret[2]) {
|
|
4780
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4781
|
+
}
|
|
4782
|
+
return ret[0] >>> 0;
|
|
4783
|
+
}
|
|
4784
4784
|
/**
|
|
4785
4785
|
* Compute the volume of a solid.
|
|
4786
4786
|
*
|
|
@@ -5268,30 +5268,30 @@ export function setLogLevel(level) {
|
|
|
5268
5268
|
throw takeFromExternrefTable0(ret[0]);
|
|
5269
5269
|
}
|
|
5270
5270
|
}
|
|
5271
|
-
export function
|
|
5271
|
+
export function __wbg_Error_67e7344beaa85059(arg0, arg1) {
|
|
5272
5272
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
5273
5273
|
return ret;
|
|
5274
5274
|
}
|
|
5275
|
-
export function
|
|
5275
|
+
export function __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0(arg0, arg1) {
|
|
5276
5276
|
const ret = debugString(arg1);
|
|
5277
5277
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5278
5278
|
const len1 = WASM_VECTOR_LEN;
|
|
5279
5279
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5280
5280
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5281
5281
|
}
|
|
5282
|
-
export function
|
|
5282
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
5283
5283
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5284
5284
|
}
|
|
5285
|
-
export function
|
|
5285
|
+
export function __wbg_error_8c6014ceeb158c14(arg0, arg1) {
|
|
5286
5286
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5287
5287
|
}
|
|
5288
|
-
export function
|
|
5288
|
+
export function __wbg_log_8efded3067fadcdc(arg0, arg1) {
|
|
5289
5289
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
5290
5290
|
}
|
|
5291
|
-
export function
|
|
5291
|
+
export function __wbg_warn_0b9a7e5b248fcb5b(arg0, arg1) {
|
|
5292
5292
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5293
5293
|
}
|
|
5294
|
-
export function
|
|
5294
|
+
export function __wbindgen_generic_0000000000000001(arg0, arg1) {
|
|
5295
5295
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
5296
5296
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
5297
5297
|
return ret;
|