brepjs 15.1.3 → 15.1.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"boolean2D.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/boolean2D.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAMvD;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAAI,CAAC;AAyLxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,OAAO,EACd,QAAQ,OAAO,KACd,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAmD/C,CAAC;AAaF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,OAAO,EACd,QAAQ,OAAO,KACd,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IA2C/C,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,GACd,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAAI,CAoDnD"}
1
+ {"version":3,"file":"boolean2D.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/boolean2D.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAMvD;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAAI,CAAC;AAyLxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,OAAO,EACd,QAAQ,OAAO,KACd,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAmD/C,CAAC;AAaF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,OAAO,EACd,QAAQ,OAAO,KACd,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAiD/C,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,GACd,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,IAAI,CAoDnD"}
@@ -25,8 +25,10 @@ export declare function curveMidPoint(curve: Curve2D): Point2D;
25
25
  export declare function rotateToStartAt(curves: Curve2D[], point: Point2D): Curve2D[];
26
26
  /**
27
27
  * Rotate the curves array so that it starts at the curve matching the given
28
- * segment. If the segment is oriented the other way, the curves are reversed
29
- * first.
28
+ * segment. Tries both segment orientations (forward and flipped) against both
29
+ * curve orientations (original and reversed chain) to handle cases where
30
+ * `intersectCurves` returns a common segment oriented opposite to the
31
+ * matching curve in the split result.
30
32
  */
31
33
  export declare function rotateToStartAtSegment(curves: Curve2D[], segment: Curve2D): Curve2D[];
32
34
  //# sourceMappingURL=booleanHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"booleanHelpers.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/booleanHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OACH,CAAC;AAMjD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAIjE;AAMD,MAAM,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC;AAChC,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAE9D,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAMlD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAMhD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAMxD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAE9D;AAMD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGrD;AAsDD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,CAG5E;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAwBrF"}
1
+ {"version":3,"file":"booleanHelpers.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/booleanHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OACH,CAAC;AAMjD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAIjE;AAMD,MAAM,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC;AAChC,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAE9D,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAMlD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAMhD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAMxD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAE9D;AAMD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGrD;AA0ED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAgDrF"}
@@ -1 +1 @@
1
- {"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,mBAAmB,CAAC;AAG1D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAY5C,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA0IxE;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,oBAAoB,EAAE,OAAO,EAAE,EAAE,EACjC,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,OAAO,GAClB,OAAO,CAQT;AAMD;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,GAChB,mBAAmB,EAAE,GAAG,IAAI,CAwE9B"}
1
+ {"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,mBAAmB,CAAC;AAG1D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAY5C,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAyJxE;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,oBAAoB,EAAE,OAAO,EAAE,EAAE,EACjC,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,OAAO,GAClB,OAAO,CAQT;AAMD;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,GAChB,mBAAmB,EAAE,GAAG,IAAI,CAwE9B"}
@@ -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,CAoDxB"}
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"}
package/dist/2d.cjs CHANGED
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_shapeTypes = require("./shapeTypes-DoBHuzjo.cjs");
3
3
  const require_errors = require("./errors-9zQcQK1H.cjs");
4
4
  const require_faceFns = require("./faceFns-Z6uVCQfc.cjs");
5
- const require_boolean2D = require("./boolean2D-CzOxpkFV.cjs");
5
+ const require_boolean2D = require("./boolean2D-tui3MK0X.cjs");
6
6
  const require_blueprint = require("./blueprint-4w3i6ayW.cjs");
