brepjs 18.119.2 → 18.119.3

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 (96) hide show
  1. package/dist/2d/lib/curve2D.d.ts +6 -1
  2. package/dist/2d/lib/curve2dFns.d.ts +6 -1
  3. package/dist/2d.cjs +7 -7
  4. package/dist/2d.js +7 -7
  5. package/dist/{adjacencyFns-BdM5p58J.js → adjacencyFns-DLityMyV.js} +2 -2
  6. package/dist/{adjacencyFns-Brrc7jlS.cjs → adjacencyFns-DSxuQYnb.cjs} +2 -2
  7. package/dist/{blueprint-DTNT4qYJ.cjs → blueprint-BGcBMy3b.cjs} +39 -9
  8. package/dist/{blueprint-DJJo8WkI.js → blueprint-CAG6jseD.js} +33 -9
  9. package/dist/{blueprintFns-CcpboZ80.js → blueprintFns-B4C3zH7N.js} +9 -4
  10. package/dist/{blueprintFns-2XDZfCxX.cjs → blueprintFns-CnoqynzI.cjs} +9 -4
  11. package/dist/{blueprintSketcher-C0EXFVb2.cjs → blueprintSketcher-BNz6f36D.cjs} +166 -61
  12. package/dist/{blueprintSketcher-DDPyypmC.js → blueprintSketcher-CKKxvxB-.js} +159 -54
  13. package/dist/{boolean2D-Ddfo_dd0.cjs → boolean2D-B-0xobBP.cjs} +5 -5
  14. package/dist/{boolean2D-C_PVz8xT.js → boolean2D-C_1gMcZ6.js} +5 -5
  15. package/dist/brepjs.cjs +105 -92
  16. package/dist/brepjs.js +39 -27
  17. package/dist/{cameraFns-Czr5vABD.cjs → cameraFns-2-haLzLi.cjs} +4 -4
  18. package/dist/{cameraFns-D9tdBYLM.js → cameraFns-CG_J66Hl.js} +4 -4
  19. package/dist/core.cjs +12 -11
  20. package/dist/core.js +4 -3
  21. package/dist/{cornerFinder-Cqg-Dz74.js → cornerFinder-CPFM7bA0.js} +1 -1
  22. package/dist/{cornerFinder-DETRDOMz.cjs → cornerFinder-mfsUMi5g.cjs} +1 -1
  23. package/dist/{curveFns-RENXKp64.js → curveFns-DX13KRh2.js} +2 -2
  24. package/dist/{curveFns-D7utcbnf.cjs → curveFns-GmFnqNo3.cjs} +2 -2
  25. package/dist/{drawFns-D9Rf4foW.cjs → drawFns-B14M5M68.cjs} +14 -14
  26. package/dist/{drawFns-B9HbtAoc.js → drawFns-BShGVVXW.js} +14 -14
  27. package/dist/{errors-B3CDG537.js → errors-MHLiNE-C.js} +1 -92
  28. package/dist/{errors-CJU8CHng.cjs → errors-RHkKO5bZ.cjs} +0 -103
  29. package/dist/{faceFns-CPswi9Cm.cjs → faceFns-BK4r7Dxk.cjs} +3 -3
  30. package/dist/{faceFns-CB6uzvOg.js → faceFns-DJj9Nb6T.js} +3 -3
  31. package/dist/{healingFns-BFTYLiAm.js → healingFns-DxcRyVCG.js} +5 -6
  32. package/dist/{healingFns-bhMxTTqw.cjs → healingFns-Hx4oTlq8.cjs} +27 -28
  33. package/dist/{helpers-Cu4ag5bh.cjs → helpers-BfkBvokP.cjs} +8 -24
  34. package/dist/{helpers-BiN4qQZP.js → helpers-Du_OdHuy.js} +9 -25
  35. package/dist/{importFns-X8vBhZI2.js → importFns-BHs19muu.js} +3 -3
  36. package/dist/{importFns-DS4J1xLv.cjs → importFns-GySbuvVv.cjs} +3 -3
  37. package/dist/io.cjs +2 -2
  38. package/dist/io.js +2 -2
  39. package/dist/{loftFns-ChHjzUK-.cjs → loftFns-BdpZ8FMN.cjs} +2 -125
  40. package/dist/{loftFns-BF5X7ltI.js → loftFns-BeGJ6dxx.js} +4 -109
  41. package/dist/{measureFns-B5Zzg1qM.cjs → measureFns-CJGrmhHT.cjs} +4 -4
  42. package/dist/{measureFns-CC7HhAH3.js → measureFns-CMnbcUZC.js} +4 -4
  43. package/dist/measurement.cjs +1 -1
  44. package/dist/measurement.js +1 -1
  45. package/dist/{meshFns-D57Fyqyf.js → meshFns-Cs5EBsf7.js} +4 -4
  46. package/dist/{meshFns-CaXmWmhe.cjs → meshFns-Dqf5QBhQ.cjs} +5 -5
  47. package/dist/operations.cjs +2 -2
  48. package/dist/operations.js +2 -2
  49. package/dist/originTrackingFns-DZmdiQ-O.js +203 -0
  50. package/dist/originTrackingFns-fpEgTIwV.cjs +226 -0
  51. package/dist/{planeOps-Cp6GQ23-.js → planeOps-CQahLrCx.js} +1 -1
  52. package/dist/{planeOps-Cr25KWWA.cjs → planeOps-VlFxtvzY.cjs} +1 -1
  53. package/dist/primitiveFns-B_rflH83.cjs +773 -0
  54. package/dist/primitiveFns-Cxo3xDKY.js +558 -0
  55. package/dist/projection.cjs +1 -1
  56. package/dist/projection.js +1 -1
  57. package/dist/query.cjs +2 -2
  58. package/dist/query.js +2 -2
  59. package/dist/{refResolveFns-3bw9-U-e.js → refResolveFns-BbRLD8LA.js} +6 -6
  60. package/dist/{refResolveFns-BxmgIhQM.cjs → refResolveFns-CVDLwh12.cjs} +6 -6
  61. package/dist/result.cjs +1 -1
  62. package/dist/result.js +1 -1
  63. package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
  64. package/dist/shapeFns-BTFx-os7.js +43 -0
  65. package/dist/shapeFns-D_5TgiUi.cjs +84 -0
  66. package/dist/shapeRef.cjs +1 -1
  67. package/dist/shapeRef.js +1 -1
  68. package/dist/{shapeTypes-Bpsu5KJO.cjs → shapeTypes-CkcIL7zv.cjs} +1 -222
  69. package/dist/{shapeTypes-CnKFSfDT.js → shapeTypes-t49f64Dx.js} +2 -139
  70. package/dist/sketching.cjs +3 -3
  71. package/dist/sketching.js +3 -3
  72. package/dist/{solidBuilders-I8_V8qqU.js → solidBuilders-DTgqQC3W.js} +310 -8
  73. package/dist/{solidBuilders-Bp7lQW62.cjs → solidBuilders-IiIzjKAr.cjs} +401 -15
  74. package/dist/{surfaceBuilders-D8_08oOR.cjs → surfaceBuilders-Biqx51el.cjs} +6 -5
  75. package/dist/{surfaceBuilders-BNR7yMQO.js → surfaceBuilders-BryY-i0F.js} +4 -3
  76. package/dist/text.cjs +2 -2
  77. package/dist/text.js +2 -2
  78. package/dist/{textBlueprints-B5zcLGvJ.cjs → textBlueprints-8EcWreab.cjs} +138 -51
  79. package/dist/{textBlueprints-igbNvKcd.js → textBlueprints-rA1HT6j1.js} +116 -11
  80. package/dist/{textMetrics-CJvtpbc3.js → textMetrics-Bcbso1Ns.js} +2 -2
  81. package/dist/{textMetrics-08fF0QNf.cjs → textMetrics-GPBu9JKi.cjs} +2 -2
  82. package/dist/{threadFns-CqSMNyTZ.js → threadFns-BOtXTHZ9.js} +8 -8
  83. package/dist/{threadFns-Co6vWEWx.cjs → threadFns-DRrk9Qod.cjs} +8 -8
  84. package/dist/topology.cjs +9 -9
  85. package/dist/topology.js +9 -9
  86. package/dist/{topologyQueryFns-C3fhJndG.cjs → topologyQueryFns-Bia7o8l_.cjs} +97 -6
  87. package/dist/{topologyQueryFns-DNqT88yx.js → topologyQueryFns-BkQ6Q7gN.js} +93 -2
  88. package/dist/validityTypes-DiTgeCD9.js +129 -0
  89. package/dist/validityTypes-ZGMVlv7b.cjs +200 -0
  90. package/dist/vectors.cjs +1 -1
  91. package/dist/vectors.js +1 -1
  92. package/package.json +8 -8
  93. package/dist/primitiveFns-CRy_CUVg.cjs +0 -492
  94. package/dist/primitiveFns-DCIH-SBm.js +0 -331
  95. package/dist/shapeFns-BrHFNLMA.js +0 -771
  96. package/dist/shapeFns-qm9VRo4i.cjs +0 -962
