brepjs 20.13.1 → 20.13.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.
Files changed (93) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-BA9xrrmS.cjs → adjacencyFns-BBugwmvl.cjs} +2 -2
  4. package/dist/{adjacencyFns-C4Tui11_.js → adjacencyFns-V29Gvfs9.js} +2 -2
  5. package/dist/{blueprint-D193PMxX.cjs → blueprint-BO8zuqoy.cjs} +5 -5
  6. package/dist/{blueprint-DH0H9OWv.js → blueprint-CDmOJybf.js} +5 -5
  7. package/dist/{blueprintFns-Bfiqbmtc.js → blueprintFns-CEKZsu4N.js} +2 -2
  8. package/dist/{blueprintFns-DYIKTIvJ.cjs → blueprintFns-Cki-iwEl.cjs} +2 -2
  9. package/dist/{blueprintSketcher-B1UrnhFt.cjs → blueprintSketcher-Bxkp-vjK.cjs} +3 -3
  10. package/dist/{blueprintSketcher-RA8ti2Xp.js → blueprintSketcher-DG_2zJg7.js} +3 -3
  11. package/dist/{boolean2D-XIehGONX.cjs → boolean2D-C_sEMz0u.cjs} +4 -4
  12. package/dist/{boolean2D-CCKUmway.js → boolean2D-DqCcYA2X.js} +4 -4
  13. package/dist/{booleanFns-zRlNDHQY.cjs → booleanFns-CA9tvtqr.cjs} +5 -5
  14. package/dist/{booleanFns-CyxmW1pL.js → booleanFns-CopMFBLS.js} +5 -5
  15. package/dist/brepjs.cjs +32 -30
  16. package/dist/brepjs.js +32 -30
  17. package/dist/{cameraFns-CtpBKmwD.js → cameraFns-BIIpsfds.js} +3 -3
  18. package/dist/{cameraFns-BDjt94fY.cjs → cameraFns-BJ35ht2H.cjs} +3 -3
  19. package/dist/core.cjs +2 -2
  20. package/dist/core.js +2 -2
  21. package/dist/{cornerFinder-CIryesVI.js → cornerFinder-C8VCstc3.js} +1 -1
  22. package/dist/{cornerFinder-DWN1Vkea.cjs → cornerFinder-D83OLL_I.cjs} +1 -1
  23. package/dist/{curveFns-b_C6tBeU.js → curveFns--TqXOi8f.js} +1 -1
  24. package/dist/{curveFns-0vAErrs9.cjs → curveFns-B29Eot3K.cjs} +1 -1
  25. package/dist/{drawFns-vcRf5KKV.cjs → drawFns-Bqs4HPzo.cjs} +12 -12
  26. package/dist/{drawFns--_Bd7ONO.js → drawFns-g9FrZ_P4.js} +12 -12
  27. package/dist/{faceFns-DzNcnzS5.cjs → faceFns-BeSpw0Dz.cjs} +2 -2
  28. package/dist/{faceFns-WtnWpVQl.js → faceFns-BzHfvPea.js} +2 -2
  29. package/dist/{healingFns-D26gj7M5.cjs → healingFns-BtZg6i3J.cjs} +30 -13
  30. package/dist/{healingFns-B82dNj9P.js → healingFns-DtefNa-x.js} +30 -13
  31. package/dist/{helpers-BO5NktbN.cjs → helpers-CFEuQ0ok.cjs} +6 -6
  32. package/dist/{helpers-C5I0ZqYC.js → helpers-CHUowMmV.js} +6 -6
  33. package/dist/{importFns-sxpO2z86.js → importFns-BLaneR8r.js} +5 -5
  34. package/dist/{importFns-Ceb2VgcK.cjs → importFns-BX0866c6.cjs} +5 -5
  35. package/dist/io.cjs +2 -2
  36. package/dist/io.js +2 -2
  37. package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +0 -4
  38. package/dist/kernel/brepkit/helpers.d.ts +15 -0
  39. package/dist/kernel/brepkit/measureOps.d.ts +7 -0
  40. package/dist/kernel/brepkit/modifierOps.d.ts +11 -1
  41. package/dist/{loftFns-KXrP3aat.cjs → loftFns-Byjbneme.cjs} +31 -16
  42. package/dist/{loftFns-Y-aBF_f7.js → loftFns-Cth8Le9X.js} +32 -17
  43. package/dist/{measureFns-C8UjdHpB.cjs → measureFns-BlS2xJcn.cjs} +53 -9
  44. package/dist/{measureFns-B0PhQ5dY.js → measureFns-CLsSuByu.js} +49 -11
  45. package/dist/measurement/measureFns.d.ts +16 -1
  46. package/dist/measurement.cjs +2 -2
  47. package/dist/measurement.js +2 -2
  48. package/dist/{meshFns-BazHDlpY.js → meshFns-CzpP9SBf.js} +3 -3
  49. package/dist/{meshFns-BnkXZ0Xm.cjs → meshFns-ECQqx-8Q.cjs} +3 -3
  50. package/dist/operations/sweepFns.d.ts +7 -3
  51. package/dist/operations.cjs +2 -2
  52. package/dist/operations.js +2 -2
  53. package/dist/{primitiveFns-BM709SMs.cjs → primitiveFns-CzhQz02F.cjs} +5 -5
  54. package/dist/{primitiveFns-BZALpT35.js → primitiveFns-Kph3YP3A.js} +5 -5
  55. package/dist/{principalBoxFns-DLOoxmZB.js → principalBoxFns-C8ZmZNxJ.js} +3 -3
  56. package/dist/{principalBoxFns-C_hSxRc7.cjs → principalBoxFns-Ck9rR3Op.cjs} +3 -3
  57. package/dist/projection.cjs +1 -1
  58. package/dist/projection.js +1 -1
  59. package/dist/query.cjs +2 -2
  60. package/dist/query.js +2 -2
  61. package/dist/{refResolveFns-BkSLmvyY.cjs → refResolveFns-CVUSuVee.cjs} +6 -6
  62. package/dist/{refResolveFns-BA1ES0sL.js → refResolveFns-Cf16q6AH.js} +6 -6
  63. package/dist/{shapeFns-Bgql2_E6.cjs → shapeFns-BEwoFgq2.cjs} +2 -2
  64. package/dist/{shapeFns-CSWOXGx9.js → shapeFns-Bepwarf3.js} +2 -2
  65. package/dist/shapeRef.cjs +1 -1
  66. package/dist/shapeRef.js +1 -1
  67. package/dist/{shapeTypes-BFfnNmzj.cjs → shapeTypes-CIw6-GFy.cjs} +685 -175
  68. package/dist/{shapeTypes-C7hqbMwl.js → shapeTypes-hLHmANUz.js} +685 -175
  69. package/dist/sketching.cjs +3 -3
  70. package/dist/sketching.js +3 -3
  71. package/dist/{solidBuilders-CWw3yasa.cjs → solidBuilders-BVHK-era.cjs} +3 -3
  72. package/dist/{solidBuilders-B01dFnd7.js → solidBuilders-IA8xNuxJ.js} +3 -3
  73. package/dist/{surfaceBuilders-Cn7GIsyR.js → surfaceBuilders-BYwkPzfM.js} +3 -3
  74. package/dist/{surfaceBuilders-DL7UTpW2.cjs → surfaceBuilders-DIM5GSAT.cjs} +3 -3
  75. package/dist/text.cjs +2 -2
  76. package/dist/text.js +2 -2
  77. package/dist/{textBlueprints-B7gDC-aP.js → textBlueprints-B4w-_4_D.js} +8 -8
  78. package/dist/{textBlueprints-dOnCv38X.cjs → textBlueprints-CPJ6sBZZ.cjs} +8 -8
  79. package/dist/{textMetrics-Cqc0xzHC.cjs → textMetrics-Dfr_9G6g.cjs} +1 -1
  80. package/dist/{textMetrics-BFzj8Zvn.js → textMetrics-na1BYw65.js} +1 -1
  81. package/dist/{threadFns-M8pqF4TW.js → threadFns-BEO0-PP6.js} +7 -7
  82. package/dist/{threadFns-DwTPnV_1.cjs → threadFns-CAsRIX6c.cjs} +7 -7
  83. package/dist/topology/apiTypes.d.ts +7 -3
  84. package/dist/topology/chamferAngleFns.d.ts +2 -2
  85. package/dist/topology/evolutionFns.d.ts +1 -1
  86. package/dist/topology/modifierFns.d.ts +11 -4
  87. package/dist/topology.cjs +9 -9
  88. package/dist/topology.js +9 -9
  89. package/dist/{topologyQueryFns-95FptXtu.cjs → topologyQueryFns-BNDmjz7x.cjs} +1 -1
  90. package/dist/{topologyQueryFns-C3-_9dFM.js → topologyQueryFns-BYqsNs6q.js} +1 -1
  91. package/dist/{validityTypes-C6qOP241.js → validityTypes-BYhzdgTM.js} +1 -1
  92. package/dist/{validityTypes--tgDeAF8.cjs → validityTypes-Gd5B_HcL.cjs} +1 -1
  93. package/package.json +2 -2
