brepjs 18.100.3 → 18.102.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 (89) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{blueprint-DZB6Drrd.js → blueprint-CF12Nceg.js} +5 -5
  4. package/dist/{blueprint-1x01ITBT.cjs → blueprint-D5ArjKiA.cjs} +5 -5
  5. package/dist/{blueprintFns-o4dhTIZQ.js → blueprintFns-BuPAK4OB.js} +2 -2
  6. package/dist/{blueprintFns-DkmuKpz6.cjs → blueprintFns-CcCfkbyd.cjs} +2 -2
  7. package/dist/{blueprintSketcher-C5Q-JLEK.js → blueprintSketcher-CEQ8s7TD.js} +3 -3
  8. package/dist/{blueprintSketcher-BoHwuwaU.cjs → blueprintSketcher-DCttG3KS.cjs} +3 -3
  9. package/dist/{boolean2D-DV642GXt.js → boolean2D-8rB2sUzj.js} +4 -4
  10. package/dist/{boolean2D-C1Akp29q.cjs → boolean2D-BCqDjg0y.cjs} +4 -4
  11. package/dist/brepjs.cjs +234 -39
  12. package/dist/brepjs.js +228 -40
  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-Bmjk2BOw.js → cornerFinder-COqoeY--.js} +1 -1
  19. package/dist/{cornerFinder-CqSNuWBI.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-BVVGRW0h.js → drawFns-CsXPFyDe.js} +12 -12
  24. package/dist/{drawFns-Dwq6JHbb.cjs → drawFns-DYkjT_hx.cjs} +12 -12
  25. package/dist/{faceFns-B7yceDjt.cjs → faceFns-DKg2St8b.cjs} +4 -7
  26. package/dist/{faceFns-CFvc_qXI.js → faceFns-mo4ThIHz.js} +4 -7
  27. package/dist/{healingFns-BY6Q9gge.js → healingFns-Bb3eEBNm.js} +5 -5
  28. package/dist/{healingFns-CEzX-45q.cjs → healingFns-CM5mVMow.cjs} +5 -5
  29. package/dist/{helpers-A0a3O6af.cjs → helpers-8zxf2gkc.cjs} +6 -6
  30. package/dist/{helpers-BamnXOMX.js → helpers-DT44wBAD.js} +6 -6
  31. package/dist/{importFns-Dj107tFY.cjs → importFns-B6hw9Nhx.cjs} +3 -3
  32. package/dist/{importFns-Cfe_tEh_.js → importFns-CEczwPdN.js} +3 -3
  33. package/dist/index.d.ts +2 -1
  34. package/dist/io.cjs +2 -2
  35. package/dist/io.js +2 -2
  36. package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +6 -7
  37. package/dist/kernel/brepkit/kernel2dOps.d.ts +3 -4
  38. package/dist/kernel/geometry2d.d.ts +2 -0
  39. package/dist/kernel/occt/kernel2dOps.d.ts +3 -4
  40. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  41. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  42. package/dist/{loftFns-CFyOO359.cjs → loftFns-DaRDYpfB.cjs} +11 -1
  43. package/dist/{loftFns-D5rQxNOI.js → loftFns-DyNuD9XL.js} +11 -1
  44. package/dist/{measureFns-Bb0Do7in.js → measureFns-Dkh_DmrE.js} +3 -3
  45. package/dist/{measureFns-Cmc_y0WE.cjs → measureFns-Q2dnokUU.cjs} +3 -3
  46. package/dist/measurement.cjs +1 -1
  47. package/dist/measurement.js +1 -1
  48. package/dist/{meshFns-Bkcg1u5D.js → meshFns-CAAarhVm.js} +3 -3
  49. package/dist/{meshFns-BKBGgLB4.cjs → meshFns-DeKdpmu7.cjs} +3 -3
  50. package/dist/{occtWasmAdapter-D7mOxU0Q.js → occtWasmAdapter-BDEPveZs.js} +82 -14
  51. package/dist/{occtWasmAdapter-Bv2OTOX9.cjs → occtWasmAdapter-DDZELjlB.cjs} +93 -13
  52. package/dist/operations/extrudeUtils.d.ts +1 -6
  53. package/dist/operations/instanceFns.d.ts +66 -0
  54. package/dist/operations/sweepFns.d.ts +1 -7
  55. package/dist/operations.cjs +2 -2
  56. package/dist/operations.js +2 -2
  57. package/dist/{primitiveFns-DS7-3evP.js → primitiveFns-62SO4ti5.js} +4 -4
  58. package/dist/{primitiveFns-B898KlXM.cjs → primitiveFns-BAWtMd9H.cjs} +4 -4
  59. package/dist/projection.cjs +1 -1
  60. package/dist/projection.js +1 -1
  61. package/dist/query.cjs +2 -2
  62. package/dist/query.js +2 -2
  63. package/dist/{shapeFns-D-4StVDd.js → shapeFns-DyBbhU30.js} +2 -2
  64. package/dist/{shapeFns-B3GP-0FJ.cjs → shapeFns-L4a8kH_A.cjs} +2 -2
  65. package/dist/shapeRef.cjs +1 -1
  66. package/dist/shapeRef.js +1 -1
  67. package/dist/{shapeRefFns-DzVlxDhd.js → shapeRefFns-Cn4WNb3q.js} +4 -4
  68. package/dist/{shapeRefFns-C6L7KhTi.cjs → shapeRefFns-Dij41NuC.cjs} +4 -4
  69. package/dist/{shapeTypes-DQfoZt_L.cjs → shapeTypes-Bwgm5N6R.cjs} +5 -133
  70. package/dist/{shapeTypes-z5bfGPVI.js → shapeTypes-C4lPfrc2.js} +3 -131
  71. package/dist/sketching.cjs +3 -3
  72. package/dist/sketching.js +3 -3
  73. package/dist/{solidBuilders-8H08aDto.js → solidBuilders-Biwv2cW3.js} +5 -5
  74. package/dist/{solidBuilders-B0Uyvvyy.cjs → solidBuilders-CgRmJEdn.cjs} +5 -5
  75. package/dist/{surfaceBuilders-BYopOndo.js → surfaceBuilders-Bww4jhBo.js} +2 -2
  76. package/dist/{surfaceBuilders-zGpnLDxz.cjs → surfaceBuilders-FLnYYA70.cjs} +2 -2
  77. package/dist/text.cjs +2 -2
  78. package/dist/text.js +2 -2
  79. package/dist/{textBlueprints-B8cDsSHe.cjs → textBlueprints-08NcMO9T.cjs} +7 -7
  80. package/dist/{textBlueprints-ziKppdNm.js → textBlueprints-CEzTC9vX.js} +7 -7
  81. package/dist/{textMetrics-CP-jrZ98.js → textMetrics-CBbDQ5QW.js} +1 -1
  82. package/dist/{textMetrics-B8qEy3dh.cjs → textMetrics-W-H6jUDj.cjs} +1 -1
  83. package/dist/{threadFns-7jlwHbES.js → threadFns-8rKpQXiR.js} +6 -6
  84. package/dist/{threadFns-B_8tna0V.cjs → threadFns-DGYdomjN.cjs} +6 -6
  85. package/dist/topology.cjs +8 -8
  86. package/dist/topology.js +8 -8
  87. package/dist/{topologyQueryFns-De27Nxmf.js → topologyQueryFns-Do8E4EXj.js} +1 -1
  88. package/dist/{topologyQueryFns-BLkQkExs.cjs → topologyQueryFns-ygBBXxnP.cjs} +1 -1
  89. 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-BoHwuwaU.cjs");
