brepjs 18.100.2 → 18.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{blueprint-CoG7hqAO.js → blueprint-CF12Nceg.js} +7 -7
  4. package/dist/{blueprint-D60m51kI.cjs → blueprint-D5ArjKiA.cjs} +7 -7
  5. package/dist/{blueprintFns-CsR4vknQ.js → blueprintFns-BuPAK4OB.js} +2 -2
  6. package/dist/{blueprintFns-CDdNG1E0.cjs → blueprintFns-CcCfkbyd.cjs} +2 -2
  7. package/dist/{blueprintSketcher-BH026Vs6.js → blueprintSketcher-CEQ8s7TD.js} +3 -3
  8. package/dist/{blueprintSketcher-CNV3BF1m.cjs → blueprintSketcher-DCttG3KS.cjs} +3 -3
  9. package/dist/{boolean2D-BkoT0tyj.js → boolean2D-8rB2sUzj.js} +4 -4
  10. package/dist/{boolean2D-DAy71yz-.cjs → boolean2D-BCqDjg0y.cjs} +4 -4
  11. package/dist/brepjs.cjs +96 -41
  12. package/dist/brepjs.js +96 -41
  13. package/dist/{cameraFns-B62EdiYs.js → cameraFns-Bu6jgTKc.js} +2 -2
  14. package/dist/{cameraFns-B-T9D-ie.cjs → cameraFns-S7YbAxfg.cjs} +2 -2
  15. package/dist/core/kernelBoundary.d.ts +1 -2
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.js +1 -1
  18. package/dist/{cornerFinder-C6GEoGxi.js → cornerFinder-COqoeY--.js} +1 -1
  19. package/dist/{cornerFinder-oRnX2o08.cjs → cornerFinder-Ci2NbbAW.cjs} +1 -1
  20. package/dist/csg/evaluate.d.ts +29 -6
  21. package/dist/{curveFns-CaEoZJFJ.js → curveFns-CG05Jygr.js} +1 -1
  22. package/dist/{curveFns-BIlzT4bO.cjs → curveFns-Dx7_wMut.cjs} +1 -1
  23. package/dist/{drawFns-BoJx2cw1.js → drawFns-CsXPFyDe.js} +12 -12
  24. package/dist/{drawFns-CBSGIxrq.cjs → drawFns-DYkjT_hx.cjs} +12 -12
  25. package/dist/{faceFns-BvtC44tv.cjs → faceFns-DKg2St8b.cjs} +6 -9
  26. package/dist/{faceFns-Cgpg9n36.js → faceFns-mo4ThIHz.js} +6 -9
  27. package/dist/{healingFns-BiChNtRz.js → healingFns-Bb3eEBNm.js} +5 -5
  28. package/dist/{healingFns-DY8866Fl.cjs → healingFns-CM5mVMow.cjs} +5 -5
  29. package/dist/{helpers-DDN_oU6P.cjs → helpers-8zxf2gkc.cjs} +6 -6
  30. package/dist/{helpers-CRB4YhSI.js → helpers-DT44wBAD.js} +6 -6
  31. package/dist/{importFns-v3C1RKi2.cjs → importFns-B6hw9Nhx.cjs} +9 -9
  32. package/dist/{importFns-CcUm7pcu.js → importFns-CEczwPdN.js} +9 -9
  33. package/dist/io.cjs +2 -2
  34. package/dist/io.js +2 -2
  35. package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +6 -7
  36. package/dist/kernel/brepkit/kernel2dOps.d.ts +3 -4
  37. package/dist/kernel/geometry2d.d.ts +2 -0
  38. package/dist/kernel/occt/kernel2dOps.d.ts +3 -4
  39. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  40. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  41. package/dist/{loftFns-CFyOO359.cjs → loftFns-DaRDYpfB.cjs} +11 -1
  42. package/dist/{loftFns-D5rQxNOI.js → loftFns-DyNuD9XL.js} +11 -1
  43. package/dist/{measureFns-BrrVzFq0.js → measureFns-Dkh_DmrE.js} +3 -3
  44. package/dist/{measureFns-D2Y2OOuw.cjs → measureFns-Q2dnokUU.cjs} +3 -3
  45. package/dist/measurement.cjs +1 -1
  46. package/dist/measurement.js +1 -1
  47. package/dist/{meshFns-Bkcg1u5D.js → meshFns-CAAarhVm.js} +3 -3
  48. package/dist/{meshFns-BKBGgLB4.cjs → meshFns-DeKdpmu7.cjs} +3 -3
  49. package/dist/{occtWasmAdapter-D7mOxU0Q.js → occtWasmAdapter-BDEPveZs.js} +82 -14
  50. package/dist/{occtWasmAdapter-Bv2OTOX9.cjs → occtWasmAdapter-DDZELjlB.cjs} +93 -13
  51. package/dist/operations/extrudeUtils.d.ts +1 -6
  52. package/dist/operations/sweepFns.d.ts +1 -7
  53. package/dist/operations.cjs +2 -2
  54. package/dist/operations.js +2 -2
  55. package/dist/{primitiveFns-DmF1hhYr.js → primitiveFns-62SO4ti5.js} +4 -4
  56. package/dist/{primitiveFns-DFwdXRvP.cjs → primitiveFns-BAWtMd9H.cjs} +4 -4
  57. package/dist/projection.cjs +1 -1
  58. package/dist/projection.js +1 -1
  59. package/dist/query.cjs +2 -2
  60. package/dist/query.js +2 -2
  61. package/dist/{shapeFns-D-4StVDd.js → shapeFns-DyBbhU30.js} +2 -2
  62. package/dist/{shapeFns-B3GP-0FJ.cjs → shapeFns-L4a8kH_A.cjs} +2 -2
  63. package/dist/shapeRef.cjs +1 -1
  64. package/dist/shapeRef.js +1 -1
  65. package/dist/{shapeRefFns-CtUw9bYy.js → shapeRefFns-Cn4WNb3q.js} +4 -4
  66. package/dist/{shapeRefFns-CdgSGKLD.cjs → shapeRefFns-Dij41NuC.cjs} +4 -4
  67. package/dist/{shapeTypes-DQfoZt_L.cjs → shapeTypes-Bwgm5N6R.cjs} +5 -133
  68. package/dist/{shapeTypes-z5bfGPVI.js → shapeTypes-C4lPfrc2.js} +3 -131
  69. package/dist/sketching.cjs +3 -3
  70. package/dist/sketching.js +3 -3
  71. package/dist/{solidBuilders-Dcl1gZwH.js → solidBuilders-Biwv2cW3.js} +5 -5
  72. package/dist/{solidBuilders-RRBbe3dp.cjs → solidBuilders-CgRmJEdn.cjs} +5 -5
  73. package/dist/{surfaceBuilders-DXMOQVyx.js → surfaceBuilders-Bww4jhBo.js} +10 -10
  74. package/dist/{surfaceBuilders-D_htXKwS.cjs → surfaceBuilders-FLnYYA70.cjs} +10 -10
  75. package/dist/text.cjs +2 -2
  76. package/dist/text.js +2 -2
  77. package/dist/{textBlueprints-A1zJwOLD.cjs → textBlueprints-08NcMO9T.cjs} +7 -7
  78. package/dist/{textBlueprints-Da_l2ncZ.js → textBlueprints-CEzTC9vX.js} +7 -7
  79. package/dist/{textMetrics-DwaQOil0.js → textMetrics-CBbDQ5QW.js} +1 -1
  80. package/dist/{textMetrics-qCUPlyrb.cjs → textMetrics-W-H6jUDj.cjs} +1 -1
  81. package/dist/{threadFns-D2kDxalD.js → threadFns-8rKpQXiR.js} +6 -6
  82. package/dist/{threadFns-BqoKTKCh.cjs → threadFns-DGYdomjN.cjs} +6 -6
  83. package/dist/topology.cjs +8 -8
  84. package/dist/topology.js +8 -8
  85. package/dist/{topologyQueryFns-De27Nxmf.js → topologyQueryFns-Do8E4EXj.js} +1 -1
  86. package/dist/{topologyQueryFns-BLkQkExs.cjs → topologyQueryFns-ygBBXxnP.cjs} +1 -1
  87. package/package.json +2 -2
