brepjs 15.1.10 → 15.1.12

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 (90) hide show
  1. package/dist/2d/blueprints/segmentAssembly.d.ts.map +1 -1
  2. package/dist/2d.cjs +5 -5
  3. package/dist/2d.js +5 -5
  4. package/dist/{blueprint-DD20bL3n.js → blueprint-CY11BkHM.js} +9 -8
  5. package/dist/{blueprint-BvUKWbkE.cjs → blueprint-DpfTrOOt.cjs} +13 -12
  6. package/dist/{blueprintFns-DLDx4XFc.js → blueprintFns-B6NYYOlY.js} +2 -2
  7. package/dist/{blueprintFns-DFLtehf-.cjs → blueprintFns-oD720gYA.cjs} +2 -2
  8. package/dist/{boolean2D-CQE7rswO.cjs → boolean2D-BUqgODrH.cjs} +57 -19
  9. package/dist/{boolean2D-CpSRx5_U.js → boolean2D-zRsWUMD9.js} +50 -12
  10. package/dist/{booleanFns-D3wX7_qO.cjs → booleanFns-B86ltlZD.cjs} +30 -16
  11. package/dist/{booleanFns-C-IpkYUW.js → booleanFns-CiiCf7YH.js} +27 -13
  12. package/dist/brepjs.cjs +28 -27
  13. package/dist/brepjs.js +25 -24
  14. package/dist/constants-BNP_xnBN.cjs +26 -0
  15. package/dist/constants-csSEYddm.js +9 -0
  16. package/dist/core.cjs +8 -7
  17. package/dist/core.js +5 -4
  18. package/dist/{cornerFinder-BybcZVxL.cjs → cornerFinder-DNmYCgaQ.cjs} +4 -4
  19. package/dist/{cornerFinder-C7k0yipe.js → cornerFinder-lO-ySgHJ.js} +3 -3
  20. package/dist/{curveFns-BErRtKDj.cjs → curveFns-B_pwrAMv.cjs} +1 -1
  21. package/dist/{curveFns-DbIakl9J.js → curveFns-Dv0wz8Zm.js} +1 -1
  22. package/dist/{drawFns-Bk5q5z-m.cjs → drawFns-D98GdpRM.cjs} +16 -15
  23. package/dist/{drawFns-tyuGCCqm.js → drawFns-L7NpQwWq.js} +15 -14
  24. package/dist/{extrudeFns-7_WDVoEg.cjs → extrudeFns-B9muBNIT.cjs} +2 -2
  25. package/dist/{extrudeFns-pjrR5ECA.js → extrudeFns-lgSsOjwq.js} +2 -2
  26. package/dist/{faceFns-wSgaAQrJ.js → faceFns-CauBoVg1.js} +5 -35
  27. package/dist/{faceFns-B8y0xqpK.cjs → faceFns-DnIpKBex.cjs} +4 -40
  28. package/dist/{helpers-DsVYL2Ri.js → helpers-B_-mIteL.js} +7 -7
  29. package/dist/{helpers-CpCe09zS.cjs → helpers-kil7evW4.cjs} +9 -9
  30. package/dist/{historyFns-DAY8a7Ss.cjs → historyFns-D7UojEn3.cjs} +5 -5
  31. package/dist/{historyFns-s3knhOiM.js → historyFns-DYrliEQE.js} +5 -5
  32. package/dist/{importFns-C0Edyiov.js → importFns-CPzDHVKm.js} +3 -3
  33. package/dist/{importFns-B-5chCzB.cjs → importFns-Y4wgn0rJ.cjs} +3 -3
  34. package/dist/io.cjs +2 -2
  35. package/dist/io.js +2 -2
  36. package/dist/kernel/geometry2d.d.ts.map +1 -1
  37. package/dist/kernel/occt/defaultAdapter.d.ts.map +1 -1
  38. package/dist/kernel/occt/kernel2dOps.d.ts +68 -61
  39. package/dist/kernel/occt/kernel2dOps.d.ts.map +1 -1
  40. package/dist/{measureFns-gRr84qGk.js → measureFns-Bey2EmNQ.js} +2 -2
  41. package/dist/{measureFns-vgnbVhDc.cjs → measureFns-Bt0Rd9q9.cjs} +2 -2
  42. package/dist/measurement.cjs +1 -1
  43. package/dist/measurement.js +1 -1
  44. package/dist/{meshFns-rMEka_pV.cjs → meshFns-Cxs6gU44.cjs} +2 -2
  45. package/dist/{meshFns-CA6fJ-Z0.js → meshFns-DO58R94T.js} +2 -2
  46. package/dist/operations.cjs +2 -2
  47. package/dist/operations.js +2 -2
  48. package/dist/{planeOps-DoTESDTM.cjs → planeOps-CuI-sDtn.cjs} +4 -3
  49. package/dist/{planeOps-C94s53Ia.js → planeOps-Da2ylKGq.js} +3 -2
  50. package/dist/{primitiveFns-B1R8RWjt.cjs → primitiveFns-CWiHuJw9.cjs} +34 -34
  51. package/dist/{primitiveFns-DtfUR91z.js → primitiveFns-Rpdnd3FK.js} +21 -21
  52. package/dist/query.cjs +2 -2
  53. package/dist/query.js +2 -2
  54. package/dist/{shapeFns-ClKIHb3P.js → shapeFns-4ySHDRyO.js} +14 -14
  55. package/dist/{shapeFns-BtGq6ZqD.cjs → shapeFns-CBRy0V_S.cjs} +20 -20
  56. package/dist/shapeRef.cjs +1 -1
  57. package/dist/shapeRef.js +1 -1
  58. package/dist/{shapeRefFns-DjWRttT2.js → shapeRefFns-D21Yl4Eu.js} +3 -3
  59. package/dist/{shapeRefFns-MA4_U4Fn.cjs → shapeRefFns-oAyQxHO1.cjs} +3 -3
  60. package/dist/{shapeTypes-Qh4ErtGx.js → shapeTypes-BLV4Ktdb.js} +604 -788
  61. package/dist/{shapeTypes-Cs7uihz8.cjs → shapeTypes-CaSWO-Hg.cjs} +604 -793
  62. package/dist/sketching.cjs +2 -2
  63. package/dist/sketching.js +2 -2
  64. package/dist/{solidBuilders-BMv6UQUY.cjs → solidBuilders-BZFaM6nk.cjs} +2 -2
  65. package/dist/{solidBuilders-CHvrwtLL.js → solidBuilders-BexZFemn.js} +2 -2
  66. package/dist/{surfaceBuilders-CL8MJABt.js → surfaceBuilders-AnSYsNAb.js} +2 -2
  67. package/dist/{surfaceBuilders-Bgc5TlIe.cjs → surfaceBuilders-Bixz70pj.cjs} +2 -2
  68. package/dist/topology/booleanFns.d.ts.map +1 -1
  69. package/dist/topology/evolutionFns.d.ts.map +1 -1
  70. package/dist/topology/modifierFns.d.ts.map +1 -1
  71. package/dist/topology/shapeFns.d.ts.map +1 -1
  72. package/dist/topology/topologyQueryFns.d.ts +1 -1
  73. package/dist/topology/topologyQueryFns.d.ts.map +1 -1
  74. package/dist/topology.cjs +6 -6
  75. package/dist/topology.js +6 -6
  76. package/dist/{types-SLY3VwcI.js → types--GD-LVc6.js} +1 -9
  77. package/dist/{types-hXSlplF3.cjs → types-gLi9wL0N.cjs} +0 -26
  78. package/dist/vectors.cjs +6 -5
  79. package/dist/vectors.js +4 -3
  80. package/dist/worker.cjs +1 -1
  81. package/dist/worker.js +1 -1
  82. package/package.json +1 -1
  83. package/dist/core/shapePropertyCache.d.ts +0 -17
  84. package/dist/core/shapePropertyCache.d.ts.map +0 -1
  85. /package/dist/{arrayAccess-CmulMesb.cjs → arrayAccess-DsnQpdSD.cjs} +0 -0
  86. /package/dist/{arrayAccess-xxcB3YNq.js → arrayAccess-tCIbjLs5.js} +0 -0
  87. /package/dist/{vecOps-BXvBYIor.cjs → vecOps-5bNB19nE.cjs} +0 -0
  88. /package/dist/{vecOps-D9etjPgV.js → vecOps-DBmIPNhk.js} +0 -0
  89. /package/dist/{workerHandler-C-7OUJsa.cjs → workerHandler-C-3cFcsQ.cjs} +0 -0
  90. /package/dist/{workerHandler-o2xzAfFk.js → workerHandler-Dm0_0F8Z.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"segmentAssembly.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/segmentAssembly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAU9C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,CA6BzD;AAMD,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;CACtC;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,UAAU,GACV,IAAI,GACJ,eAAe,GACf,oBAAoB,CAAC;AAMzB,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1C;AAmGD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAkExB"}