6
- const require_blueprint = require("./blueprint-1x01ITBT.cjs");
7
- const require_boolean2D = require("./boolean2D-C1Akp29q.cjs");
8
- const require_blueprintFns = require("./blueprintFns-DkmuKpz6.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-C5Q-JLEK.js";
5
- import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-DZB6Drrd.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-DV642GXt.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-o4dhTIZQ.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-CFvc_qXI.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-BYopOndo.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-BamnXOMX.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) {
@@ -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-B7yceDjt.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-zGpnLDxz.cjs");
11
- const require_helpers = require("./helpers-A0a3O6af.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) {
@@ -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-C5Q-JLEK.js";
3
- import { t as Blueprint } from "./blueprint-DZB6Drrd.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-BoHwuwaU.cjs");
3
- const require_blueprint = require("./blueprint-1x01ITBT.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-BamnXOMX.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-DZB6Drrd.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-A0a3O6af.cjs");
7
- const require_blueprint = require("./blueprint-1x01ITBT.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-BYopOndo.js";
5
- import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-C5Q-JLEK.js";
6
- import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-BamnXOMX.js";
7
- import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-DZB6Drrd.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-zGpnLDxz.cjs");
5
- const require_blueprintSketcher = require("./blueprintSketcher-BoHwuwaU.cjs");
6
- const require_helpers = require("./helpers-A0a3O6af.cjs");
7
- const require_blueprint = require("./blueprint-1x01ITBT.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-B8cDsSHe.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-B7yceDjt.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-zGpnLDxz.cjs");
18
- const require_solidBuilders = require("./solidBuilders-B0Uyvvyy.cjs");
19
- const require_healingFns = require("./healingFns-CEzX-45q.cjs");
20
- const require_threadFns = require("./threadFns-B_8tna0V.cjs");
21
- const require_blueprintSketcher = require("./blueprintSketcher-BoHwuwaU.cjs");
22
- const require_helpers = require("./helpers-A0a3O6af.cjs");
23
- const require_drawFns = require("./drawFns-Dwq6JHbb.cjs");
24
- const require_measureFns = require("./measureFns-Cmc_y0WE.cjs");
25
- const require_cornerFinder = require("./cornerFinder-CqSNuWBI.cjs");
26
- const require_boolean2D = require("./boolean2D-C1Akp29q.cjs");
27
- const require_blueprintFns = require("./blueprintFns-DkmuKpz6.cjs");
28
- const require_importFns = require("./importFns-Dj107tFY.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-B8qEy3dh.cjs");
32
- const require_shapeRefFns = require("./shapeRefFns-C6L7KhTi.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-B898KlXM.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;
@@ -2132,6 +2132,139 @@ function roof(w, options) {
2132
2132
  }
2133
2133
  }
2134
2134
  //#endregion
2135
+ //#region src/operations/instanceFns.ts
2136
+ /**
2137
+ * Transform-only instancing — hold ONE source shape + N placements without
2138
+ * copying the kernel shape. Real geometry (a Compound, or a fused solid) or a
2139
+ * render payload (one mesh + N matrices) is produced only on demand.
2140
+ *
2141
+ * A 10x10 grid is 1 solid + 100 transforms, not 100 booleans. Materialize-on-
2142
+ * export keeps the kernel work deferred; `instancedMesh` meshes the source once
2143
+ * for an instanced (e.g. three.js InstancedMesh) preview.
2144
+ */
2145
+ function translation(v) {
2146
+ return [
2147
+ [
2148
+ 1,
2149
+ 0,
2150
+ 0,
2151
+ v[0]
2152
+ ],
2153
+ [
2154
+ 0,
2155
+ 1,
2156
+ 0,
2157
+ v[1]
2158
+ ],
2159
+ [
2160
+ 0,
2161
+ 0,
2162
+ 1,
2163
+ v[2]
2164
+ ],
2165
+ [
2166
+ 0,
2167
+ 0,
2168
+ 0,
2169
+ 1
2170
+ ]
2171
+ ];
2172
+ }
2173
+ function isVec3Array(p) {
2174
+ const first = p[0];
2175
+ return first !== void 0 && typeof first[0] === "number";
2176
+ }
2177
+ function make(source, placements, grid) {
2178
+ return {
2179
+ __instanced: true,
2180
+ source,
2181
+ placements,
2182
+ grid,
2183
+ [Symbol.dispose]() {
2184
+ source[Symbol.dispose]();
2185
+ }
2186
+ };
2187
+ }
2188
+ /** Type guard for an InstancedShape. */
2189
+ function isInstanced(x) {
2190
+ return typeof x === "object" && x !== null && x.__instanced === true;
2191
+ }
2192
+ /**
2193
+ * Instance a shape across explicit placements. `Vec3[]` is translate-only sugar
2194
+ * for `Matrix4x4[]`. The source is owned by the returned container.
2195
+ */
2196
+ function instance(source, placements) {
2197
+ return make(source, isVec3Array(placements) ? placements.map(translation) : placements.map((m) => m.map((row) => [...row])));
2198
+ }
2199
+ /** Instance a shape across a cols x rows grid in the XY plane. */
2200
+ function instanceGrid(source, opts) {
2201
+ const { cols, rows, pitchX, pitchY } = opts;
2202
+ if (!Number.isInteger(cols) || !Number.isInteger(rows) || cols < 1 || rows < 1) throw new RangeError(`instanceGrid: cols and rows must be positive integers, got ${cols}x${rows}`);
2203
+ const placements = [];
2204
+ for (let i = 0; i < cols; i++) for (let j = 0; j < rows; j++) placements.push(translation([
2205
+ i * pitchX,
2206
+ j * pitchY,
2207
+ 0
2208
+ ]));
2209
+ return make(source, placements, {
2210
+ cols,
2211
+ rows,
2212
+ pitchX,
2213
+ pitchY
2214
+ });
2215
+ }
2216
+ /** Number of placements. */
2217
+ function instanceCount(inst) {
2218
+ return inst.placements.length;
2219
+ }
2220
+ /**
2221
+ * Produce real geometry: a Compound of N placed copies (default), or a single
2222
+ * fused solid (`fuse: true`, 3D only). This is where the N kernel transforms
2223
+ * happen. A grid-built instance fuses via the faster kernel `gridPattern`.
2224
+ */
2225
+ function materialize(inst, opts = {}) {
2226
+ const { source, placements, grid } = inst;
2227
+ if (placements.length === 0) return require_errors.err(require_errors.validationError("INSTANCE_EMPTY", "materialize: instance has no placements"));
2228
+ if (opts.fuse) {
2229
+ if (!require_shapeTypes.isShape3D(source)) return require_errors.err(require_errors.validationError("MATERIALIZE_NOT_3D", "materialize({fuse:true}) requires a 3D source shape"));
2230
+ if (grid) return require_threadFns.gridPattern(source, [
2231
+ 1,
2232
+ 0,
2233
+ 0
2234
+ ], [
2235
+ 0,
2236
+ 1,
2237
+ 0
2238
+ ], grid.cols, grid.rows, grid.pitchX, grid.pitchY);
2239
+ return combine(source, placements, true);
2240
+ }
2241
+ return combine(source, placements, false);
2242
+ }
2243
+ function combine(source, placements, fuse) {
2244
+ const copies = [];
2245
+ for (const m of placements) {
2246
+ const placed = require_shapeFns.applyMatrix(source, m);
2247
+ if (!placed.ok) {
2248
+ for (const c of copies) c[Symbol.dispose]();
2249
+ return placed;
2250
+ }
2251
+ copies.push(placed.value);
2252
+ }
2253
+ const result = fuse ? require_solidBuilders.fuseAll(copies, { unsafe: true }) : require_errors.ok(require_solidBuilders.makeCompound(copies));
2254
+ for (const c of copies) if (!result.ok || c !== result.value) c[Symbol.dispose]();
2255
+ return result;
2256
+ }
2257
+ /**
2258
+ * Mesh the source once and return it alongside the placements — the
2259
+ * "one tessellation, N placements" render payload for an instanced draw.
2260
+ */
2261
+ function instancedMesh(inst, opts) {
2262
+ return {
2263
+ geometry: require_meshFns.mesh(inst.source, opts),
2264
+ instances: inst.placements
2265
+ };
2266
+ }
2267
+ //#endregion
2135
2268
  //#region src/kernel/solverAdapter.ts
2136
2269
  /**
2137
2270
  * Constraint solver adapter — analytical solver for simple assembly mates.
@@ -5645,34 +5778,61 @@ function cacheKey(node, env, kernelId, tolerance) {
5645
5778
  return `${toHex(node.structuralHash)}:${kernelId}:${toHex(projHash)}:${tolHash}`;
5646
5779
  }
5647
5780
  var Evaluator = class {
5648
- scope = new require_shapeTypes.DisposalScope();
5649
5781
  cache = /* @__PURE__ */ new Map();
5650
- registered = /* @__PURE__ */ new WeakSet();
5782
+ refCounts = /* @__PURE__ */ new Map();
5783
+ evaluating = false;
5784
+ pendingKeys = [];
5651
5785
  kernelId;
5652
5786
  defaultTolerance;
5787
+ maxCacheEntries;
5653
5788
  onStep;
5654
5789
  hits = 0;
5655
5790
  misses = 0;
5791
+ evictions = 0;
5656
5792
  constructor(options = {}) {
5657
5793
  this.kernelId = options.kernel ?? require_shapeTypes.getActiveKernelId() ?? "unregistered";
5658
5794
  this.defaultTolerance = options.tolerance;
5659
5795
  if (options.onStep) this.onStep = options.onStep;
5796
+ const max = options.maxCacheEntries;
5797
+ if (max !== void 0 && (!Number.isInteger(max) || max < 1)) throw new RangeError(`Evaluator: maxCacheEntries must be a positive integer, got ${String(max)}`);
5798
+ this.maxCacheEntries = max;
5660
5799
  }
5661
5800
  /**
5662
5801
  * 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.
5802
+ * The returned shape is borrowed — callers must NOT call `.delete()` /
5803
+ * `[Symbol.dispose]()` on it; that would invalidate the cache entry for
5804
+ * every future call returning the same handle. By default it stays valid
5805
+ * until the Evaluator is disposed; if `maxCacheEntries` is set, only until
5806
+ * the next successful evaluate() call (LRU eviction may free older entries),
5807
+ * and evaluate() is then non-reentrant — calling it from an onStep callback
5808
+ * throws.
5667
5809
  */
5668
5810
  evaluate(node, env = {}) {
5669
- return require_shapeTypes.withKernel(this.kernelId, () => this.evaluateInner(node, env));
5811
+ 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.");
5812
+ return require_shapeTypes.withKernel(this.kernelId, () => {
5813
+ this.evaluating = true;
5814
+ let committed = false;
5815
+ try {
5816
+ const result = this.evaluateInner(node, env);
5817
+ if (this.maxCacheEntries !== void 0 && result.ok) this.trimCache(this.maxCacheEntries);
5818
+ committed = result.ok;
5819
+ return result;
5820
+ } finally {
5821
+ if (!committed && this.maxCacheEntries !== void 0) this.rollbackPending();
5822
+ this.pendingKeys.length = 0;
5823
+ this.evaluating = false;
5824
+ }
5825
+ });
5670
5826
  }
5671
5827
  evaluateInner(node, env) {
5672
5828
  const key = cacheKey(node, env, this.kernelId, this.defaultTolerance);
5673
5829
  const cached = this.cache.get(key);
5674
5830
  if (cached !== void 0) {
5675
5831
  this.hits++;
5832
+ if (this.maxCacheEntries !== void 0) {
5833
+ this.cache.delete(key);
5834
+ this.cache.set(key, cached);
5835
+ }
5676
5836
  this.onStep?.({
5677
5837
  node,
5678
5838
  cacheKey: key,
@@ -5687,11 +5847,10 @@ var Evaluator = class {
5687
5847
  evalNode: (child) => this.evaluateInner(child, env)
5688
5848
  });
5689
5849
  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);
5850
+ const shape = result.value;
5851
+ this.refCounts.set(shape, (this.refCounts.get(shape) ?? 0) + 1);
5852
+ this.cache.set(key, shape);
5853
+ if (this.maxCacheEntries !== void 0) this.pendingKeys.push(key);
5695
5854
  this.onStep?.({
5696
5855
  node,
5697
5856
  cacheKey: key,
@@ -5699,19 +5858,48 @@ var Evaluator = class {
5699
5858
  });
5700
5859
  return result;
5701
5860
  }
5861
+ releaseShape(shape) {
5862
+ const next = (this.refCounts.get(shape) ?? 1) - 1;
5863
+ if (next <= 0) {
5864
+ this.refCounts.delete(shape);
5865
+ shape[Symbol.dispose]();
5866
+ } else this.refCounts.set(shape, next);
5867
+ }
5868
+ trimCache(max) {
5869
+ while (this.cache.size > max) {
5870
+ const oldest = this.cache.keys().next();
5871
+ if (oldest.done) break;
5872
+ const key = oldest.value;
5873
+ const shape = this.cache.get(key);
5874
+ this.cache.delete(key);
5875
+ this.evictions++;
5876
+ if (shape !== void 0) this.releaseShape(shape);
5877
+ }
5878
+ }
5879
+ rollbackPending() {
5880
+ for (const key of this.pendingKeys) {
5881
+ const shape = this.cache.get(key);
5882
+ if (shape === void 0) continue;
5883
+ this.cache.delete(key);
5884
+ this.releaseShape(shape);
5885
+ }
5886
+ }
5702
5887
  cacheStats() {
5703
5888
  return {
5704
5889
  hits: this.hits,
5705
5890
  misses: this.misses,
5706
- entries: this.cache.size
5891
+ entries: this.cache.size,
5892
+ evictions: this.evictions
5707
5893
  };
5708
5894
  }
5709
5895
  resetStats() {
5710
5896
  this.hits = 0;
5711
5897
  this.misses = 0;
5898
+ this.evictions = 0;
5712
5899
  }
5713
5900
  [Symbol.dispose]() {
5714
- this.scope[Symbol.dispose]();
5901
+ for (const shape of this.refCounts.keys()) shape[Symbol.dispose]();
5902
+ this.refCounts.clear();
5715
5903
  this.cache.clear();
5716
5904
  }
5717
5905
  };
@@ -6733,6 +6921,7 @@ exports.getTagMetadata = require_shapeFns.getTagMetadata;
6733
6921
  exports.getVertices = require_topologyQueryFns.getVertices;
6734
6922
  exports.getVoxel = getVoxel;
6735
6923
  exports.getWires = require_topologyQueryFns.getWires;
6924
+ exports.gridPattern = require_threadFns.gridPattern;
6736
6925
  exports.guidedSweep = require_loftFns.guidedSweep;
6737
6926
  exports.heal = heal;
6738
6927
  exports.healFace = require_healingFns.healFace;
@@ -6755,6 +6944,10 @@ exports.initFromManifold = require_shapeTypes.initFromManifold;
6755
6944
  exports.initFromOC = require_shapeTypes.initFromOC;
6756
6945
  exports.initVoxel = initVoxel;
6757
6946
  exports.innerWires = require_faceFns.innerWires;
6947
+ exports.instance = instance;
6948
+ exports.instanceCount = instanceCount;
6949
+ exports.instanceGrid = instanceGrid;
6950
+ exports.instancedMesh = instancedMesh;
6758
6951
  exports.interpolateCurve = require_curveFns.interpolateCurve;
6759
6952
  exports.intersect = intersect;
6760
6953
  exports.intersect2D = require_boolean2D.intersect2D;
@@ -6785,6 +6978,7 @@ exports.isFace = require_shapeTypes.isFace;
6785
6978
  exports.isFilletRadius = isFilletRadius;
6786
6979
  exports.isInitRequest = require_workerHandler.isInitRequest;
6787
6980
  exports.isInside2D = require_blueprintFns.isInside2D;
6981
+ exports.isInstanced = isInstanced;
6788
6982
  exports.isLive = require_shapeTypes.isLive;
6789
6983
  exports.isManifoldShell = require_shapeTypes.isManifoldShell;
6790
6984
  exports.isNumber = isNumber;
@@ -6838,6 +7032,7 @@ exports.map = require_errors.map;
6838
7032
  exports.mapBoth = require_errors.mapBoth;
6839
7033
  exports.mapErr = require_errors.mapErr;
6840
7034
  exports.match = require_errors.match;
7035
+ exports.materialize = materialize;
6841
7036
  exports.measureArea = require_measureFns.measureArea;
6842
7037
  exports.measureCurvatureAt = require_measureFns.measureCurvatureAt;
6843
7038
  exports.measureCurvatureAtMid = require_measureFns.measureCurvatureAtMid;