brepjs 20.7.0 → 20.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/2d.cjs +7 -7
  2. package/dist/2d.js +7 -7
  3. package/dist/{adjacencyFns-BgJQQjdt.js → adjacencyFns-CRd3d1xM.js} +3 -3
  4. package/dist/{adjacencyFns-_RTYhwtD.cjs → adjacencyFns-qDDFKib0.cjs} +3 -3
  5. package/dist/{blueprint-wq2TU1XP.cjs → blueprint-CgWpKzKK.cjs} +7 -7
  6. package/dist/{blueprint-Bth4EVaO.js → blueprint-Dr-l3Nlb.js} +7 -7
  7. package/dist/{blueprintFns-DQmNe1p6.js → blueprintFns-DU8jUsTf.js} +3 -3
  8. package/dist/{blueprintFns-Dd0gm1rX.cjs → blueprintFns-lhshdjAb.cjs} +3 -3
  9. package/dist/{blueprintSketcher-DNp87aQZ.js → blueprintSketcher-P4oIgADL.js} +4 -4
  10. package/dist/{blueprintSketcher-CSDqr27-.cjs → blueprintSketcher-ZRJzo1tb.cjs} +4 -4
  11. package/dist/{boolean2D-BkgOjMRt.cjs → boolean2D-h4By3wwW.cjs} +5 -5
  12. package/dist/{boolean2D-BAb4SnIL.js → boolean2D-iTKFBIvC.js} +5 -5
  13. package/dist/brepjs.cjs +40 -32
  14. package/dist/brepjs.js +40 -33
  15. package/dist/{cameraFns-CKUN90f_.cjs → cameraFns-CNWY4B7i.cjs} +4 -4
  16. package/dist/{cameraFns-9AGyuZVp.js → cameraFns-Dgx3MCGf.js} +4 -4
  17. package/dist/core/errors.d.ts +3 -0
  18. package/dist/core.cjs +4 -4
  19. package/dist/core.js +4 -4
  20. package/dist/{cornerFinder-Cr_04etw.js → cornerFinder-BqGipV9i.js} +1 -1
  21. package/dist/{cornerFinder-DJWo6h1Z.cjs → cornerFinder-DZORgosi.cjs} +1 -1
  22. package/dist/{curveFns-U7srQ3ZA.cjs → curveFns-C01yujmY.cjs} +2 -2
  23. package/dist/{curveFns-CkA2WJP2.js → curveFns-DqgDK9xJ.js} +2 -2
  24. package/dist/{drawFns-C6bmFijD.js → drawFns-BbDx57EX.js} +14 -14
  25. package/dist/{drawFns-DlCxozRP.cjs → drawFns-mtCQj7Qu.cjs} +14 -14
  26. package/dist/{errors-GVyCnpi0.cjs → errors-B9r_Dzs1.cjs} +3 -0
  27. package/dist/{errors-vxP5FT8B.js → errors-CUsZRWJ7.js} +3 -0
  28. package/dist/{faceFns-BBk6XKJO.js → faceFns-BNGMbh3P.js} +3 -3
  29. package/dist/{faceFns-DSRREV5G.cjs → faceFns-BlYowjvU.cjs} +3 -3
  30. package/dist/{healingFns-C9G3yjOe.cjs → healingFns-DXYEpHAx.cjs} +123 -5
  31. package/dist/{healingFns-CEr0afli.js → healingFns-xPtXVShE.js} +118 -6
  32. package/dist/{helpers-JuPoaP_b.cjs → helpers-Ngw1OFee.cjs} +7 -7
  33. package/dist/{helpers-sDialr0f.js → helpers-vd5KEdfZ.js} +7 -7
  34. package/dist/{importFns-ClqPJCFR.cjs → importFns-BwEwuqM2.cjs} +3 -3
  35. package/dist/{importFns-DSUfSQn2.js → importFns-DQW8EVaa.js} +3 -3
  36. package/dist/index.d.ts +1 -1
  37. package/dist/io.cjs +2 -2
  38. package/dist/io.js +2 -2
  39. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  40. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +16 -0
  41. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  42. package/dist/{loftFns-B8DSoG-F.js → loftFns-Cth0_MXM.js} +2 -2
  43. package/dist/{loftFns-mkJeOaII.cjs → loftFns-DlBiqyB-.cjs} +2 -2
  44. package/dist/{measureFns-PRM3gOjw.js → measureFns-B_DpfIE3.js} +4 -4
  45. package/dist/{measureFns-BvNkzSR6.cjs → measureFns-BnbD7-w7.cjs} +4 -4
  46. package/dist/measurement.cjs +2 -2
  47. package/dist/measurement.js +2 -2
  48. package/dist/{meshFns-CgbT3uuO.js → meshFns-B4L-5mVr.js} +4 -4
  49. package/dist/{meshFns-W7ZTKqiJ.cjs → meshFns-DlGc_nS6.cjs} +4 -4
  50. package/dist/ns/modifiers.d.ts +1 -1
  51. package/dist/{occtWasmAdapter-PzZJHUAd.js → occtWasmAdapter-Bi9GozJ9.js} +20 -0
  52. package/dist/{occtWasmAdapter-BSQeA69d.cjs → occtWasmAdapter-Dd9giakk.cjs} +20 -0
  53. package/dist/operations.cjs +2 -2
  54. package/dist/operations.js +2 -2
  55. package/dist/{originTrackingFns-D8SNCDKj.js → originTrackingFns-BQIWwnFh.js} +2 -2
  56. package/dist/{originTrackingFns-DJDTRJh3.cjs → originTrackingFns-DDOCQdaW.cjs} +2 -2
  57. package/dist/{planeOps-C9d2Y56B.cjs → planeOps-C7sRqzno.cjs} +1 -1
  58. package/dist/{planeOps-Dp0YvuFE.js → planeOps-DgG0vHN7.js} +1 -1
  59. package/dist/{primitiveFns-EtHyTqhw.cjs → primitiveFns-B8ab8U8_.cjs} +5 -5
  60. package/dist/{primitiveFns-W3RYNJcm.js → primitiveFns-ChWAGjel.js} +5 -5
  61. package/dist/{principalBoxFns-Cbtty-2_.js → principalBoxFns-CvAYgpY4.js} +4 -4
  62. package/dist/{principalBoxFns-CmZa7qHi.cjs → principalBoxFns-DXNRJ_A-.cjs} +4 -4
  63. package/dist/projection.cjs +1 -1
  64. package/dist/projection.js +1 -1
  65. package/dist/query.cjs +2 -2
  66. package/dist/query.js +2 -2
  67. package/dist/{refResolveFns-BkciKtNP.js → refResolveFns-Bc5nUmmk.js} +6 -6
  68. package/dist/{refResolveFns-D99Vqe7a.cjs → refResolveFns-C6CYnUNd.cjs} +6 -6
  69. package/dist/result.cjs +1 -1
  70. package/dist/result.js +1 -1
  71. package/dist/{shapeFns-B54CsPyk.cjs → shapeFns-Cn0lAxbU.cjs} +3 -3
  72. package/dist/{shapeFns-DB3l3ULC.js → shapeFns-DLD8qAsI.js} +3 -3
  73. package/dist/shapeRef.cjs +1 -1
  74. package/dist/shapeRef.js +1 -1
  75. package/dist/{shapeTypes-CgbUTASh.js → shapeTypes-D0j6Lk3z.js} +1 -1
  76. package/dist/{shapeTypes-D_anqiRe.cjs → shapeTypes-K0rZK5U-.cjs} +1 -1
  77. package/dist/sketching.cjs +3 -3
  78. package/dist/sketching.js +3 -3
  79. package/dist/{solidBuilders-DE_na4G3.js → solidBuilders-94pT7hv6.js} +7 -7
  80. package/dist/{solidBuilders-CUd-korS.cjs → solidBuilders-DfXGia5F.cjs} +7 -7
  81. package/dist/{surfaceBuilders-wdGNiImD.js → surfaceBuilders-DGEXvSTe.js} +4 -4
  82. package/dist/{surfaceBuilders-DOn2jWkh.cjs → surfaceBuilders-DnZj4fvS.cjs} +4 -4
  83. package/dist/text.cjs +2 -2
  84. package/dist/text.js +2 -2
  85. package/dist/{textBlueprints-BQ60Rc96.cjs → textBlueprints-BUV_vedl.cjs} +9 -9
  86. package/dist/{textBlueprints-B_jwMuej.js → textBlueprints-D4Yez18p.js} +9 -9
  87. package/dist/{textMetrics-Bm0a4kh7.cjs → textMetrics-BwFqDdvR.cjs} +2 -2
  88. package/dist/{textMetrics-Dj3yfZNQ.js → textMetrics-C1iq-fwi.js} +2 -2
  89. package/dist/{threadFns-DlL5VnMf.js → threadFns-DHL3t8zV.js} +8 -8
  90. package/dist/{threadFns-BuRPVenB.cjs → threadFns-DS6WgBI2.cjs} +8 -8
  91. package/dist/topology/api.d.ts +2 -0
  92. package/dist/topology/modifierFns.d.ts +14 -0
  93. package/dist/topology/wrapperFns.d.ts +1 -0
  94. package/dist/topology.cjs +9 -9
  95. package/dist/topology.js +9 -9
  96. package/dist/{topologyQueryFns-ENxs8uu2.cjs → topologyQueryFns-BPJZTpIz.cjs} +2 -2
  97. package/dist/{topologyQueryFns-6M_dbT1R.js → topologyQueryFns-DtzwRKVP.js} +2 -2
  98. package/dist/{validityTypes-BTuI0vcR.js → validityTypes-CqFq8m-i.js} +2 -2
  99. package/dist/{validityTypes-BPamqRZ8.cjs → validityTypes-DfqnKBzz.cjs} +2 -2
  100. package/dist/vectors.cjs +1 -1
  101. package/dist/vectors.js +1 -1
  102. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  const require_constants = require("./constants-oee0S_x6.cjs");