@@ -1,22 +1,22 @@
1
- import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-C7hqbMwl.js";
1
+ import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-hLHmANUz.js";
2
2
  import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
3
3
  import { P as unwrap, s as safeIndex } from "./errors-BTccWbtE.js";
4
- import { s as getEdges } from "./topologyQueryFns-C3-_9dFM.js";
4
+ import { s as getEdges } from "./topologyQueryFns-BYqsNs6q.js";
5
5
  import { t as DEG2RAD } from "./constants-iraOnb2p.js";
6
6
  import { r as toVec3 } from "./types-CKXsIm9-.js";
7
7
  import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-S-m9H_fe.js";
8
8
  import { a as planeToWorld, o as resolvePlane } from "./planeOps-D3yDuMux.js";
9
- import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-WtnWpVQl.js";
10
- import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-b_C6tBeU.js";
9
+ import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-BzHfvPea.js";
10
+ import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns--TqXOi8f.js";
11
11
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
12
- import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-Cn7GIsyR.js";
13
- import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-RA8ti2Xp.js";
14
- import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-C5I0ZqYC.js";
15
- import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } from "./blueprint-DH0H9OWv.js";
16
- import { t as cornerFinder } from "./cornerFinder-CIryesVI.js";
17
- import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CCKUmway.js";
18
- import { _ as wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } from "./textBlueprints-B7gDC-aP.js";
19
- import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-CtpBKmwD.js";
12
+ import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-BYwkPzfM.js";
13
+ import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-DG_2zJg7.js";
14
+ import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-CHUowMmV.js";
15
+ import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } from "./blueprint-CDmOJybf.js";
16
+ import { t as cornerFinder } from "./cornerFinder-C8VCstc3.js";
17
+ import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-DqCcYA2X.js";
18
+ import { _ as wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } from "./textBlueprints-B4w-_4_D.js";
19
+ import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-BIIpsfds.js";
20
20
  // src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CIw6-GFy.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-95FptXtu.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-BNDmjz7x.cjs");