1
+ {"version":3,"file":"segmentAssembly.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/segmentAssembly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAkE9C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,CA6BzD;AAMD,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;CACtC;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,UAAU,GACV,IAAI,GACJ,eAAe,GACf,oBAAoB,CAAC;AAMzB,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1C;AAmGD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAmExB"}
package/dist/2d.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-CaSWO-Hg.cjs");
3
3
  const require_errors = require("./errors-CXRNVCec.cjs");
4
- const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
5
- const require_boolean2D = require("./boolean2D-CQE7rswO.cjs");
6
- const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
7
- const require_blueprintFns = require("./blueprintFns-DFLtehf-.cjs");
4
+ const require_faceFns = require("./faceFns-DnIpKBex.cjs");
5
+ const require_boolean2D = require("./boolean2D-BUqgODrH.cjs");
6
+ const require_blueprint = require("./blueprint-DpfTrOOt.cjs");
7
+ const require_blueprintFns = require("./blueprintFns-oD720gYA.cjs");
8
8
  //#region src/core/curve2dHandle.ts
9
9
  /**
10
10
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
package/dist/2d.js CHANGED
@@ -1,9 +1,9 @@
1
- import { B as createKernelHandle, Z as getKernel2D, a as createEdge } from "./shapeTypes-Qh4ErtGx.js";
1
+ import { B as createKernelHandle, Z as getKernel2D, a as createEdge } from "./shapeTypes-BLV4Ktdb.js";
2
2
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DboJwVCf.js";
3
- import { B as kernelCallRaw } from "./faceFns-wSgaAQrJ.js";
4
- import { _ as Blueprints, a as fuseBlueprints, c as roundedRectangleBlueprint, g as CompoundBlueprint, h as organiseBlueprints, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CpSRx5_U.js";
5
- import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-DD20bL3n.js";
6
- import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-DLDx4XFc.js";
3
+ import { z as kernelCallRaw } from "./faceFns-CauBoVg1.js";
4
+ import { _ as Blueprints, a as fuseBlueprints, c as roundedRectangleBlueprint, g as CompoundBlueprint, h as organiseBlueprints, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-zRsWUMD9.js";
5
+ import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-CY11BkHM.js";
6
+ import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-B6NYYOlY.js";
7
7
  //#region src/core/curve2dHandle.ts
8
8
  /**
9
9
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
@@ -1,12 +1,13 @@
1
- import { G as unregisterFromCleanup, U as registerForCleanup, X as getKernel, Z as getKernel2D, a as createEdge, u as createWire } from "./shapeTypes-Qh4ErtGx.js";
1
+ import { G as unregisterFromCleanup, U as registerForCleanup, X as getKernel, Z as getKernel2D, a as createEdge, u as createWire } from "./shapeTypes-BLV4Ktdb.js";
2
2
  import { A as ok, R as unwrap, b as err, d as validationError, h as bug, n as computationError } from "./errors-DboJwVCf.js";
3
- import { N as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-wSgaAQrJ.js";
4
- import { i as DEG2RAD, o as RAD2DEG, r as toVec3 } from "./types-SLY3VwcI.js";
5
- import { r as makePlane } from "./planeOps-C94s53Ia.js";
6
- import { f as getOrientation } from "./curveFns-DbIakl9J.js";
7
- import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
8
- import { r as makeFace } from "./surfaceBuilders-CL8MJABt.js";
9
- import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-DsVYL2Ri.js";
3
+ import { M as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-CauBoVg1.js";
4
+ import { r as RAD2DEG, t as DEG2RAD } from "./constants-csSEYddm.js";
5
+ import { r as toVec3 } from "./types--GD-LVc6.js";
6
+ import { r as makePlane } from "./planeOps-Da2ylKGq.js";
7
+ import { f as getOrientation } from "./curveFns-Dv0wz8Zm.js";
8
+ import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-tCIbjLs5.js";
9
+ import { r as makeFace } from "./surfaceBuilders-AnSYsNAb.js";
10
+ import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-B_-mIteL.js";
10
11
  //#region src/2d/lib/definitions.ts
11
12
  /** Type guard that checks whether a value is a `Point2D`. */