package/dist/2d.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
5
- const require_blueprintSketcher = require("./blueprintSketcher-CNV3BF1m.cjs");
6
- const require_blueprint = require("./blueprint-D60m51kI.cjs");
7
- const require_boolean2D = require("./boolean2D-DAy71yz-.cjs");
8
- const require_blueprintFns = require("./blueprintFns-CDdNG1E0.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
5
+ const require_blueprintSketcher = require("./blueprintSketcher-DCttG3KS.cjs");
6
+ const require_blueprint = require("./blueprint-D5ArjKiA.cjs");
7
+ const require_boolean2D = require("./boolean2D-BCqDjg0y.cjs");
8
+ const require_blueprintFns = require("./blueprintFns-CcCfkbyd.cjs");
9
9
  //#region src/core/curve2dHandle.ts
10
10
  /**
11
11
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
package/dist/2d.js CHANGED
@@ -1,10 +1,10 @@
1
- import { B as createKernelHandle, Q as getKernel2D, a as createEdge } from "./shapeTypes-z5bfGPVI.js";
1
+ import { B as createKernelHandle, Q as getKernel2D, a as createEdge } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
3
- import { w as kernelCallRaw } from "./topologyQueryFns-De27Nxmf.js";
4
- import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-BH026Vs6.js";
5
- import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-CoG7hqAO.js";
6
- import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BkoT0tyj.js";
7
- 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-CsR4vknQ.js";
3
+ import { w as kernelCallRaw } from "./topologyQueryFns-Do8E4EXj.js";
4
+ import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-CEQ8s7TD.js";
5
+ import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-CF12Nceg.js";
6
+ import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-8rB2sUzj.js";
7
+ 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-BuPAK4OB.js";
8
8
  //#region src/core/curve2dHandle.ts
9
9
  /**
10
10
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
@@ -1,14 +1,14 @@
1
- import { G as unregisterFromCleanup, Q as getKernel2D, U as registerForCleanup, Z as getKernel, a as createEdge, u as createWire } from "./shapeTypes-z5bfGPVI.js";
1
+ import { G as unregisterFromCleanup, Q as getKernel2D, U as registerForCleanup, Z as getKernel, a as createEdge, u as createWire } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
3
3
  import { A as ok, R as unwrap, b as err, d as validationError, h as bug, n as computationError } from "./errors-DNWJsfVU.js";
4
4
  import { r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  import { r as toVec3 } from "./types-D24Y27N0.js";
6
6
  import { r as makePlane } from "./planeOps-DSjjtrjg.js";
7
- import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-Cgpg9n36.js";
8
- import { p as getOrientation } from "./curveFns-CaEoZJFJ.js";
7
+ import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-mo4ThIHz.js";
8
+ import { p as getOrientation } from "./curveFns-CG05Jygr.js";
9
9
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
10
- import { r as makeFace } from "./surfaceBuilders-DXMOQVyx.js";
11
- import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-CRB4YhSI.js";
10
+ import { r as makeFace } from "./surfaceBuilders-Bww4jhBo.js";
11
+ import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-DT44wBAD.js";
12
12
  //#region src/2d/lib/definitions.ts
13
13
  /** Type guard that checks whether a value is a `Point2D`. */
14
14
  function isPoint2D(point) {
@@ -487,8 +487,8 @@ function make2dInerpolatedBSplineCurve(points, { tolerance = .001, smoothing = n
487
487
  degMin,
488
488
  continuity: "C2"
489
489
  })));