2
2
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
3
- const require_helpers = require("./helpers-JuPoaP_b.cjs");
3
+ const require_helpers = require("./helpers-Ngw1OFee.cjs");
4
4
  // src/query/cornerFinder.ts
5
5
  var PI_2 = 2 * Math.PI;
6
6
  function positiveHalfAngle(angle) {
@@ -1,5 +1,5 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
2
- const require_errors = require("./errors-GVyCnpi0.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
3
3
  // src/topology/curveFns.ts
4
4
  /**
5
5
  * Curve and 1D shape functions — functional replacements for _1DShape/Curve methods.
@@ -1,5 +1,5 @@
1
- import { T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, v as isEdge } from "./shapeTypes-CgbUTASh.js";
2
- import { E as ok, g as err, l as typeCastError } from "./errors-vxP5FT8B.js";
1
+ import { T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, v as isEdge } from "./shapeTypes-D0j6Lk3z.js";
2
+ import { E as ok, g as err, l as typeCastError } from "./errors-CUsZRWJ7.js";
3
3
  // src/topology/curveFns.ts
4
4
  /**
5
5
  * Curve and 1D shape functions — functional replacements for _1DShape/Curve methods.
@@ -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-CgbUTASh.js";
1
+ import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-D0j6Lk3z.js";
2
2
  import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
3
- import { P as unwrap, s as safeIndex } from "./errors-vxP5FT8B.js";
4
- import { s as getEdges } from "./topologyQueryFns-6M_dbT1R.js";
3
+ import { P as unwrap, s as safeIndex } from "./errors-CUsZRWJ7.js";
4
+ import { s as getEdges } from "./topologyQueryFns-DtzwRKVP.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
- import { a as planeToWorld, o as resolvePlane } from "./planeOps-Dp0YvuFE.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-BBk6XKJO.js";
10
- import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-CkA2WJP2.js";
8
+ import { a as planeToWorld, o as resolvePlane } from "./planeOps-DgG0vHN7.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-BNGMbh3P.js";
10
+ import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-DqgDK9xJ.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-wdGNiImD.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-DNp87aQZ.js";
14
- import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-sDialr0f.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-Bth4EVaO.js";
16
- import { t as cornerFinder } from "./cornerFinder-Cr_04etw.js";
17
- import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BAb4SnIL.js";
18
- import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-B_jwMuej.js";
19
- import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-9AGyuZVp.js";
12
+ import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-DGEXvSTe.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-P4oIgADL.js";
14
+ import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-vd5KEdfZ.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-Dr-l3Nlb.js";
16
+ import { t as cornerFinder } from "./cornerFinder-BqGipV9i.js";
17
+ import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-iTKFBIvC.js";
18
+ import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-D4Yez18p.js";
19
+ import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-Dgx3MCGf.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,22 +1,22 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
2
  const require_bug = require("./bug-CBcpIPuf.cjs");
3
- const require_errors = require("./errors-GVyCnpi0.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
3
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-BPJZTpIz.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
6
  const require_types = require("./types-CjF9Rofr.cjs");
7
7
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
8
- const require_planeOps = require("./planeOps-C9d2Y56B.cjs");
9
- const require_faceFns = require("./faceFns-DSRREV5G.cjs");
10
- const require_curveFns = require("./curveFns-U7srQ3ZA.cjs");
8
+ const require_planeOps = require("./planeOps-C7sRqzno.cjs");
9
+ const require_faceFns = require("./faceFns-BlYowjvU.cjs");
10
+ const require_curveFns = require("./curveFns-C01yujmY.cjs");
11
11
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
12
- const require_surfaceBuilders = require("./surfaceBuilders-DOn2jWkh.cjs");
13
- const require_blueprintSketcher = require("./blueprintSketcher-CSDqr27-.cjs");
14
- const require_helpers = require("./helpers-JuPoaP_b.cjs");
15
- const require_blueprint = require("./blueprint-wq2TU1XP.cjs");
16
- const require_cornerFinder = require("./cornerFinder-DJWo6h1Z.cjs");
17
- const require_boolean2D = require("./boolean2D-BkgOjMRt.cjs");
18
- const require_textBlueprints = require("./textBlueprints-BQ60Rc96.cjs");
19
- const require_cameraFns = require("./cameraFns-CKUN90f_.cjs");
12
+ const require_surfaceBuilders = require("./surfaceBuilders-DnZj4fvS.cjs");
13
+ const require_blueprintSketcher = require("./blueprintSketcher-ZRJzo1tb.cjs");
14
+ const require_helpers = require("./helpers-Ngw1OFee.cjs");
15
+ const require_blueprint = require("./blueprint-CgWpKzKK.cjs");
16
+ const require_cornerFinder = require("./cornerFinder-DZORgosi.cjs");
17
+ const require_boolean2D = require("./boolean2D-h4By3wwW.cjs");
18
+ const require_textBlueprints = require("./textBlueprints-BUV_vedl.cjs");
19
+ const require_cameraFns = require("./cameraFns-CNWY4B7i.cjs");
20
20
  // src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -211,6 +211,7 @@ var BrepErrorCode = {
211
211
  ZERO_OFFSET: "ZERO_OFFSET",
212
212
  NO_EDGES: "NO_EDGES",
213
213
  NO_FACES: "NO_FACES",
214
+ FACE_NOT_IN_SHAPE: "FACE_NOT_IN_SHAPE",
214
215
  DRAFT_NO_FACES: "DRAFT_NO_FACES",
215
216
  DRAFT_INVALID_ANGLE: "DRAFT_INVALID_ANGLE",
216
217
  DRAFT_NOT_3D: "DRAFT_NOT_3D",
@@ -236,6 +237,8 @@ var BrepErrorCode = {
236
237
  SHELL_INVALID_RESULT: "SHELL_INVALID_RESULT",
237
238
  OFFSET_NOT_3D: "OFFSET_NOT_3D",
238
239
  OFFSET_INVALID_RESULT: "OFFSET_INVALID_RESULT",
240
+ REMOVE_FACES_FAILED: "REMOVE_FACES_FAILED",
241
+ REMOVE_FACES_INCOMPLETE: "REMOVE_FACES_INCOMPLETE",
239
242
  NULL_SHAPE: "NULL_SHAPE",
240
243
  NO_WRAPPER: "NO_WRAPPER",
241
244
  WELD_NOT_SHELL: "WELD_NOT_SHELL",
@@ -211,6 +211,7 @@ var BrepErrorCode = {
211
211
  ZERO_OFFSET: "ZERO_OFFSET",
212
212
  NO_EDGES: "NO_EDGES",
213
213
  NO_FACES: "NO_FACES",
214
+ FACE_NOT_IN_SHAPE: "FACE_NOT_IN_SHAPE",
214
215
  DRAFT_NO_FACES: "DRAFT_NO_FACES",
215
216
  DRAFT_INVALID_ANGLE: "DRAFT_INVALID_ANGLE",
216
217
  DRAFT_NOT_3D: "DRAFT_NOT_3D",
@@ -236,6 +237,8 @@ var BrepErrorCode = {
236
237
  SHELL_INVALID_RESULT: "SHELL_INVALID_RESULT",
237
238
  OFFSET_NOT_3D: "OFFSET_NOT_3D",
238
239
  OFFSET_INVALID_RESULT: "OFFSET_INVALID_RESULT",
240
+ REMOVE_FACES_FAILED: "REMOVE_FACES_FAILED",
241
+ REMOVE_FACES_INCOMPLETE: "REMOVE_FACES_INCOMPLETE",
239
242
  NULL_SHAPE: "NULL_SHAPE",
240
243
  NO_WRAPPER: "NO_WRAPPER",
241
244
  WELD_NOT_SHELL: "WELD_NOT_SHELL",
@@ -1,6 +1,6 @@
1
- import { i as castShape, q as getKernel } from "./shapeTypes-CgbUTASh.js";
2
- import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-vxP5FT8B.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-6M_dbT1R.js";
1
+ import { i as castShape, q as getKernel } from "./shapeTypes-D0j6Lk3z.js";
2
+ import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-CUsZRWJ7.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-DtzwRKVP.js";
4
4
  import { r as toVec3 } from "./types-CKXsIm9-.js";
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
2
- const require_errors = require("./errors-GVyCnpi0.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-BPJZTpIz.cjs");
4
4
  const require_types = require("./types-CjF9Rofr.cjs");
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,9 +1,10 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
2
- const require_errors = require("./errors-GVyCnpi0.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-Dd9giakk.cjs");
3
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-BPJZTpIz.cjs");
4
5
  const require_constants = require("./constants-oee0S_x6.cjs");
5
- const require_faceFns = require("./faceFns-DSRREV5G.cjs");
6
- const require_solidBuilders = require("./solidBuilders-CUd-korS.cjs");
6
+ const require_faceFns = require("./faceFns-BlYowjvU.cjs");
7
+ const require_solidBuilders = require("./solidBuilders-DfXGia5F.cjs");
7
8
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
8
9
  // src/topology/threeHelpers.ts
9
10
  /**
@@ -586,6 +587,117 @@ function variableFillet(shape, edge, radii) {
586
587
  return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "Variable-radius fillet failed", e));
587
588
  }
588
589
  }
590
+ function faceSignature(face) {
591
+ const kernel = require_shapeTypes.getKernel();
592
+ const { min, max } = kernel.boundingBox(face);
593
+ return {
594
+ hash: kernel.hashCode(face, require_constants.HASH_CODE_MAX),
595
+ type: kernel.surfaceType(face),
596
+ area: kernel.area(face),
597
+ center: kernel.surfaceCenterOfMass(face),
598
+ box: [...min, ...max]
599
+ };
600
+ }
601
+ var near = (a, b, tol) => a.every((v, i) => Math.abs(v - (b[i] ?? NaN)) <= tol);
602
+ function sameFace(a, b) {
603
+ if (a.hash === b.hash) return true;
604
+ if (a.type !== b.type || Math.abs(a.area - b.area) > 1e-6 * Math.max(1, a.area)) return false;
605
+ const tol = 1e-6 * Math.max(1, Math.sqrt(a.area));
606
+ return near(a.center, b.center, tol) && near(a.box, b.box, tol);
607
+ }
608
+ /**
609
+ * Indexes of the picked faces still in `result`, as themselves or rebuilt in
610
+ * place: where the faces around a pick cannot close its gap, defeaturing
611
+ * hands that face back instead of failing.
612
+ */
613
+ function keptFaceIndexes(picked, result) {
614
+ const remaining = require_topologyQueryFns.getFaces(result).map((f) => faceSignature(f.wrapped));
615
+ const kept = [];
616
+ picked.forEach((face, i) => {
617
+ const signature = faceSignature(face.wrapped);
618
+ if (remaining.some((other) => sameFace(signature, other))) kept.push(i);
619
+ });
620
+ return kept;
621
+ }
622
+ /**
623
+ * The one solid a result holds, taking ownership of `result`: occt-wasm's
624
+ * defeaturing returns the healed body wrapped in a compound. `undefined` (with
625
+ * everything released) when the result holds no solid or more than one.
626
+ */
627
+ function soleSolid(result) {
628
+ if (require_shapeTypes.isSolid(result)) return result;
629
+ const kernel = require_shapeTypes.getKernel();
630
+ const solids = [...kernel.iterShapes(result.wrapped, "solid")];
631
+ require_shapeTypes.disposeResultShape(result);
632
+ const [only, ...extra] = solids;
633
+ for (const s of extra) kernel.dispose(s);
634
+ if (only === void 0 || extra.length > 0) {
635
+ if (only !== void 0) kernel.dispose(only);
636
+ return;
637
+ }
638
+ return require_shapeTypes.castResultShapeWithKnownType(only, "solid");
639
+ }
640
+ function validateRemoveFacesInputs(shape, faces) {
641
+ const check = validateNotNull$1(shape, "removeFaces: shape");
642
+ if (require_errors.isErr(check)) return check;
643
+ if (faces.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.NO_FACES, "removeFaces: at least one face must be specified", void 0, void 0, "Pick the faces of the feature to remove"));
644
+ const own = new Set(require_topologyQueryFns.subShapeHashes(shape, "face"));
645
+ const foreign = faces.findIndex((f) => !own.has(require_shapeTypes.getKernel().hashCode(f.wrapped, require_constants.HASH_CODE_MAX)));
646
+ if (foreign === -1) return void 0;
647
+ return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.FACE_NOT_IN_SHAPE, `removeFaces: face ${foreign} is not a face of the shape`, void 0, { faceIndex: foreign }, "Pick the faces with getFaces() on the same shape passed to removeFaces"));
648
+ }
649
+ function removeFacesKernelError(e, faceCount) {
650
+ if (require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) {
651
+ const kernelId = require_shapeTypes.getKernel().kernelId;
652
+ return require_errors.err(require_errors.unsupportedError(require_errors.BrepErrorCode.UNSUPPORTED_CAPABILITY, `removeFaces: the ${kernelId} kernel has no defeaturing`, e, { kernel: kernelId }, "Use the occt-wasm kernel, which provides defeaturing"));
653
+ }
654
+ const raw = e instanceof Error ? e.message : String(e);
655
+ return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.REMOVE_FACES_FAILED, `removeFaces failed: ${raw}`, e, {
656
+ operation: "removeFaces",
657
+ faceCount
658
+ }));
659
+ }
660
+ /**
661
+ * Remove faces from a solid and close the gap with the faces around them
662
+ * (OCCT defeaturing): a hole, pocket, boss, or fillet face disappears and its
663
+ * neighbours extend to meet.
664
+ *
665
+ * @param shape - The solid to edit.
666
+ * @param faces - Faces of `shape` to remove.
667
+ * @returns Err `REMOVE_FACES_INCOMPLETE` (with `metadata.keptFaceIndexes`)
668
+ * when a picked face is still in the result because its neighbours could not
669
+ * close the gap, `REMOVE_FACES_FAILED` when the kernel fails or the result is
670
+ * not one valid solid, and `UNSUPPORTED_CAPABILITY` on a kernel without
671
+ * defeaturing.
672
+ */
673
+ function removeFaces(shape, faces) {
674
+ const invalid = validateRemoveFacesInputs(shape, faces);
675
+ if (invalid) return invalid;
676
+ const kernel = require_shapeTypes.getKernel();
677
+ let result;
678
+ try {
679
+ result = soleSolid(require_shapeTypes.castResultShape(kernel.defeature(shape.wrapped, faces.map((f) => f.wrapped))));
680
+ } catch (e) {
681
+ return removeFacesKernelError(e, faces.length);
682
+ }
683
+ if (result === void 0 || !kernel.isValid(result.wrapped)) {
684
+ if (result) require_shapeTypes.disposeResultShape(result);
685
+ return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.REMOVE_FACES_FAILED, "removeFaces: the result is not one valid solid", void 0, {
686
+ operation: "removeFaces",
687
+ faceCount: faces.length
688
+ }));
689
+ }
690
+ const kept = keptFaceIndexes(faces, result);
691
+ if (kept.length > 0) {
692
+ require_shapeTypes.disposeResultShape(result);
693
+ return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.REMOVE_FACES_INCOMPLETE, `removeFaces: ${kept.length} of ${faces.length} face(s) could not be removed; the faces around them cannot close the gap`, void 0, {
694
+ operation: "removeFaces",
695
+ keptFaceIndexes: kept
696
+ }, "Remove the whole feature, or leave out the faces listed in metadata.keptFaceIndexes"));
697
+ }
698
+ require_solidBuilders.propagateMetadataByHash([shape], result);
699
+ return require_errors.ok(result);
700
+ }
589
701
  // src/topology/chamferAngleFns.ts
