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