brepjs 18.118.12 → 18.118.13

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 (81) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-BaiFeuKQ.cjs → adjacencyFns-BdxIbZtR.cjs} +2 -2
  4. package/dist/{adjacencyFns-CRqm5AS0.js → adjacencyFns-qxeJWyj-.js} +2 -2
  5. package/dist/{blueprint-xYq-5XuV.js → blueprint-CJ7k25eW.js} +5 -5
  6. package/dist/{blueprint-DI5CF5j9.cjs → blueprint-DF-Ig1SW.cjs} +5 -5
  7. package/dist/{blueprintFns-BIx82gku.js → blueprintFns-BKtVfo16.js} +2 -2
  8. package/dist/{blueprintFns-rkE3w33A.cjs → blueprintFns-CjvHOuIy.cjs} +2 -2
  9. package/dist/{blueprintSketcher-DuNukkBb.js → blueprintSketcher-BIUHqWo9.js} +3 -3
  10. package/dist/{blueprintSketcher-CW1MTtqe.cjs → blueprintSketcher-DRGumaWR.cjs} +3 -3
  11. package/dist/{boolean2D-CstWuqo8.cjs → boolean2D-5WdQm5Kb.cjs} +4 -4
  12. package/dist/{boolean2D-D7WPkRuG.js → boolean2D-Buf04D7l.js} +4 -4
  13. package/dist/brepjs.cjs +40 -28
  14. package/dist/brepjs.js +40 -28
  15. package/dist/{cameraFns-CaG1cMFg.cjs → cameraFns-CiGOarQ4.cjs} +2 -2
  16. package/dist/{cameraFns-B1P5WTCI.js → cameraFns-MViqtlSh.js} +2 -2
  17. package/dist/core.cjs +1 -1
  18. package/dist/core.js +1 -1
  19. package/dist/{cornerFinder-BZqos_kQ.js → cornerFinder-BEe90gzY.js} +1 -1
  20. package/dist/{cornerFinder-Ivo7aISl.cjs → cornerFinder-Bss_mZV9.cjs} +1 -1
  21. package/dist/{curveFns-DDLgrGyy.cjs → curveFns-C2zZ7Xuq.cjs} +1 -1
  22. package/dist/{curveFns-C5qarKS5.js → curveFns-CH6gaGTf.js} +1 -1
  23. package/dist/{drawFns-BU7wz6Sh.js → drawFns-CWfBvGiY.js} +47 -33
  24. package/dist/{drawFns-BX8bt_LP.cjs → drawFns-DZHPT-nb.cjs} +48 -34
  25. package/dist/{faceFns-RZFix5VU.cjs → faceFns-BbmIuuFt.cjs} +2 -2
  26. package/dist/{faceFns-Bkno2HCU.js → faceFns-ClvSac1T.js} +2 -2
  27. package/dist/{healingFns-DbunvjeU.cjs → healingFns-BZ-TOacm.cjs} +5 -5
  28. package/dist/{healingFns-D3Yl3-zg.js → healingFns-BhB_G0L0.js} +5 -5
  29. package/dist/{helpers-DVMbGdiy.cjs → helpers-D0be4TzF.cjs} +6 -6
  30. package/dist/{helpers-XUoXaD5D.js → helpers-zVYq0h_A.js} +6 -6
  31. package/dist/{importFns-C2z-lgvq.js → importFns-CzBtuX0j.js} +2 -2
  32. package/dist/{importFns-EwV81J0E.cjs → importFns-Tgnymh7F.cjs} +2 -2
  33. package/dist/io.cjs +2 -2
  34. package/dist/io.js +2 -2
  35. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  36. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  37. package/dist/{loftFns-BWaSzS-2.cjs → loftFns-Be0OZxYM.cjs} +1 -1
  38. package/dist/{loftFns-DpQTJQgv.js → loftFns-DxJAP4Qv.js} +1 -1
  39. package/dist/{measureFns-D7FLzPAB.js → measureFns-Bbgcgo9U.js} +3 -3
  40. package/dist/{measureFns-z1j5oyK6.cjs → measureFns-cK6MSs6B.cjs} +3 -3
  41. package/dist/measurement.cjs +1 -1
  42. package/dist/measurement.js +1 -1
  43. package/dist/{meshFns-DqHpJu5I.js → meshFns-CKXYSlFr.js} +3 -3
  44. package/dist/{meshFns-CKOXvMDj.cjs → meshFns-Df26UzQ9.cjs} +3 -3
  45. package/dist/{occtWasmAdapter-nqo3wbVj.js → occtWasmAdapter-BgmRCYeD.js} +29 -11
  46. package/dist/{occtWasmAdapter-8wX1Z2-I.cjs → occtWasmAdapter-CWX5KCl8.cjs} +29 -11
  47. package/dist/operations.cjs +2 -2
  48. package/dist/operations.js +2 -2
  49. package/dist/{primitiveFns-uXoHZuh9.js → primitiveFns-1otQpjcN.js} +50 -19
  50. package/dist/{primitiveFns-D0k3Absh.cjs → primitiveFns-DZkzMLUq.cjs} +50 -19
  51. package/dist/projection.cjs +1 -1
  52. package/dist/projection.js +1 -1
  53. package/dist/query.cjs +2 -2
  54. package/dist/query.js +2 -2
  55. package/dist/{refResolveFns-C1DZyVnQ.cjs → refResolveFns-BLM5XlZR.cjs} +6 -6
  56. package/dist/{refResolveFns-CEs1EWWI.js → refResolveFns-_niAxNu8.js} +6 -6
  57. package/dist/{shapeFns-CpopWo8-.js → shapeFns-Gzaax25v.js} +2 -2
  58. package/dist/{shapeFns-CQVLaU7u.cjs → shapeFns-m5OBBpM4.cjs} +2 -2
  59. package/dist/shapeRef.cjs +1 -1
  60. package/dist/shapeRef.js +1 -1
  61. package/dist/{shapeTypes-BtEERwGK.js → shapeTypes-BalkiKtK.js} +4 -2
  62. package/dist/{shapeTypes-BsJXkU8g.cjs → shapeTypes-C4gRoPYX.cjs} +4 -2
  63. package/dist/sketching.cjs +3 -3
  64. package/dist/sketching.js +3 -3
  65. package/dist/{solidBuilders-t7TnJXqT.cjs → solidBuilders-CHzmSo67.cjs} +8 -8
  66. package/dist/{solidBuilders-BRva7VpY.js → solidBuilders-CgEPRock.js} +8 -8
  67. package/dist/{surfaceBuilders-On9uTEBH.cjs → surfaceBuilders-DWHDogVL.cjs} +13 -4
  68. package/dist/{surfaceBuilders-Co91_Kh7.js → surfaceBuilders-HAF4Xtow.js} +13 -4
  69. package/dist/text.cjs +2 -2
  70. package/dist/text.js +2 -2
  71. package/dist/{textBlueprints-DdCJocI3.js → textBlueprints-CFPE5_QI.js} +7 -7
  72. package/dist/{textBlueprints-BoFKAYI9.cjs → textBlueprints-DgTBXc6O.cjs} +7 -7
  73. package/dist/{textMetrics-CS_JMGf1.cjs → textMetrics-BH-izd6N.cjs} +1 -1
  74. package/dist/{textMetrics-DYzW2as_.js → textMetrics-C2cwK7wU.js} +1 -1
  75. package/dist/{threadFns-DwKNCMFx.cjs → threadFns-B6SQd48K.cjs} +32 -18
  76. package/dist/{threadFns-BKQNkgT6.js → threadFns-G71HVwW7.js} +32 -18
  77. package/dist/topology.cjs +9 -9
  78. package/dist/topology.js +9 -9
  79. package/dist/{topologyQueryFns-5vIsyp4r.cjs → topologyQueryFns-BzIV1jHw.cjs} +1 -1
  80. package/dist/{topologyQueryFns-BU41SCtU.js → topologyQueryFns-vDjZw1k2.js} +1 -1
  81. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-BsJXkU8g.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_faceFns = require("./faceFns-RZFix5VU.cjs");