590
702
  /**
591
703
  * Chamfer with distance + angle — functional API.
@@ -1500,6 +1612,12 @@ Object.defineProperty(exports, "positionOnCurve", {
1500
1612
  return positionOnCurve;
1501
1613
  }
1502
1614
  });
1615
+ Object.defineProperty(exports, "removeFaces", {
1616
+ enumerable: true,
1617
+ get: function() {
1618
+ return removeFaces;
1619
+ }
1620
+ });
1503
1621
  Object.defineProperty(exports, "shell", {
1504
1622
  enumerable: true,
1505
1623
  get: function() {
@@ -1,9 +1,10 @@
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, x as isShape3D, y as isFace } from "./shapeTypes-CgbUTASh.js";
2
- import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, x as isOk } from "./errors-vxP5FT8B.js";
3
- import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-6M_dbT1R.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-D0j6Lk3z.js";
2
+ import { O as isUnsupportedKernelOperationError } from "./occtWasmAdapter-Bi9GozJ9.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, x as isOk } from "./errors-CUsZRWJ7.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-DtzwRKVP.js";
4
5
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
5
- import { y as downcast } from "./faceFns-BBk6XKJO.js";
6
- import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-DE_na4G3.js";
6
+ import { y as downcast } from "./faceFns-BNGMbh3P.js";
7
+ import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-94pT7hv6.js";
7
8
  import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
8
9
  // src/topology/threeHelpers.ts
9
10
  /**
@@ -586,6 +587,117 @@ function variableFillet(shape, edge, radii) {
586
587
  return err(kernelError(BrepErrorCode.VARIABLE_FILLET_FAILED, "Variable-radius fillet failed", e));
587
588
  }
588
589
  }
590
+ function faceSignature(face) {
591
+ const kernel = getKernel();
592
+ const { min, max } = kernel.boundingBox(face);
593
+ return {
594
+ hash: kernel.hashCode(face, HASH_CODE_MAX),
595
+ type: kernel.surfaceType(face),
596
+ area: kernel.area(face),
597
+ center: kernel.surfaceCenterOfMass(face),
598
+ box: [...min, ...max]
599
+ };
600
+ }
601
+ var near = (a, b, tol) => a.every((v, i) => Math.abs(v - (b[i] ?? NaN)) <= tol);
602
+ function sameFace(a, b) {
603
+ if (a.hash === b.hash) return true;
604
+ if (a.type !== b.type || Math.abs(a.area - b.area) > 1e-6 * Math.max(1, a.area)) return false;
605
+ const tol = 1e-6 * Math.max(1, Math.sqrt(a.area));
606
+ return near(a.center, b.center, tol) && near(a.box, b.box, tol);
607
+ }
608
+ /**
609
+ * Indexes of the picked faces still in `result`, as themselves or rebuilt in
610
+ * place: where the faces around a pick cannot close its gap, defeaturing
611
+ * hands that face back instead of failing.
612
+ */
613
+ function keptFaceIndexes(picked, result) {
614
+ const remaining = getFaces(result).map((f) => faceSignature(f.wrapped));
615
+ const kept = [];
616
+ picked.forEach((face, i) => {
617
+ const signature = faceSignature(face.wrapped);
618
+ if (remaining.some((other) => sameFace(signature, other))) kept.push(i);
619
+ });
620
+ return kept;
621
+ }
622
+ /**
623
+ * The one solid a result holds, taking ownership of `result`: occt-wasm's
624
+ * defeaturing returns the healed body wrapped in a compound. `undefined` (with
625
+ * everything released) when the result holds no solid or more than one.
626
+ */
627
+ function soleSolid(result) {
628
+ if (isSolid(result)) return result;
629
+ const kernel = getKernel();
630
+ const solids = [...kernel.iterShapes(result.wrapped, "solid")];
631
+ disposeResultShape(result);
632
+ const [only, ...extra] = solids;
633
+ for (const s of extra) kernel.dispose(s);
634
+ if (only === void 0 || extra.length > 0) {
635
+ if (only !== void 0) kernel.dispose(only);
636
+ return;
637
+ }
638
+ return castResultShapeWithKnownType(only, "solid");
639
+ }
640
+ function validateRemoveFacesInputs(shape, faces) {
641
+ const check = validateNotNull$1(shape, "removeFaces: shape");
642
+ if (isErr(check)) return check;
643
+ if (faces.length === 0) return err(validationError(BrepErrorCode.NO_FACES, "removeFaces: at least one face must be specified", void 0, void 0, "Pick the faces of the feature to remove"));
644
+ const own = new Set(subShapeHashes(shape, "face"));
645
+ const foreign = faces.findIndex((f) => !own.has(getKernel().hashCode(f.wrapped, HASH_CODE_MAX)));
646
+ if (foreign === -1) return void 0;
647
+ return err(validationError(BrepErrorCode.FACE_NOT_IN_SHAPE, `removeFaces: face ${foreign} is not a face of the shape`, void 0, { faceIndex: foreign }, "Pick the faces with getFaces() on the same shape passed to removeFaces"));
648
+ }
649
+ function removeFacesKernelError(e, faceCount) {
650
+ if (isUnsupportedKernelOperationError(e)) {
651
+ const kernelId = getKernel().kernelId;
652
+ return err(unsupportedError(BrepErrorCode.UNSUPPORTED_CAPABILITY, `removeFaces: the ${kernelId} kernel has no defeaturing`, e, { kernel: kernelId }, "Use the occt-wasm kernel, which provides defeaturing"));
653
+ }
654
+ const raw = e instanceof Error ? e.message : String(e);
655
+ return err(kernelError(BrepErrorCode.REMOVE_FACES_FAILED, `removeFaces failed: ${raw}`, e, {
656
+ operation: "removeFaces",
657
+ faceCount
658
+ }));
659
+ }
660
+ /**
661
+ * Remove faces from a solid and close the gap with the faces around them
662
+ * (OCCT defeaturing): a hole, pocket, boss, or fillet face disappears and its
663
+ * neighbours extend to meet.
664
+ *
665
+ * @param shape - The solid to edit.
666
+ * @param faces - Faces of `shape` to remove.
667
+ * @returns Err `REMOVE_FACES_INCOMPLETE` (with `metadata.keptFaceIndexes`)
668
+ * when a picked face is still in the result because its neighbours could not
669
+ * close the gap, `REMOVE_FACES_FAILED` when the kernel fails or the result is
670
+ * not one valid solid, and `UNSUPPORTED_CAPABILITY` on a kernel without
671
+ * defeaturing.
672
+ */
673
+ function removeFaces(shape, faces) {
674
+ const invalid = validateRemoveFacesInputs(shape, faces);
675
+ if (invalid) return invalid;
676
+ const kernel = getKernel();
677
+ let result;
678
+ try {
679
+ result = soleSolid(castResultShape(kernel.defeature(shape.wrapped, faces.map((f) => f.wrapped))));
680
+ } catch (e) {
681
+ return removeFacesKernelError(e, faces.length);
682
+ }
683
+ if (result === void 0 || !kernel.isValid(result.wrapped)) {
684
+ if (result) disposeResultShape(result);
685
+ return err(kernelError(BrepErrorCode.REMOVE_FACES_FAILED, "removeFaces: the result is not one valid solid", void 0, {
686
+ operation: "removeFaces",
687
+ faceCount: faces.length
688
+ }));
689
+ }
690
+ const kept = keptFaceIndexes(faces, result);
691
+ if (kept.length > 0) {
692
+ disposeResultShape(result);
693
+ return err(kernelError(BrepErrorCode.REMOVE_FACES_INCOMPLETE, `removeFaces: ${kept.length} of ${faces.length} face(s) could not be removed; the faces around them cannot close the gap`, void 0, {
694
+ operation: "removeFaces",
695
+ keptFaceIndexes: kept
696
+ }, "Remove the whole feature, or leave out the faces listed in metadata.keptFaceIndexes"));
697
+ }
698
+ propagateMetadataByHash([shape], result);
699
+ return ok(result);
700
+ }
589
701
  // src/topology/chamferAngleFns.ts