490
- } catch {
491
- return err(computationError("BSPLINE_2D_FAILED", "B-spline approximation failed"));
490
+ } catch (e) {
491
+ return err(computationError("BSPLINE_2D_FAILED", "B-spline approximation failed", e));
492
492
  }
493
493
  }
494
494
  /**
@@ -1,14 +1,14 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_types = require("./types-KjA8tY4Y.cjs");
6
6
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
7
- const require_faceFns = require("./faceFns-BvtC44tv.cjs");
8
- const require_curveFns = require("./curveFns-BIlzT4bO.cjs");
7
+ const require_faceFns = require("./faceFns-DKg2St8b.cjs");
8
+ const require_curveFns = require("./curveFns-Dx7_wMut.cjs");
9
9
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
10
- const require_surfaceBuilders = require("./surfaceBuilders-D_htXKwS.cjs");
11
- const require_helpers = require("./helpers-DDN_oU6P.cjs");
10
+ const require_surfaceBuilders = require("./surfaceBuilders-FLnYYA70.cjs");
11
+ const require_helpers = require("./helpers-8zxf2gkc.cjs");
12
12
  //#region src/2d/lib/definitions.ts
13
13
  /** Type guard that checks whether a value is a `Point2D`. */
14
14
  function isPoint2D(point) {
@@ -487,8 +487,8 @@ function make2dInerpolatedBSplineCurve(points, { tolerance = .001, smoothing = n
487
487
  degMin,
488
488
  continuity: "C2"
489
489
  })));
