brepjs 18.66.1 → 18.67.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 (79) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{blueprint-DUu2ps2h.js → blueprint-Z5mhI2QD.js} +5 -5
  4. package/dist/{blueprint-D0HcOCoD.cjs → blueprint-a7QLhV4U.cjs} +5 -5
  5. package/dist/{blueprintFns-BoMZHBGl.js → blueprintFns-BNhsXv6q.js} +2 -2
  6. package/dist/{blueprintFns-pq0yw94E.cjs → blueprintFns-DULa6FpG.cjs} +2 -2
  7. package/dist/{blueprintSketcher-DelJzBzJ.js → blueprintSketcher-0DeTMXwj.js} +3 -3
  8. package/dist/{blueprintSketcher-CWSesXXR.cjs → blueprintSketcher-4zOPSOnK.cjs} +3 -3
  9. package/dist/{boolean2D-DYjuIlFY.js → boolean2D-BNWuFXK_.js} +4 -4
  10. package/dist/{boolean2D-C6xLLzU_.cjs → boolean2D-xDBZQH_n.cjs} +4 -4
  11. package/dist/{booleanFns-CLzeqmgT.js → booleanFns-CaKngiuu.js} +4 -4
  12. package/dist/{booleanFns-D57G9tJA.cjs → booleanFns-aeG4pQmM.cjs} +4 -4
  13. package/dist/brepjs.cjs +312 -46
  14. package/dist/brepjs.js +304 -47
  15. package/dist/{cameraFns-DSAYGgrz.cjs → cameraFns-Bk8frXwa.cjs} +2 -2
  16. package/dist/{cameraFns-D_UnhA2O.js → cameraFns-k787od3u.js} +2 -2
  17. package/dist/core.cjs +1 -1
  18. package/dist/core.js +1 -1
  19. package/dist/{cornerFinder-CszkHDW1.js → cornerFinder-B8GvvW0U.js} +1 -1
  20. package/dist/{cornerFinder-Dvu2q_-E.cjs → cornerFinder-tTS3ny7e.cjs} +1 -1
  21. package/dist/{curveFns-BJLQixZw.cjs → curveFns-CYP8UOgX.cjs} +1 -1
  22. package/dist/{curveFns-CLNHpU2N.js → curveFns-DvNBwUdJ.js} +1 -1
  23. package/dist/{drawFns-BuE0lne3.cjs → drawFns-Chpdmj4G.cjs} +12 -12
  24. package/dist/{drawFns-Cw29tkrx.js → drawFns-DmAPsfmx.js} +12 -12
  25. package/dist/{extrudeFns-19bOK66L.js → extrudeFns-CMr1tf7I.js} +1 -1
  26. package/dist/{extrudeFns-BDgqrytA.cjs → extrudeFns-IvYW5-8y.cjs} +1 -1
  27. package/dist/{faceFns-BmaS4kkW.cjs → faceFns-Byt7Vd3F.cjs} +2 -2
  28. package/dist/{faceFns-CWU_70z7.js → faceFns-CZp3Y8vi.js} +2 -2
  29. package/dist/{helpers-CA8uFXQW.js → helpers-BX-0e71G.js} +6 -6
  30. package/dist/{helpers-qkB-gFkC.cjs → helpers-wFts3ttt.cjs} +6 -6
  31. package/dist/{historyFns-CDVZ3KM8.cjs → historyFns-BzPsKySX.cjs} +4 -4
  32. package/dist/{historyFns-CnUZzNHQ.js → historyFns-CZ9oNL7j.js} +4 -4
  33. package/dist/{importFns-BBnjqm6T.js → importFns-1SHLSNtG.js} +2 -2
  34. package/dist/{importFns-B7pbqJhZ.cjs → importFns-CwILDYiQ.cjs} +2 -2
  35. package/dist/index.d.ts +2 -2
  36. package/dist/io.cjs +2 -2
  37. package/dist/io.js +2 -2
  38. package/dist/{measureFns-HhPPUiRO.cjs → measureFns-CrSEblGG.cjs} +3 -3
  39. package/dist/{measureFns-Bye5UsOe.js → measureFns-CvvenWkS.js} +3 -3
  40. package/dist/measurement.cjs +1 -1
  41. package/dist/measurement.js +1 -1
  42. package/dist/{meshFns-Cog1SKSV.js → meshFns-0RHalM3t.js} +3 -3
  43. package/dist/{meshFns-B5jxU_H4.cjs → meshFns-DwHAYqRN.cjs} +3 -3
  44. package/dist/operations.cjs +2 -2
  45. package/dist/operations.js +2 -2
  46. package/dist/{primitiveFns-B_Vhus6h.cjs → primitiveFns-CKCALTVe.cjs} +7 -7
  47. package/dist/{primitiveFns-DTg4kOPD.js → primitiveFns-ecKWNC5k.js} +7 -7
  48. package/dist/projection.cjs +1 -1
  49. package/dist/projection.js +1 -1
  50. package/dist/query.cjs +2 -2
  51. package/dist/query.js +2 -2
  52. package/dist/{shapeFns-ClKe2vri.cjs → shapeFns-B5JrP5aD.cjs} +2 -2
  53. package/dist/{shapeFns-CMQD_3Rz.js → shapeFns-D63FuB8f.js} +2 -2
  54. package/dist/shapeRef.cjs +1 -1
  55. package/dist/shapeRef.js +1 -1
  56. package/dist/{shapeRefFns-DqmUj3wF.js → shapeRefFns-DjGKujf0.js} +4 -4
  57. package/dist/{shapeRefFns-DUt-hIWq.cjs → shapeRefFns-H_O8zyAx.cjs} +4 -4
  58. package/dist/{shapeTypes-CQscfe8k.js → shapeTypes-RYLpXWzG.js} +10 -4
  59. package/dist/{shapeTypes-CPClTSJn.cjs → shapeTypes-kAKwccy_.cjs} +10 -4
  60. package/dist/sketching.cjs +3 -3
  61. package/dist/sketching.js +3 -3
  62. package/dist/{solidBuilders-U04-5yA1.js → solidBuilders-0SgkQ386.js} +2 -2
  63. package/dist/{solidBuilders-CtxTfDlu.cjs → solidBuilders-B2IX6Pm8.cjs} +2 -2
  64. package/dist/{surfaceBuilders-88vLyzZe.cjs → surfaceBuilders-BkvJS8pw.cjs} +2 -2
  65. package/dist/{surfaceBuilders-GesSUnRk.js → surfaceBuilders-jx81G_YJ.js} +2 -2
  66. package/dist/text.cjs +2 -2
  67. package/dist/text.js +2 -2
  68. package/dist/{textBlueprints-DP_2uuR2.js → textBlueprints-BXGrW7Ak.js} +7 -7
  69. package/dist/{textBlueprints-BRqklfRI.cjs → textBlueprints-Q2gxuZd1.cjs} +7 -7
  70. package/dist/{textMetrics-F2qR-eqQ.cjs → textMetrics-CnCjqf59.cjs} +1 -1
  71. package/dist/{textMetrics-BAOyWVzI.js → textMetrics-V7TXOETY.js} +1 -1
  72. package/dist/topology.cjs +7 -7
  73. package/dist/topology.js +7 -7
  74. package/dist/{topologyQueryFns-BuZ2h4o9.js → topologyQueryFns-BtWPlP5v.js} +1 -1
  75. package/dist/{topologyQueryFns-jK9Vpzqr.cjs → topologyQueryFns-Ck5trXrW.cjs} +1 -1
  76. package/dist/voxel/engine.d.ts +43 -0
  77. package/dist/voxel/fieldFns.d.ts +120 -0
  78. package/dist/voxel/index.d.ts +2 -0
  79. package/package.json +1 -1