4
4
  const require_types = require("./types-CjF9Rofr.cjs");
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,6 +1,6 @@
1
- import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-C7hqbMwl.js";
1
+ import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-hLHmANUz.js";
2
2
  import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-BTccWbtE.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-C3-_9dFM.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-BYqsNs6q.js";
4
4
  import { r as toVec3 } from "./types-CKXsIm9-.js";
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,13 +1,13 @@
1
- const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CIw6-GFy.cjs");
2
2
  const require_occtWasmAdapter = require("./occtWasmAdapter-4YnvqZOW.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-95FptXtu.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-BNDmjz7x.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
- const require_faceFns = require("./faceFns-DzNcnzS5.cjs");
7
- const require_booleanFns = require("./booleanFns-zRlNDHQY.cjs");
8
- const require_shapeFns = require("./shapeFns-Bgql2_E6.cjs");
6
+ const require_faceFns = require("./faceFns-BeSpw0Dz.cjs");
7
+ const require_booleanFns = require("./booleanFns-CA9tvtqr.cjs");
8
+ const require_shapeFns = require("./shapeFns-BEwoFgq2.cjs");
9
9
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
10
- const require_adjacencyFns = require("./adjacencyFns-BA9xrrmS.cjs");
10
+ const require_adjacencyFns = require("./adjacencyFns-BBugwmvl.cjs");
11
11
  // src/topology/threeHelpers.ts
12
12
  /**
13
13
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -368,6 +368,7 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
368
368
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().filletWithHistory(shape.wrapped, edgeShapes, kernelRadius, inputFaceHashes, require_constants.HASH_CODE_MAX);
369
369
  return finalizeShape3D(evolution, resultShape, [shape], require_errors.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape");
370
370
  } catch (e) {
371
+ if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return require_errors.err(filletUnsupportedError(e));
371
372
  return require_errors.err(edgeTreatmentError("fillet", e, filteredEdges, {
372
373
  edgeCount: selectedCount,
373
374
  radius
@@ -375,6 +376,19 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
375
376
  }
376
377
  }
377
378
  /**
379
+ * `UNSUPPORTED_CAPABILITY` for a fillet the kernel cannot build as asked (a
380
+ * radius that varies along an edge on brepkit), from its
381
+ * `UnsupportedKernelOperationError`.
382
+ */
383
+ function filletUnsupportedError(e) {
384
+ const kernelId = require_shapeTypes.getKernel().kernelId;
385
+ const raw = e instanceof Error ? e.message : String(e);
386
+ return require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `fillet: the ${kernelId} kernel cannot build this fillet (${raw})`, e, {
387
+ kernel: kernelId,
388
+ operation: "fillet"
389
+ }, "Use one constant radius per edge, or use the occt-wasm kernel");
390
+ }
391
+ /**
378
392
  * `FILLET_FAILED` / `CHAMFER_FAILED`, with `metadata.failedEdges` set to the
379
393
  * edges the kernel named when it could not build them (occt-wasm 5.8+).
380
394
  */
@@ -406,7 +420,7 @@ function chamferUnsupportedError(e) {
406
420
  * @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
407
421
  * @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
408
422
  * @returns Err `UNSUPPORTED_CAPABILITY` when the kernel cannot build the
409
- * distances asked for (brepkit has no asymmetric chamfer).
423
+ * distances asked for.
410
424
  */
411
425
  function chamfer(shape, edges, distance) {
412
426
  const check = validateNotNull$1(shape, "chamfer: shape");
@@ -582,9 +596,10 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
582
596
  * The radius varies along the edge according to the provided spec points.
583
597
  * Each point specifies a normalized parameter (0 = start, 1 = end) and radius.
584
598
  *
585
- * **Cross-kernel note:** brepkit supports arbitrary multi-point radius profiles.
586
- * occt-wasm supports a linear (start/end, <=2-point) profile and returns
587
- * UNSUPPORTED for multi-point; the opencascade.js kernel does not implement it.
599
+ * **Cross-kernel note:** occt-wasm supports a linear (start/end, <=2-point)
600
+ * profile; brepkit supports only a constant radius. Either returns
601
+ * `UNSUPPORTED_CAPABILITY` for a profile it cannot build. The opencascade.js
602
+ * kernel does not implement it.
588
603
  */
589
604
  function variableFillet(shape, edge, radii) {
590
605
  if (radii.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "radii must contain at least one radius spec"));
@@ -610,6 +625,7 @@ function variableFillet(shape, edge, radii) {
610
625
  }
611
626
  return require_errors.ok(wrapped);
612
627
  } catch (e) {
628
+ if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return require_errors.err(filletUnsupportedError(e));
613
629
  return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "Variable-radius fillet failed", e));
614
630
  }
615
631
  }