490
- } catch {
491
- return require_errors.err(require_errors.computationError("BSPLINE_2D_FAILED", "B-spline approximation failed"));
490
+ } catch (e) {
491
+ return require_errors.err(require_errors.computationError("BSPLINE_2D_FAILED", "B-spline approximation failed", e));
492
492
  }
493
493
  }
494
494
  /**
@@ -1,6 +1,6 @@
1
1
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
2
- import { i as CompoundBlueprint } from "./blueprintSketcher-BH026Vs6.js";
3
- import { t as Blueprint } from "./blueprint-CoG7hqAO.js";
2
+ import { i as CompoundBlueprint } from "./blueprintSketcher-CEQ8s7TD.js";
3
+ import { t as Blueprint } from "./blueprint-CF12Nceg.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-CXJtc4I7.cjs");
2
- const require_blueprintSketcher = require("./blueprintSketcher-CNV3BF1m.cjs");
3
- const require_blueprint = require("./blueprint-D60m51kI.cjs");
2
+ const require_blueprintSketcher = require("./blueprintSketcher-DCttG3KS.cjs");
3
+ const require_blueprint = require("./blueprint-D5ArjKiA.cjs");
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
6
6
  * Return a reversed copy of the curve (non-mutating).
@@ -1,10 +1,10 @@
1
- import { Q as getKernel2D, Z as getKernel } from "./shapeTypes-z5bfGPVI.js";
1
+ import { Q as getKernel2D, Z as getKernel } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
3
3
  import { A as ok, R as unwrap, T as isOk, b as err, h as bug, n as computationError, s as safeIndex } from "./errors-DNWJsfVU.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-CRB4YhSI.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-CoG7hqAO.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-DT44wBAD.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-CF12Nceg.js";
8
8
  //#region node_modules/flatqueue/index.js
9
9
  /**
10
10
  * @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
@@ -1,10 +1,10 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
6
- const require_helpers = require("./helpers-DDN_oU6P.cjs");
7
- const require_blueprint = require("./blueprint-D60m51kI.cjs");
6
+ const require_helpers = require("./helpers-8zxf2gkc.cjs");
7
+ const require_blueprint = require("./blueprint-D5ArjKiA.cjs");
8
8
  //#region node_modules/flatqueue/index.js
9
9
  /**
10
10
  * @typedef {Float64ArrayConstructor | Float32ArrayConstructor |
@@ -1,10 +1,10 @@
1
1
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
2
2
  import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
3
3
  import { r as lastOrThrow } from "./arrayAccess-DrUGPADn.js";
4
- import { v as zip } from "./surfaceBuilders-DXMOQVyx.js";
5
- import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-BH026Vs6.js";
6
- import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-CRB4YhSI.js";
7
- import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-CoG7hqAO.js";
4
+ import { v as zip } from "./surfaceBuilders-Bww4jhBo.js";
5
+ import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-CEQ8s7TD.js";
6
+ import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-DT44wBAD.js";
7
+ import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-CF12Nceg.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.
@@ -1,10 +1,10 @@
1
1
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
4
- const require_surfaceBuilders = require("./surfaceBuilders-D_htXKwS.cjs");
5
- const require_blueprintSketcher = require("./blueprintSketcher-CNV3BF1m.cjs");
6
- const require_helpers = require("./helpers-DDN_oU6P.cjs");
7
- const require_blueprint = require("./blueprint-D60m51kI.cjs");
4
+ const require_surfaceBuilders = require("./surfaceBuilders-FLnYYA70.cjs");
5
+ const require_blueprintSketcher = require("./blueprintSketcher-DCttG3KS.cjs");
6
+ const require_helpers = require("./helpers-8zxf2gkc.cjs");
7
+ const require_blueprint = require("./blueprint-D5ArjKiA.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.
package/dist/brepjs.cjs CHANGED
@@ -1,37 +1,37 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-A1zJwOLD.cjs");
3
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
4
- const require_occtWasmAdapter = require("./occtWasmAdapter-Bv2OTOX9.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-08NcMO9T.cjs");
3
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
4
+ const require_occtWasmAdapter = require("./occtWasmAdapter-DDZELjlB.cjs");
5
5
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
6
6
  const require_errors = require("./errors-CXJtc4I7.cjs");
7
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
7
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
8
8
  const require_constants = require("./constants-BOVyEYGH.cjs");
9
9
  const require_types = require("./types-KjA8tY4Y.cjs");
10
10
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
11
11
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
12
- const require_faceFns = require("./faceFns-BvtC44tv.cjs");
13
- const require_shapeFns = require("./shapeFns-B3GP-0FJ.cjs");
14
- const require_curveFns = require("./curveFns-BIlzT4bO.cjs");
15
- const require_meshFns = require("./meshFns-BKBGgLB4.cjs");
12
+ const require_faceFns = require("./faceFns-DKg2St8b.cjs");
13
+ const require_shapeFns = require("./shapeFns-L4a8kH_A.cjs");
14
+ const require_curveFns = require("./curveFns-Dx7_wMut.cjs");
15
+ const require_meshFns = require("./meshFns-DeKdpmu7.cjs");
16
16
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
17
- const require_surfaceBuilders = require("./surfaceBuilders-D_htXKwS.cjs");
18
- const require_solidBuilders = require("./solidBuilders-RRBbe3dp.cjs");
19
- const require_healingFns = require("./healingFns-DY8866Fl.cjs");
20
- const require_threadFns = require("./threadFns-BqoKTKCh.cjs");
21
- const require_blueprintSketcher = require("./blueprintSketcher-CNV3BF1m.cjs");
22
- const require_helpers = require("./helpers-DDN_oU6P.cjs");
23
- const require_drawFns = require("./drawFns-CBSGIxrq.cjs");
24
- const require_measureFns = require("./measureFns-D2Y2OOuw.cjs");
25
- const require_cornerFinder = require("./cornerFinder-oRnX2o08.cjs");
26
- const require_boolean2D = require("./boolean2D-DAy71yz-.cjs");
27
- const require_blueprintFns = require("./blueprintFns-CDdNG1E0.cjs");
28
- const require_importFns = require("./importFns-v3C1RKi2.cjs");
29
- const require_loftFns = require("./loftFns-CFyOO359.cjs");
30
- const require_cameraFns = require("./cameraFns-B-T9D-ie.cjs");
31
- const require_textMetrics = require("./textMetrics-qCUPlyrb.cjs");
32
- const require_shapeRefFns = require("./shapeRefFns-CdgSGKLD.cjs");
17
+ const require_surfaceBuilders = require("./surfaceBuilders-FLnYYA70.cjs");
18
+ const require_solidBuilders = require("./solidBuilders-CgRmJEdn.cjs");
19
+ const require_healingFns = require("./healingFns-CM5mVMow.cjs");
20
+ const require_threadFns = require("./threadFns-DGYdomjN.cjs");
21
+ const require_blueprintSketcher = require("./blueprintSketcher-DCttG3KS.cjs");
22
+ const require_helpers = require("./helpers-8zxf2gkc.cjs");
23
+ const require_drawFns = require("./drawFns-DYkjT_hx.cjs");
24
+ const require_measureFns = require("./measureFns-Q2dnokUU.cjs");
25
+ const require_cornerFinder = require("./cornerFinder-Ci2NbbAW.cjs");
26
+ const require_boolean2D = require("./boolean2D-BCqDjg0y.cjs");
27
+ const require_blueprintFns = require("./blueprintFns-CcCfkbyd.cjs");
28
+ const require_importFns = require("./importFns-B6hw9Nhx.cjs");
29
+ const require_loftFns = require("./loftFns-DaRDYpfB.cjs");
30
+ const require_cameraFns = require("./cameraFns-S7YbAxfg.cjs");
31
+ const require_textMetrics = require("./textMetrics-W-H6jUDj.cjs");
32
+ const require_shapeRefFns = require("./shapeRefFns-Dij41NuC.cjs");
33
33
  const require_workerHandler = require("./workerHandler-CdlOTwJg.cjs");
34
- const require_primitiveFns = require("./primitiveFns-DFwdXRvP.cjs");
34
+ const require_primitiveFns = require("./primitiveFns-BAWtMd9H.cjs");
35
35
  //#region src/topology/shapeBooleans.ts
36
36
  var BOPAlgo_GlueShift = 1;
37
37
  var BOPAlgo_GlueFull = 2;
@@ -2899,8 +2899,8 @@ function sewMeshToSolid(triangles, errorCode, tolerance = 1e-6) {
2899
2899
  } catch {
2900
2900
  try {
2901
2901
  return require_errors.ok(require_shapeTypes.castShape(kernel.sew(triFaces, tolerance)));
2902
- } catch {
2903
- return require_errors.err(require_errors.ioError(errorCode, "Failed to sew triangular faces"));
2902
+ } catch (e) {
2903
+ return require_errors.err(require_errors.ioError(errorCode, "Failed to sew triangular faces", e));
2904
2904
  }
2905
2905
  }
2906
2906
  }
@@ -5645,34 +5645,61 @@ function cacheKey(node, env, kernelId, tolerance) {
5645
5645
  return `${toHex(node.structuralHash)}:${kernelId}:${toHex(projHash)}:${tolHash}`;
5646
5646
  }
5647
5647
  var Evaluator = class {
5648
- scope = new require_shapeTypes.DisposalScope();
5649
5648
  cache = /* @__PURE__ */ new Map();