@@ -1,10 +1,10 @@
1
- import { at as getKernel2D, it as getKernel } from "./shapeTypes-CnKFSfDT.js";
1
+ import { K as getKernel, q as getKernel2D } from "./shapeTypes-t49f64Dx.js";
2
2
  import { i as wasmIndex, n as bug } from "./bug-BdOHwn_e.js";
3
- import { C as isOk, I as unwrap, O as ok, n as computationError, s as safeIndex, v as err } from "./errors-B3CDG537.js";
3
+ import { E as ok, P as unwrap, g as err, n as computationError, s as safeIndex, x as isOk } from "./errors-MHLiNE-C.js";
4
4
  import { r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
6
- import { _ as samePoint, 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, v as scalarMultiply2d } from "./helpers-BiN4qQZP.js";
7
- import { _ as Curve2D, 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-DJJo8WkI.js";
6
+ import { _ as samePoint, b as subtract2d, c as add2d, d as crossProduct2d, f as distance2d, g as rotate2d, h as polarToCartesian, m as polarAngle2d, u as cartesianToPolar, v as scalarMultiply2d } from "./helpers-Du_OdHuy.js";
7
+ import { S as isPoint2D, _ as Curve2D, b as BoundingBox2d, 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, y as normalize2d } from "./blueprint-CAG6jseD.js";
8
8
  //#region node_modules/flatqueue/index.js
9
9
  /**
10
10
  * @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
@@ -668,32 +668,99 @@ var make2dOffset = (curve, offset) => {
668
668
  };
669
669
  //#endregion
670
670
  //#region src/2d/lib/customCorners.ts
671
+ /** Unwrap an intersection, discarding the common-segment curves the caller does not use. */
672
+ function intersectionPoints(first, second) {
673
+ const result = unwrap(intersectCurves(first, second));
674
+ result.commonSegments.forEach((c) => {
675
+ c.delete();
676
+ });
677
+ return result.intersections;
678
+ }
679
+ /**
680
+ * Delete the split pieces the caller is discarding. `splitAt` returns the curve
681
+ * itself when there is nothing to split, so the source is never deleted here.
682
+ */
683
+ function disposeSplitPieces(pieces, source, kept) {
684
+ pieces.forEach((piece) => {
685
+ if (piece !== source && piece !== kept) piece.delete();
686
+ });
687
+ }
688
+ /**
689
+ * Run `split` and, if it throws, dispose the pieces an earlier split already
690
+ * produced. Splitting the second curve of a corner can fail (its parameter may
691
+ * not project onto the offset), stranding the first curve's pieces.
692
+ */
693
+ function splitOrDiscard(split, earlier) {
694
+ try {
695
+ return split();
696
+ } catch (e) {
697
+ disposeSplitPieces(earlier.pieces, earlier.source);
698
+ throw e;
699
+ }
700
+ }
701
+ /**
702
+ * Build the corner result, disposing the trimmed halves if the connecting curve
703
+ * cannot be built. They are unreachable once the error propagates.
704
+ */
705
+ function discardTrimsOnError(firstCurve, secondCurve, first, second, build) {
706
+ try {
707
+ return build();
708
+ } catch (e) {
709
+ if (first !== firstCurve) first.delete();
710
+ if (second !== secondCurve) second.delete();
711
+ throw e;
712
+ }
713
+ }
671
714
  function removeCorner(firstCurve, secondCurve, radius) {
672
715
  const sinAngle = crossProduct2d(firstCurve.tangentAt(1), secondCurve.tangentAt(0));
673
716
  if (Math.abs(sinAngle) < 1e-10) return null;
674
717
  const offset = Math.abs(radius) * (sinAngle > 0 ? -1 : 1);
675
- const firstOffset = make2dOffset(firstCurve, offset);
676
- const secondOffset = make2dOffset(secondCurve, offset);
677
- if (!(firstOffset instanceof Curve2D) || !(secondOffset instanceof Curve2D)) return null;
678
- const intersectionResult = intersectCurves(firstOffset, secondOffset, 1e-9);
679
- if (!isOk(intersectionResult)) return null;
680
- const potentialCenter = intersectionResult.value.intersections.at(-1);
681
- if (!isPoint2D(potentialCenter)) return null;
682
- const center = potentialCenter;
683
- const splitForFillet = (curve, offsetCurve) => {
684
- const [x, y] = offsetCurve.tangentAt(center);
685
- const normal = normalize2d([-y, x]);
686
- const splitPoint = add2d(center, scalarMultiply2d(normal, offset));
687
- const splitParam = unwrap(curve.parameter(splitPoint, 1e-6));
688
- return curve.splitAt([splitParam]);
689
- };
690
- const firstSplit = splitForFillet(firstCurve, firstOffset);
691
- const secondSplit = splitForFillet(secondCurve, secondOffset);
692
- return {
693
- first: wasmIndex(firstSplit, 0),
694
- second: wasmIndex(secondSplit, 1),
695
- center
696
- };
718
+ let firstOffset = null;
719
+ let secondOffset = null;
720
+ try {
721
+ firstOffset = make2dOffset(firstCurve, offset);
722
+ secondOffset = make2dOffset(secondCurve, offset);
723
+ if (!(firstOffset instanceof Curve2D) || !(secondOffset instanceof Curve2D)) return null;
724
+ const firstOffsetCurve = firstOffset;
725
+ const secondOffsetCurve = secondOffset;
726
+ const intersectionResult = intersectCurves(firstOffsetCurve, secondOffsetCurve, 1e-9);
727
+ if (!isOk(intersectionResult)) return null;
728
+ intersectionResult.value.commonSegments.forEach((c) => {
729
+ c.delete();
730
+ });
731
+ const potentialCenter = intersectionResult.value.intersections.at(-1);
732
+ if (!isPoint2D(potentialCenter)) return null;
733
+ const center = potentialCenter;
734
+ const splitForFillet = (curve, offsetCurve) => {
735
+ const [x, y] = offsetCurve.tangentAt(center);
736
+ const normal = normalize2d([-y, x]);
737
+ const splitPoint = add2d(center, scalarMultiply2d(normal, offset));
738
+ const splitParam = unwrap(curve.parameter(splitPoint, 1e-6));
739
+ return curve.splitAt([splitParam]);
740
+ };
741
+ const firstSplit = splitForFillet(firstCurve, firstOffsetCurve);
742
+ const secondSplit = splitOrDiscard(() => splitForFillet(secondCurve, secondOffsetCurve), {
743
+ pieces: firstSplit,
744
+ source: firstCurve
745
+ });
746
+ const first = firstSplit[0];
747
+ const second = secondSplit[1];
748
+ if (!first || !second) {
749
+ disposeSplitPieces(firstSplit, firstCurve);
750
+ disposeSplitPieces(secondSplit, secondCurve);
751
+ return null;
752
+ }
753
+ disposeSplitPieces(firstSplit, firstCurve, first);
754
+ disposeSplitPieces(secondSplit, secondCurve, second);
755
+ return {
756
+ first,
757
+ second,
758
+ center
759
+ };
760
+ } finally {
761
+ if (firstOffset instanceof Curve2D) firstOffset.delete();
762
+ if (secondOffset instanceof Curve2D) secondOffset.delete();
763
+ }
697
764
  }
698
765
  /**
699
766
  * Insert a circular fillet arc at the corner between two curves.
@@ -711,11 +778,11 @@ function filletCurves(firstCurve, secondCurve, radius) {
711
778
  const cornerRemoved = removeCorner(firstCurve, secondCurve, radius);
712
779
  if (!cornerRemoved) return [firstCurve, secondCurve];
713
780
  const { first, second, center } = cornerRemoved;
714
- return [
781
+ return discardTrimsOnError(firstCurve, secondCurve, first, second, () => [
715
782
  first,
716
783
  make2dArcFromCenter(first.lastPoint, second.firstPoint, center),
717
784
  second
718
- ];
785
+ ]);
719
786
  }
720
787
  /**
721
788
  * Insert a straight chamfer segment at the corner between two curves.
@@ -727,11 +794,11 @@ function chamferCurves(firstCurve, secondCurve, radius) {
727
794
  const cornerRemoved = removeCorner(firstCurve, secondCurve, radius);
728
795
  if (!cornerRemoved) return [firstCurve, secondCurve];
729
796
  const { first, second } = cornerRemoved;
730
- return [
797
+ return discardTrimsOnError(firstCurve, secondCurve, first, second, () => [
731
798
  first,
732
799
  make2dSegmentCurve(first.lastPoint, second.firstPoint),
733
800
  second
734
- ];
801
+ ]);
735
802
  }
736
803
  /**
737
804
  * Insert a dogbone fillet at an inner corner for CNC milling clearance.
@@ -745,29 +812,53 @@ function dogboneFilletCurves(firstCurve, secondCurve, radius) {
745
812
  if (Math.abs(sinAngle) < 1e-10) return [firstCurve, secondCurve];
746
813
  const orientationCorrection = sinAngle > 0 ? -1 : 1;
747
814
  const offset = Math.abs(radius) * Math.sin(a / 2) * orientationCorrection;
748
- const firstOffset = make2dOffset(firstCurve, offset);
749
- const secondOffset = make2dOffset(secondCurve, offset);
750
- if (!(firstOffset instanceof Curve2D) || !(secondOffset instanceof Curve2D)) return [firstCurve, secondCurve];
751
- const intersectionResult2 = intersectCurves(firstOffset, secondOffset, 1e-9);
752
- if (!isOk(intersectionResult2)) return [firstCurve, secondCurve];
753
- const potentialCenter = intersectionResult2.value.intersections.at(-1);
754
- if (!isPoint2D(potentialCenter)) return [firstCurve, secondCurve];
755
- const circle = make2dCircle(radius, potentialCenter);
756
- const firstInt = unwrap(intersectCurves(firstCurve, circle)).intersections[0];
757
- const secondInt = unwrap(intersectCurves(secondCurve, circle)).intersections.at(-1);
758
- if (!firstInt || !secondInt) return [firstCurve, secondCurve];
759
- const firstSplit = firstCurve.splitAt([firstInt]);
760
- const secondSplit = secondCurve.splitAt([secondInt]);
761
- const firstPart = wasmIndex(firstSplit, 0);
762
- const secondPart = wasmIndex(secondSplit, secondSplit.length - 1);
815
+ let firstOffset = null;
816
+ let secondOffset = null;
817
+ let circle = null;
763
818
  try {
764
- return [
765
- firstPart,
766
- make2dThreePointArc(firstPart.lastPoint, firstCurve.lastPoint, secondPart.firstPoint),
767
- secondPart
768
- ];
769
- } catch {
770
- return [firstCurve, secondCurve];
819
+ firstOffset = make2dOffset(firstCurve, offset);
820
+ secondOffset = make2dOffset(secondCurve, offset);
821
+ if (!(firstOffset instanceof Curve2D) || !(secondOffset instanceof Curve2D)) return [firstCurve, secondCurve];
822
+ const intersectionResult2 = intersectCurves(firstOffset, secondOffset, 1e-9);
823
+ if (!isOk(intersectionResult2)) return [firstCurve, secondCurve];
824
+ intersectionResult2.value.commonSegments.forEach((c) => {
825
+ c.delete();
826
+ });
827
+ const potentialCenter = intersectionResult2.value.intersections.at(-1);
828
+ if (!isPoint2D(potentialCenter)) return [firstCurve, secondCurve];
829
+ circle = make2dCircle(radius, potentialCenter);
830
+ const firstInt = intersectionPoints(firstCurve, circle)[0];
831
+ const secondInt = intersectionPoints(secondCurve, circle).at(-1);
832
+ if (!firstInt || !secondInt) return [firstCurve, secondCurve];
833
+ const firstSplit = firstCurve.splitAt([firstInt]);
834
+ const secondSplit = splitOrDiscard(() => secondCurve.splitAt([secondInt]), {
835
+ pieces: firstSplit,
836
+ source: firstCurve
837
+ });
838
+ const firstPart = firstSplit[0];
839
+ const secondPart = secondSplit[secondSplit.length - 1];
840
+ if (!firstPart || !secondPart) {
841
+ disposeSplitPieces(firstSplit, firstCurve);
842
+ disposeSplitPieces(secondSplit, secondCurve);
843
+ return [firstCurve, secondCurve];
844
+ }
845
+ disposeSplitPieces(firstSplit, firstCurve, firstPart);
846
+ disposeSplitPieces(secondSplit, secondCurve, secondPart);
847
+ try {
848
+ return [
849
+ firstPart,
850
+ make2dThreePointArc(firstPart.lastPoint, firstCurve.lastPoint, secondPart.firstPoint),
851
+ secondPart
852
+ ];
853
+ } catch {
854
+ if (firstPart !== firstCurve) firstPart.delete();
855
+ if (secondPart !== secondCurve) secondPart.delete();
856
+ return [firstCurve, secondCurve];
857
+ }
858
+ } finally {
859
+ if (firstOffset instanceof Curve2D) firstOffset.delete();
860
+ if (secondOffset instanceof Curve2D) secondOffset.delete();
861
+ circle?.delete();
771
862
  }
772
863
  }
773
864
  //#endregion
@@ -1213,6 +1304,16 @@ var cornerModeFns = {
1213
1304
  dogbone: dogboneFilletCurves,
1214
1305
  fillet: filletCurves
1215
1306
  };
1307
+ /**
1308
+ * Delete the curves a corner function consumed. Corner functions return their
1309
+ * inputs untouched when they bail (collinear curves, failed offset), so only
1310
+ * the ones absent from the result are ours to free.
1311
+ */
1312
+ function disposeConsumedCurves(consumed, produced) {
1313
+ consumed.forEach((curve) => {
1314
+ if (!produced.includes(curve)) curve.delete();
1315
+ });
1316
+ }
1216
1317
  function buildCornerFunction(radius, mode) {
1217
1318
  if (typeof radius === "function") return radius;
1218
1319
  const makeFn = cornerModeFns[mode];
@@ -1295,7 +1396,9 @@ var BaseSketcher2d = class {
1295
1396
  }
1296
1397
  const previousCurve = this.pendingCurves.pop();
1297
1398
  if (!previousCurve) bug("Sketcher2d.saveCurve", "No previous curve available for custom corner");
1298
- this.pendingCurves.push(...this._nextCorner(previousCurve, curve));
1399
+ const cornered = this._nextCorner(previousCurve, curve);
1400
+ disposeConsumedCurves([previousCurve, curve], cornered);
1401
+ this.pendingCurves.push(...cornered);
1299
1402
  this._nextCorner = null;
1300
1403
  }
1301
1404
  /** Draw a straight line to an absolute 2D point. */
@@ -1469,7 +1572,9 @@ var BaseSketcher2d = class {
1469
1572
  const previousCurve = this.pendingCurves.pop();
1470
1573
  const curve = this.pendingCurves.shift();
1471
1574
  if (!previousCurve || !curve) bug("Sketcher2d._customCornerLastWithFirst", "Not enough curves to close and fillet");
1472
- this.pendingCurves.push(...buildCornerFunction(radius, mode)(previousCurve, curve));
1575
+ const cornered = buildCornerFunction(radius, mode)(previousCurve, curve);
1576
+ disposeConsumedCurves([previousCurve, curve], cornered);
1577
+ this.pendingCurves.push(...cornered);
1473
1578
  }
1474
1579
  _closeSketch() {
1475
1580
  if (!samePoint(this.pointer, this.firstPoint)) this.lineTo(this.firstPoint);
@@ -1,10 +1,10 @@
1
1
  const require_bug = require("./bug-O02CsAmt.cjs");
2
- const require_errors = require("./errors-CJU8CHng.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
3
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
4
- const require_surfaceBuilders = require("./surfaceBuilders-D8_08oOR.cjs");
5
- const require_blueprintSketcher = require("./blueprintSketcher-C0EXFVb2.cjs");
6
- const require_helpers = require("./helpers-Cu4ag5bh.cjs");
7
- const require_blueprint = require("./blueprint-DTNT4qYJ.cjs");
4
+ const require_surfaceBuilders = require("./surfaceBuilders-Biqx51el.cjs");
5
+ const require_blueprintSketcher = require("./blueprintSketcher-BNz6f36D.cjs");
6
+ const require_helpers = require("./helpers-BfkBvokP.cjs");
7
+ const require_blueprint = require("./blueprint-BGcBMy3b.cjs");
8
8
  //#region src/2d/blueprints/cannedBlueprints.ts
9
9
  /**
10
10
  * Create a regular polygon blueprint inscribed in a circle of the given radius.
@@ -1,10 +1,10 @@
1
1
  import { i as wasmIndex, n as bug } from "./bug-BdOHwn_e.js";
2
- import { I as unwrap, s as safeIndex } from "./errors-B3CDG537.js";
2
+ import { P as unwrap, s as safeIndex } from "./errors-MHLiNE-C.js";
3
3
  import { r as lastOrThrow } from "./arrayAccess-DrUGPADn.js";
4
- import { v as zip } from "./surfaceBuilders-BNR7yMQO.js";
5
- import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-DDPyypmC.js";
6
- import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-BiN4qQZP.js";
7
- import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-DJJo8WkI.js";
4
+ import { v as zip } from "./surfaceBuilders-BryY-i0F.js";
5
+ import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-CKKxvxB-.js";
6
+ import { _ as samePoint$1, b as subtract2d, d as crossProduct2d, o as PRECISION_INTERSECTION } from "./helpers-Du_OdHuy.js";
7
+ import { f as make2dSegmentCurve, t as Blueprint, x as removeDuplicatePoints } from "./blueprint-CAG6jseD.js";
8
8
  //#region src/2d/blueprints/cannedBlueprints.ts
9
9
  /**
10
10
  * Create a regular polygon blueprint inscribed in a circle of the given radius.