@@ -803,7 +819,7 @@ function castChamferResult(input, { raw, evolution }) {
803
819
  * @param distance - Chamfer distance along the face (must be positive).
804
820
  * @param angleDeg - Chamfer angle in degrees (must be in range (0, 90)).
805
821
  * @returns Ok with the chamfered shape, or Err on invalid input or kernel
806
- * failure. A kernel without a distance-angle chamfer (brepkit) returns
822
+ * failure. A kernel without a distance-angle chamfer returns
807
823
  * `UNSUPPORTED_CAPABILITY`.
808
824
  *
809
825
  * @remarks Uses `BRepFilletAPI_MakeChamfer.AddDA(dist, angle, edge, face)` internally.
@@ -842,7 +858,7 @@ function entryWithStrayFace(shape, entries) {
842
858
  * Chamfer each edge by its own distance and angle, in one operation.
843
859
  *
844
860
  * Edges that all share one distance and angle, with no reference face given,
845
- * go through {@link chamferDistAngle}, which every kernel but brepkit provides.
861
+ * go through {@link chamferDistAngle}, which every kernel provides.
846
862
  * Different values, or any `face`, need a kernel with a per-edge distance-angle
847
863
  * chamfer (occt-wasm 5.9.0 or later); on any other kernel the result is an
848
864
  * `UNSUPPORTED_CAPABILITY` error. On occt-wasm the edges of one
@@ -1263,6 +1279,7 @@ function filletWithEvolution(shape, edges, radius) {
1263
1279
  evolution
1264
1280
  });
1265
1281
  } catch (e) {
1282
+ if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) return require_errors.err(filletUnsupportedError(e));
1266
1283
  const raw = e instanceof Error ? e.message : String(e);