5650
- registered = /* @__PURE__ */ new WeakSet();
5649
+ refCounts = /* @__PURE__ */ new Map();
5650
+ evaluating = false;
5651
+ pendingKeys = [];
5651
5652
  kernelId;
5652
5653
  defaultTolerance;
5654
+ maxCacheEntries;
5653
5655
  onStep;
5654
5656
  hits = 0;
5655
5657
  misses = 0;
5658
+ evictions = 0;
5656
5659
  constructor(options = {}) {
5657
5660
  this.kernelId = options.kernel ?? require_shapeTypes.getActiveKernelId() ?? "unregistered";
5658
5661
  this.defaultTolerance = options.tolerance;
5659
5662
  if (options.onStep) this.onStep = options.onStep;
5663
+ const max = options.maxCacheEntries;
5664
+ if (max !== void 0 && (!Number.isInteger(max) || max < 1)) throw new RangeError(`Evaluator: maxCacheEntries must be a positive integer, got ${String(max)}`);
5665
+ this.maxCacheEntries = max;
5660
5666
  }
5661
5667
  /**
5662
5668
  * Materialize a CSG IR tree against the given parameter environment.
5663
- * The returned shape is borrowed — valid for as long as this Evaluator is
5664
- * not disposed. Callers must NOT call `.delete()` / `[Symbol.dispose]()`
5665
- * on the returned shape; that would invalidate the cache entry for every
5666
- * future call returning the same handle.
5669
+ * The returned shape is borrowed — callers must NOT call `.delete()` /
5670
+ * `[Symbol.dispose]()` on it; that would invalidate the cache entry for
5671
+ * every future call returning the same handle. By default it stays valid
5672
+ * until the Evaluator is disposed; if `maxCacheEntries` is set, only until
5673
+ * the next successful evaluate() call (LRU eviction may free older entries),
5674
+ * and evaluate() is then non-reentrant — calling it from an onStep callback
5675
+ * throws.
5667
5676
  */