590
702
  /**
591
703
  * Chamfer with distance + angle — functional API.
@@ -1356,4 +1468,4 @@ function fixSelfIntersection(wire) {
1356
1468
  return err(kernelError(BrepErrorCode.FIX_SELF_INTERSECTION_FAILED, "Failed to fix wire self-intersection", e));
1357
1469
  }
1358
1470
  }
1359
- export { toBufferGeometryData as A, chamfer as C, shell as D, offset as E, toLODGeometryData as M, toLODGeometryLevels as N, thicken as O, toLineGeometryData as P, chamferDistAngle as S, fillet as T, checkBoolean as _, healFace as a, getNurbsCurveData as b, isValid as c, chamferWithEvolution as d, cutWithEvolution as f, shellWithEvolution as g, intersectWithEvolution as h, heal as i, toGroupedBufferGeometryData as j, variableFillet as k, solidFromShell as l, fuseWithEvolution as m, fixSelfIntersection as n, healSolid as o, filletWithEvolution as p, fixShape as r, healWire as s, autoHeal as t, positionOnCurve as u, cutAllBisect as v, draft as w, getNurbsSurfaceData as x, fuseAllBisect as y };
1471
+ export { variableFillet as A, chamfer as C, removeFaces as D, offset as E, toLineGeometryData as F, toGroupedBufferGeometryData as M, toLODGeometryData as N, shell as O, toLODGeometryLevels as P, chamferDistAngle as S, fillet as T, checkBoolean as _, healFace as a, getNurbsCurveData as b, isValid as c, chamferWithEvolution as d, cutWithEvolution as f, shellWithEvolution as g, intersectWithEvolution as h, heal as i, toBufferGeometryData as j, thicken as k, solidFromShell as l, fuseWithEvolution as m, fixSelfIntersection as n, healSolid as o, filletWithEvolution as p, fixShape as r, healWire as s, autoHeal as t, positionOnCurve as u, cutAllBisect as v, draft as w, getNurbsSurfaceData as x, fuseAllBisect as y };
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
2
- const require_errors = require("./errors-GVyCnpi0.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-ENxs8uu2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-BPJZTpIz.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-DSRREV5G.cjs");
7
- const require_shapeFns = require("./shapeFns-B54CsPyk.cjs");
8
- const require_curveFns = require("./curveFns-U7srQ3ZA.cjs");
9
- const require_measureFns = require("./measureFns-BvNkzSR6.cjs");
6
+ const require_faceFns = require("./faceFns-BlYowjvU.cjs");
7
+ const require_shapeFns = require("./shapeFns-Cn0lAxbU.cjs");
8
+ const require_curveFns = require("./curveFns-C01yujmY.cjs");
9
+ const require_measureFns = require("./measureFns-BnbD7-w7.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-CgbUTASh.js";
2
- import { E as ok, g as err, o as queryError, x as isOk } from "./errors-vxP5FT8B.js";
3
- import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-6M_dbT1R.js";
1
+ import { q as getKernel, y as isFace } from "./shapeTypes-D0j6Lk3z.js";
2
+ import { E as ok, g as err, o as queryError, x as isOk } from "./errors-CUsZRWJ7.js";
3
+ import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-DtzwRKVP.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-BBk6XKJO.js";
7
- import { a as isSameShape, n as getHashCode } from "./shapeFns-DB3l3ULC.js";
8
- import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CkA2WJP2.js";
9
- import { n as measureArea } from "./measureFns-PRM3gOjw.js";
6
+ import { l as normalAt, s as getSurfaceType } from "./faceFns-BNGMbh3P.js";
7
+ import { a as isSameShape, n as getHashCode } from "./shapeFns-DLD8qAsI.js";
8
+ import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-DqgDK9xJ.js";
9
+ import { n as measureArea } from "./measureFns-B_DpfIE3.js";
10
10
  // src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
2
  const require_bug = require("./bug-CBcpIPuf.cjs");
3
- const require_errors = require("./errors-GVyCnpi0.cjs");
3
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
4
4
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
5
- const require_blueprint = require("./blueprint-wq2TU1XP.cjs");
5
+ const require_blueprint = require("./blueprint-CgWpKzKK.cjs");
6
6
  // src/io/objExportFns.ts
7
7
  /** Read a vec3 from a typed array at the given vertex index. */