12
13
  function isPoint2D(point) {
@@ -1,12 +1,13 @@
1
- const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CaSWO-Hg.cjs");
2
2
  const require_errors = require("./errors-CXRNVCec.cjs");
3
- const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
4
- const require_types = require("./types-hXSlplF3.cjs");
5
- const require_planeOps = require("./planeOps-DoTESDTM.cjs");
6
- const require_curveFns = require("./curveFns-BErRtKDj.cjs");
7
- const require_arrayAccess = require("./arrayAccess-CmulMesb.cjs");
8
- const require_surfaceBuilders = require("./surfaceBuilders-Bgc5TlIe.cjs");
9
- const require_helpers = require("./helpers-CpCe09zS.cjs");
3
+ const require_faceFns = require("./faceFns-DnIpKBex.cjs");
4
+ const require_constants = require("./constants-BNP_xnBN.cjs");
5
+ const require_types = require("./types-gLi9wL0N.cjs");
6
+ const require_planeOps = require("./planeOps-CuI-sDtn.cjs");
7
+ const require_curveFns = require("./curveFns-B_pwrAMv.cjs");
8
+ const require_arrayAccess = require("./arrayAccess-DsnQpdSD.cjs");
9
+ const require_surfaceBuilders = require("./surfaceBuilders-Bixz70pj.cjs");
10
+ const require_helpers = require("./helpers-kil7evW4.cjs");
10
11
  //#region src/2d/lib/definitions.ts
11
12
  /** Type guard that checks whether a value is a `Point2D`. */
12
13
  function isPoint2D(point) {
@@ -536,7 +537,7 @@ var adaptedCurveToPathElem = (curve, lastPoint) => {
536
537
  if (!circleData) require_errors.bug("adaptedCurveToPathElem", "Expected circle data");
537
538
  const { radius, isDirect } = circleData;
538
539
  const bounds = k2d.getCurve2dBounds(curve.wrapped);
539
- const paramAngle = (bounds.last - bounds.first) * require_types.RAD2DEG;
540
+ const paramAngle = (bounds.last - bounds.first) * require_constants.RAD2DEG;
540
541
  const end = paramAngle !== 360 ? endpoint : `${round5(endX)} ${round5(endY + 1e-4)}`;
541
542
  return `A ${radius} ${radius} 0 ${Math.abs(paramAngle) > 180 ? "1" : "0"} ${isDirect ? "1" : "0"} ${end}`;
542
543
  }
@@ -545,9 +546,9 @@ var adaptedCurveToPathElem = (curve, lastPoint) => {
545
546
  if (!ellipseData) require_errors.bug("adaptedCurveToPathElem", "Expected ellipse data");
546
547
  const { majorRadius: rx, minorRadius: ry, xAxisAngle, isDirect } = ellipseData;
547
548
  const bounds = k2d.getCurve2dBounds(curve.wrapped);
548
- const paramAngle = (bounds.last - bounds.first) * require_types.RAD2DEG;
549
+ const paramAngle = (bounds.last - bounds.first) * require_constants.RAD2DEG;
549
550
  const end = paramAngle !== 360 ? endpoint : `${round5(endX)} ${round5(endY + 1e-4)}`;
550
- const angle = 180 - xAxisAngle * require_types.RAD2DEG;
551
+ const angle = 180 - xAxisAngle * require_constants.RAD2DEG;
551
552
  return `A ${round5(rx)} ${round5(ry)} ${round5(angle)} ${Math.abs(paramAngle) > 180 ? "1" : "0"} ${isDirect ? "1" : "0"} ${end}`;
552
553
  }
553
554
  require_errors.bug("adaptedCurveToPathElem", `Unsupported curve type: ${curveType}`);
@@ -816,7 +817,7 @@ var Blueprint = class Blueprint {
816
817
  * @returns A new rotated Blueprint.
817
818
  */
818
819
  rotate(angle, center) {
819
- return new Blueprint(transformCurves(this.curves, rotateTransform2d(angle * require_types.DEG2RAD, center)));
820
+ return new Blueprint(transformCurves(this.curves, rotateTransform2d(angle * require_constants.DEG2RAD, center)));
820
821
  }
821
822
  translate(xDistOrPoint, yDist = 0) {
822
823
  const translationVector = isPoint2D(xDistOrPoint) ? xDistOrPoint : [xDistOrPoint, yDist];
@@ -1,6 +1,6 @@
1
1
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DboJwVCf.js";
2
- import { g as CompoundBlueprint } from "./boolean2D-CpSRx5_U.js";
3
- import { t as Blueprint } from "./blueprint-DD20bL3n.js";
2
+ import { g as CompoundBlueprint } from "./boolean2D-zRsWUMD9.js";
3
+ import { t as Blueprint } from "./blueprint-CY11BkHM.js";
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
6
6
  * Return a reversed copy of the curve (non-mutating).
@@ -1,6 +1,6 @@
1
1
  const require_errors = require("./errors-CXRNVCec.cjs");
2
- const require_boolean2D = require("./boolean2D-CQE7rswO.cjs");
3
- const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
2
+ const require_boolean2D = require("./boolean2D-BUqgODrH.cjs");
3
+ const require_blueprint = require("./blueprint-DpfTrOOt.cjs");
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
6
6
  * Return a reversed copy of the curve (non-mutating).
@@ -1,15 +1,16 @@
1
- const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CaSWO-Hg.cjs");
2
2
  const require_errors = require("./errors-CXRNVCec.cjs");
3
- const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
4
- const require_types = require("./types-hXSlplF3.cjs");
5
- const require_vecOps = require("./vecOps-BXvBYIor.cjs");
6
- const require_planeOps = require("./planeOps-DoTESDTM.cjs");
7
- const require_curveFns = require("./curveFns-BErRtKDj.cjs");
8
- const require_arrayAccess = require("./arrayAccess-CmulMesb.cjs");
9
- const require_surfaceBuilders = require("./surfaceBuilders-Bgc5TlIe.cjs");
10
- const require_helpers = require("./helpers-CpCe09zS.cjs");
11
- const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
12
- const require_extrudeFns = require("./extrudeFns-7_WDVoEg.cjs");
3
+ const require_faceFns = require("./faceFns-DnIpKBex.cjs");
4
+ const require_constants = require("./constants-BNP_xnBN.cjs");
5
+ const require_types = require("./types-gLi9wL0N.cjs");
6
+ const require_vecOps = require("./vecOps-5bNB19nE.cjs");
7
+ const require_planeOps = require("./planeOps-CuI-sDtn.cjs");
8
+ const require_curveFns = require("./curveFns-B_pwrAMv.cjs");
9
+ const require_arrayAccess = require("./arrayAccess-DsnQpdSD.cjs");
10
+ const require_surfaceBuilders = require("./surfaceBuilders-Bixz70pj.cjs");
11
+ const require_helpers = require("./helpers-kil7evW4.cjs");
12
+ const require_blueprint = require("./blueprint-DpfTrOOt.cjs");
13
+ const require_extrudeFns = require("./extrudeFns-B9muBNIT.cjs");
13
14
  //#region node_modules/flatqueue/index.js
14
15
  /** @template T */
15
16
  var FlatQueue = class {
@@ -1265,10 +1266,10 @@ var defaultsSplineOptions = (config) => {
1265
1266
  };
1266
1267
  const { endTangent: endTgt, startFactor = 1, endFactor = 1, startTangent: startTgt } = conf;
1267
1268
  let endTangent;
1268
- if (typeof endTgt === "number") endTangent = require_helpers.polarToCartesian(1, endTgt * require_types.DEG2RAD);
1269
+ if (typeof endTgt === "number") endTangent = require_helpers.polarToCartesian(1, endTgt * require_constants.DEG2RAD);
1269
1270
  else endTangent = endTgt;
1270
1271
  let startTangent;
1271
- if (typeof startTgt === "number") startTangent = require_helpers.polarToCartesian(1, startTgt * require_types.DEG2RAD);
1272
+ if (typeof startTgt === "number") startTangent = require_helpers.polarToCartesian(1, startTgt * require_constants.DEG2RAD);
1272
1273
  else startTangent = startTgt;
1273
1274
  return {
1274
1275
  endTangent,
@@ -1387,7 +1388,7 @@ function normalizeEllipseRadii(horizontalRadius, verticalRadius, rotation) {
1387
1388
  * @param convertToUV - Coordinate conversion function from user space to UV space.
1388
1389
  */
1389
1390
  function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis, sweep, convertToUV) {
1390
- const radRotationAngle = rotationAngleDeg * require_types.DEG2RAD;
1391
+ const radRotationAngle = rotationAngleDeg * require_constants.DEG2RAD;
1391
1392
  const convertAxis = (ax) => require_helpers.distance2d(convertToUV(ax));
1392
1393
  const r1 = convertAxis(require_helpers.polarToCartesian(majorRadius, radRotationAngle));
1393
1394
  const r2 = convertAxis(require_helpers.polarToCartesian(minorRadius, radRotationAngle + Math.PI / 2));
@@ -1479,7 +1480,7 @@ var BaseSketcher2d = class {
1479
1480
  const lastCurve = this._lastCurve();
1480
1481
  if (!lastCurve) return 0;
1481
1482
  const [dx, dy] = lastCurve.tangentAt(1);
1482
- return Math.atan2(dy, dx) * require_types.RAD2DEG;
1483
+ return Math.atan2(dy, dx) * require_constants.RAD2DEG;
1483
1484
  }
1484
1485
  /** Move the pen to an absolute 2D position before drawing any curves. */
1485
1486
  movePointerTo(point) {
@@ -1525,11 +1526,11 @@ var BaseSketcher2d = class {
1525
1526
  }
1526
1527
  /** Draw a line to a point given in polar coordinates [r, theta] from the origin. */
1527
1528
  polarLineTo([r, theta]) {
1528
- return this.lineTo(require_helpers.polarToCartesian(r, theta * require_types.DEG2RAD));
1529
+ return this.lineTo(require_helpers.polarToCartesian(r, theta * require_constants.DEG2RAD));
1529
1530
  }
1530
1531
  /** Draw a line in polar coordinates (distance and angle in degrees) from the current point. */
1531
1532
  polarLine(distance, angle) {
1532
- const [x, y] = require_helpers.polarToCartesian(distance, angle * require_types.DEG2RAD);
1533
+ const [x, y] = require_helpers.polarToCartesian(distance, angle * require_constants.DEG2RAD);
1533
1534
  return this.line(x, y);
1534
1535
  }
1535
1536
  /** Draw a line tangent to the previous curve, extending by the given distance. */
@@ -1616,7 +1617,7 @@ var BaseSketcher2d = class {
1616
1617
  halfEllipseTo(end, minorRadius, sweep = false) {
1617
1618
  const angle = require_helpers.polarAngle2d(end, this.pointer);
1618
1619
  const dist = require_helpers.distance2d(end, this.pointer);
1619
- return this.ellipseTo(end, dist / 2, minorRadius, angle * require_types.RAD2DEG, true, sweep);
1620
+ return this.ellipseTo(end, dist / 2, minorRadius, angle * require_constants.RAD2DEG, true, sweep);
1620
1621
  }
1621
1622
  /** Draw a half-ellipse arc to a relative end point with a given minor radius. */
1622
1623
  halfEllipse(xDist, yDist, minorRadius, sweep = false) {
@@ -2202,6 +2203,43 @@ function blueprintsIntersectionSegments(first, second) {
2202
2203
  //#endregion
2203
2204
  //#region src/2d/blueprints/segmentAssembly.ts
2204
2205
  /**
2206
+ * Merge adjacent collinear line segments into single segments.
2207
+ *
2208
+ * Boolean operations can split a line at intersection points that lie on the
2209
+ * line itself (e.g. when a cut rectangle's edge is collinear with the
2210
+ * profile's edge). The extra split creates a C0 discontinuity in swept
2211
+ * surfaces. Merging eliminates unnecessary vertices.
2212
+ */
2213
+ function mergeCollinearSegments(curves) {
2214
+ if (curves.length < 2) return curves;
2215
+ const result = [];
2216
+ let i = 0;
2217
+ while (i < curves.length) {
2218
+ const current = curves[i];
2219
+ if (current.geomType !== "LINE") {
2220
+ result.push(current);
2221
+ i++;
2222
+ continue;
2223
+ }
2224
+ let endPoint = current.lastPoint;
2225
+ let j = i + 1;
2226
+ while (j < curves.length) {
2227
+ const next = curves[j];
2228
+ if (next.geomType !== "LINE") break;
2229
+ if (!samePoint(endPoint, next.firstPoint)) break;
2230
+ const dir1 = require_helpers.subtract2d(endPoint, current.firstPoint);
2231
+ const dir2 = require_helpers.subtract2d(next.lastPoint, next.firstPoint);
2232
+ if (Math.abs(require_helpers.crossProduct2d(dir1, dir2)) > 1e-9) break;
2233
+ endPoint = next.lastPoint;
2234
+ j++;
2235
+ }
2236
+ if (j > i + 1) result.push(require_blueprint.make2dSegmentCurve(current.firstPoint, endPoint));
2237
+ else result.push(current);
2238
+ i = j;
2239
+ }
2240
+ return result;
2241
+ }
2242
+ /**
2205
2243
  * Split an array of curves into separate continuous paths. A discontinuity
2206
2244
  * occurs where one curve's lastPoint does not match the next curve's
2207
2245
  * firstPoint.
@@ -2307,7 +2345,7 @@ function booleanOperation(first, second, config) {
2307
2345
  });
2308
2346
  const finalLastWasSame = lastWasSame;
2309
2347
  if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
2310
- const paths = splitPaths(assembledCurves).filter((b) => b.length > 0).map((b) => new require_blueprint.Blueprint(b));
2348
+ const paths = splitPaths(mergeCollinearSegments(assembledCurves)).filter((b) => b.length > 0).map((b) => new require_blueprint.Blueprint(b));
2311
2349
  if (paths.length === 0) return null;
2312
2350
  if (paths.length === 1) {
2313
2351
  const single = paths[0];
@@ -1,15 +1,16 @@
1
- import { R as DisposalScope, X as getKernel, Y as _usingCtx, Z as getKernel2D, a as createEdge, h as isShape3D, o as createFace, t as castShape, u as createWire } from "./shapeTypes-Qh4ErtGx.js";
1
+ import { R as DisposalScope, X as getKernel, Y as _usingCtx, Z as getKernel2D, a as createEdge, h as isShape3D, o as createFace, t as castShape, u as createWire } from "./shapeTypes-BLV4Ktdb.js";
2
2
  import { A as ok, R as unwrap, T as isOk, b as err, d as validationError, h as bug, i as kernelError, l as typeCastError, n as computationError, s as safeIndex } from "./errors-DboJwVCf.js";
3
- import { P as downcast, c as normalAt, p as uvBounds, u as pointOnSurface } from "./faceFns-wSgaAQrJ.js";
4
- import { i as DEG2RAD, o as RAD2DEG, r as toVec3 } from "./types-SLY3VwcI.js";
5
- import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-D9etjPgV.js";
6
- import { n as createPlane } from "./planeOps-C94s53Ia.js";
7
- import { c as curveStartPoint, l as curveTangentAt, r as curveIsClosed } from "./curveFns-DbIakl9J.js";
8
- import { r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
9
- import { _ as zip, i as makeNewFaceWithinFace, r as makeFace, s as assembleWire } from "./surfaceBuilders-CL8MJABt.js";
10
- import { _ as samePoint$1, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, s as PRECISION_INTERSECTION, v as scalarMultiply2d } from "./helpers-DsVYL2Ri.js";
11
- import { _ as Curve2D, b as removeDuplicatePoints, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-DD20bL3n.js";
12
- import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-pjrR5ECA.js";
3
+ import { N as downcast, c as normalAt, p as uvBounds, u as pointOnSurface } from "./faceFns-CauBoVg1.js";
4
+ import { r as RAD2DEG, t as DEG2RAD } from "./constants-csSEYddm.js";
5
+ import { r as toVec3 } from "./types--GD-LVc6.js";
6
+ import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-DBmIPNhk.js";
7
+ import { n as createPlane } from "./planeOps-Da2ylKGq.js";
8
+ import { c as curveStartPoint, l as curveTangentAt, r as curveIsClosed } from "./curveFns-Dv0wz8Zm.js";
9
+ import { r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-tCIbjLs5.js";
10
+ import { _ as zip, i as makeNewFaceWithinFace, r as makeFace, s as assembleWire } from "./surfaceBuilders-AnSYsNAb.js";
11
+ import { _ as samePoint$1, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, s as PRECISION_INTERSECTION, v as scalarMultiply2d } from "./helpers-B_-mIteL.js";
12
+ import { _ as Curve2D, b as removeDuplicatePoints, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-CY11BkHM.js";
13
+ import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-lgSsOjwq.js";
13
14
  //#region node_modules/flatqueue/index.js
14
15
  /** @template T */
15
16
  var FlatQueue = class {
@@ -2202,6 +2203,43 @@ function blueprintsIntersectionSegments(first, second) {
2202
2203
  //#endregion
2203
2204
  //#region src/2d/blueprints/segmentAssembly.ts
2204
2205
  /**
2206
+ * Merge adjacent collinear line segments into single segments.
2207
+ *
2208
+ * Boolean operations can split a line at intersection points that lie on the
2209
+ * line itself (e.g. when a cut rectangle's edge is collinear with the
2210
+ * profile's edge). The extra split creates a C0 discontinuity in swept
2211
+ * surfaces. Merging eliminates unnecessary vertices.
2212
+ */
2213
+ function mergeCollinearSegments(curves) {
2214
+ if (curves.length < 2) return curves;
2215
+ const result = [];
2216
+ let i = 0;
2217
+ while (i < curves.length) {
2218
+ const current = curves[i];
2219
+ if (current.geomType !== "LINE") {
2220
+ result.push(current);
2221
+ i++;
2222
+ continue;
2223
+ }
2224
+ let endPoint = current.lastPoint;
2225
+ let j = i + 1;
2226
+ while (j < curves.length) {
2227
+ const next = curves[j];
2228
+ if (next.geomType !== "LINE") break;
2229
+ if (!samePoint(endPoint, next.firstPoint)) break;
2230
+ const dir1 = subtract2d(endPoint, current.firstPoint);
2231
+ const dir2 = subtract2d(next.lastPoint, next.firstPoint);
2232
+ if (Math.abs(crossProduct2d(dir1, dir2)) > 1e-9) break;
2233
+ endPoint = next.lastPoint;
2234
+ j++;
2235
+ }
2236
+ if (j > i + 1) result.push(make2dSegmentCurve(current.firstPoint, endPoint));
2237
+ else result.push(current);
2238
+ i = j;
2239
+ }
2240
+ return result;
2241
+ }
2242
+ /**
2205
2243
  * Split an array of curves into separate continuous paths. A discontinuity
2206
2244
  * occurs where one curve's lastPoint does not match the next curve's
2207
2245
  * firstPoint.
@@ -2307,7 +2345,7 @@ function booleanOperation(first, second, config) {
2307
2345
  });
2308
2346
  const finalLastWasSame = lastWasSame;
2309
2347
  if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
2310
- const paths = splitPaths(assembledCurves).filter((b) => b.length > 0).map((b) => new Blueprint(b));
2348
+ const paths = splitPaths(mergeCollinearSegments(assembledCurves)).filter((b) => b.length > 0).map((b) => new Blueprint(b));
2311
2349
  if (paths.length === 0) return null;
2312
2350
  if (paths.length === 1) {
2313
2351
  const single = paths[0];
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CaSWO-Hg.cjs");
2
2
  const require_errors = require("./errors-CXRNVCec.cjs");
3
- const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
4
- const require_types = require("./types-hXSlplF3.cjs");
5
- const require_vecOps = require("./vecOps-BXvBYIor.cjs");
6
- const require_planeOps = require("./planeOps-DoTESDTM.cjs");
7
- const require_shapeFns = require("./shapeFns-BtGq6ZqD.cjs");
8
- const require_arrayAccess = require("./arrayAccess-CmulMesb.cjs");
9
- const require_surfaceBuilders = require("./surfaceBuilders-Bgc5TlIe.cjs");
3
+ const require_faceFns = require("./faceFns-DnIpKBex.cjs");
4
+ const require_constants = require("./constants-BNP_xnBN.cjs");
5
+ const require_vecOps = require("./vecOps-5bNB19nE.cjs");
6
+ const require_planeOps = require("./planeOps-CuI-sDtn.cjs");
7
+ const require_shapeFns = require("./shapeFns-CBRy0V_S.cjs");
8
+ const require_arrayAccess = require("./arrayAccess-DsnQpdSD.cjs");
9
+ const require_surfaceBuilders = require("./surfaceBuilders-Bixz70pj.cjs");
10
10
  //#region src/topology/booleanFns.ts
11
11
  /**
12
12
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -48,7 +48,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValu
48
48
  fuzzyValue
49
49
  }), "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
50
50
  const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
51
- const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().fuseWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_types.HASH_CODE_MAX, {
51
+ const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().fuseWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
52
52
  optimisation,
53
53
  simplify,
54
54
  fuzzyValue
@@ -56,7 +56,12 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValu
56
56
  if (diagnostics.hasErrors) {
57
57
  if (require_shapeTypes.getKernel().isNull(resultShape)) {
58
58
  require_shapeTypes.getKernel().dispose(resultShape);
59
- return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.BOOLEAN_HAS_ERRORS, "Boolean operation reported internal errors and produced no result.", void 0, { diagnostics }, "Use checkBoolean() to pre-validate operands, or try autoHeal() on inputs."));
59
+ console.warn("brepjs: fuse history path produced null result; retrying without evolution tracking.", diagnostics);
60
+ return castToShape3D(require_shapeTypes.getKernel().fuse(a.wrapped, b.wrapped, {
61
+ optimisation,
62
+ simplify,
63
+ fuzzyValue
64
+ }), "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
60
65
  }
61
66
  console.warn("brepjs: fuse reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
62
67
  }
@@ -76,7 +81,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
76
81
  fuzzyValue
77
82
  }), "CUT_NOT_3D", "Cut did not produce a 3D shape");
78
83
  const inputFaceHashes = require_shapeFns.collectInputFaceHashes([base, tool]);
79
- const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().cutWithHistory(base.wrapped, tool.wrapped, inputFaceHashes, require_types.HASH_CODE_MAX, {
84
+ const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().cutWithHistory(base.wrapped, tool.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
80
85
  optimisation,
81
86
  simplify,
82
87
  fuzzyValue
@@ -84,7 +89,12 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
84
89
  if (diagnostics.hasErrors) {
85
90
  if (require_shapeTypes.getKernel().isNull(resultShape)) {
86
91
  require_shapeTypes.getKernel().dispose(resultShape);
87
- return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.BOOLEAN_HAS_ERRORS, "Boolean operation reported internal errors and produced no result.", void 0, { diagnostics }, "Use checkBoolean() to pre-validate operands, or try autoHeal() on inputs."));
92
+ console.warn("brepjs: cut history path produced null result; retrying without evolution tracking.", diagnostics);
93
+ return castToShape3D(require_shapeTypes.getKernel().cut(base.wrapped, tool.wrapped, {
94
+ optimisation,
95
+ simplify,
96
+ fuzzyValue
97
+ }), "CUT_NOT_3D", "Cut did not produce a 3D shape");
88
98
  }
89
99
  console.warn("brepjs: cut reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
90
100
  }
@@ -103,14 +113,18 @@ function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe
103
113
  fuzzyValue
104
114
  }), "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape");
105
115
  const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
106
- const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().intersectWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_types.HASH_CODE_MAX, {
116
+ const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().intersectWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
107
117
  simplify,
108
118
  fuzzyValue
109
119
  });
110
120
  if (diagnostics.hasErrors) {
111
121
  if (require_shapeTypes.getKernel().isNull(resultShape)) {
112
122
  require_shapeTypes.getKernel().dispose(resultShape);
113
- return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.BOOLEAN_HAS_ERRORS, "Boolean operation reported internal errors and produced no result.", void 0, { diagnostics }, "Use checkBoolean() to pre-validate operands, or try autoHeal() on inputs."));
123
+ console.warn("brepjs: intersect history path produced null result; retrying without evolution tracking.", diagnostics);
124
+ return castToShape3D(require_shapeTypes.getKernel().intersect(a.wrapped, b.wrapped, {
125
+ simplify,
126
+ fuzzyValue
127
+ }), "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape");
114
128
  }
115
129
  console.warn("brepjs: intersect reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
116
130
  }
@@ -249,8 +263,8 @@ function buildEdgeAdjacency(edges) {
249
263
  const edgeVertexHashes = /* @__PURE__ */ new Map();
250
264
  for (const edge of edges) {
251
265
  const verts = require_faceFns.getVertices(edge);
252
- const h0 = verts[0] ? require_faceFns.getOrQueryHashCode(kernel, verts[0].wrapped) : -1;
253
- const h1 = verts.length > 1 && verts[1] ? require_faceFns.getOrQueryHashCode(kernel, verts[1].wrapped) : h0;
266
+ const h0 = verts[0] ? kernel.hashCode(verts[0].wrapped, require_constants.HASH_CODE_MAX) : -1;
267
+ const h1 = verts.length > 1 && verts[1] ? kernel.hashCode(verts[1].wrapped, require_constants.HASH_CODE_MAX) : h0;
254
268
  edgeVertexHashes.set(edge, [h0, h1]);
255
269
  for (const h of [h0, h1]) {
256
270
  const bucket = vertexToEdges.get(h) ?? [];
@@ -1,12 +1,12 @@
1
- import { X as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-Qh4ErtGx.js";
1
+ import { X as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-BLV4Ktdb.js";
2
2
  import { A as ok, R as unwrap, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DboJwVCf.js";
3
- import { C as getVertices, b as getEdges, j as getOrQueryHashCode, w as getWires } from "./faceFns-wSgaAQrJ.js";
4
- import { a as HASH_CODE_MAX } from "./types-SLY3VwcI.js";
5
- import { h as vecScale, t as vecAdd } from "./vecOps-D9etjPgV.js";
6
- import { o as resolvePlane } from "./planeOps-C94s53Ia.js";
7
- import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-ClKIHb3P.js";
8
- import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
9
- import { r as makeFace } from "./surfaceBuilders-CL8MJABt.js";
3
+ import { C as getVertices, b as getEdges, w as getWires } from "./faceFns-CauBoVg1.js";
4
+ import { n as HASH_CODE_MAX } from "./constants-csSEYddm.js";
5
+ import { h as vecScale, t as vecAdd } from "./vecOps-DBmIPNhk.js";
6
+ import { o as resolvePlane } from "./planeOps-Da2ylKGq.js";
7
+ import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-4ySHDRyO.js";
8
+ import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-tCIbjLs5.js";
9
+ import { r as makeFace } from "./surfaceBuilders-AnSYsNAb.js";
10
10
  //#region src/topology/booleanFns.ts
11
11
  /**
12
12
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -56,7 +56,12 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValu
56
56
  if (diagnostics.hasErrors) {
57
57
  if (getKernel().isNull(resultShape)) {
58
58
  getKernel().dispose(resultShape);
59
- return err(kernelError(BrepErrorCode.BOOLEAN_HAS_ERRORS, "Boolean operation reported internal errors and produced no result.", void 0, { diagnostics }, "Use checkBoolean() to pre-validate operands, or try autoHeal() on inputs."));
59
+ console.warn("brepjs: fuse history path produced null result; retrying without evolution tracking.", diagnostics);
60
+ return castToShape3D(getKernel().fuse(a.wrapped, b.wrapped, {
61
+ optimisation,
62
+ simplify,
63
+ fuzzyValue
64
+ }), "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
60
65
  }
61
66
  console.warn("brepjs: fuse reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
62
67
  }
@@ -84,7 +89,12 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
84
89
  if (diagnostics.hasErrors) {
85
90
  if (getKernel().isNull(resultShape)) {
86
91
  getKernel().dispose(resultShape);
87
- return err(kernelError(BrepErrorCode.BOOLEAN_HAS_ERRORS, "Boolean operation reported internal errors and produced no result.", void 0, { diagnostics }, "Use checkBoolean() to pre-validate operands, or try autoHeal() on inputs."));
92
+ console.warn("brepjs: cut history path produced null result; retrying without evolution tracking.", diagnostics);
93
+ return castToShape3D(getKernel().cut(base.wrapped, tool.wrapped, {
94
+ optimisation,
95
+ simplify,
96
+ fuzzyValue
97
+ }), "CUT_NOT_3D", "Cut did not produce a 3D shape");
88
98
  }
89
99
  console.warn("brepjs: cut reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
90
100
  }
@@ -110,7 +120,11 @@ function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe
110
120
  if (diagnostics.hasErrors) {
111
121
  if (getKernel().isNull(resultShape)) {
112
122
  getKernel().dispose(resultShape);
113
- return err(kernelError(BrepErrorCode.BOOLEAN_HAS_ERRORS, "Boolean operation reported internal errors and produced no result.", void 0, { diagnostics }, "Use checkBoolean() to pre-validate operands, or try autoHeal() on inputs."));
123
+ console.warn("brepjs: intersect history path produced null result; retrying without evolution tracking.", diagnostics);
124
+ return castToShape3D(getKernel().intersect(a.wrapped, b.wrapped, {
125
+ simplify,
126
+ fuzzyValue
127
+ }), "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape");
114
128
  }
115
129
  console.warn("brepjs: intersect reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
116
130
  }
@@ -249,8 +263,8 @@ function buildEdgeAdjacency(edges) {
249
263
  const edgeVertexHashes = /* @__PURE__ */ new Map();
250
264
  for (const edge of edges) {
251
265
  const verts = getVertices(edge);
252
- const h0 = verts[0] ? getOrQueryHashCode(kernel, verts[0].wrapped) : -1;
253
- const h1 = verts.length > 1 && verts[1] ? getOrQueryHashCode(kernel, verts[1].wrapped) : h0;
266
+ const h0 = verts[0] ? kernel.hashCode(verts[0].wrapped, HASH_CODE_MAX) : -1;
267
+ const h1 = verts.length > 1 && verts[1] ? kernel.hashCode(verts[1].wrapped, HASH_CODE_MAX) : h0;
254
268
  edgeVertexHashes.set(edge, [h0, h1]);
255
269
  for (const h of [h0, h1]) {
256
270
  const bucket = vertexToEdges.get(h) ?? [];
package/dist/brepjs.cjs CHANGED
@@ -1,30 +1,31 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_drawFns = require("./drawFns-Bk5q5z-m.cjs");
3
- const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
2
+ const require_drawFns = require("./drawFns-D98GdpRM.cjs");
3
+ const require_shapeTypes = require("./shapeTypes-CaSWO-Hg.cjs");
4
4
  const require_occtWasmAdapter = require("./occtWasmAdapter-DcGOi3MQ.cjs");
5
5
  const require_errors = require("./errors-CXRNVCec.cjs");
6
- const require_faceFns = require("./faceFns-B8y0xqpK.cjs");
7
- const require_types = require("./types-hXSlplF3.cjs");
8
- const require_vecOps = require("./vecOps-BXvBYIor.cjs");
9
- const require_planeOps = require("./planeOps-DoTESDTM.cjs");
10
- const require_shapeFns = require("./shapeFns-BtGq6ZqD.cjs");
11
- const require_curveFns = require("./curveFns-BErRtKDj.cjs");
12
- const require_meshFns = require("./meshFns-rMEka_pV.cjs");
13
- const require_arrayAccess = require("./arrayAccess-CmulMesb.cjs");
14
- const require_surfaceBuilders = require("./surfaceBuilders-Bgc5TlIe.cjs");
15
- const require_booleanFns = require("./booleanFns-D3wX7_qO.cjs");
16
- const require_primitiveFns = require("./primitiveFns-B1R8RWjt.cjs");
17
- const require_historyFns = require("./historyFns-DAY8a7Ss.cjs");
18
- const require_boolean2D = require("./boolean2D-CQE7rswO.cjs");
19
- const require_helpers = require("./helpers-CpCe09zS.cjs");
20
- const require_solidBuilders = require("./solidBuilders-BMv6UQUY.cjs");
21
- const require_measureFns = require("./measureFns-vgnbVhDc.cjs");
22
- const require_cornerFinder = require("./cornerFinder-BybcZVxL.cjs");
23
- const require_extrudeFns = require("./extrudeFns-7_WDVoEg.cjs");
24
- const require_blueprintFns = require("./blueprintFns-DFLtehf-.cjs");
25
- const require_importFns = require("./importFns-B-5chCzB.cjs");
26
- const require_shapeRefFns = require("./shapeRefFns-MA4_U4Fn.cjs");
27
- const require_workerHandler = require("./workerHandler-C-7OUJsa.cjs");
6
+ const require_faceFns = require("./faceFns-DnIpKBex.cjs");
7
+ const require_constants = require("./constants-BNP_xnBN.cjs");
8
+ const require_types = require("./types-gLi9wL0N.cjs");
9
+ const require_vecOps = require("./vecOps-5bNB19nE.cjs");
10
+ const require_planeOps = require("./planeOps-CuI-sDtn.cjs");
11
+ const require_shapeFns = require("./shapeFns-CBRy0V_S.cjs");
12
+ const require_curveFns = require("./curveFns-B_pwrAMv.cjs");
13
+ const require_meshFns = require("./meshFns-Cxs6gU44.cjs");
14
+ const require_arrayAccess = require("./arrayAccess-DsnQpdSD.cjs");
15
+ const require_surfaceBuilders = require("./surfaceBuilders-Bixz70pj.cjs");
16
+ const require_booleanFns = require("./booleanFns-B86ltlZD.cjs");
17
+ const require_primitiveFns = require("./primitiveFns-CWiHuJw9.cjs");
18
+ const require_historyFns = require("./historyFns-D7UojEn3.cjs");
19
+ const require_boolean2D = require("./boolean2D-BUqgODrH.cjs");
20
+ const require_helpers = require("./helpers-kil7evW4.cjs");
21
+ const require_solidBuilders = require("./solidBuilders-BZFaM6nk.cjs");
22
+ const require_measureFns = require("./measureFns-Bt0Rd9q9.cjs");
23
+ const require_cornerFinder = require("./cornerFinder-DNmYCgaQ.cjs");
24
+ const require_extrudeFns = require("./extrudeFns-B9muBNIT.cjs");
25
+ const require_blueprintFns = require("./blueprintFns-oD720gYA.cjs");
26
+ const require_importFns = require("./importFns-Y4wgn0rJ.cjs");
27
+ const require_shapeRefFns = require("./shapeRefFns-oAyQxHO1.cjs");
28
+ const require_workerHandler = require("./workerHandler-C-3cFcsQ.cjs");
28
29
  //#region src/topology/shapeBooleans.ts
29
30
  var BOPAlgo_GlueShift = 1;
30
31
  var BOPAlgo_GlueFull = 2;
@@ -2765,12 +2766,12 @@ exports.BrepErrorCode = require_errors.BrepErrorCode;
2765
2766
  exports.BrepWrapperError = BrepWrapperError;
2766
2767
  exports.BrepkitAdapter = require_shapeTypes.BrepkitAdapter;
2767
2768
  exports.CompoundSketch = require_drawFns.CompoundSketch;
2768
- exports.DEG2RAD = require_types.DEG2RAD;
2769
+ exports.DEG2RAD = require_constants.DEG2RAD;
2769
2770
  exports.DisposalScope = require_shapeTypes.DisposalScope;
2770
- exports.HASH_CODE_MAX = require_types.HASH_CODE_MAX;
2771
+ exports.HASH_CODE_MAX = require_constants.HASH_CODE_MAX;
2771
2772
  exports.OK = require_errors.OK;
2772
2773
  exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
2773
- exports.RAD2DEG = require_types.RAD2DEG;
2774
+ exports.RAD2DEG = require_constants.RAD2DEG;
2774
2775
  exports.Sketch = require_boolean2D.Sketch;
2775
2776
  exports.Sketches = require_drawFns.Sketches;
2776
2777
  exports.addChild = require_historyFns.addChild;