5668
5677
  evaluate(node, env = {}) {
5669
- return require_shapeTypes.withKernel(this.kernelId, () => this.evaluateInner(node, env));
5678
+ if (this.maxCacheEntries !== void 0 && this.evaluating) throw new Error("Evaluator.evaluate() is not reentrant when maxCacheEntries is set — do not call it from an onStep callback.");
5679
+ return require_shapeTypes.withKernel(this.kernelId, () => {
5680
+ this.evaluating = true;
5681
+ let committed = false;
5682
+ try {
5683
+ const result = this.evaluateInner(node, env);
5684
+ if (this.maxCacheEntries !== void 0 && result.ok) this.trimCache(this.maxCacheEntries);
5685
+ committed = result.ok;
5686
+ return result;
5687
+ } finally {
5688
+ if (!committed && this.maxCacheEntries !== void 0) this.rollbackPending();
5689
+ this.pendingKeys.length = 0;
5690
+ this.evaluating = false;
5691
+ }
5692
+ });
5670
5693
  }
5671
5694
  evaluateInner(node, env) {
5672
5695
  const key = cacheKey(node, env, this.kernelId, this.defaultTolerance);
5673
5696
  const cached = this.cache.get(key);
5674
5697
  if (cached !== void 0) {
5675
5698
  this.hits++;
5699
+ if (this.maxCacheEntries !== void 0) {
5700
+ this.cache.delete(key);
5701
+ this.cache.set(key, cached);
5702
+ }
5676
5703
  this.onStep?.({
5677
5704
  node,
5678
5705
  cacheKey: key,
@@ -5687,11 +5714,10 @@ var Evaluator = class {
5687
5714
  evalNode: (child) => this.evaluateInner(child, env)
5688
5715
  });
5689
5716
  if (!result.ok) return result;
5690
- if (!this.registered.has(result.value)) {
5691
- this.scope.register(result.value);
5692
- this.registered.add(result.value);
5693
- }
5694
- this.cache.set(key, result.value);
5717
+ const shape = result.value;
5718
+ this.refCounts.set(shape, (this.refCounts.get(shape) ?? 0) + 1);
5719
+ this.cache.set(key, shape);
5720
+ if (this.maxCacheEntries !== void 0) this.pendingKeys.push(key);
5695
5721
  this.onStep?.({
5696
5722
  node,
5697
5723
  cacheKey: key,
@@ -5699,19 +5725,48 @@ var Evaluator = class {
5699
5725
  });
5700
5726
  return result;
5701
5727
  }
5728
+ releaseShape(shape) {
5729
+ const next = (this.refCounts.get(shape) ?? 1) - 1;
5730
+ if (next <= 0) {
5731
+ this.refCounts.delete(shape);
5732
+ shape[Symbol.dispose]();
5733
+ } else this.refCounts.set(shape, next);
5734
+ }
5735
+ trimCache(max) {
5736
+ while (this.cache.size > max) {
5737
+ const oldest = this.cache.keys().next();
5738
+ if (oldest.done) break;
5739
+ const key = oldest.value;
5740
+ const shape = this.cache.get(key);
5741
+ this.cache.delete(key);
5742
+ this.evictions++;
5743
+ if (shape !== void 0) this.releaseShape(shape);
5744
+ }
5745
+ }
5746
+ rollbackPending() {
5747
+ for (const key of this.pendingKeys) {
5748
+ const shape = this.cache.get(key);
5749
+ if (shape === void 0) continue;
5750
+ this.cache.delete(key);
5751
+ this.releaseShape(shape);
5752
+ }
5753
+ }
5702
5754
  cacheStats() {
5703
5755
  return {
5704
5756
  hits: this.hits,
5705
5757
  misses: this.misses,
5706
- entries: this.cache.size
5758
+ entries: this.cache.size,
5759
+ evictions: this.evictions
5707
5760
  };
5708
5761
  }
5709
5762
  resetStats() {
5710
5763
  this.hits = 0;
5711
5764
  this.misses = 0;
5765
+ this.evictions = 0;
5712
5766
  }
5713
5767
  [Symbol.dispose]() {
5714
- this.scope[Symbol.dispose]();
5768
+ for (const shape of this.refCounts.keys()) shape[Symbol.dispose]();
5769
+ this.refCounts.clear();
5715
5770
  this.cache.clear();
5716
5771
  }
5717
5772
  };