8
8
  function vec3At(arr, i) {
@@ -1,8 +1,8 @@
1
- import { n as castResultShape, q as getKernel } from "./shapeTypes-CgbUTASh.js";
1
+ import { n as castResultShape, q as getKernel } from "./shapeTypes-D0j6Lk3z.js";
2
2
  import { i as wasmIndex, r as vec3At$1 } from "./bug-ClMTAJhe.js";
3
- import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-vxP5FT8B.js";
3
+ import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-CUsZRWJ7.js";
4
4
  import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
5
- import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-Bth4EVaO.js";
5
+ import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-Dr-l3Nlb.js";
6
6
  // src/io/objExportFns.ts
7
7
  /** Read a vec3 from a typed array at the given vertex index. */
8
8
  function vec3At(arr, i) {
package/dist/index.d.ts CHANGED
@@ -145,7 +145,7 @@ export type { Shapeable, WrappedMarker, FinderFn, FilletRadius, ChamferDistance,
145
145
  export { resolve, resolve3D } from './topology/apiTypes.js';
146
146
  export { box, cylinder, sphere, cone, torus, ellipsoid, line, circle, ellipse, helix, threePointArc, ellipseArc, bsplineApprox, bezier, tangentArc, wire, wireLoop, face, filledFace, subFace, polygon, vertex, compound, solid, offsetFace, sewShells, addHoles, type BoxOptions, type CylinderOptions, type SphereOptions, type ConeOptions, type TorusOptions, type EllipsoidOptions, type CircleOptions, type EllipseOptions, type HelixOptions, type EllipseArcOptions, } from './topology/primitiveFns.js';
147
147
  export { fill } from './topology/surfaceBuilders.js';
148
- export { translate, rotate, mirror, scale, clone, locate, applyMatrix, composeTransforms, transformCopy, type TransformOp, type ComposedTransform, fuse, cut, fuseAll, cutAll, intersect, section, sectionToFace, split, slice, fillet, chamfer, shell, offset, thicken, draft, heal, simplify, mesh, meshEdges, describe, toBREP, fromBREP, isValid, isEmpty, type RotateOptions, type MirrorOptions, type ScaleOptions, } from './topology/api.js';
148
+ export { translate, rotate, mirror, scale, clone, locate, applyMatrix, composeTransforms, transformCopy, type TransformOp, type ComposedTransform, fuse, cut, fuseAll, cutAll, intersect, section, sectionToFace, split, slice, fillet, chamfer, shell, removeFaces, offset, thicken, draft, heal, simplify, mesh, meshEdges, describe, toBREP, fromBREP, isValid, isEmpty, type RotateOptions, type MirrorOptions, type ScaleOptions, } from './topology/api.js';
149
149
  export { extrude, revolve, loft, type RevolveOptions, type LoftOptions as CleanLoftOptions, type SweepOptions as CleanSweepOptions, } from './operations/api.js';
150
150
  export { loftAll, type LoftAllEntry } from './operations/loftFns.js';
151
151
  export { thread, type ThreadOptions } from './operations/threadFns.js';
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-W7ZTKqiJ.cjs");
3
- const require_importFns = require("./importFns-ClqPJCFR.cjs");
2
+ const require_meshFns = require("./meshFns-DlGc_nS6.cjs");
3
+ const require_importFns = require("./importFns-BwEwuqM2.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-CgbT3uuO.js";
2
- import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-DSUfSQn2.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-B4L-5mVr.js";
2
+ import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-DQW8EVaa.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_occtWasmAdapter = require("../../occtWasmAdapter-BSQeA69d.cjs");
2
+ const require_occtWasmAdapter = require("../../occtWasmAdapter-Dd9giakk.cjs");
3
3
  exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
@@ -40,6 +40,22 @@ export declare class OcctWasmAdapter implements KernelAdapter {
40
40
  static fromKernel(kernel: OcctKernelOwner): OcctWasmAdapter;
41
41
  /** The owner retained to keep the borrowed raw kernel alive, or `undefined` when built from a raw kernel. */
42
42
  get retainedKernelOwner(): OcctKernelOwner | undefined;
43
+ /**
44
+ * Bring a shape built through occt-wasm's own `OcctKernel` (the kernel this
45
+ * adapter wraps) into brepjs without a BREP round trip:
46
+ * `castShape(adapter.adoptShape(id))`.
47
+ *
48
+ * brepjs takes ownership of the arena slot and frees it when the shape is
49
+ * disposed or collected, so do not also `release(id)` it through `OcctKernel`.
50
+ */
51
+ adoptShape(id: number): KernelShape;
52
+ /**
53
+ * The occt-wasm arena id behind a brepjs shape (`adapter.shapeId(solid.wrapped)`),
54
+ * for passing it to `OcctKernel` calls. The id stays owned by brepjs: it is
55
+ * valid until the brepjs shape is disposed, and must not be released through
56
+ * `OcctKernel`.
57
+ */
58
+ shapeId(shape: KernelShape): number;
43
59
  dispose(h: {
44
60
  delete(): void;
45
61
  }): void;
@@ -1 +1 @@
1
- export { t as OcctWasmAdapter } from "../../occtWasmAdapter-PzZJHUAd.js";
1
+ export { t as OcctWasmAdapter } from "../../occtWasmAdapter-Bi9GozJ9.js";
@@ -1,5 +1,5 @@
1
- import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-CgbUTASh.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-vxP5FT8B.js";
1
+ import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-D0j6Lk3z.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-CUsZRWJ7.js";
3
3
  import { r as toVec3 } from "./types-CKXsIm9-.js";
4
4
  import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
5
5
  // src/operations/extrudeUtils.ts
@@ -1,5 +1,5 @@
1
- const require_shapeTypes = require("./shapeTypes-D_anqiRe.cjs");
2
- const require_errors = require("./errors-GVyCnpi0.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-K0rZK5U-.cjs");
2
+ const require_errors = require("./errors-B9r_Dzs1.cjs");
3
3
  const require_types = require("./types-CjF9Rofr.cjs");
4
4
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
5
5
  // src/operations/extrudeUtils.ts
@@ -1,7 +1,7 @@
1
- import { q as getKernel } from "./shapeTypes-CgbUTASh.js";
2
- import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-vxP5FT8B.js";
3
- import { E as kernelCallRaw } from "./topologyQueryFns-6M_dbT1R.js";
4
- import { m as uvBounds } from "./faceFns-BBk6XKJO.js";
1
+ import { q as getKernel } from "./shapeTypes-D0j6Lk3z.js";
2
+ import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-CUsZRWJ7.js";
3
+ import { E as kernelCallRaw } from "./topologyQueryFns-DtzwRKVP.js";
4
+ import { m as uvBounds } from "./faceFns-BNGMbh3P.js";
5
5
  // src/measurement/measureCache.ts
6
6
  var cache = /* @__PURE__ */ new WeakMap();
7
7
  function getCachedMeasurement(shape, key) {