package/dist/text.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-BRqklfRI.cjs");
3
- const require_textMetrics = require("./textMetrics-F2qR-eqQ.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-Q2gxuZd1.cjs");
3
+ const require_textMetrics = require("./textMetrics-CnCjqf59.cjs");
4
4
  exports.fontMetrics = require_textMetrics.fontMetrics;
5
5
  exports.getFont = require_textBlueprints.getFont;
6
6
  exports.loadFont = require_textBlueprints.loadFont;
package/dist/text.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-DP_2uuR2.js";
2
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-BAOyWVzI.js";
1
+ import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-BXGrW7Ak.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-V7TXOETY.js";
3
3
  export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
@@ -1,15 +1,15 @@
1
- import { Z as getKernel, h as isShape3D, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-CQscfe8k.js";
1
+ import { Z as getKernel, h as isShape3D, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-RYLpXWzG.js";
2
2
  import { A as ok, R as unwrap, T as isOk, b as err, d as validationError, h as bug, i as kernelError, l as typeCastError, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
3
3
  import { r as toVec3 } from "./types-D24Y27N0.js";
4
4
  import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-SKPRvPH-.js";
5
5
  import { n as createPlane } from "./planeOps-DSjjtrjg.js";
6
- import { _ as downcast, g as cast } from "./faceFns-CWU_70z7.js";
7
- import { c as curveStartPoint, l as curveTangentAt } from "./curveFns-CLNHpU2N.js";
6
+ import { _ as downcast, g as cast } from "./faceFns-CZp3Y8vi.js";
7
+ import { c as curveStartPoint, l as curveTangentAt } from "./curveFns-DvNBwUdJ.js";
8
8
  import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
9
- import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-GesSUnRk.js";
10
- import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-DelJzBzJ.js";
11
- import { o as makeSolid, t as makeCompound } from "./solidBuilders-U04-5yA1.js";
12
- import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-19bOK66L.js";
9
+ import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-jx81G_YJ.js";
10
+ import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-0DeTMXwj.js";
11
+ import { o as makeSolid, t as makeCompound } from "./solidBuilders-0SgkQ386.js";
12
+ import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-CMr1tf7I.js";
13
13
  import opentype from "opentype.js";
14
14
  //#region src/operations/loftFns.ts
15
15
  /**
@@ -29,18 +29,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  //#endregion
32
- const require_shapeTypes = require("./shapeTypes-CPClTSJn.cjs");
32
+ const require_shapeTypes = require("./shapeTypes-kAKwccy_.cjs");
33
33
  const require_errors = require("./errors-CXJtc4I7.cjs");
34
34
  const require_types = require("./types-KjA8tY4Y.cjs");
35
35
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
36
36
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
37
- const require_faceFns = require("./faceFns-BmaS4kkW.cjs");
38
- const require_curveFns = require("./curveFns-BJLQixZw.cjs");
37
+ const require_faceFns = require("./faceFns-Byt7Vd3F.cjs");
38
+ const require_curveFns = require("./curveFns-CYP8UOgX.cjs");
39
39
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
40
- const require_surfaceBuilders = require("./surfaceBuilders-88vLyzZe.cjs");
41
- const require_blueprintSketcher = require("./blueprintSketcher-CWSesXXR.cjs");
42
- const require_solidBuilders = require("./solidBuilders-CtxTfDlu.cjs");
43
- const require_extrudeFns = require("./extrudeFns-BDgqrytA.cjs");
40
+ const require_surfaceBuilders = require("./surfaceBuilders-BkvJS8pw.cjs");
41
+ const require_blueprintSketcher = require("./blueprintSketcher-4zOPSOnK.cjs");
42
+ const require_solidBuilders = require("./solidBuilders-B2IX6Pm8.cjs");
43
+ const require_extrudeFns = require("./extrudeFns-IvYW5-8y.cjs");
44
44
  let opentype_js = require("opentype.js");
45
45
  opentype_js = __toESM(opentype_js, 1);
46
46
  //#region src/operations/loftFns.ts
@@ -1,4 +1,4 @@
1
- const require_textBlueprints = require("./textBlueprints-BRqklfRI.cjs");
1
+ const require_textBlueprints = require("./textBlueprints-Q2gxuZd1.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  //#region src/text/sketchText.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
2
- import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-DP_2uuR2.js";
2
+ import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-BXGrW7Ak.js";
3
3
  //#region src/text/sketchText.ts
4
4
  /**
5
5
  * Render text as 3D sketch outlines on a plane.
package/dist/topology.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_topologyQueryFns = require("./topologyQueryFns-jK9Vpzqr.cjs");
3
- const require_faceFns = require("./faceFns-BmaS4kkW.cjs");
4
- const require_shapeFns = require("./shapeFns-ClKe2vri.cjs");
5
- const require_curveFns = require("./curveFns-BJLQixZw.cjs");
6
- const require_meshFns = require("./meshFns-B5jxU_H4.cjs");
7
- const require_booleanFns = require("./booleanFns-D57G9tJA.cjs");
8
- const require_primitiveFns = require("./primitiveFns-B_Vhus6h.cjs");
2
+ const require_topologyQueryFns = require("./topologyQueryFns-Ck5trXrW.cjs");
3
+ const require_faceFns = require("./faceFns-Byt7Vd3F.cjs");
4
+ const require_shapeFns = require("./shapeFns-B5JrP5aD.cjs");
5
+ const require_curveFns = require("./curveFns-CYP8UOgX.cjs");
6
+ const require_meshFns = require("./meshFns-DwHAYqRN.cjs");
7
+ const require_booleanFns = require("./booleanFns-aeG4pQmM.cjs");
8
+ const require_primitiveFns = require("./primitiveFns-CKCALTVe.cjs");
9
9
  exports.addHoles = require_primitiveFns.addHoles;
10
10
  exports.adjacentFaces = require_primitiveFns.adjacentFaces;
11
11
  exports.approximateCurve = require_curveFns.approximateCurve;
package/dist/topology.js CHANGED
@@ -1,8 +1,8 @@
1
- import { S as vertexPosition, _ as iterFaces, b as iterVertices, c as getFaces, f as getVertices, g as iterEdges, m as invalidateShapeCache, n as getBounds, p as getWires, s as getEdges, x as iterWires } from "./topologyQueryFns-BuZ2h4o9.js";
2
- import { _ as downcast, a as flipFaceOrientation, b as iterTopo, c as normalAt, d as projectPointOnFace, g as cast, h as asTopo, i as faceOrientation, l as outerWire, m as uvCoordinates, n as faceCenter, o as getSurfaceType, p as uvBounds, r as faceGeomType, s as innerWires, t as classifyPointOnFace, u as pointOnSurface, v as fromBREP, x as shapeType, y as isCompSolid } from "./faceFns-CWU_70z7.js";
3
- import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-CMQD_3Rz.js";
4
- import { a as curveLength, c as curveStartPoint, d as getCurveType, f as getOrientation, i as curveIsPeriodic, l as curveTangentAt, m as offsetWire2D, n as curveEndPoint, o as curvePeriod, p as interpolateCurve, r as curveIsClosed, s as curvePointAt, t as approximateCurve, u as flipOrientation } from "./curveFns-CLNHpU2N.js";
5
- import { c as createMeshCache, n as exportSTEP, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-Cog1SKSV.js";
6
- import { a as fuseAll, r as cutAll } from "./booleanFns-CLzeqmgT.js";
7
- import { $ as fuseAllBisect, A as fixShape, C as threePointArc, D as wireLoop, E as wire, G as chamferWithEvolution, I as solidFromShell, J as fuseWithEvolution, K as cutWithEvolution, M as healFace, N as healSolid, O as autoHeal, P as healWire, Q as cutAllBisect, S as tangentArc, T as vertex, U as variableFillet, W as positionOnCurve, X as shellWithEvolution, Y as intersectWithEvolution, Z as checkBoolean, _ as polygon, a as circle, at as sharedEdges, b as sphere, c as cylinder, ct as chamferDistAngle, d as ellipsoid, et as getNurbsCurveData, f as face, ft as toLineGeometryData, g as offsetFace, h as line, i as bsplineApprox, it as facesOfEdge, k as fixSelfIntersection, l as ellipse, lt as toBufferGeometryData, m as helix, n as bezier, nt as adjacentFaces, o as compound, ot as verticesOfEdge, p as filledFace, q as filletWithEvolution, r as box, rt as edgesOfFace, s as cone, st as wiresOfFace, t as addHoles, tt as getNurbsSurfaceData, u as ellipseArc, ut as toGroupedBufferGeometryData, v as sewShells, w as torus, x as subFace, y as solid } from "./primitiveFns-DTg4kOPD.js";
1
+ import { S as vertexPosition, _ as iterFaces, b as iterVertices, c as getFaces, f as getVertices, g as iterEdges, m as invalidateShapeCache, n as getBounds, p as getWires, s as getEdges, x as iterWires } from "./topologyQueryFns-BtWPlP5v.js";
2
+ import { _ as downcast, a as flipFaceOrientation, b as iterTopo, c as normalAt, d as projectPointOnFace, g as cast, h as asTopo, i as faceOrientation, l as outerWire, m as uvCoordinates, n as faceCenter, o as getSurfaceType, p as uvBounds, r as faceGeomType, s as innerWires, t as classifyPointOnFace, u as pointOnSurface, v as fromBREP, x as shapeType, y as isCompSolid } from "./faceFns-CZp3Y8vi.js";
3
+ import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-D63FuB8f.js";
4
+ import { a as curveLength, c as curveStartPoint, d as getCurveType, f as getOrientation, i as curveIsPeriodic, l as curveTangentAt, m as offsetWire2D, n as curveEndPoint, o as curvePeriod, p as interpolateCurve, r as curveIsClosed, s as curvePointAt, t as approximateCurve, u as flipOrientation } from "./curveFns-DvNBwUdJ.js";
5
+ import { c as createMeshCache, n as exportSTEP, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-0RHalM3t.js";
6
+ import { a as fuseAll, r as cutAll } from "./booleanFns-CaKngiuu.js";
7
+ import { $ as fuseAllBisect, A as fixShape, C as threePointArc, D as wireLoop, E as wire, G as chamferWithEvolution, I as solidFromShell, J as fuseWithEvolution, K as cutWithEvolution, M as healFace, N as healSolid, O as autoHeal, P as healWire, Q as cutAllBisect, S as tangentArc, T as vertex, U as variableFillet, W as positionOnCurve, X as shellWithEvolution, Y as intersectWithEvolution, Z as checkBoolean, _ as polygon, a as circle, at as sharedEdges, b as sphere, c as cylinder, ct as chamferDistAngle, d as ellipsoid, et as getNurbsCurveData, f as face, ft as toLineGeometryData, g as offsetFace, h as line, i as bsplineApprox, it as facesOfEdge, k as fixSelfIntersection, l as ellipse, lt as toBufferGeometryData, m as helix, n as bezier, nt as adjacentFaces, o as compound, ot as verticesOfEdge, p as filledFace, q as filletWithEvolution, r as box, rt as edgesOfFace, s as cone, st as wiresOfFace, t as addHoles, tt as getNurbsSurfaceData, u as ellipseArc, ut as toGroupedBufferGeometryData, v as sewShells, w as torus, x as subFace, y as solid } from "./primitiveFns-ecKWNC5k.js";
8
8
  export { addHoles, adjacentFaces, approximateCurve, asTopo, autoHeal, bezier, box, bsplineApprox, cast, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkBoolean, circle, classifyPointOnFace, clearMeshCache, compound, cone, createMeshCache, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cutAll, cutAllBisect, cutWithEvolution, cylinder, fromBREP as deserializeShape, downcast, edgesOfFace, ellipse, ellipseArc, ellipsoid, exportIGES, exportSTEP, exportSTL, face, faceCenter, faceGeomType, faceOrientation, facesOfEdge, filledFace, filletWithEvolution, fixSelfIntersection, fixShape, flipFaceOrientation, flipOrientation, fuseAll, fuseAllBisect, fuseWithEvolution, getBounds, getCurveType, getEdges, getFaces, getHashCode, getNurbsCurveData, getNurbsSurfaceData, getOrientation, getSurfaceType, getVertices, getWires, healFace, healSolid, healWire, helix, innerWires, interpolateCurve, intersectWithEvolution, invalidateShapeCache, isCompSolid, isEqualShape, isSameShape, iterEdges, iterFaces, iterTopo, iterVertices, iterWires, line, normalAt, offsetFace, offsetWire2D, outerWire, pointOnSurface, polygon, positionOnCurve, projectPointOnFace, sewShells, shapeType, sharedEdges, shellWithEvolution, solid, solidFromShell, sphere, subFace, tangentArc, threePointArc, toBufferGeometryData, toGroupedBufferGeometryData, toLineGeometryData, torus, uvBounds, uvCoordinates, variableFillet, vertex, vertexPosition, verticesOfEdge, wire, wireLoop, wiresOfFace };
@@ -1,4 +1,4 @@
1
- import { N as getOrQueryType, R as DisposalScope, Y as _usingCtx, Z as getKernel, r as castShapeWithKnownType, t as castShape } from "./shapeTypes-CQscfe8k.js";
1
+ import { N as getOrQueryType, R as DisposalScope, Y as _usingCtx, Z as getKernel, r as castShapeWithKnownType, t as castShape } from "./shapeTypes-RYLpXWzG.js";
2
2
  import { A as ok, b as err, f as getSuggestionForCode, p as translateKernelError } from "./errors-DNWJsfVU.js";
3
3
  //#region src/core/kernelCall.ts
4
4
  function buildError(kind, code, message, cause, suggestion) {
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-CPClTSJn.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-kAKwccy_.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  //#region src/core/kernelCall.ts
4
4
  function buildError(kind, code, message, cause, suggestion) {
@@ -23,9 +23,52 @@ export interface VoxelEngine {
23
23
  shell_mesh(verts: Float32Array, tris: Uint32Array, thickness: number, resolution: number, padding: number): VoxelRepairResult;
24
24
  /** Voxel CSG of two meshes (op: 0=union, 1=intersection, 2=difference A−B). */
25
25
  voxel_boolean(verts_a: Float32Array, tris_a: Uint32Array, verts_b: Float32Array, tris_b: Uint32Array, op: number, resolution: number, padding: number): VoxelRepairResult;
26
+ /**
27
+ * Persistent dense voxel-field class, for same-grid op chains: voxelize a mesh
28
+ * once, then boolean/offset/shell/reinit in place, contour once. Structurally
29
+ * satisfied by the generated `VoxelField` wasm-bindgen class.
30
+ */
31
+ VoxelField: WasmVoxelFieldConstructor;
26
32
  /** Engine artifact version, for loader/artifact compatibility checks. */
27
33
  version(): string;
28
34
  }
35
+ /**
36
+ * Constructor of the wasm `VoxelField` class. `new VoxelField(verts, tris, res,
37
+ * padding)` voxelizes a mesh into a persistent dense field. Throws (as a JS
38
+ * exception) on a non-dense grid or a grid over the voxel cap.
39
+ */
40
+ export interface WasmVoxelFieldConstructor {
41
+ new (verts: Float32Array, tris: Uint32Array, resolution: number, padding: number): WasmVoxelField;
42
+ /**
43
+ * Boolean two meshes onto ONE co-registered dense field (union bbox → voxelize
44
+ * both onto a shared grid → combine), ready to chain. The correct path for
45
+ * "boolean then offset/shell" two independently-described meshes, where
46
+ * {@link WasmVoxelField.boolean} requires the operands to already share grid
47
+ * geometry. `op`: 0=union, 1=intersection, 2=difference A−B.
48
+ */
49
+ boolean_of(verts_a: Float32Array, tris_a: Uint32Array, verts_b: Float32Array, tris_b: Uint32Array, op: number, resolution: number, padding: number): WasmVoxelField;
50
+ }
51
+ /**
52
+ * A persistent dense voxel field. All ops MUTATE IN PLACE (return void), so the
53
+ * same grid persists across a chain. `contour()` reads the zero set into a fresh
54
+ * {@link VoxelRepairResult}; `free()` releases the backing WASM grid (mandatory).
55
+ * Structurally satisfied by the generated `VoxelField` wasm-bindgen class.
56
+ */
57
+ export interface WasmVoxelField {
58
+ /** CSG-combine in place (op: 0=union, 1=intersection, 2=difference self−B). */
59
+ boolean(other: WasmVoxelField, op: number): void;
60
+ /** Offset the surface in place (>0 outward, <0 inward); auto-reinits if dirty. */
61
+ offset(distance: number): void;
62
+ /** Hollow into an inward shell in place (thickness > 0); auto-reinits if dirty. */
63
+ shell(thickness: number): void;
64
+ /** Reinitialize φ to a true SDF (|∇φ|=1) while preserving the zero set. */
65
+ reinit(): void;
66
+ /** Surface-Nets contour the current field to a triangle mesh. */
67
+ contour(): VoxelRepairResult;
68
+ /** Release the backing WASM grid allocation (wasm-bindgen lifecycle). */
69
+ free(): void;
70
+ [Symbol.dispose](): void;
71
+ }
29
72
  /**
30
73
  * The repaired-mesh handle the wasm `repair_mesh` returns. Flat xyz
31
74
  * `positions`/`normals` (length 3·V) and a triangle-list `indices` (3 per tri),
@@ -0,0 +1,120 @@
1
+ import { Result } from '../core/result.js';
2
+ import { KernelMeshResult } from '../kernel/types.js';
3
+ import { AnyShape, Dimension } from '../core/shapeTypes.js';
4
+ import { VoxelMeshInput } from './signFns.js';
5
+ import { WasmVoxelField } from './engine.js';
6
+ /** Field tuning. `resolution` sizes the longest bbox axis in voxels; `padding`
7
+ * is the air-margin ring (>= 1) Surface Nets needs AND the headroom an outward
8
+ * offset has before it clips at the grid boundary (the grid is fixed at
9
+ * voxelize time — size both for the intended maximum offset). */
10
+ export interface VoxelFieldOptions {
11
+ resolution?: number;
12
+ padding?: number;
13
+ }
14
+ /** Boolean op selector for {@link fieldBoolean} / {@link VoxelFieldHandle.boolean}. */
15
+ export type VoxelBooleanOp = 'union' | 'intersection' | 'difference';
16
+ /**
17
+ * A persistent, disposable voxel field. Carries the wrapped WASM field as
18
+ * `value` and a fluent op-chain (`.boolean().offset().shell().contour()`) that
19
+ * throws on the rare WASM error (mirroring the `shape()` facade's
20
+ * throw-on-`Err` convention), so a `using`-scoped chain reads cleanly:
21
+ *
22
+ * ```ts
23
+ * using field = voxelField(meshA).unwrap();
24
+ * using other = voxelField(meshB).unwrap();
25
+ * const mesh = field.boolean(other, 'union').offset(2).contour();
26
+ * ```
27
+ *
28
+ * Dispose is mandatory (FinalizationRegistry is an unreliable safety net): use
29
+ * `using`, or call `[Symbol.dispose]()` explicitly, to free the WASM grid.
30
+ */
31
+ export interface VoxelFieldHandle {
32
+ /** The wrapped WASM field. Throws if the handle has been disposed. */
33
+ readonly value: WasmVoxelField;
34
+ /** Whether the backing WASM grid has been freed. */
35
+ readonly disposed: boolean;
36
+ [Symbol.dispose](): void;
37
+ /** CSG-combine with `other` in place (marks the field for lazy reinit). */
38
+ boolean(other: VoxelFieldHandle, op: VoxelBooleanOp): VoxelFieldHandle;
39
+ /** Offset the surface in place (>0 outward, <0 inward); auto-reinits if dirty. */
40
+ offset(distance: number): VoxelFieldHandle;
41
+ /** Hollow into an inward shell in place (thickness > 0); auto-reinits if dirty. */
42
+ shell(thickness: number): VoxelFieldHandle;
43
+ /** Reinitialize φ to a true SDF while preserving the zero set. */
44
+ reinit(): VoxelFieldHandle;
45
+ /** Surface-Nets contour the current field to a mesh (the field stays alive). */
46
+ contour(): KernelMeshResult;
47
+ }
48
+ /**
49
+ * Voxelize a mesh into a persistent dense {@link VoxelFieldHandle}: one grid you
50
+ * can boolean / offset / shell / reinit in place, then contour once. The handle
51
+ * is disposable — free the WASM grid with `using` (or `[Symbol.dispose]()`).
52
+ *
53
+ * `resolution` sizes the longest bbox axis; `padding` is the air-margin ring.
54
+ * Errors on an empty/invalid mesh, or if the grid would exceed the dense budget
55
+ * (the persistent path is dense-only) or the voxel cap.
56
+ */
57
+ export declare function voxelField(mesh: VoxelMeshInput, opts?: VoxelFieldOptions, id?: string): Result<VoxelFieldHandle>;
58
+ /**
59
+ * Boolean two meshes into ONE co-registered, chainable {@link VoxelFieldHandle}:
60
+ * voxelize both onto a single shared grid sized to their union bbox, combine by
61
+ * `op`, and keep the field. This is THE correct way to "boolean then chain
62
+ * offset/shell" two independently-described meshes — unlike {@link fieldBoolean},
63
+ * which requires the operands to already share grid geometry. The result is
64
+ * dirty (the blend drifts the gradient), so a subsequent offset/shell
65
+ * auto-reinitializes. The handle is disposable — free it with `using`.
66
+ *
67
+ * `op` is `'difference'` = A − B. Errors on an empty/invalid mesh, or if the
68
+ * shared grid would exceed the dense budget (the persistent path is dense-only).
69
+ */
70
+ export declare function voxelBooleanField(a: VoxelMeshInput, b: VoxelMeshInput, op: VoxelBooleanOp, opts?: VoxelFieldOptions, id?: string): Result<VoxelFieldHandle>;
71
+ /**
72
+ * CSG-combine two fields IN PLACE, returning the SAME `handle` for chaining. The
73
+ * min/max blend keeps the zero set exact but drifts the gradient near the join,
74
+ * so a subsequent {@link fieldOffset}/{@link fieldShell} auto-reinitializes.
75
+ *
76
+ * PRECONDITION: both operands must be CO-REGISTERED — same origin, spacing, AND
77
+ * dims. Two fields built by {@link voxelField} from DIFFERENT meshes generally do
78
+ * NOT share geometry (each sizes its grid to its own bbox), and the WASM guard
79
+ * rejects that mismatch as an `err(...)` rather than silently blending mismatched
80
+ * coordinate frames. For the easy co-registered path, build the field directly
81
+ * from both meshes with {@link voxelBooleanField}.
82
+ */
83
+ export declare function fieldBoolean(handle: VoxelFieldHandle, other: VoxelFieldHandle, op: VoxelBooleanOp): Result<VoxelFieldHandle>;
84
+ /**
85
+ * Offset the field's surface IN PLACE (>0 outward, <0 inward), returning the
86
+ * SAME `handle`. Auto-reinitializes first if the field is dirty (post-boolean),
87
+ * so the iso-shift always rides a true SDF.
88
+ */
89
+ export declare function fieldOffset(handle: VoxelFieldHandle, distance: number): Result<VoxelFieldHandle>;
90
+ /**
91
+ * Hollow the field into an inward shell of `thickness` IN PLACE, returning the
92
+ * SAME `handle`. Auto-reinitializes first if dirty; the result is dirty again
93
+ * (the shell re-introduces a kink).
94
+ */
95
+ export declare function fieldShell(handle: VoxelFieldHandle, thickness: number): Result<VoxelFieldHandle>;
96
+ /**
97
+ * Explicitly reinitialize φ to a true SDF (|∇φ|=1) while preserving the zero
98
+ * set, returning the SAME `handle`. Idempotent on a clean field. Offset/shell
99
+ * already auto-reinitialize, so this is for advanced control only.
100
+ */
101
+ export declare function fieldReinit(handle: VoxelFieldHandle): Result<VoxelFieldHandle>;
102
+ /**
103
+ * Surface-Nets contour the current field to a {@link KernelMeshResult}. The
104
+ * field stays alive and chainable afterwards (contour borrows it). An empty
105
+ * contour surfaces as `VOXEL_DEGENERATE_RESULT`.
106
+ */
107
+ export declare function fieldContour(handle: VoxelFieldHandle): Result<KernelMeshResult>;
108
+ /**
109
+ * Voxelize a B-rep shape into a persistent {@link VoxelFieldHandle}: tessellate
110
+ * it, then run {@link voxelField}. Threads a meshing failure back as an
111
+ * `err(...)`. The handle is disposable — free it with `using`.
112
+ */
113
+ export declare function voxelFieldFromShape(shape: AnyShape<Dimension>, opts?: VoxelFieldOptions, id?: string): Result<VoxelFieldHandle>;
114
+ /**
115
+ * Boolean two B-rep shapes into one co-registered, chainable
116
+ * {@link VoxelFieldHandle}: tessellate both, then run {@link voxelBooleanField}.
117
+ * `op` is `'difference'` = A − B. Threads either meshing failure back as an
118
+ * `err(...)`. The handle is disposable — free it with `using`.
119
+ */
120
+ export declare function voxelBooleanFieldShapes(a: AnyShape<Dimension>, b: AnyShape<Dimension>, op: VoxelBooleanOp, opts?: VoxelFieldOptions, id?: string): Result<VoxelFieldHandle>;
@@ -9,8 +9,10 @@ export type { VoxelEngine, VoxelRepairResult } from './engine.js';
9
9
  export type { VoxelMeshInput } from './signFns.js';
10
10
  export type { RepairOptions } from './repairFns.js';
11
11
  export type { VoxelOpOptions } from './meshOpsFns.js';
12
+ export type { VoxelFieldHandle, VoxelFieldOptions, VoxelBooleanOp } from './fieldFns.js';
12
13
  export { registerVoxel, getVoxel, getActiveVoxelId, initVoxel } from './registry.js';
13
14
  export { windingNumbers, pointsInside } from './signFns.js';
14
15
  export { repairMesh } from './repairFns.js';
15
16
  export { offsetMesh, shellMesh, voxelBoolean, offsetShape, shellShape, voxelBooleanShapes, } from './meshOpsFns.js';
17
+ export { voxelField, voxelBooleanField, fieldBoolean, fieldOffset, fieldShell, fieldReinit, fieldContour, voxelFieldFromShape, voxelBooleanFieldShapes, } from './fieldFns.js';
16
18
  export { shapeToMeshInput } from './shapeMesh.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "18.66.1",
3
+ "version": "18.67.0",
4
4
  "description": "Web CAD library with pluggable geometry kernel",
5
5
  "keywords": [
6
6
  "cad",