1267
1284
  return require_errors.err(require_errors.kernelError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
1268
1285
  operation: "fillet",
@@ -1279,7 +1296,7 @@ function filletWithEvolution(shape, edges, radius) {
1279
1296
  * @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
1280
1297
  * @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
1281
1298
  * @returns Err `UNSUPPORTED_CAPABILITY` when the kernel cannot build the
1282
- * distances asked for (brepkit has no asymmetric chamfer).
1299
+ * distances asked for.
1283
1300
  */
1284
1301
  function chamferWithEvolution(shape, edges, distance) {
1285
1302
  const check = validateNotNull(shape, "chamferWithEvolution: shape");
@@ -1,13 +1,13 @@
1
- import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-C7hqbMwl.js";
1
+ import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-hLHmANUz.js";
2
2
  import { j as isUnsupportedKernelOperationError, n as faultyEdgeIndexesOf } from "./occtWasmAdapter-CGsnjMOe.js";
3
3
  import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, u as unsupportedError, x as isOk } from "./errors-BTccWbtE.js";
4
- import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-C3-_9dFM.js";
4
+ import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-BYqsNs6q.js";
5
5
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
6
- import { y as downcast } from "./faceFns-WtnWpVQl.js";
7
- import { a as fuse, f as collectInputFaceHashes, h as propagateMetadataByHash, i as cutAll, m as propagateAllMetadata, n as copyAsBooleanResult, o as fuseAll, r as cut } from "./booleanFns-CyxmW1pL.js";
8
- import { a as isSameShape } from "./shapeFns-CSWOXGx9.js";
6
+ import { y as downcast } from "./faceFns-BzHfvPea.js";
7
+ import { a as fuse, f as collectInputFaceHashes, h as propagateMetadataByHash, i as cutAll, m as propagateAllMetadata, n as copyAsBooleanResult, o as fuseAll, r as cut } from "./booleanFns-CopMFBLS.js";
8
+ import { a as isSameShape } from "./shapeFns-Bepwarf3.js";
9
9
  import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
10
- import { i as facesOfEdge } from "./adjacencyFns-C4Tui11_.js";
10
+ import { i as facesOfEdge } from "./adjacencyFns-V29Gvfs9.js";
11
11
  // src/topology/threeHelpers.ts
12
12
  /**
13
13
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -368,6 +368,7 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
368
368
  const { shape: resultShape, evolution } = getKernel().filletWithHistory(shape.wrapped, edgeShapes, kernelRadius, inputFaceHashes, HASH_CODE_MAX);
369
369
  return finalizeShape3D(evolution, resultShape, [shape], BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape");
370
370
  } catch (e) {
371
+ if (isUnsupportedKernelOperationError(e)) return err(filletUnsupportedError(e));
371
372
  return err(edgeTreatmentError("fillet", e, filteredEdges, {
372
373
  edgeCount: selectedCount,
373
374
  radius
@@ -375,6 +376,19 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
375
376
  }
376
377
  }
377
378
  /**
379
+ * `UNSUPPORTED_CAPABILITY` for a fillet the kernel cannot build as asked (a
380
+ * radius that varies along an edge on brepkit), from its
381
+ * `UnsupportedKernelOperationError`.
382
+ */
383
+ function filletUnsupportedError(e) {
384
+ const kernelId = getKernel().kernelId;
385
+ const raw = e instanceof Error ? e.message : String(e);
386
+ return unsupportedError(BrepErrorCode.UNSUPPORTED_CAPABILITY, `fillet: the ${kernelId} kernel cannot build this fillet (${raw})`, e, {
387
+ kernel: kernelId,
388
+ operation: "fillet"
389
+ }, "Use one constant radius per edge, or use the occt-wasm kernel");
390
+ }
391
+ /**
378
392
  * `FILLET_FAILED` / `CHAMFER_FAILED`, with `metadata.failedEdges` set to the
379
393
  * edges the kernel named when it could not build them (occt-wasm 5.8+).
380
394
  */
@@ -406,7 +420,7 @@ function chamferUnsupportedError(e) {
406
420
  * @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
407
421
  * @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
408
422
  * @returns Err `UNSUPPORTED_CAPABILITY` when the kernel cannot build the
409
- * distances asked for (brepkit has no asymmetric chamfer).
423
+ * distances asked for.
410
424
  */
411
425
  function chamfer(shape, edges, distance) {
412
426
  const check = validateNotNull$1(shape, "chamfer: shape");
@@ -582,9 +596,10 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
582
596
  * The radius varies along the edge according to the provided spec points.
583
597
  * Each point specifies a normalized parameter (0 = start, 1 = end) and radius.
584
598
  *
585
- * **Cross-kernel note:** brepkit supports arbitrary multi-point radius profiles.
586
- * occt-wasm supports a linear (start/end, <=2-point) profile and returns
587
- * UNSUPPORTED for multi-point; the opencascade.js kernel does not implement it.
599
+ * **Cross-kernel note:** occt-wasm supports a linear (start/end, <=2-point)
600
+ * profile; brepkit supports only a constant radius. Either returns
601
+ * `UNSUPPORTED_CAPABILITY` for a profile it cannot build. The opencascade.js
602
+ * kernel does not implement it.
588
603
  */
589
604
  function variableFillet(shape, edge, radii) {
590
605
  if (radii.length === 0) return err(validationError(BrepErrorCode.VARIABLE_FILLET_FAILED, "radii must contain at least one radius spec"));
@@ -610,6 +625,7 @@ function variableFillet(shape, edge, radii) {
610
625
  }
611
626
  return ok(wrapped);
612
627
  } catch (e) {
628
+ if (isUnsupportedKernelOperationError(e)) return err(filletUnsupportedError(e));
613
629
  return err(kernelError(BrepErrorCode.VARIABLE_FILLET_FAILED, "Variable-radius fillet failed", e));
614
630
  }
615
631
  }
@@ -803,7 +819,7 @@ function castChamferResult(input, { raw, evolution }) {
803
819
  * @param distance - Chamfer distance along the face (must be positive).
804
820
  * @param angleDeg - Chamfer angle in degrees (must be in range (0, 90)).
805
821
  * @returns Ok with the chamfered shape, or Err on invalid input or kernel
806
- * failure. A kernel without a distance-angle chamfer (brepkit) returns
822
+ * failure. A kernel without a distance-angle chamfer returns
807
823
  * `UNSUPPORTED_CAPABILITY`.
808
824
  *
809
825
  * @remarks Uses `BRepFilletAPI_MakeChamfer.AddDA(dist, angle, edge, face)` internally.
@@ -842,7 +858,7 @@ function entryWithStrayFace(shape, entries) {
842
858
  * Chamfer each edge by its own distance and angle, in one operation.
843
859
  *
844
860
  * Edges that all share one distance and angle, with no reference face given,
845
- * go through {@link chamferDistAngle}, which every kernel but brepkit provides.
861
+ * go through {@link chamferDistAngle}, which every kernel provides.
846
862
  * Different values, or any `face`, need a kernel with a per-edge distance-angle
847
863
  * chamfer (occt-wasm 5.9.0 or later); on any other kernel the result is an
848
864
  * `UNSUPPORTED_CAPABILITY` error. On occt-wasm the edges of one
@@ -1263,6 +1279,7 @@ function filletWithEvolution(shape, edges, radius) {
1263
1279
  evolution
1264
1280
  });
1265
1281
  } catch (e) {
1282
+ if (isUnsupportedKernelOperationError(e)) return err(filletUnsupportedError(e));
1266
1283
  const raw = e instanceof Error ? e.message : String(e);
1267
1284
  return err(kernelError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
1268
1285
  operation: "fillet",
@@ -1279,7 +1296,7 @@ function filletWithEvolution(shape, edges, radius) {
1279
1296
  * @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
1280
1297
  * @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
1281
1298
  * @returns Err `UNSUPPORTED_CAPABILITY` when the kernel cannot build the
1282
- * distances asked for (brepkit has no asymmetric chamfer).
1299
+ * distances asked for.
1283
1300
  */
1284
1301
  function chamferWithEvolution(shape, edges, distance) {
1285
1302
  const check = validateNotNull(shape, "chamferWithEvolution: shape");
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CIw6-GFy.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-95FptXtu.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-BNDmjz7x.cjs");
4
4
  const require_constants = require("./constants-oee0S_x6.cjs");
5
5
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
6
- const require_faceFns = require("./faceFns-DzNcnzS5.cjs");
7
- const require_shapeFns = require("./shapeFns-Bgql2_E6.cjs");
8
- const require_curveFns = require("./curveFns-0vAErrs9.cjs");
9
- const require_measureFns = require("./measureFns-C8UjdHpB.cjs");
6
+ const require_faceFns = require("./faceFns-BeSpw0Dz.cjs");
7
+ const require_shapeFns = require("./shapeFns-BEwoFgq2.cjs");
8
+ const require_curveFns = require("./curveFns-B29Eot3K.cjs");
9
+ const require_measureFns = require("./measureFns-BlS2xJcn.cjs");
10
10
  // src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,12 +1,12 @@
1
- import { q as getKernel, y as isFace } from "./shapeTypes-C7hqbMwl.js";
1
+ import { q as getKernel, y as isFace } from "./shapeTypes-hLHmANUz.js";
2
2
  import { E as ok, g as err, o as queryError, x as isOk } from "./errors-BTccWbtE.js";
3
- import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-C3-_9dFM.js";
3
+ import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-BYqsNs6q.js";
4
4
  import { t as DEG2RAD } from "./constants-iraOnb2p.js";
5
5
  import { a as vecDot, d as vecNormalize } from "./vecOps-S-m9H_fe.js";
6
- import { l as normalAt, s as getSurfaceType } from "./faceFns-WtnWpVQl.js";
7
- import { a as isSameShape, n as getHashCode } from "./shapeFns-CSWOXGx9.js";
8
- import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-b_C6tBeU.js";
9
- import { n as measureArea } from "./measureFns-B0PhQ5dY.js";
6
+ import { l as normalAt, s as getSurfaceType } from "./faceFns-BzHfvPea.js";
7
+ import { a as isSameShape, n as getHashCode } from "./shapeFns-Bepwarf3.js";
8
+ import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns--TqXOi8f.js";
9
+ import { r as measureArea } from "./measureFns-CLsSuByu.js";
10
10
  // src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,12 +1,12 @@
1
- import { C as isSolid, G as _usingCtx, S as isShell, _ as isCompound, n as castResultShape, q as getKernel } from "./shapeTypes-C7hqbMwl.js";
1
+ import { C as isSolid, G as _usingCtx, S as isShell, _ as isCompound, n as castResultShape, q as getKernel } from "./shapeTypes-hLHmANUz.js";
2
2
  import { i as wasmIndex, r as vec3At$1 } from "./bug-ClMTAJhe.js";
3
3
  import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
4
- import { S as subShapeCount, c as getFaces, u as getShells } from "./topologyQueryFns-C3-_9dFM.js";
4
+ import { S as subShapeCount, c as getFaces, u as getShells } from "./topologyQueryFns-BYqsNs6q.js";
5
5
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
6
- import { t as makeCompound } from "./solidBuilders-B01dFnd7.js";
7
- import { u as igesUnsupportedError } from "./meshFns-BazHDlpY.js";
6
+ import { t as makeCompound } from "./solidBuilders-IA8xNuxJ.js";
7
+ import { u as igesUnsupportedError } from "./meshFns-CzpP9SBf.js";
8
8
  import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
9
- import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-DH0H9OWv.js";
9
+ import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-CDmOJybf.js";
10
10
  // src/io/objExportFns.ts
11
11
  /** Read a vec3 from a typed array at the given vertex index. */
12
12
  function vec3At(arr, i) {
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CIw6-GFy.cjs");
2
2
  const require_bug = require("./bug-CBcpIPuf.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-95FptXtu.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-BNDmjz7x.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
- const require_solidBuilders = require("./solidBuilders-CWw3yasa.cjs");
7
- const require_meshFns = require("./meshFns-BnkXZ0Xm.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-BVHK-era.cjs");
7
+ const require_meshFns = require("./meshFns-ECQqx-8Q.cjs");
8
8
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
9
- const require_blueprint = require("./blueprint-D193PMxX.cjs");
9
+ const require_blueprint = require("./blueprint-BO8zuqoy.cjs");
10
10
  // src/io/objExportFns.ts
11
11
  /** Read a vec3 from a typed array at the given vertex index. */
12
12
  function vec3At(arr, i) {
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-BnkXZ0Xm.cjs");
3
- const require_importFns = require("./importFns-Ceb2VgcK.cjs");
2
+ const require_meshFns = require("./meshFns-ECQqx-8Q.cjs");
3
+ const require_importFns = require("./importFns-BX0866c6.cjs");
4
4
  exports.blueprintToDXF = require_importFns.blueprintToDXF;
5
5
  exports.exportDXF = require_importFns.exportDXF;
6
6
  exports.exportGlb = require_importFns.exportGlb;
package/dist/io.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-BazHDlpY.js";
2
- import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-sxpO2z86.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-CzpP9SBf.js";
2
+ import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-BLaneR8r.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
@@ -118,9 +118,7 @@ export interface BrepkitKernel {
118
118
  filletV2(solid: number, edgeHandles: Uint32Array | number[], radius: number): number;
119
119
  filletVariable(solid: number, json: string): number;
120
120
  chamfer(solid: number, edgeHandles: Uint32Array | number[], distance: number): number;
121
- /** @unwired */
122
121
  chamferV2(solid: number, edgeHandles: Uint32Array | number[], d1: number, d2: number): number;
123
- /** @unwired */
124
122
  chamferDistanceAngle(solid: number, edgeHandles: Uint32Array | number[], distance: number, angle: number): number;
125
123
  shell(solid: number, thickness: number, openFaces: Uint32Array | number[]): number;
126
124
  /** @unwired */
@@ -340,8 +338,6 @@ export interface BrepkitKernel {
340
338
  toBrepJson(solid: number): string;
341
339
  transformFace(face: number, matrix: Float64Array | number[]): void;
342
340
  /** @future Not in brepkit-wasm 3.0.0. Referenced with feature detection in adapter. */
343
- chamferAsymmetric?(solid: number, edgeHandles: Uint32Array | number[], d1: number, d2: number): number;
344
- /** @future Not in brepkit-wasm 3.0.0. Referenced with feature detection in adapter. */
345
341
  copyEdge?(edge: number): number;
346
342
  /** @future Not in brepkit-wasm 3.0.0. Referenced with feature detection in adapter. */
347
343
  transformEdge?(edge: number, matrix: Float64Array | number[]): void;
@@ -53,6 +53,20 @@ export declare function unwrapSolidOrThrow(shape: KernelShape, methodName: strin
53
53
  export declare function unwrapSolidsForExport(bk: BrepkitKernel, shape: KernelShape, methodName: string): number[];
54
54
  /** Euclidean distance between two 3D points. */
55
55
  export declare function dist3(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): number;
56
+ type Point = [number, number, number];
57
+ /**
58
+ * The curve parameters an edge spans. brepkit reports a circle or ellipse edge's
59
+ * domain as the whole [0, 2π] even for an arc; the arc runs counterclockwise
60
+ * about the curve's axis from the angle of its start vertex to that of its end
61
+ * vertex (brepkit's own `circle_param_range`), angles read off the curve's frame.
62
+ */
63
+ export declare function edgeParamRange(bk: BrepkitKernel, edgeId: number): [number, number];
64
+ /**
65
+ * Points whose bounding box is the edge's: its ends, plus for a circle or
66
+ * ellipse the points where each coordinate peaks within the arc (exact), and
67
+ * for any other curve samples along its parameter range.
68
+ */
69
+ export declare function edgeBoxPoints(bk: BrepkitKernel, edgeId: number): Point[];
56
70
  /** Copy a WASM-backed Uint8Array into an independent ArrayBuffer. */
57
71
  export declare function copyWasmBytes(bytes: Uint8Array): ArrayBuffer;
58
72
  /** Build a row-major 4x4 translation matrix. */
@@ -95,3 +109,4 @@ export declare function bb2d(h: BBox2dHandle): BkBBox2d;
95
109
  * callback would produce distinct angles per face.
96
110
  */
97
111
  export declare function resolveUniformAngle(faces: KernelShape[], angleDeg: number | ((face: KernelShape) => number)): number;
112
+ export {};
@@ -10,6 +10,13 @@ export declare function boundingBox(bk: BrepkitKernel, shape: KernelShape): {
10
10
  min: [number, number, number];
11
11
  max: [number, number, number];
12
12
  };
13
+ /**
14
+ * Minimum distance between two shapes. brepkit-wasm measures from a point to a
15
+ * solid, face or edge, and between two solids; a wire, shell or compound is
16
+ * measured through its edges, faces or children, taking the closest pair. Any
17
+ * other pairing (face to face, edge to edge, face to solid, ...) has no exact
18
+ * brepkit measure and throws {@link UnsupportedKernelOperationError}.
19
+ */
13
20
  export declare function distance(bk: BrepkitKernel, shape1: KernelShape, shape2: KernelShape): DistanceResult;
14
21
  export declare function surfaceCurvature(bk: BrepkitKernel, face: KernelShape, u: number, v: number): {
15
22
  gaussian: number;
@@ -1,12 +1,22 @@
1
1
  import { BrepkitKernel } from './brepkitWasmTypes.js';
2
2
  import { KernelShape } from '../types.js';
3
3
  export declare function fillet(bk: BrepkitKernel, shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
4
+ /**
5
+ * A variable fillet spec on one edge: `{ edge: hashCode, radii: [{ param, radius }] }`
6
+ * from variableFillet, or `{ edgeId, startRadius, endRadius }`. A constant radius is
7
+ * an ordinary fillet; a radius that varies is unsupported (see
8
+ * {@link varyingFilletUnsupported}).
9
+ */
10
+ export declare function filletVariable(bk: BrepkitKernel, shape: KernelShape, spec: string): KernelShape;
4
11
  export declare function chamfer(bk: BrepkitKernel, shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
12
+ /**
13
+ * brepkit sets `distance` back on the edge's first face in its own face order
14
+ * and the other face back by distance·tan(angle).
15
+ */
5
16
  export declare function chamferDistAngle(bk: BrepkitKernel, shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
6
17
  export declare function shell(bk: BrepkitKernel, shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
7
18
  export declare function thicken(bk: BrepkitKernel, shape: KernelShape, thickness: number): KernelShape;
8
19
  export declare function offset(bk: BrepkitKernel, shape: KernelShape, distance: number, tolerance?: number): KernelShape;
9
- export declare function filletVariable(bk: BrepkitKernel, shape: KernelShape, spec: string): KernelShape;
10
20
  export declare function draft(bk: BrepkitKernel, shape: KernelShape, faces: KernelShape[], pullDirection: [number, number, number], neutralPlane: [number, number, number], angleDeg: number): KernelShape;
11
21
  export declare function defeature(bk: BrepkitKernel, shape: KernelShape, faces: KernelShape[]): KernelShape;
12
22
  export declare function offsetWire2D(bk: BrepkitKernel, wire: KernelShape, offsetVal: number, joinType?: number | 'arc' | 'intersection' | 'tangent'): KernelShape;
@@ -1,4 +1,5 @@
1
- const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CIw6-GFy.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-4YnvqZOW.cjs");
2
3
  const require_errors = require("./errors-O_blYTWT.cjs");
3
4
  const require_types = require("./types-CjF9Rofr.cjs");
4
5
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
@@ -81,6 +82,14 @@ function castSweepShellTuple(result) {
81
82
  endWire
82
83
  ]);
83
84
  }
85
+ /** `UNSUPPORTED_CAPABILITY` for a sweep option the kernel cannot build (a twist or a scaling law on brepkit). */
86
+ function sweepUnsupportedError(kernelId, e) {
87
+ const raw = e instanceof Error ? e.message : String(e);
88
+ return require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `sweep: the ${kernelId} kernel cannot build this sweep (${raw})`, e, {
89
+ kernel: kernelId,
90
+ operation: "sweep"
91
+ }, "Drop the twist or scaling law, or use the occt-wasm kernel");
92
+ }
84
93
  function sweep(wire, spine, config = {}, shellMode = false) {
85
94
  if (config.mode === "simple" && !shellMode) {
86
95
  const kernel = require_shapeTypes.getKernel();
@@ -101,21 +110,27 @@ function sweep(wire, spine, config = {}, shellMode = false) {
101
110
  const { frenet = false, auxiliarySpine, law = null, transitionMode = "right", withContact, support, forceProfileSpineOthogonality, tolerance, boundTolerance, angularTolerance, maxDegree, maxSegments } = config;
102
111
  const kernel = require_shapeTypes.getKernel();
103
112
  const withCorrection = transitionMode === "round" ? true : !!forceProfileSpineOthogonality;
104
- const result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
105
- transitionMode,
106
- contact: !!withContact,
107
- correction: withCorrection,
108
- frenet,
109
- shellMode,
110
- ...auxiliarySpine?.wrapped ? { auxiliary: auxiliarySpine.wrapped } : {},
111
- ...law !== null ? { law } : {},
112
- ...support !== null ? { support } : {},
113
- tolerance,
114
- boundTolerance,
115
- angularTolerance,
116
- maxDegree,
117
- maxSegments
118
- });
113
+ let result;
114
+ try {
115
+ result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
116
+ transitionMode,
117
+ contact: !!withContact,
118
+ correction: withCorrection,
119
+ frenet,
120
+ shellMode,
121
+ ...auxiliarySpine?.wrapped ? { auxiliary: auxiliarySpine.wrapped } : {},
122
+ ...law !== null ? { law } : {},
123
+ ...support !== null ? { support } : {},
124
+ tolerance,
125
+ boundTolerance,
126
+ angularTolerance,
127
+ maxDegree,
128
+ maxSegments
129
+ });
130
+ } catch (e) {
131
+ if (!require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) throw e;
132
+ return require_errors.err(sweepUnsupportedError(kernel.kernelId, e));
133
+ }
119
134
  if (shellMode && typeof result === "object" && "firstShape" in result) return castSweepShellTuple(result);
120
135
  const shape = require_shapeTypes.castResultShape(result);
121
136
  if (!require_shapeTypes.isShape3D(shape)) {
@@ -1,5 +1,6 @@
1
- import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-C7hqbMwl.js";
2
- import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
1
+ import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-hLHmANUz.js";
2
+ import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-CGsnjMOe.js";
3
+ import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
3
4
  import { r as toVec3 } from "./types-CKXsIm9-.js";
4
5
  import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
5
6
  // src/operations/extrudeUtils.ts
@@ -81,6 +82,14 @@ function castSweepShellTuple(result) {
81
82
  endWire
82
83
  ]);
83
84
  }
85
+ /** `UNSUPPORTED_CAPABILITY` for a sweep option the kernel cannot build (a twist or a scaling law on brepkit). */
86
+ function sweepUnsupportedError(kernelId, e) {
87
+ const raw = e instanceof Error ? e.message : String(e);
88
+ return unsupportedError(BrepErrorCode.UNSUPPORTED_CAPABILITY, `sweep: the ${kernelId} kernel cannot build this sweep (${raw})`, e, {
89
+ kernel: kernelId,
90
+ operation: "sweep"
91
+ }, "Drop the twist or scaling law, or use the occt-wasm kernel");
92
+ }
84
93
  function sweep(wire, spine, config = {}, shellMode = false) {
85
94
  if (config.mode === "simple" && !shellMode) {
86
95
  const kernel = getKernel();
@@ -101,21 +110,27 @@ function sweep(wire, spine, config = {}, shellMode = false) {
101
110
  const { frenet = false, auxiliarySpine, law = null, transitionMode = "right", withContact, support, forceProfileSpineOthogonality, tolerance, boundTolerance, angularTolerance, maxDegree, maxSegments } = config;
102
111
  const kernel = getKernel();
103
112
  const withCorrection = transitionMode === "round" ? true : !!forceProfileSpineOthogonality;
104
- const result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
105
- transitionMode,
106
- contact: !!withContact,
107
- correction: withCorrection,
108
- frenet,
109
- shellMode,
110
- ...auxiliarySpine?.wrapped ? { auxiliary: auxiliarySpine.wrapped } : {},
111
- ...law !== null ? { law } : {},
112
- ...support !== null ? { support } : {},
113
- tolerance,
114
- boundTolerance,
115
- angularTolerance,
116
- maxDegree,
117
- maxSegments
118
- });
113
+ let result;
114
+ try {
115
+ result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
116
+ transitionMode,
117
+ contact: !!withContact,
118
+ correction: withCorrection,
119
+ frenet,
120
+ shellMode,
121
+ ...auxiliarySpine?.wrapped ? { auxiliary: auxiliarySpine.wrapped } : {},
122
+ ...law !== null ? { law } : {},
123
+ ...support !== null ? { support } : {},
124
+ tolerance,
125
+ boundTolerance,
126
+ angularTolerance,
127
+ maxDegree,
128
+ maxSegments
129
+ });
130
+ } catch (e) {
131
+ if (!isUnsupportedKernelOperationError(e)) throw e;
132
+ return err(sweepUnsupportedError(kernel.kernelId, e));
133
+ }
119
134
  if (shellMode && typeof result === "object" && "firstShape" in result) return castSweepShellTuple(result);
120
135
  const shape = castResultShape(result);
121
136
  if (!isShape3D(shape)) {