7
- const require_blueprintFns = require("./blueprintFns-BNic8mLn.cjs");
7
+ const require_blueprintFns = require("./blueprintFns-C68xzLWi.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
1
  import { B as createKernelHandle, Z as getKernel2D, a as createEdge } from "./shapeTypes-D3seZBe7.js";
2
2
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
3
3
  import { B as kernelCallRaw } from "./faceFns-CBdCV-j8.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-AgCPXDXs.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-CmdpCG5R.js";
5
5
  import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-xXn5kpyL.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-A6WhJQN_.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-Dm3epW6I.js";
7
7
  //#region src/core/curve2dHandle.ts
8
8
  /**
9
9
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
@@ -1,5 +1,5 @@
1
1
  const require_errors = require("./errors-9zQcQK1H.cjs");
2
- const require_boolean2D = require("./boolean2D-CzOxpkFV.cjs");
2
+ const require_boolean2D = require("./boolean2D-tui3MK0X.cjs");
3
3
  const require_blueprint = require("./blueprint-4w3i6ayW.cjs");
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
2
- import { g as CompoundBlueprint } from "./boolean2D-AgCPXDXs.js";
2
+ import { g as CompoundBlueprint } from "./boolean2D-CmdpCG5R.js";
3
3
  import { t as Blueprint } from "./blueprint-xXn5kpyL.js";
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
@@ -1955,7 +1955,8 @@ function curveMidPoint(curve) {
1955
1955
  }
1956
1956
  /**
1957
1957
  * Find the index of the first curve in `curves` whose firstPoint matches
1958
- * `point` (using hash + samePoint for fast comparison).
1958
+ * `point`. Uses hash for a fast first pass, then falls back to tolerance-only
1959
+ * comparison to handle floating-point rounding at `toFixed(9)` boundaries.
1959
1960
  * Returns -1 if no match is found.
1960
1961
  */
1961
1962
  function findCurveIndexByStartPoint(curves, point) {
@@ -1965,11 +1966,17 @@ function findCurveIndexByStartPoint(curves, point) {
1965
1966
  if (curve === void 0) continue;
1966
1967
  if (hashPoint(curve.firstPoint) === targetHash && samePoint(point, curve.firstPoint)) return i;
1967
1968
  }
1969
+ for (let i = 0; i < curves.length; i++) {
1970
+ const curve = curves[i];
1971
+ if (curve === void 0) continue;
1972
+ if (samePoint(point, curve.firstPoint)) return i;
1973
+ }
1968
1974
  return -1;
1969
1975
  }
1970
1976
  /**
1971
1977
  * Find the index of the first curve in `curves` that matches the given
1972
- * segment's start and end points (using hash + samePoint).
1978
+ * segment's start and end points. Uses hash for a fast first pass, then
1979
+ * falls back to tolerance-only comparison.
1973
1980
  * Returns -1 if no match is found.
1974
1981
  */
1975
1982
  function findCurveIndexBySegment(curves, segFirstHash, segLastHash, matchesFn) {
@@ -1978,6 +1985,11 @@ function findCurveIndexBySegment(curves, segFirstHash, segLastHash, matchesFn) {
1978
1985
  if (curve === void 0) continue;
1979
1986
  if (hashPoint(curve.firstPoint) === segFirstHash && hashPoint(curve.lastPoint) === segLastHash && matchesFn(curve)) return i;
1980
1987
  }
1988
+ for (let i = 0; i < curves.length; i++) {
1989
+ const curve = curves[i];
1990
+ if (curve === void 0) continue;
1991
+ if (matchesFn(curve)) return i;
1992
+ }
1981
1993
  return -1;
1982
1994
  }
1983
1995
  /** Rotate an array so that element at `startIndex` becomes the first element. */
@@ -1994,29 +2006,48 @@ function rotateToStartAt(curves, point) {
1994
2006
  }
1995
2007
  /**
1996
2008
  * Rotate the curves array so that it starts at the curve matching the given
1997
- * segment. If the segment is oriented the other way, the curves are reversed
1998
- * first.
2009
+ * segment. Tries both segment orientations (forward and flipped) against both
2010
+ * curve orientations (original and reversed chain) to handle cases where
2011
+ * `intersectCurves` returns a common segment oriented opposite to the
2012
+ * matching curve in the split result.
1999
2013
  */
2000
2014
  function rotateToStartAtSegment(curves, segment) {
2001
2015
  const segFirstHash = hashPoint(segment.firstPoint);
2002
2016
  const segLastHash = hashPoint(segment.lastPoint);
2003
- const onSegment = (curve) => samePoint(segment.firstPoint, curve.firstPoint) && samePoint(segment.lastPoint, curve.lastPoint);
2004
- let startIndex = findCurveIndexBySegment(curves, segFirstHash, segLastHash, onSegment);
2005
- if (startIndex !== -1) return rotateArray(curves, startIndex);
2017
+ const matchesForward = (curve) => samePoint(segment.firstPoint, curve.firstPoint) && samePoint(segment.lastPoint, curve.lastPoint);
2018
+ const matchesFlipped = (curve) => samePoint(segment.lastPoint, curve.firstPoint) && samePoint(segment.firstPoint, curve.lastPoint);
2019
+ function tryRotate(chain, firstHash, lastHash, matchFn) {
2020
+ const idx = findCurveIndexBySegment(chain, firstHash, lastHash, matchFn);
2021
+ return idx !== -1 ? rotateArray(chain, idx) : null;
2022
+ }
2023
+ const fwdFwd = tryRotate(curves, segFirstHash, segLastHash, matchesForward);
2024
+ if (fwdFwd !== null) return fwdFwd;
2025
+ const flipFwd = tryRotate(curves, segLastHash, segFirstHash, matchesFlipped);
2026
+ if (flipFwd !== null) return flipFwd;
2006
2027
  const reversed = reverseSegment(curves);
2007
- startIndex = findCurveIndexBySegment(reversed, segFirstHash, segLastHash, onSegment);
2008
- if (startIndex === -1) bug("rotateToStartAtSegment", "failed to rotate to segment start");
2009
- return rotateArray(reversed, startIndex);
2028
+ const fwdRev = tryRotate(reversed, segFirstHash, segLastHash, matchesForward);
2029
+ if (fwdRev !== null) return fwdRev;
2030
+ const flipRev = tryRotate(reversed, segLastHash, segFirstHash, matchesFlipped);
2031
+ if (flipRev !== null) return flipRev;
2032
+ bug("rotateToStartAtSegment", "failed to rotate to segment start");
2010
2033
  }
2011
2034
  //#endregion
2012
2035
  //#region src/2d/blueprints/intersectionSegments.ts
2013
2036
  function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
2014
2037
  const intersectionSet = new Set(allIntersections.map(hashPoint));
2015
2038
  const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
2039
+ const matchesIntersection = (point) => {
2040
+ if (intersectionSet.has(hashPoint(point))) return true;
2041
+ return allIntersections.some((p) => samePoint(p, point));
2042
+ };
2043
+ const matchesCommonSegment = (first, last) => {
2044
+ if (commonSegmentSet.has(hashSegment(first, last))) return true;
2045
+ return allCommonSegments.some((seg) => samePoint(seg.firstPoint, first) && samePoint(seg.lastPoint, last) || samePoint(seg.firstPoint, last) && samePoint(seg.lastPoint, first));
2046
+ };
2016
2047
  let currentCurves = [];
2017
2048
  for (const curve of curves) {
2018
- const endsAtIntersection = intersectionSet.has(hashPoint(curve.lastPoint));
2019
- const isCommon = commonSegmentSet.has(hashSegment(curve.firstPoint, curve.lastPoint));
2049
+ const endsAtIntersection = matchesIntersection(curve.lastPoint);
2050
+ const isCommon = matchesCommonSegment(curve.firstPoint, curve.lastPoint);
2020
2051
  if (endsAtIntersection) {
2021
2052
  currentCurves.push(curve);
2022
2053
  yield currentCurves;
@@ -2227,7 +2258,7 @@ function booleanOperation(first, second, config) {
2227
2258
  if (segments.every(([, secondSegment]) => secondSegment === "same")) return { identical: true };
2228
2259
  let segmentsIn = null;
2229
2260
  let lastWasSame = null;
2230
- const paths = splitPaths(segments.flatMap(([firstSegment, secondSegment]) => {
2261
+ let assembledCurves = segments.flatMap(([firstSegment, secondSegment]) => {
2231
2262
  if (secondSegment === "same") {
2232
2263
  const result = handleSameSegment(firstSegment, segmentsIn, lastWasSame);
2233
2264
  segmentsIn = result.segmentsIn;
@@ -2238,7 +2269,10 @@ function booleanOperation(first, second, config) {
2238
2269
  segmentsIn = result.segmentsIn;
2239
2270
  lastWasSame = result.lastWasSame;
2240
2271
  return result.curves;
2241
- })).filter((b) => b.length > 0).map((b) => new Blueprint(b));
2272
+ });
2273
+ const finalLastWasSame = lastWasSame;
2274
+ if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
2275
+ const paths = splitPaths(assembledCurves).filter((b) => b.length > 0).map((b) => new Blueprint(b));
2242
2276
  if (paths.length === 0) return null;
2243
2277
  if (paths.length === 1) {
2244
2278
  const single = paths[0];
@@ -2522,7 +2556,7 @@ var cut2D = (first, second) => {
2522
2556
  if (first instanceof CompoundBlueprint) {
2523
2557
  const wrapper = safeIndex(first.blueprints, 0, "cut2D");
2524
2558
  if (second instanceof Blueprint && !second.intersects(wrapper)) {
2525
- if (!wrapper.isInside(second.firstPoint)) return null;
2559
+ if (!wrapper.isInside(second.firstPoint)) return first.clone();
2526
2560
  return organiseBlueprints([wrapper, ...allBlueprints(fuse2D(second, new Blueprints(first.blueprints.slice(1))))]);
2527
2561
  } else {
2528
2562
  let out = cut2D(wrapper, second);
@@ -2532,7 +2566,11 @@ var cut2D = (first, second) => {
2532
2566
  return out;
2533
2567
  }
2534
2568
  }
2535
- if (second instanceof Blueprints) return mergeNonIntersecting(second.blueprints.map((bp) => cut2D(first, bp)));
2569
+ if (second instanceof Blueprints) {
2570
+ let out = first;
2571
+ for (const bp of second.blueprints) out = cut2D(out, bp);
2572
+ return out;
2573
+ }
2536
2574
  if (second instanceof CompoundBlueprint) {
2537
2575
  let out = cutBlueprints(first, safeIndex(second.blueprints, 0, "cut2D"));
2538
2576
  second.blueprints.slice(1).forEach((bp) => {
@@ -1955,7 +1955,8 @@ function curveMidPoint(curve) {
1955
1955
  }
1956
1956
  /**
1957
1957
  * Find the index of the first curve in `curves` whose firstPoint matches
1958
- * `point` (using hash + samePoint for fast comparison).
1958
+ * `point`. Uses hash for a fast first pass, then falls back to tolerance-only
1959
+ * comparison to handle floating-point rounding at `toFixed(9)` boundaries.
1959
1960
  * Returns -1 if no match is found.
1960
1961
  */
1961
1962
  function findCurveIndexByStartPoint(curves, point) {
@@ -1965,11 +1966,17 @@ function findCurveIndexByStartPoint(curves, point) {
1965
1966
  if (curve === void 0) continue;
1966
1967
  if (hashPoint(curve.firstPoint) === targetHash && samePoint(point, curve.firstPoint)) return i;
1967
1968
  }
1969
+ for (let i = 0; i < curves.length; i++) {
1970
+ const curve = curves[i];
1971
+ if (curve === void 0) continue;
1972
+ if (samePoint(point, curve.firstPoint)) return i;
1973
+ }
1968
1974
  return -1;
1969
1975
  }
1970
1976
  /**
1971
1977
  * Find the index of the first curve in `curves` that matches the given
1972
- * segment's start and end points (using hash + samePoint).
1978
+ * segment's start and end points. Uses hash for a fast first pass, then
1979
+ * falls back to tolerance-only comparison.
1973
1980
  * Returns -1 if no match is found.
1974
1981
  */
1975
1982
  function findCurveIndexBySegment(curves, segFirstHash, segLastHash, matchesFn) {
@@ -1978,6 +1985,11 @@ function findCurveIndexBySegment(curves, segFirstHash, segLastHash, matchesFn) {
1978
1985
  if (curve === void 0) continue;
1979
1986
  if (hashPoint(curve.firstPoint) === segFirstHash && hashPoint(curve.lastPoint) === segLastHash && matchesFn(curve)) return i;
1980
1987
  }
1988
+ for (let i = 0; i < curves.length; i++) {
1989
+ const curve = curves[i];
1990
+ if (curve === void 0) continue;
1991
+ if (matchesFn(curve)) return i;
1992
+ }
1981
1993
  return -1;
1982
1994
  }
1983
1995
  /** Rotate an array so that element at `startIndex` becomes the first element. */
@@ -1994,29 +2006,48 @@ function rotateToStartAt(curves, point) {
1994
2006
  }
1995
2007
  /**
1996
2008
  * Rotate the curves array so that it starts at the curve matching the given
1997
- * segment. If the segment is oriented the other way, the curves are reversed
1998
- * first.
2009
+ * segment. Tries both segment orientations (forward and flipped) against both
2010
+ * curve orientations (original and reversed chain) to handle cases where
2011
+ * `intersectCurves` returns a common segment oriented opposite to the
2012
+ * matching curve in the split result.
1999
2013
  */
2000
2014
  function rotateToStartAtSegment(curves, segment) {
2001
2015
  const segFirstHash = hashPoint(segment.firstPoint);
2002
2016
  const segLastHash = hashPoint(segment.lastPoint);
2003
- const onSegment = (curve) => samePoint(segment.firstPoint, curve.firstPoint) && samePoint(segment.lastPoint, curve.lastPoint);
2004
- let startIndex = findCurveIndexBySegment(curves, segFirstHash, segLastHash, onSegment);
2005
- if (startIndex !== -1) return rotateArray(curves, startIndex);
2017
+ const matchesForward = (curve) => samePoint(segment.firstPoint, curve.firstPoint) && samePoint(segment.lastPoint, curve.lastPoint);
2018
+ const matchesFlipped = (curve) => samePoint(segment.lastPoint, curve.firstPoint) && samePoint(segment.firstPoint, curve.lastPoint);
2019
+ function tryRotate(chain, firstHash, lastHash, matchFn) {
2020
+ const idx = findCurveIndexBySegment(chain, firstHash, lastHash, matchFn);
2021
+ return idx !== -1 ? rotateArray(chain, idx) : null;
2022
+ }
2023
+ const fwdFwd = tryRotate(curves, segFirstHash, segLastHash, matchesForward);
2024
+ if (fwdFwd !== null) return fwdFwd;
2025
+ const flipFwd = tryRotate(curves, segLastHash, segFirstHash, matchesFlipped);
2026
+ if (flipFwd !== null) return flipFwd;
2006
2027
  const reversed = reverseSegment(curves);
2007
- startIndex = findCurveIndexBySegment(reversed, segFirstHash, segLastHash, onSegment);
2008
- if (startIndex === -1) require_errors.bug("rotateToStartAtSegment", "failed to rotate to segment start");
2009
- return rotateArray(reversed, startIndex);
2028
+ const fwdRev = tryRotate(reversed, segFirstHash, segLastHash, matchesForward);
2029
+ if (fwdRev !== null) return fwdRev;
2030
+ const flipRev = tryRotate(reversed, segLastHash, segFirstHash, matchesFlipped);
2031
+ if (flipRev !== null) return flipRev;
2032
+ require_errors.bug("rotateToStartAtSegment", "failed to rotate to segment start");
2010
2033
  }
2011
2034
  //#endregion
2012
2035
  //#region src/2d/blueprints/intersectionSegments.ts
2013
2036
  function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
2014
2037
  const intersectionSet = new Set(allIntersections.map(hashPoint));
2015
2038
  const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
2039
+ const matchesIntersection = (point) => {
2040
+ if (intersectionSet.has(hashPoint(point))) return true;
2041
+ return allIntersections.some((p) => samePoint(p, point));
2042
+ };
2043
+ const matchesCommonSegment = (first, last) => {
2044
+ if (commonSegmentSet.has(hashSegment(first, last))) return true;
2045
+ return allCommonSegments.some((seg) => samePoint(seg.firstPoint, first) && samePoint(seg.lastPoint, last) || samePoint(seg.firstPoint, last) && samePoint(seg.lastPoint, first));
2046
+ };
2016
2047
  let currentCurves = [];
2017
2048
  for (const curve of curves) {
2018
- const endsAtIntersection = intersectionSet.has(hashPoint(curve.lastPoint));
2019
- const isCommon = commonSegmentSet.has(hashSegment(curve.firstPoint, curve.lastPoint));
2049
+ const endsAtIntersection = matchesIntersection(curve.lastPoint);
2050
+ const isCommon = matchesCommonSegment(curve.firstPoint, curve.lastPoint);
2020
2051
  if (endsAtIntersection) {
2021
2052
  currentCurves.push(curve);
2022
2053
  yield currentCurves;
@@ -2227,7 +2258,7 @@ function booleanOperation(first, second, config) {
2227
2258
  if (segments.every(([, secondSegment]) => secondSegment === "same")) return { identical: true };
2228
2259
  let segmentsIn = null;
2229
2260
  let lastWasSame = null;
2230
- const paths = splitPaths(segments.flatMap(([firstSegment, secondSegment]) => {
2261
+ let assembledCurves = segments.flatMap(([firstSegment, secondSegment]) => {
2231
2262
  if (secondSegment === "same") {
2232
2263
  const result = handleSameSegment(firstSegment, segmentsIn, lastWasSame);
2233
2264
  segmentsIn = result.segmentsIn;
@@ -2238,7 +2269,10 @@ function booleanOperation(first, second, config) {
2238
2269
  segmentsIn = result.segmentsIn;
2239
2270
  lastWasSame = result.lastWasSame;
2240
2271
  return result.curves;
2241
- })).filter((b) => b.length > 0).map((b) => new require_blueprint.Blueprint(b));
2272
+ });
2273
+ const finalLastWasSame = lastWasSame;
2274
+ if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
2275
+ const paths = splitPaths(assembledCurves).filter((b) => b.length > 0).map((b) => new require_blueprint.Blueprint(b));
2242
2276
  if (paths.length === 0) return null;
2243
2277
  if (paths.length === 1) {
2244
2278
  const single = paths[0];
@@ -2522,7 +2556,7 @@ var cut2D = (first, second) => {
2522
2556
  if (first instanceof CompoundBlueprint) {
2523
2557
  const wrapper = require_errors.safeIndex(first.blueprints, 0, "cut2D");
2524
2558
  if (second instanceof require_blueprint.Blueprint && !second.intersects(wrapper)) {
2525
- if (!wrapper.isInside(second.firstPoint)) return null;
2559
+ if (!wrapper.isInside(second.firstPoint)) return first.clone();
2526
2560
  return organiseBlueprints([wrapper, ...allBlueprints(fuse2D(second, new Blueprints(first.blueprints.slice(1))))]);
2527
2561
  } else {
2528
2562
  let out = cut2D(wrapper, second);
@@ -2532,7 +2566,11 @@ var cut2D = (first, second) => {
2532
2566
  return out;
2533
2567
  }
2534
2568
  }
2535
- if (second instanceof Blueprints) return mergeNonIntersecting(second.blueprints.map((bp) => cut2D(first, bp)));
2569
+ if (second instanceof Blueprints) {
2570
+ let out = first;
2571
+ for (const bp of second.blueprints) out = cut2D(out, bp);
2572
+ return out;
2573
+ }
2536
2574
  if (second instanceof CompoundBlueprint) {
2537
2575
  let out = cutBlueprints(first, require_errors.safeIndex(second.blueprints, 0, "cut2D"));
2538
2576
  second.blueprints.slice(1).forEach((bp) => {
package/dist/brepjs.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_drawFns = require("./drawFns-CnBG_x6F.cjs");
2
+ const require_drawFns = require("./drawFns-Fz0E1ioE.cjs");
3
3
  const require_shapeTypes = require("./shapeTypes-DoBHuzjo.cjs");
4
4
  const require_errors = require("./errors-9zQcQK1H.cjs");
5
5
  const require_faceFns = require("./faceFns-Z6uVCQfc.cjs");
@@ -14,13 +14,13 @@ const require_surfaceBuilders = require("./surfaceBuilders-DpoOuVmz.cjs");
14
14
  const require_booleanFns = require("./booleanFns-BJtawwA0.cjs");
15
15
  const require_primitiveFns = require("./primitiveFns-DIKm4sVE.cjs");
16
16
  const require_historyFns = require("./historyFns-CHcfaeHI.cjs");
17
- const require_boolean2D = require("./boolean2D-CzOxpkFV.cjs");
17
+ const require_boolean2D = require("./boolean2D-tui3MK0X.cjs");
18
18
  const require_helpers = require("./helpers-WtVQGyPq.cjs");
19
19
  const require_solidBuilders = require("./solidBuilders-CJLijwcy.cjs");
20
20
  const require_measureFns = require("./measureFns-Dw3gJxtW.cjs");
21
21
  const require_cornerFinder = require("./cornerFinder-D7Q8B0yg.cjs");
22
22
  const require_extrudeFns = require("./extrudeFns-Don0l4Wq.cjs");
23
- const require_blueprintFns = require("./blueprintFns-BNic8mLn.cjs");
23
+ const require_blueprintFns = require("./blueprintFns-C68xzLWi.cjs");
24
24
  const require_importFns = require("./importFns-CP0NNYks.cjs");
25
25
  const require_shapeRefFns = require("./shapeRefFns-BYkjUjgL.cjs");
26
26
  const require_workerHandler = require("./workerHandler-Dl5bx8Qj.cjs");
package/dist/brepjs.js CHANGED
@@ -12,14 +12,14 @@ import { n as fill, r as makeFace } from "./surfaceBuilders-DewviEAb.js";
12
12
  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-Dekoe2OM.js";
13
13
  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-C-Z7pzVe.js";
14
14
  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-DEBKY9ZA.js";
15
- 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-AgCPXDXs.js";
15
+ 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-CmdpCG5R.js";
16
16
  import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-Cko_0e9R.js";
17
- 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-CSgc2JQ6.js";
17
+ 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-BW4ImsKe.js";
18
18
  import { r as makeCylinder } from "./solidBuilders-BIWD6a-a.js";
19
19
  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-Br7xFNAT.js";
20
20
  import { t as cornerFinder } from "./cornerFinder-C8VD-Eap.js";
21
21
  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-xBCFBG7e.js";
22
- 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-A6WhJQN_.js";
22
+ 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-Dm3epW6I.js";
23
23
  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-M40taVnq.js";
24
24
  import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-C-h3UVLi.js";
25
25
  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-DHY0IzlP.js";
@@ -7,7 +7,7 @@ import { a as planeToWorld, o as resolvePlane } from "./planeOps-De5KoY28.js";
7
7
  import { m as offsetWire2D } from "./curveFns-JTh5okGu.js";
8
8
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-E7Lh-LcJ.js";
9
9
  import { c as makeBSplineApproximation, d as makeEllipse, p as makeHelix, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeCircle } from "./surfaceBuilders-DewviEAb.js";
10
- import { S as Flatbush, _ as Blueprints, b as make2dOffset, c as roundedRectangleBlueprint, f as Sketch, g as CompoundBlueprint, h as organiseBlueprints, l as BaseSketcher2d, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D, u as BlueprintSketcher, v as chamferCurves, x as intersectCurves, y as filletCurves } from "./boolean2D-AgCPXDXs.js";
10
+ import { S as Flatbush, _ as Blueprints, b as make2dOffset, c as roundedRectangleBlueprint, f as Sketch, g as CompoundBlueprint, h as organiseBlueprints, l as BaseSketcher2d, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D, u as BlueprintSketcher, v as chamferCurves, x as intersectCurves, y as filletCurves } from "./boolean2D-CmdpCG5R.js";
11
11
  import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-Cko_0e9R.js";
12
12
  import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-xXn5kpyL.js";
13
13
  import { o as makeSolid, t as makeCompound } from "./solidBuilders-BIWD6a-a.js";
@@ -38,7 +38,7 @@ const require_planeOps = require("./planeOps-BXsq07La.cjs");
38
38
  const require_curveFns = require("./curveFns-6oIwf4om.cjs");
39
39
  const require_arrayAccess = require("./arrayAccess-DsvS2R9t.cjs");
40
40
  const require_surfaceBuilders = require("./surfaceBuilders-DpoOuVmz.cjs");
41
- const require_boolean2D = require("./boolean2D-CzOxpkFV.cjs");
41
+ const require_boolean2D = require("./boolean2D-tui3MK0X.cjs");
42
42
  const require_helpers = require("./helpers-WtVQGyPq.cjs");
43
43
  const require_blueprint = require("./blueprint-4w3i6ayW.cjs");
44
44
  const require_solidBuilders = require("./solidBuilders-CJLijwcy.cjs");
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_drawFns = require("./drawFns-CnBG_x6F.cjs");
3
- const require_boolean2D = require("./boolean2D-CzOxpkFV.cjs");
2
+ const require_drawFns = require("./drawFns-Fz0E1ioE.cjs");
3
+ const require_boolean2D = require("./boolean2D-tui3MK0X.cjs");
4
4
  //#region src/sketching.ts
5
5
  /**
6
6
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
package/dist/sketching.js CHANGED
@@ -1,5 +1,5 @@
1
- import { d as FaceSketcher, f as Sketch, l as BaseSketcher2d, u as BlueprintSketcher } from "./boolean2D-AgCPXDXs.js";
2
- import { $ as sketchFaceOffset, A as DrawingPen, B as drawSingleCircle, F as drawParametricFunction, H as drawText, I as drawPointsInterpolation, L as drawPolysides, M as draw, N as drawCircle, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, V as drawSingleEllipse, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, at as Sketcher, 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, k as Drawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-CSgc2JQ6.js";
1
+ import { d as FaceSketcher, f as Sketch, l as BaseSketcher2d, u as BlueprintSketcher } from "./boolean2D-CmdpCG5R.js";
2
+ import { $ as sketchFaceOffset, A as DrawingPen, B as drawSingleCircle, F as drawParametricFunction, H as drawText, I as drawPointsInterpolation, L as drawPolysides, M as draw, N as drawCircle, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, V as drawSingleEllipse, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, at as Sketcher, 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, k as Drawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-BW4ImsKe.js";
3
3
  //#region src/sketching.ts
4
4
  /**
5
5
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "15.1.3",
3
+ "version": "15.1.5",
4
4
  "description": "Web CAD library with pluggable geometry kernel",
5
5
  "keywords": [
6
6
  "cad",