brepjs 15.1.11 → 15.1.13

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.cjs +5 -5
  2. package/dist/2d.js +5 -5
  3. package/dist/{blueprint-DD20bL3n.js → blueprint-CY11BkHM.js} +9 -8
  4. package/dist/{blueprint-BvUKWbkE.cjs → blueprint-DpfTrOOt.cjs} +13 -12
  5. package/dist/{blueprintFns-DgUIqFgy.js → blueprintFns-C-XRp3LD.js} +2 -2
  6. package/dist/{blueprintFns-CXdRmpJv.cjs → blueprintFns-DTGzK_O3.cjs} +2 -2
  7. package/dist/{boolean2D-Cpk3Ieie.cjs → boolean2D-CNan_aDM.cjs} +26 -19
  8. package/dist/{boolean2D-BtmgEhzg.js → boolean2D-Dj0eTZfG.js} +19 -12
  9. package/dist/{booleanFns-8kJL7byz.cjs → booleanFns-B86ltlZD.cjs} +13 -13
  10. package/dist/{booleanFns-BmOsJHAY.js → booleanFns-CiiCf7YH.js} +10 -10
  11. package/dist/brepjs.cjs +28 -27
  12. package/dist/brepjs.js +25 -24
  13. package/dist/constants-BNP_xnBN.cjs +26 -0
  14. package/dist/constants-csSEYddm.js +9 -0
  15. package/dist/core.cjs +8 -7
  16. package/dist/core.js +5 -4
  17. package/dist/{cornerFinder-BybcZVxL.cjs → cornerFinder-DNmYCgaQ.cjs} +4 -4
  18. package/dist/{cornerFinder-C7k0yipe.js → cornerFinder-lO-ySgHJ.js} +3 -3
  19. package/dist/{curveFns-BErRtKDj.cjs → curveFns-B_pwrAMv.cjs} +1 -1
  20. package/dist/{curveFns-DbIakl9J.js → curveFns-Dv0wz8Zm.js} +1 -1
  21. package/dist/{drawFns-PktTJbzy.cjs → drawFns-BNSmHZXu.cjs} +16 -15
  22. package/dist/{drawFns-Rn-dEfBR.js → drawFns-CJxFWoi9.js} +15 -14
  23. package/dist/{extrudeFns-7_WDVoEg.cjs → extrudeFns-B9muBNIT.cjs} +2 -2
  24. package/dist/{extrudeFns-pjrR5ECA.js → extrudeFns-lgSsOjwq.js} +2 -2
  25. package/dist/{faceFns-wSgaAQrJ.js → faceFns-CauBoVg1.js} +5 -35
  26. package/dist/{faceFns-B8y0xqpK.cjs → faceFns-DnIpKBex.cjs} +4 -40
  27. package/dist/{helpers-DsVYL2Ri.js → helpers-B_-mIteL.js} +7 -7
  28. package/dist/{helpers-CpCe09zS.cjs → helpers-kil7evW4.cjs} +9 -9
  29. package/dist/{historyFns-DbUJQAXI.cjs → historyFns-D7UojEn3.cjs} +5 -5
  30. package/dist/{historyFns-B3d7YiP9.js → historyFns-DYrliEQE.js} +5 -5
  31. package/dist/{importFns-C0Edyiov.js → importFns-CPzDHVKm.js} +3 -3
  32. package/dist/{importFns-B-5chCzB.cjs → importFns-Y4wgn0rJ.cjs} +3 -3
  33. package/dist/io.cjs +2 -2
  34. package/dist/io.js +2 -2
  35. package/dist/kernel/geometry2d.d.ts.map +1 -1
  36. package/dist/kernel/occt/defaultAdapter.d.ts.map +1 -1
  37. package/dist/kernel/occt/kernel2dOps.d.ts +68 -61
  38. package/dist/kernel/occt/kernel2dOps.d.ts.map +1 -1
  39. package/dist/{measureFns-gRr84qGk.js → measureFns-Bey2EmNQ.js} +2 -2
  40. package/dist/{measureFns-vgnbVhDc.cjs → measureFns-Bt0Rd9q9.cjs} +2 -2
  41. package/dist/measurement.cjs +1 -1
  42. package/dist/measurement.js +1 -1
  43. package/dist/{meshFns-rMEka_pV.cjs → meshFns-Cxs6gU44.cjs} +2 -2
  44. package/dist/{meshFns-CA6fJ-Z0.js → meshFns-DO58R94T.js} +2 -2
  45. package/dist/operations.cjs +2 -2
  46. package/dist/operations.js +2 -2
  47. package/dist/{planeOps-DoTESDTM.cjs → planeOps-CuI-sDtn.cjs} +4 -3
  48. package/dist/{planeOps-C94s53Ia.js → planeOps-Da2ylKGq.js} +3 -2
  49. package/dist/{primitiveFns-B1R8RWjt.cjs → primitiveFns-CWiHuJw9.cjs} +34 -34
  50. package/dist/{primitiveFns-DtfUR91z.js → primitiveFns-Rpdnd3FK.js} +21 -21
  51. package/dist/query.cjs +2 -2
  52. package/dist/query.js +2 -2
  53. package/dist/{shapeFns-ClKIHb3P.js → shapeFns-4ySHDRyO.js} +14 -14
  54. package/dist/{shapeFns-BtGq6ZqD.cjs → shapeFns-CBRy0V_S.cjs} +20 -20
  55. package/dist/shapeRef.cjs +1 -1
  56. package/dist/shapeRef.js +1 -1
  57. package/dist/{shapeRefFns-DjWRttT2.js → shapeRefFns-D21Yl4Eu.js} +3 -3
  58. package/dist/{shapeRefFns-MA4_U4Fn.cjs → shapeRefFns-oAyQxHO1.cjs} +3 -3
  59. package/dist/{shapeTypes-Qh4ErtGx.js → shapeTypes-BLV4Ktdb.js} +604 -788
  60. package/dist/{shapeTypes-Cs7uihz8.cjs → shapeTypes-CaSWO-Hg.cjs} +604 -793
  61. package/dist/sketching/sketch.d.ts.map +1 -1
  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
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-Cpk3Ieie.cjs");
6
- const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
7
- const require_blueprintFns = require("./blueprintFns-CXdRmpJv.cjs");
4
+ const require_faceFns = require("./faceFns-DnIpKBex.cjs");
5
+ const require_boolean2D = require("./boolean2D-CNan_aDM.cjs");
6
+ const require_blueprint = require("./blueprint-DpfTrOOt.cjs");
7
+ const require_blueprintFns = require("./blueprintFns-DTGzK_O3.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-BtmgEhzg.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-DgUIqFgy.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-Dj0eTZfG.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-C-XRp3LD.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-BtmgEhzg.js";
3
- import { t as Blueprint } from "./blueprint-DD20bL3n.js";
2
+ import { g as CompoundBlueprint } from "./boolean2D-Dj0eTZfG.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-Cpk3Ieie.cjs");
3
- const require_blueprint = require("./blueprint-BvUKWbkE.cjs");
2
+ const require_boolean2D = require("./boolean2D-CNan_aDM.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 {
@@ -1223,7 +1224,13 @@ var Sketch = class Sketch {
1223
1224
  const normal = require_vecOps.vecNormalize(require_vecOps.vecScale(require_curveFns.curveTangentAt(this.wire, 1e-9), -1));
1224
1225
  const defaultDir = this.defaultDirection;
1225
1226
  const xDir = require_vecOps.vecScale(require_vecOps.vecCross(normal, defaultDir), -1);
1226
- const sketch = sketchOnPlane(require_planeOps.createPlane([...startPoint], [...xDir], [...normal]), [...startPoint]);
1227
+ const result = sketchOnPlane(require_planeOps.createPlane([...startPoint], [...xDir], [...normal]), [...startPoint]);
1228
+ let sketch;
1229
+ if ("sketches" in result && Array.isArray(result.sketches)) {
1230
+ const pieces = result.sketches;
1231
+ sketch = pieces[0];
1232
+ for (let i = 1; i < pieces.length; i++) pieces[i]?.delete();
1233
+ } else sketch = result;
1227
1234
  const config = {
1228
1235
  forceProfileSpineOthogonality: true,
1229
1236
  ...sweepConfig
@@ -1265,10 +1272,10 @@ var defaultsSplineOptions = (config) => {
1265
1272
  };
1266
1273
  const { endTangent: endTgt, startFactor = 1, endFactor = 1, startTangent: startTgt } = conf;
1267
1274
  let endTangent;
1268
- if (typeof endTgt === "number") endTangent = require_helpers.polarToCartesian(1, endTgt * require_types.DEG2RAD);
1275
+ if (typeof endTgt === "number") endTangent = require_helpers.polarToCartesian(1, endTgt * require_constants.DEG2RAD);
1269
1276
  else endTangent = endTgt;
1270
1277
  let startTangent;
1271
- if (typeof startTgt === "number") startTangent = require_helpers.polarToCartesian(1, startTgt * require_types.DEG2RAD);
1278
+ if (typeof startTgt === "number") startTangent = require_helpers.polarToCartesian(1, startTgt * require_constants.DEG2RAD);
1272
1279
  else startTangent = startTgt;
1273
1280
  return {
1274
1281
  endTangent,
@@ -1387,7 +1394,7 @@ function normalizeEllipseRadii(horizontalRadius, verticalRadius, rotation) {
1387
1394
  * @param convertToUV - Coordinate conversion function from user space to UV space.
1388
1395
  */
1389
1396
  function makeEllipseArcFromSvgParams(startUV, endUV, majorRadius, minorRadius, rotationAngleDeg, longAxis, sweep, convertToUV) {
1390
- const radRotationAngle = rotationAngleDeg * require_types.DEG2RAD;
1397
+ const radRotationAngle = rotationAngleDeg * require_constants.DEG2RAD;
1391
1398
  const convertAxis = (ax) => require_helpers.distance2d(convertToUV(ax));
1392
1399
  const r1 = convertAxis(require_helpers.polarToCartesian(majorRadius, radRotationAngle));
1393
1400
  const r2 = convertAxis(require_helpers.polarToCartesian(minorRadius, radRotationAngle + Math.PI / 2));
@@ -1479,7 +1486,7 @@ var BaseSketcher2d = class {
1479
1486
  const lastCurve = this._lastCurve();
1480
1487
  if (!lastCurve) return 0;
1481
1488
  const [dx, dy] = lastCurve.tangentAt(1);
1482
- return Math.atan2(dy, dx) * require_types.RAD2DEG;
1489
+ return Math.atan2(dy, dx) * require_constants.RAD2DEG;
1483
1490
  }
1484
1491
  /** Move the pen to an absolute 2D position before drawing any curves. */
1485
1492
  movePointerTo(point) {
@@ -1525,11 +1532,11 @@ var BaseSketcher2d = class {
1525
1532
  }
1526
1533
  /** Draw a line to a point given in polar coordinates [r, theta] from the origin. */
1527
1534
  polarLineTo([r, theta]) {
1528
- return this.lineTo(require_helpers.polarToCartesian(r, theta * require_types.DEG2RAD));
1535
+ return this.lineTo(require_helpers.polarToCartesian(r, theta * require_constants.DEG2RAD));
1529
1536
  }
1530
1537
  /** Draw a line in polar coordinates (distance and angle in degrees) from the current point. */
1531
1538
  polarLine(distance, angle) {
1532
- const [x, y] = require_helpers.polarToCartesian(distance, angle * require_types.DEG2RAD);
1539
+ const [x, y] = require_helpers.polarToCartesian(distance, angle * require_constants.DEG2RAD);
1533
1540
  return this.line(x, y);
1534
1541
  }
1535
1542
  /** Draw a line tangent to the previous curve, extending by the given distance. */
@@ -1616,7 +1623,7 @@ var BaseSketcher2d = class {
1616
1623
  halfEllipseTo(end, minorRadius, sweep = false) {
1617
1624
  const angle = require_helpers.polarAngle2d(end, this.pointer);
1618
1625
  const dist = require_helpers.distance2d(end, this.pointer);
1619
- return this.ellipseTo(end, dist / 2, minorRadius, angle * require_types.RAD2DEG, true, sweep);
1626
+ return this.ellipseTo(end, dist / 2, minorRadius, angle * require_constants.RAD2DEG, true, sweep);
1620
1627
  }
1621
1628
  /** Draw a half-ellipse arc to a relative end point with a given minor radius. */
1622
1629
  halfEllipse(xDist, yDist, minorRadius, sweep = false) {
@@ -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 {
@@ -1223,7 +1224,13 @@ var Sketch = class Sketch {
1223
1224
  const normal = vecNormalize(vecScale(curveTangentAt(this.wire, 1e-9), -1));
1224
1225
  const defaultDir = this.defaultDirection;
1225
1226
  const xDir = vecScale(vecCross(normal, defaultDir), -1);
1226
- const sketch = sketchOnPlane(createPlane([...startPoint], [...xDir], [...normal]), [...startPoint]);
1227
+ const result = sketchOnPlane(createPlane([...startPoint], [...xDir], [...normal]), [...startPoint]);
1228
+ let sketch;
1229
+ if ("sketches" in result && Array.isArray(result.sketches)) {
1230
+ const pieces = result.sketches;
1231
+ sketch = pieces[0];
1232
+ for (let i = 1; i < pieces.length; i++) pieces[i]?.delete();
1233
+ } else sketch = result;
1227
1234
  const config = {
1228
1235
  forceProfileSpineOthogonality: true,
1229
1236
  ...sweepConfig
@@ -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
@@ -81,7 +81,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
81
81
  fuzzyValue
82
82
  }), "CUT_NOT_3D", "Cut did not produce a 3D shape");
83
83
  const inputFaceHashes = require_shapeFns.collectInputFaceHashes([base, tool]);
84
- 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, {
85
85
  optimisation,
86
86
  simplify,
87
87
  fuzzyValue
@@ -113,7 +113,7 @@ function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe
113
113
  fuzzyValue
114
114
  }), "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape");
115
115
  const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
116
- 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, {
117
117
  simplify,
118
118
  fuzzyValue
119
119
  });
@@ -263,8 +263,8 @@ function buildEdgeAdjacency(edges) {
263
263
  const edgeVertexHashes = /* @__PURE__ */ new Map();
264
264
  for (const edge of edges) {
265
265
  const verts = require_faceFns.getVertices(edge);
266
- const h0 = verts[0] ? require_faceFns.getOrQueryHashCode(kernel, verts[0].wrapped) : -1;
267
- 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;
268
268
  edgeVertexHashes.set(edge, [h0, h1]);
269
269
  for (const h of [h0, h1]) {
270
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.
@@ -263,8 +263,8 @@ function buildEdgeAdjacency(edges) {
263
263
  const edgeVertexHashes = /* @__PURE__ */ new Map();
264
264
  for (const edge of edges) {
265
265
  const verts = getVertices(edge);
266
- const h0 = verts[0] ? getOrQueryHashCode(kernel, verts[0].wrapped) : -1;
267
- 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;
268
268
  edgeVertexHashes.set(edge, [h0, h1]);
269
269
  for (const h of [h0, h1]) {
270
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-PktTJbzy.cjs");
3
- const require_shapeTypes = require("./shapeTypes-Cs7uihz8.cjs");
2
+ const require_drawFns = require("./drawFns-BNSmHZXu.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-8kJL7byz.cjs");
16
- const require_primitiveFns = require("./primitiveFns-B1R8RWjt.cjs");
17
- const require_historyFns = require("./historyFns-DbUJQAXI.cjs");
18
- const require_boolean2D = require("./boolean2D-Cpk3Ieie.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-CXdRmpJv.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-CNan_aDM.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-DTGzK_O3.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;
package/dist/brepjs.js CHANGED
@@ -1,29 +1,30 @@
1
- import { $ as initFromOC, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, Q as init, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getKernel, _ as isSolid, a as createEdge, at as BrepkitAdapter, b as closedWire, c as createSolid, d as isCompound, et as prewarm, f as isEdge, g as isShell, h as isShape3D, i as createCompound, it as supportsProjection, j as validSolid, k as planarFace, l as createVertex, m as isShape1D, n as castShape3D, nt as withKernel, o as createFace, ot as getPerformanceStats, p as isFace, q as withScopeResult, rt as supportsConstraintSketch, s as createShell, st as resetPerformanceStats, t as castShape, tt as registerKernel, u as createWire, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-Qh4ErtGx.js";
1
+ import { $ as initFromOC, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, Q as init, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getKernel, _ as isSolid, a as createEdge, at as BrepkitAdapter, b as closedWire, c as createSolid, d as isCompound, et as prewarm, f as isEdge, g as isShell, h as isShape3D, i as createCompound, it as supportsProjection, j as validSolid, k as planarFace, l as createVertex, m as isShape1D, n as castShape3D, nt as withKernel, o as createFace, ot as getPerformanceStats, p as isFace, q as withScopeResult, rt as supportsConstraintSketch, s as createShell, st as resetPerformanceStats, t as castShape, tt as registerKernel, u as createWire, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-BLV4Ktdb.js";
2
2
  import { t as OcctWasmAdapter } from "./occtWasmAdapter-BBr9e9ej.js";
3
3
  import { A as ok, B as unwrapOr, C as fromNullable, D as mapBoth, E as map, F as tapErr, H as zip, I as tryCatch, L as tryCatchAsync, M as orElse, N as pipeline, O as mapErr, P as tap, R as unwrap, S as flatten, T as isOk, V as unwrapOrElse, _ as all, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, j as or, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, t as BrepErrorCode, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-DboJwVCf.js";
4
- import { A as vertexPosition, B as kernelCallRaw, C as getVertices, D as iterFaces, E as iterEdges, F as fromBREP, I as isCompSolid, L as iterTopo, M as asTopo, N as cast, O as iterVertices, P as downcast, R as shapeType, T as invalidateShapeCache, V as kernelCallScoped, a as flipFaceOrientation, b as getEdges, c as normalAt, d as projectPointOnFace, f as removeHolesFromFace, g as getBounds, h as describe$1, i as faceOrientation, k as iterWires, l as outerWire, m as uvCoordinates, n as faceCenter, o as getSurfaceType, p as uvBounds, r as faceGeomType, s as innerWires, t as classifyPointOnFace, u as pointOnSurface, w as getWires, x as getFaces, y as getCachedSurfaceType, z as kernelCall } from "./faceFns-wSgaAQrJ.js";
5
- import { a as HASH_CODE_MAX, i as DEG2RAD, n as toVec2, o as RAD2DEG, r as toVec3, t as resolveDirection } from "./types-SLY3VwcI.js";
6
- import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-D9etjPgV.js";
7
- import { i as pivotPlane, n as createPlane, o as resolvePlane, r as makePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-C94s53Ia.js";
8
- import { C as findFacesByTag, D as tagFaces, E as setTagMetadata, O as getFaceOrigins, S as getShapeColor, T as getTagMetadata, a as isSameShape, b as colorShape, c as applyMatrix$1, d as resize, f as rotate$1, h as translate$1, i as isEqualShape, k as setShapeOrigin, l as composeTransforms, m as transformCopy$1, n as getHashCode, o as simplify$1, p as scale$1, r as isEmpty$2, s as toBREP$1, t as clone$1, u as mirror$1, w as getFaceTags, x as getFaceColor, y as colorFaces } from "./shapeFns-ClKIHb3P.js";
9
- import { a as curveLength, c as curveStartPoint, d as getCurveType, f as getOrientation, i as curveIsPeriodic, l as curveTangentAt, m as offsetWire2D, n as curveEndPoint, o as curvePeriod, p as interpolateCurve, r as curveIsClosed, s as curvePointAt, t as approximateCurve, u as flipOrientation } from "./curveFns-DbIakl9J.js";
10
- import { a as meshEdges$1, c as createMeshCache, i as mesh$1, n as exportSTEP, o as meshMultiLOD, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-CA6fJ-Z0.js";
11
- import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
12
- import { n as fill, r as makeFace } from "./surfaceBuilders-CL8MJABt.js";
13
- import { a as fuseAll, c as sectionToFace$1, i as fuse$1, l as slice$1, n as cut$1, o as intersect$1, r as cutAll, s as section$1, t as booleanPipeline, u as split$1 } from "./booleanFns-BmOsJHAY.js";
14
- import { $ as getNurbsSurfaceData, A as fixShape, B as offset$1, C as threePointArc, D as wireLoop, E as wire, F as isValid$1, G as chamferWithEvolution, H as thicken$1, I as solidFromShell, J as fuseWithEvolution, K as cutWithEvolution, L as chamfer$1, M as healFace, N as healSolid, O as autoHeal, P as healWire, Q as getNurbsCurveData, R as draft$1, S as tangentArc, T as vertex, U as variableFillet, V as shell$1, W as positionOnCurve, X as shellWithEvolution, Y as intersectWithEvolution, Z as checkBoolean, _ as polygon, a as circle, at as wiresOfFace, b as sphere, c as cylinder, ct as toGroupedBufferGeometryData, d as ellipsoid, et as adjacentFaces, f as face, g as offsetFace, h as line, i as bsplineApprox, it as verticesOfEdge, j as heal$1, k as fixSelfIntersection, l as ellipse, lt as toLODGeometryData, m as helix, n as bezier, nt as facesOfEdge, o as compound, ot as chamferDistAngle, p as filledFace, q as filletWithEvolution, r as box, rt as sharedEdges, s as cone, st as toBufferGeometryData, t as addHoles, tt as edgesOfFace, u as ellipseArc, ut as toLineGeometryData, v as sewShells, w as torus, x as subFace, y as solid, z as fillet$1 } from "./primitiveFns-DtfUR91z.js";
15
- import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, f as serializeHistory, g as addChild, h as undoLast, i as deserializeHistory, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-B3d7YiP9.js";
16
- import { a as fuseBlueprints, c as roundedRectangleBlueprint, f as Sketch, h as organiseBlueprints, i as cutBlueprints, m as loftAll, n as fuse2D, o as intersectBlueprints, p as loft$1, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BtmgEhzg.js";
17
- import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-DsVYL2Ri.js";
18
- import { $ as sketchFaceOffset, B as drawSingleCircle, C as cameraFromPlane, D as makeProjectedEdges, E as projectEdges, F as drawParametricFunction, G as loadFont, H as drawText, I as drawPointsInterpolation, J as textMetrics, K as sketchText, L as drawPolysides, M as draw, N as drawCircle, O as isProjectionPlane, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, T as createCamera, U as fontMetrics, V as drawSingleEllipse, W as getFont, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, b as sketchWires, c as rotateDrawing, d as compoundSketchExtrude, et as sketchHelix, f as compoundSketchFace, g as sketchFace, h as sketchExtrude, i as drawingFuse, it as sketchRoundedRectangle, j as deserializeDrawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, q as textBlueprints, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, w as cameraLookAt, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-Rn-dEfBR.js";
19
- import { r as makeCylinder } from "./solidBuilders-CHvrwtLL.js";
20
- import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-gRr84qGk.js";
21
- import { t as cornerFinder } from "./cornerFinder-C7k0yipe.js";
22
- import { a as guidedSweep, c as sweep, i as complexExtrude, l as twistExtrude, n as extrudeAll, o as multiSectionSweep, r as revolve$1, s as supportExtrude, t as extrude$1 } from "./extrudeFns-pjrR5ECA.js";
23
- 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, n as createCompoundBlueprint, 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-DgUIqFgy.js";
24
- 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-C0Edyiov.js";
25
- import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-DjWRttT2.js";
26
- import { a as createTaskQueue, c as isEmpty$1, d as isDisposeRequest, f as isErrorResponse, h as isSuccessResponse, i as createWorkerClient, l as pendingCount, m as isOperationRequest, n as createWorkerHandler, o as dequeueTask, p as isInitRequest, r as registerHandler, s as enqueueTask, t as createOperationRegistry, u as rejectAll } from "./workerHandler-o2xzAfFk.js";
4
+ import { A as vertexPosition, B as kernelCallScoped, C as getVertices, D as iterFaces, E as iterEdges, F as isCompSolid, I as iterTopo, L as shapeType, M as cast, N as downcast, O as iterVertices, P as fromBREP, R as kernelCall, T as invalidateShapeCache, a as flipFaceOrientation, b as getEdges, c as normalAt, d as projectPointOnFace, f as removeHolesFromFace, g as getBounds, h as describe$1, i as faceOrientation, j as asTopo, k as iterWires, l as outerWire, m as uvCoordinates, n as faceCenter, o as getSurfaceType, p as uvBounds, r as faceGeomType, s as innerWires, t as classifyPointOnFace, u as pointOnSurface, w as getWires, x as getFaces, y as getCachedSurfaceType, z as kernelCallRaw } from "./faceFns-CauBoVg1.js";
5
+ import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-csSEYddm.js";
6
+ import { n as toVec2, r as toVec3, t as resolveDirection } from "./types--GD-LVc6.js";
7
+ import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-DBmIPNhk.js";
8
+ import { i as pivotPlane, n as createPlane, o as resolvePlane, r as makePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-Da2ylKGq.js";
9
+ import { C as findFacesByTag, D as tagFaces, E as setTagMetadata, O as getFaceOrigins, S as getShapeColor, T as getTagMetadata, a as isSameShape, b as colorShape, c as applyMatrix$1, d as resize, f as rotate$1, h as translate$1, i as isEqualShape, k as setShapeOrigin, l as composeTransforms, m as transformCopy$1, n as getHashCode, o as simplify$1, p as scale$1, r as isEmpty$2, s as toBREP$1, t as clone$1, u as mirror$1, w as getFaceTags, x as getFaceColor, y as colorFaces } from "./shapeFns-4ySHDRyO.js";
10
+ import { a as curveLength, c as curveStartPoint, d as getCurveType, f as getOrientation, i as curveIsPeriodic, l as curveTangentAt, m as offsetWire2D, n as curveEndPoint, o as curvePeriod, p as interpolateCurve, r as curveIsClosed, s as curvePointAt, t as approximateCurve, u as flipOrientation } from "./curveFns-Dv0wz8Zm.js";
11
+ import { a as meshEdges$1, c as createMeshCache, i as mesh$1, n as exportSTEP, o as meshMultiLOD, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-DO58R94T.js";
12
+ import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-tCIbjLs5.js";
13
+ import { n as fill, r as makeFace } from "./surfaceBuilders-AnSYsNAb.js";
14
+ import { a as fuseAll, c as sectionToFace$1, i as fuse$1, l as slice$1, n as cut$1, o as intersect$1, r as cutAll, s as section$1, t as booleanPipeline, u as split$1 } from "./booleanFns-CiiCf7YH.js";
15
+ import { $ as getNurbsSurfaceData, A as fixShape, B as offset$1, C as threePointArc, D as wireLoop, E as wire, F as isValid$1, G as chamferWithEvolution, H as thicken$1, I as solidFromShell, J as fuseWithEvolution, K as cutWithEvolution, L as chamfer$1, M as healFace, N as healSolid, O as autoHeal, P as healWire, Q as getNurbsCurveData, R as draft$1, S as tangentArc, T as vertex, U as variableFillet, V as shell$1, W as positionOnCurve, X as shellWithEvolution, Y as intersectWithEvolution, Z as checkBoolean, _ as polygon, a as circle, at as wiresOfFace, b as sphere, c as cylinder, ct as toGroupedBufferGeometryData, d as ellipsoid, et as adjacentFaces, f as face, g as offsetFace, h as line, i as bsplineApprox, it as verticesOfEdge, j as heal$1, k as fixSelfIntersection, l as ellipse, lt as toLODGeometryData, m as helix, n as bezier, nt as facesOfEdge, o as compound, ot as chamferDistAngle, p as filledFace, q as filletWithEvolution, r as box, rt as sharedEdges, s as cone, st as toBufferGeometryData, t as addHoles, tt as edgesOfFace, u as ellipseArc, ut as toLineGeometryData, v as sewShells, w as torus, x as subFace, y as solid, z as fillet$1 } from "./primitiveFns-Rpdnd3FK.js";
16
+ import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, f as serializeHistory, g as addChild, h as undoLast, i as deserializeHistory, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-DYrliEQE.js";
17
+ import { a as fuseBlueprints, c as roundedRectangleBlueprint, f as Sketch, h as organiseBlueprints, i as cutBlueprints, m as loftAll, n as fuse2D, o as intersectBlueprints, p as loft$1, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-Dj0eTZfG.js";
18
+ import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-B_-mIteL.js";
19
+ import { $ as sketchFaceOffset, B as drawSingleCircle, C as cameraFromPlane, D as makeProjectedEdges, E as projectEdges, F as drawParametricFunction, G as loadFont, H as drawText, I as drawPointsInterpolation, J as textMetrics, K as sketchText, L as drawPolysides, M as draw, N as drawCircle, O as isProjectionPlane, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, T as createCamera, U as fontMetrics, V as drawSingleEllipse, W as getFont, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, b as sketchWires, c as rotateDrawing, d as compoundSketchExtrude, et as sketchHelix, f as compoundSketchFace, g as sketchFace, h as sketchExtrude, i as drawingFuse, it as sketchRoundedRectangle, j as deserializeDrawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, q as textBlueprints, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, w as cameraLookAt, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-CJxFWoi9.js";
20
+ import { r as makeCylinder } from "./solidBuilders-BexZFemn.js";
21
+ import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-Bey2EmNQ.js";
22
+ import { t as cornerFinder } from "./cornerFinder-lO-ySgHJ.js";
23
+ import { a as guidedSweep, c as sweep, i as complexExtrude, l as twistExtrude, n as extrudeAll, o as multiSectionSweep, r as revolve$1, s as supportExtrude, t as extrude$1 } from "./extrudeFns-lgSsOjwq.js";
24
+ 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, n as createCompoundBlueprint, 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-C-XRp3LD.js";
25
+ 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-CPzDHVKm.js";
26
+ import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-D21Yl4Eu.js";
27
+ import { a as createTaskQueue, c as isEmpty$1, d as isDisposeRequest, f as isErrorResponse, h as isSuccessResponse, i as createWorkerClient, l as pendingCount, m as isOperationRequest, n as createWorkerHandler, o as dequeueTask, p as isInitRequest, r as registerHandler, s as enqueueTask, t as createOperationRegistry, u as rejectAll } from "./workerHandler-Dm0_0F8Z.js";
27
28
  //#region \0rolldown/runtime.js
28
29
  var __defProp = Object.defineProperty;
29
30
  var __exportAll = (all, no_symbols) => {
@@ -0,0 +1,26 @@
1
+ //#region src/core/constants.ts
2
+ /** Maximum hash code value for kernel shape hashing (2^31 - 1). */
3
+ var HASH_CODE_MAX = 2147483647;
4
+ /** Multiply degrees by this constant to convert to radians. */
5
+ var DEG2RAD = Math.PI / 180;
6
+ /** Multiply radians by this constant to convert to degrees. */
7
+ var RAD2DEG = 180 / Math.PI;
8
+ //#endregion
9
+ Object.defineProperty(exports, "DEG2RAD", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return DEG2RAD;
13
+ }
14
+ });
15
+ Object.defineProperty(exports, "HASH_CODE_MAX", {
16
+ enumerable: true,
17
+ get: function() {
18
+ return HASH_CODE_MAX;
19
+ }
20
+ });
21
+ Object.defineProperty(exports, "RAD2DEG", {
22
+ enumerable: true,
23
+ get: function() {
24
+ return RAD2DEG;
25
+ }
26
+ });
@@ -0,0 +1,9 @@
1
+ //#region src/core/constants.ts
2
+ /** Maximum hash code value for kernel shape hashing (2^31 - 1). */
3
+ var HASH_CODE_MAX = 2147483647;
4
+ /** Multiply degrees by this constant to convert to radians. */
5
+ var DEG2RAD = Math.PI / 180;
6
+ /** Multiply radians by this constant to convert to degrees. */
7
+ var RAD2DEG = 180 / Math.PI;
8
+ //#endregion
9
+ export { HASH_CODE_MAX as n, RAD2DEG as r, DEG2RAD as t };
package/dist/core.cjs CHANGED
@@ -1,15 +1,16 @@
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_types = require("./types-hXSlplF3.cjs");
5
- const require_vecOps = require("./vecOps-BXvBYIor.cjs");
6
- const require_planeOps = require("./planeOps-DoTESDTM.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");
7
8
  exports.BrepBugError = require_errors.BrepBugError;
8
- exports.DEG2RAD = require_types.DEG2RAD;
9
+ exports.DEG2RAD = require_constants.DEG2RAD;
9
10
  exports.DisposalScope = require_shapeTypes.DisposalScope;
10
- exports.HASH_CODE_MAX = require_types.HASH_CODE_MAX;
11
+ exports.HASH_CODE_MAX = require_constants.HASH_CODE_MAX;
11
12
  exports.OK = require_errors.OK;
12
- exports.RAD2DEG = require_types.RAD2DEG;
13
+ exports.RAD2DEG = require_constants.RAD2DEG;
13
14
  exports.andThen = require_errors.andThen;
14
15
  exports.bug = require_errors.bug;
15
16
  exports.castShape = require_shapeTypes.castShape;