3
+ const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
4
4
  //#region src/utils/range.ts
5
5
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
6
6
  function range(len) {
@@ -230,8 +230,17 @@ function addHolesInFace(face, holes) {
230
230
  * @returns An error if fewer than 3 points are provided or the face cannot be built.
231
231
  */
232
232
  function makePolygon(points) {
233
- if (points.length < 3) return require_errors.err(require_errors.validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon"));
234
- return require_errors.andThen(assembleWire(zip([points, [...points.slice(1), points[0]]]).map(([p1, p2]) => makeLine(p1, p2))), (wire) => makeFace(wire));
233
+ try {
234
+ var _usingCtx$1 = require_shapeTypes._usingCtx();
235
+ if (points.length < 3) return require_errors.err(require_errors.validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon"));
236
+ const closing = [...points.slice(1), points[0]];
237
+ const scope = _usingCtx$1.u(new require_shapeTypes.DisposalScope());
238
+ return require_errors.andThen(assembleWire(zip([points, closing]).map(([p1, p2]) => scope.register(makeLine(p1, p2)))), (wire) => makeFace(scope.register(wire)));
239
+ } catch (_) {
240
+ _usingCtx$1.e = _;
241
+ } finally {
242
+ _usingCtx$1.d();
243
+ }
235
244
  }
236
245
  //#endregion
237
246
  Object.defineProperty(exports, "addHolesInFace", {
@@ -1,6 +1,6 @@
1
- import { c as createFace, f as createWire, k as isPlanarFace, nt as getKernel, s as createEdge, v as isFace } from "./shapeTypes-BtEERwGK.js";
1
+ import { U as DisposalScope, c as createFace, et as _usingCtx, f as createWire, k as isPlanarFace, nt as getKernel, s as createEdge, v as isFace } from "./shapeTypes-BalkiKtK.js";
2
2
  import { A as ok, b as err, d as validationError, i as kernelError, v as andThen } from "./errors-DNWJsfVU.js";
3
- import { _ as cast, u as outerWire } from "./faceFns-Bkno2HCU.js";
3
+ import { _ as cast, u as outerWire } from "./faceFns-ClvSac1T.js";
4
4
  //#region src/utils/range.ts
5
5
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
6
6
  function range(len) {
@@ -230,8 +230,17 @@ function addHolesInFace(face, holes) {
230
230
  * @returns An error if fewer than 3 points are provided or the face cannot be built.
231
231
  */
232
232
  function makePolygon(points) {
233
- if (points.length < 3) return err(validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon"));
234
- return andThen(assembleWire(zip([points, [...points.slice(1), points[0]]]).map(([p1, p2]) => makeLine(p1, p2))), (wire) => makeFace(wire));
233
+ try {
234
+ var _usingCtx$1 = _usingCtx();
235
+ if (points.length < 3) return err(validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon"));
236
+ const closing = [...points.slice(1), points[0]];
237
+ const scope = _usingCtx$1.u(new DisposalScope());
238
+ return andThen(assembleWire(zip([points, closing]).map(([p1, p2]) => scope.register(makeLine(p1, p2)))), (wire) => makeFace(scope.register(wire)));
239
+ } catch (_) {
240
+ _usingCtx$1.e = _;
241
+ } finally {
242
+ _usingCtx$1.d();
243
+ }
235
244
  }
236
245
  //#endregion
237
246
  export { makeThreePointArc as _, makeNonPlanarFace as a, makeBSplineApproximation as c, makeCircle as d, makeEllipse as f, makeTangentArc as g, makeLine as h, makeNewFaceWithinFace as i, makeBSplineInterpolation as l, makeHelix as m, fill as n, makePolygon as o, makeEllipseArc as p, makeFace as r, assembleWire as s, addHolesInFace as t, makeBezierCurve as u, zip as v };
package/dist/text.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-BoFKAYI9.cjs");
3
- const require_textMetrics = require("./textMetrics-CS_JMGf1.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-DgTBXc6O.cjs");
3
+ const require_textMetrics = require("./textMetrics-BH-izd6N.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-DdCJocI3.js";
2
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-DYzW2as_.js";
1
+ import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-CFPE5_QI.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-C2cwK7wU.js";
3
3
  export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
@@ -1,15 +1,15 @@
1
- import { c as createFace, f as createWire } from "./shapeTypes-BtEERwGK.js";
1
+ import { c as createFace, f as createWire } from "./shapeTypes-BalkiKtK.js";
2
2
  import { A as ok, R as unwrap, b as err, h as bug, 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 { v as copyShape } from "./faceFns-Bkno2HCU.js";
7
- import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-C5qarKS5.js";
6
+ import { v as copyShape } from "./faceFns-ClvSac1T.js";
7
+ import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-CH6gaGTf.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-Co91_Kh7.js";
10
- import { o as makeSolid, p as cutAll, t as makeCompound } from "./solidBuilders-BRva7VpY.js";
11
- import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-DuNukkBb.js";
12
- import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DpQTJQgv.js";
9
+ import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-HAF4Xtow.js";
10
+ import { o as makeSolid, p as cutAll, t as makeCompound } from "./solidBuilders-CgEPRock.js";
11
+ import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-BIUHqWo9.js";
12
+ import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DxJAP4Qv.js";
13
13
  import opentype from "opentype.js";
14
14
  //#region src/sketching/compoundSketch.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-BsJXkU8g.cjs");
32
+ const require_shapeTypes = require("./shapeTypes-C4gRoPYX.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-RZFix5VU.cjs");
38
- const require_curveFns = require("./curveFns-DDLgrGyy.cjs");
37
+ const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
38
+ const require_curveFns = require("./curveFns-C2zZ7Xuq.cjs");
39
39
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
40
- const require_surfaceBuilders = require("./surfaceBuilders-On9uTEBH.cjs");
41
- const require_solidBuilders = require("./solidBuilders-t7TnJXqT.cjs");
42
- const require_blueprintSketcher = require("./blueprintSketcher-CW1MTtqe.cjs");
43
- const require_loftFns = require("./loftFns-BWaSzS-2.cjs");
40
+ const require_surfaceBuilders = require("./surfaceBuilders-DWHDogVL.cjs");
41
+ const require_solidBuilders = require("./solidBuilders-CHzmSo67.cjs");
42
+ const require_blueprintSketcher = require("./blueprintSketcher-DRGumaWR.cjs");
43
+ const require_loftFns = require("./loftFns-Be0OZxYM.cjs");
44
44
  let opentype_js = require("opentype.js");
45
45
  opentype_js = __toESM(opentype_js, 1);
46
46
  //#region src/sketching/compoundSketch.ts
@@ -1,4 +1,4 @@
1
- const require_textBlueprints = require("./textBlueprints-BoFKAYI9.cjs");
1
+ const require_textBlueprints = require("./textBlueprints-DgTBXc6O.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-DdCJocI3.js";
2
+ import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-CFPE5_QI.js";
3
3
  //#region src/text/sketchText.ts
4
4
  /**
5
5
  * Render text as 3D sketch outlines on a plane.
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BsJXkU8g.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-C4gRoPYX.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
4
- const require_faceFns = require("./faceFns-RZFix5VU.cjs");
5
- const require_shapeFns = require("./shapeFns-CQVLaU7u.cjs");
6
- const require_solidBuilders = require("./solidBuilders-t7TnJXqT.cjs");
7
- const require_loftFns = require("./loftFns-BWaSzS-2.cjs");
8
- const require_refResolveFns = require("./refResolveFns-C1DZyVnQ.cjs");
9
- const require_primitiveFns = require("./primitiveFns-D0k3Absh.cjs");
4
+ const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
5
+ const require_shapeFns = require("./shapeFns-m5OBBpM4.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-CHzmSo67.cjs");
7
+ const require_loftFns = require("./loftFns-Be0OZxYM.cjs");
8
+ const require_refResolveFns = require("./refResolveFns-BLM5XlZR.cjs");
9
+ const require_primitiveFns = require("./primitiveFns-DZkzMLUq.cjs");
10
10
  //#region src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
12
12
  function uuidv() {
@@ -130,11 +130,16 @@ function linearPattern(shape, direction, count, spacing, options) {
130
130
  if (count === 1) return require_errors.ok(shape);
131
131
  if (require_vecOps.vecIsZero(direction)) return require_errors.err(require_errors.validationError("PATTERN_ZERO_DIRECTION", "Pattern direction cannot be zero"));
132
132
  const dir = require_vecOps.vecNormalize(direction);
133
- return require_solidBuilders.fuseAll(require_shapeTypes.getKernel().linearPattern(shape.wrapped, [...dir], spacing, count).map((s) => require_shapeTypes.castResultShape(s)), {
134
- optimisation: "sameFace",
135
- ...options,
136
- unsafe: true
137
- });
133
+ const copies = require_shapeTypes.getKernel().linearPattern(shape.wrapped, [...dir], spacing, count).map((s) => require_shapeTypes.castResultShape(s));
134
+ try {
135
+ return require_solidBuilders.fuseAll(copies, {
136
+ optimisation: "sameFace",
137
+ ...options,
138
+ unsafe: true
139
+ });
140
+ } finally {
141
+ for (const c of copies) c[Symbol.dispose]();
142
+ }
138
143
  }
139
144
  /**
140
145
  * Create a circular pattern of a shape around an axis.
@@ -156,11 +161,16 @@ function circularPattern(shape, axis, count, fullAngle = 360, center = [
156
161
  if (count === 1) return require_errors.ok(shape);
157
162
  if (require_vecOps.vecIsZero(axis)) return require_errors.err(require_errors.validationError("PATTERN_ZERO_AXIS", "Pattern axis cannot be zero"));
158
163
  const angleStep = fullAngle / count;
159
- return require_solidBuilders.fuseAll(require_shapeTypes.getKernel().circularPattern(shape.wrapped, [...center], [...axis], angleStep, count).map((s) => require_shapeTypes.castResultShape(s)), {
160
- optimisation: "sameFace",
161
- ...options,
162
- unsafe: true
163
- });
164
+ const copies = require_shapeTypes.getKernel().circularPattern(shape.wrapped, [...center], [...axis], angleStep, count).map((s) => require_shapeTypes.castResultShape(s));
165
+ try {
166
+ return require_solidBuilders.fuseAll(copies, {
167
+ optimisation: "sameFace",
168
+ ...options,
169
+ unsafe: true
170
+ });
171
+ } finally {
172
+ for (const c of copies) c[Symbol.dispose]();
173
+ }
164
174
  }
165
175
  /**
166
176
  * Create a 2D grid pattern of a shape along two directions.
@@ -186,7 +196,11 @@ function gridPattern(shape, directionX, directionY, countX, countY, spacingX, sp
186
196
  if (typeof kernel.gridPattern === "function") return require_errors.ok(require_shapeTypes.castResultShape(kernel.gridPattern(shape.wrapped, [...dirX], [...dirY], spacingX, spacingY, countX, countY)));
187
197
  const rowResult = linearPattern(shape, directionX, countX, spacingX, options);
188
198
  if (!rowResult.ok) return rowResult;
189
- return linearPattern(rowResult.value, directionY, countY, spacingY, options);
199
+ const row = rowResult.value;
200
+ const out = linearPattern(row, directionY, countY, spacingY, options);
201
+ const passthrough = out.ok && out.value === row;
202
+ if (row !== shape && !passthrough) row[Symbol.dispose]();
203
+ return out;
190
204
  }
191
205
  //#endregion
192
206
  //#region src/operations/assemblyFns.ts
@@ -1,12 +1,12 @@
1
- import { G as createKernelHandle, U as DisposalScope, b as isShape3D, et as _usingCtx, nt as getKernel, t as castResultShape } from "./shapeTypes-BtEERwGK.js";
1
+ import { G as createKernelHandle, U as DisposalScope, b as isShape3D, et as _usingCtx, nt as getKernel, t as castResultShape } from "./shapeTypes-BalkiKtK.js";
2
2
  import { A as ok, T as isOk, b as err, d as validationError, n as computationError, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
3
3
  import { d as vecNormalize, s as vecIsZero } from "./vecOps-SKPRvPH-.js";
4
- import { b as fromBREP } from "./faceFns-Bkno2HCU.js";
5
- import { s as toBREP } from "./shapeFns-CpopWo8-.js";
6
- import { h as fuseAll } from "./solidBuilders-BRva7VpY.js";
7
- import { t as loft } from "./loftFns-DpQTJQgv.js";
8
- import { c as resolveRefParams } from "./refResolveFns-CEs1EWWI.js";
9
- import { E as wire, h as line } from "./primitiveFns-uXoHZuh9.js";
4
+ import { b as fromBREP } from "./faceFns-ClvSac1T.js";
5
+ import { s as toBREP } from "./shapeFns-Gzaax25v.js";
6
+ import { h as fuseAll } from "./solidBuilders-CgEPRock.js";
7
+ import { t as loft } from "./loftFns-DxJAP4Qv.js";
8
+ import { c as resolveRefParams } from "./refResolveFns-_niAxNu8.js";
9
+ import { E as wire, h as line } from "./primitiveFns-1otQpjcN.js";
10
10
  //#region src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
12
12
  function uuidv() {
@@ -130,11 +130,16 @@ function linearPattern(shape, direction, count, spacing, options) {
130
130
  if (count === 1) return ok(shape);
131
131
  if (vecIsZero(direction)) return err(validationError("PATTERN_ZERO_DIRECTION", "Pattern direction cannot be zero"));
132
132
  const dir = vecNormalize(direction);
133
- return fuseAll(getKernel().linearPattern(shape.wrapped, [...dir], spacing, count).map((s) => castResultShape(s)), {
134
- optimisation: "sameFace",
135
- ...options,
136
- unsafe: true
137
- });
133
+ const copies = getKernel().linearPattern(shape.wrapped, [...dir], spacing, count).map((s) => castResultShape(s));
134
+ try {
135
+ return fuseAll(copies, {
136
+ optimisation: "sameFace",
137
+ ...options,
138
+ unsafe: true
139
+ });
140
+ } finally {
141
+ for (const c of copies) c[Symbol.dispose]();
142
+ }
138
143
  }
139
144
  /**
140
145
  * Create a circular pattern of a shape around an axis.
@@ -156,11 +161,16 @@ function circularPattern(shape, axis, count, fullAngle = 360, center = [
156
161
  if (count === 1) return ok(shape);
157
162
  if (vecIsZero(axis)) return err(validationError("PATTERN_ZERO_AXIS", "Pattern axis cannot be zero"));
158
163
  const angleStep = fullAngle / count;
159
- return fuseAll(getKernel().circularPattern(shape.wrapped, [...center], [...axis], angleStep, count).map((s) => castResultShape(s)), {
160
- optimisation: "sameFace",
161
- ...options,
162
- unsafe: true
163
- });
164
+ const copies = getKernel().circularPattern(shape.wrapped, [...center], [...axis], angleStep, count).map((s) => castResultShape(s));
165
+ try {
166
+ return fuseAll(copies, {
167
+ optimisation: "sameFace",
168
+ ...options,
169
+ unsafe: true
170
+ });
171
+ } finally {
172
+ for (const c of copies) c[Symbol.dispose]();
173
+ }
164
174
  }
165
175
  /**
166
176
  * Create a 2D grid pattern of a shape along two directions.
@@ -186,7 +196,11 @@ function gridPattern(shape, directionX, directionY, countX, countY, spacingX, sp
186
196
  if (typeof kernel.gridPattern === "function") return ok(castResultShape(kernel.gridPattern(shape.wrapped, [...dirX], [...dirY], spacingX, spacingY, countX, countY)));
187
197
  const rowResult = linearPattern(shape, directionX, countX, spacingX, options);
188
198
  if (!rowResult.ok) return rowResult;
189
- return linearPattern(rowResult.value, directionY, countY, spacingY, options);
199
+ const row = rowResult.value;
200
+ const out = linearPattern(row, directionY, countY, spacingY, options);
201
+ const passthrough = out.ok && out.value === row;
202
+ if (row !== shape && !passthrough) row[Symbol.dispose]();
203
+ return out;
190
204
  }
191
205
  //#endregion
192
206
  //#region src/operations/assemblyFns.ts
package/dist/topology.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_topologyQueryFns = require("./topologyQueryFns-5vIsyp4r.cjs");
3
- const require_faceFns = require("./faceFns-RZFix5VU.cjs");
4
- const require_shapeFns = require("./shapeFns-CQVLaU7u.cjs");
5
- const require_curveFns = require("./curveFns-DDLgrGyy.cjs");
6
- const require_meshFns = require("./meshFns-CKOXvMDj.cjs");
7
- const require_solidBuilders = require("./solidBuilders-t7TnJXqT.cjs");
8
- const require_healingFns = require("./healingFns-DbunvjeU.cjs");
9
- const require_adjacencyFns = require("./adjacencyFns-BaiFeuKQ.cjs");
10
- const require_primitiveFns = require("./primitiveFns-D0k3Absh.cjs");
2
+ const require_topologyQueryFns = require("./topologyQueryFns-BzIV1jHw.cjs");
3
+ const require_faceFns = require("./faceFns-BbmIuuFt.cjs");
4
+ const require_shapeFns = require("./shapeFns-m5OBBpM4.cjs");
5
+ const require_curveFns = require("./curveFns-C2zZ7Xuq.cjs");
6
+ const require_meshFns = require("./meshFns-Df26UzQ9.cjs");
7
+ const require_solidBuilders = require("./solidBuilders-CHzmSo67.cjs");
8
+ const require_healingFns = require("./healingFns-BZ-TOacm.cjs");
9
+ const require_adjacencyFns = require("./adjacencyFns-BdxIbZtR.cjs");
10
+ const require_primitiveFns = require("./primitiveFns-DZkzMLUq.cjs");
11
11
  exports.addHoles = require_primitiveFns.addHoles;
12
12
  exports.adjacentFaces = require_adjacencyFns.adjacentFaces;
13
13
  exports.approximateCurve = require_curveFns.approximateCurve;
package/dist/topology.js CHANGED
@@ -1,10 +1,10 @@
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-BU41SCtU.js";
2
- import { C as shapeType, S as iterTopo, _ as cast, a as faceOrientation, b as fromBREP, c as innerWires, d as pointOnSurface, f as projectPointOnFace, g as asTopo, h as uvCoordinates, i as faceGeomType, l as normalAt, m as uvBounds, n as faceAxis, o as flipFaceOrientation, r as faceCenter, s as getSurfaceType, t as classifyPointOnFace, u as outerWire, x as isCompSolid, y as downcast } from "./faceFns-Bkno2HCU.js";
3
- import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-CpopWo8-.js";
4
- import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as getCurveType, h as offsetWire2D, i as curveIsClosed, l as curveStartPoint, m as interpolateCurve, n as curveAxis, o as curveLength, p as getOrientation, r as curveEndPoint, s as curvePeriod, t as approximateCurve, u as curveTangentAt } from "./curveFns-C5qarKS5.js";
5
- import { d as createMeshCache, n as exportSTEP, r as exportSTL, t as exportIGES, u as clearMeshCache } from "./meshFns-DqHpJu5I.js";
6
- import { h as fuseAll, p as cutAll } from "./solidBuilders-BRva7VpY.js";
7
- import { A as toBufferGeometryData, C as shellWithEvolution, D as getNurbsCurveData, E as fuseAllBisect, O as getNurbsSurfaceData, P as toLineGeometryData, S as intersectWithEvolution, T as cutAllBisect, _ as positionOnCurve, a as healFace, b as filletWithEvolution, g as variableFillet, j as toGroupedBufferGeometryData, k as chamferDistAngle, l as solidFromShell, n as fixSelfIntersection, o as healSolid, r as fixShape, s as healWire, t as autoHeal, v as chamferWithEvolution, w as checkBoolean, x as fuseWithEvolution, y as cutWithEvolution } from "./healingFns-D3Yl3-zg.js";
8
- import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-CRqm5AS0.js";
9
- import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere, c as cylinder, d as ellipsoid, f as face, g as offsetFace, h as line, i as bsplineApprox, l as ellipse, m as helix, n as bezier, o as compound, p as filledFace, r as box, s as cone, t as addHoles, u as ellipseArc, v as sewShells, w as torus, x as subFace, y as solid } from "./primitiveFns-uXoHZuh9.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-vDjZw1k2.js";
2
+ import { C as shapeType, S as iterTopo, _ as cast, a as faceOrientation, b as fromBREP, c as innerWires, d as pointOnSurface, f as projectPointOnFace, g as asTopo, h as uvCoordinates, i as faceGeomType, l as normalAt, m as uvBounds, n as faceAxis, o as flipFaceOrientation, r as faceCenter, s as getSurfaceType, t as classifyPointOnFace, u as outerWire, x as isCompSolid, y as downcast } from "./faceFns-ClvSac1T.js";
3
+ import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-Gzaax25v.js";
4
+ import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as getCurveType, h as offsetWire2D, i as curveIsClosed, l as curveStartPoint, m as interpolateCurve, n as curveAxis, o as curveLength, p as getOrientation, r as curveEndPoint, s as curvePeriod, t as approximateCurve, u as curveTangentAt } from "./curveFns-CH6gaGTf.js";
5
+ import { d as createMeshCache, n as exportSTEP, r as exportSTL, t as exportIGES, u as clearMeshCache } from "./meshFns-CKXYSlFr.js";
6
+ import { h as fuseAll, p as cutAll } from "./solidBuilders-CgEPRock.js";
7
+ import { A as toBufferGeometryData, C as shellWithEvolution, D as getNurbsCurveData, E as fuseAllBisect, O as getNurbsSurfaceData, P as toLineGeometryData, S as intersectWithEvolution, T as cutAllBisect, _ as positionOnCurve, a as healFace, b as filletWithEvolution, g as variableFillet, j as toGroupedBufferGeometryData, k as chamferDistAngle, l as solidFromShell, n as fixSelfIntersection, o as healSolid, r as fixShape, s as healWire, t as autoHeal, v as chamferWithEvolution, w as checkBoolean, x as fuseWithEvolution, y as cutWithEvolution } from "./healingFns-BhB_G0L0.js";
8
+ import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-qxeJWyj-.js";
9
+ import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere, c as cylinder, d as ellipsoid, f as face, g as offsetFace, h as line, i as bsplineApprox, l as ellipse, m as helix, n as bezier, o as compound, p as filledFace, r as box, s as cone, t as addHoles, u as ellipseArc, v as sewShells, w as torus, x as subFace, y as solid } from "./primitiveFns-1otQpjcN.js";
10
10
  export { addHoles, adjacentFaces, approximateCurve, asTopo, autoHeal, bezier, box, bsplineApprox, cast, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkBoolean, circle, classifyPointOnFace, clearMeshCache, compound, cone, createMeshCache, curveAxis, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cutAll, cutAllBisect, cutWithEvolution, cylinder, fromBREP as deserializeShape, downcast, edgesOfFace, ellipse, ellipseArc, ellipsoid, exportIGES, exportSTEP, exportSTL, face, faceAxis, 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
- const require_shapeTypes = require("./shapeTypes-BsJXkU8g.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-C4gRoPYX.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) {
@@ -1,4 +1,4 @@
1
- import { R as getOrQueryType, U as DisposalScope, et as _usingCtx, n as castResultShapeWithKnownType, nt as getKernel, t as castResultShape } from "./shapeTypes-BtEERwGK.js";
1
+ import { R as getOrQueryType, U as DisposalScope, et as _usingCtx, n as castResultShapeWithKnownType, nt as getKernel, t as castResultShape } from "./shapeTypes-BalkiKtK.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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "18.118.12",
3
+ "version": "18.118.13",
4
4
  "description": "Web CAD library with pluggable geometry kernel",
5
5
  "keywords": [
6
6
  "cad",