brepjs 18.118.21 → 18.118.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-h7eAxaRD.cjs → adjacencyFns-BHTNz8_O.cjs} +3 -3
  4. package/dist/{adjacencyFns-Dgsl8VJ2.js → adjacencyFns-W7QMVMW2.js} +3 -3
  5. package/dist/{blueprint-CwQmYoR4.js → blueprint-CAOmiu7r.js} +5 -5
  6. package/dist/{blueprint-DG-2uqNB.cjs → blueprint-HhixTgBZ.cjs} +5 -5
  7. package/dist/{blueprintFns-aCrK18ZR.js → blueprintFns-DGrnUDEC.js} +2 -2
  8. package/dist/{blueprintFns-FAuYTbQQ.cjs → blueprintFns-Ds_uQ2k9.cjs} +2 -2
  9. package/dist/{blueprintSketcher-k5dNnvzs.cjs → blueprintSketcher-BMy51I6w.cjs} +3 -3
  10. package/dist/{blueprintSketcher-VvIRL3M8.js → blueprintSketcher-DsJQXRpk.js} +3 -3
  11. package/dist/{boolean2D-qYYFeLWX.js → boolean2D-BGMaEgC3.js} +4 -4
  12. package/dist/{boolean2D-BmkwzUgt.cjs → boolean2D-DgyG0o-U.cjs} +4 -4
  13. package/dist/brepjs.cjs +34 -32
  14. package/dist/brepjs.js +34 -32
  15. package/dist/{cameraFns-BZMHFbh9.cjs → cameraFns-DC1Bqs3i.cjs} +3 -3
  16. package/dist/{cameraFns-CYU4C4N6.js → cameraFns-ZCIt2Vwu.js} +3 -3
  17. package/dist/core/disposal.d.ts +15 -0
  18. package/dist/core.cjs +1 -1
  19. package/dist/core.js +1 -1
  20. package/dist/{cornerFinder-BEiSjmuO.cjs → cornerFinder-DLmNe5qH.cjs} +1 -1
  21. package/dist/{cornerFinder-DhOm0L8g.js → cornerFinder-DpOtHhry.js} +1 -1
  22. package/dist/{curveFns-YN8_CsqU.cjs → curveFns-CLG5eRx5.cjs} +1 -1
  23. package/dist/{curveFns-SNQ04JW6.js → curveFns-Sl36NbVb.js} +1 -1
  24. package/dist/{drawFns-Dqsv_t37.cjs → drawFns-Cspcghnk.cjs} +12 -12
  25. package/dist/{drawFns-8zxP0gC5.js → drawFns-D26G4W6g.js} +12 -12
  26. package/dist/{faceFns-C0SwZInk.cjs → faceFns-B4X-xM8V.cjs} +2 -2
  27. package/dist/{faceFns-CCu9ULQm.js → faceFns-Bk5OdHMb.js} +2 -2
  28. package/dist/{healingFns-Bbl5KTIh.cjs → healingFns-B6qvJ_ua.cjs} +5 -5
  29. package/dist/{healingFns-D6Bizorp.js → healingFns-CzAgSI4a.js} +5 -5
  30. package/dist/{helpers-Cv-lOGsc.cjs → helpers-BslGOVYN.cjs} +6 -6
  31. package/dist/{helpers-By-BruMN.js → helpers-D4DOutu7.js} +6 -6
  32. package/dist/{importFns-6eFs1L_G.cjs → importFns-1OeDbirB.cjs} +2 -2
  33. package/dist/{importFns-Bcza0b4Y.js → importFns-BZk3bSlR.js} +2 -2
  34. package/dist/io.cjs +2 -2
  35. package/dist/io.js +2 -2
  36. package/dist/kernel/interfaces/topologyOps.d.ts +13 -0
  37. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  38. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +2 -0
  39. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  40. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +4 -0
  41. package/dist/kernel/occtWasm/topologyOps.d.ts +4 -0
  42. package/dist/{loftFns-Bbe5jRA-.cjs → loftFns-DjHxcgNY.cjs} +1 -1
  43. package/dist/{loftFns-DEReccFa.js → loftFns-RdVrGF1B.js} +1 -1
  44. package/dist/{measureFns-DHj5Z-5c.js → measureFns-Dy4ebDq2.js} +3 -3
  45. package/dist/{measureFns-DMzw5wf0.cjs → measureFns-Vb49femb.cjs} +3 -3
  46. package/dist/measurement.cjs +1 -1
  47. package/dist/measurement.js +1 -1
  48. package/dist/{meshFns-C2nLgSf2.js → meshFns-Bsz0MOp6.js} +3 -3
  49. package/dist/{meshFns-B9pPcwuD.cjs → meshFns-C1-S8YRk.cjs} +3 -3
  50. package/dist/{occtWasmAdapter-5_6aHhcD.js → occtWasmAdapter-CYfezu3P.js} +19 -0
  51. package/dist/{occtWasmAdapter-CIxwUim8.cjs → occtWasmAdapter-Hkzb95Fy.cjs} +19 -0
  52. package/dist/operations.cjs +2 -2
  53. package/dist/operations.js +2 -2
  54. package/dist/{primitiveFns-D2zyQa3w.js → primitiveFns-D8Vwk98k.js} +4 -4
  55. package/dist/{primitiveFns-DZXN7qDb.cjs → primitiveFns-pxjaTk8i.cjs} +4 -4
  56. package/dist/projection.cjs +1 -1
  57. package/dist/projection.js +1 -1
  58. package/dist/query.cjs +2 -2
  59. package/dist/query.js +2 -2
  60. package/dist/{refResolveFns-C_mHlM8R.js → refResolveFns-3u3H3kGf.js} +6 -6
  61. package/dist/{refResolveFns-CHm7tsm2.cjs → refResolveFns-BIhtsmdZ.cjs} +6 -6
  62. package/dist/{shapeFns-BakfS4c9.js → shapeFns-CsNSoHH6.js} +3 -7
  63. package/dist/{shapeFns-DzXcfZHY.cjs → shapeFns-ql8ziUaG.cjs} +3 -7
  64. package/dist/shapeRef.cjs +1 -1
  65. package/dist/shapeRef.js +1 -1
  66. package/dist/{shapeTypes-B5bBKbg9.js → shapeTypes-Cw-8_69M.js} +37 -2
  67. package/dist/{shapeTypes-BfOb9vzc.cjs → shapeTypes-DbUdKYv8.cjs} +42 -1
  68. package/dist/sketching.cjs +3 -3
  69. package/dist/sketching.js +3 -3
  70. package/dist/{solidBuilders-BgrXN-GP.cjs → solidBuilders-BLsga6fa.cjs} +5 -5
  71. package/dist/{solidBuilders-DaTgm_Wj.js → solidBuilders-CVs9uVKO.js} +5 -5
  72. package/dist/{surfaceBuilders-BdUP_OXk.js → surfaceBuilders-DI0oXs1Z.js} +2 -2
  73. package/dist/{surfaceBuilders-CUNhA_3a.cjs → surfaceBuilders-QPtrtoXG.cjs} +2 -2
  74. package/dist/text.cjs +2 -2
  75. package/dist/text.js +2 -2
  76. package/dist/{textBlueprints--5GSuYEm.cjs → textBlueprints-8Z_V9-Ir.cjs} +7 -7
  77. package/dist/{textBlueprints-C_JaAGiG.js → textBlueprints-GmfesKnp.js} +7 -7
  78. package/dist/{textMetrics-CyJlakdR.cjs → textMetrics-CE0SzDYa.cjs} +1 -1
  79. package/dist/{textMetrics-829YpBdN.js → textMetrics-Cj4BPjs4.js} +1 -1
  80. package/dist/{threadFns-H0mRmS6I.js → threadFns-D5BCp0GF.js} +7 -7
  81. package/dist/{threadFns-BBELmTZv.cjs → threadFns-D_wKVcfO.cjs} +7 -7
  82. package/dist/topology/topologyQueryFns.d.ts +17 -1
  83. package/dist/topology.cjs +9 -9
  84. package/dist/topology.js +9 -9
  85. package/dist/{topologyQueryFns-MAUFbsSp.js → topologyQueryFns-BT4CdXa2.js} +38 -6
  86. package/dist/{topologyQueryFns-tns6VXoD.cjs → topologyQueryFns-D5hBmDkc.cjs} +43 -5
  87. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const require_occtWasmAdapter = require("./occtWasmAdapter-CIxwUim8.cjs");
1
+ const require_occtWasmAdapter = require("./occtWasmAdapter-Hkzb95Fy.cjs");
2
2
  const require_bug = require("./bug-O02CsAmt.cjs");
3
3
  const require_errors = require("./errors-CJU8CHng.cjs");
4
4
  //#region src/kernel/quality.ts
@@ -15709,6 +15709,41 @@ function createBorrowedHandle(ocShape) {
15709
15709
  onDispose: noop
15710
15710
  };
15711
15711
  }
15712
+ /**
15713
+ * Run `fn` between an arena checkpoint and restore, reclaiming every slot it
15714
+ * allocates — including kernel-internal query temporaries brepjs holds no handle
15715
+ * for (e.g. `distance`/`boundingBox` scratch) — in a single `restoreCheckpoint`.
15716
+ *
15717
+ * **SAFE ONLY when `fn` returns plain data** (numbers, points, arrays): restore
15718
+ * frees *every* slot allocated after the checkpoint, so a live shape handle in
15719
+ * the return value would dangle. Use for data-returning batch analysis over many
15720
+ * bodies; never to wrap a shape builder. Inputs allocated before the call are
15721
+ * untouched (restore only frees from the mark forward).
15722
+ *
15723
+ * No-op wrapper on kernels without arena checkpoints (occt/manifold): `fn` runs
15724
+ * directly and those kernels' own disposal applies.
15725
+ */
15726
+ function withArenaCheckpoint(fn) {
15727
+ const kernel = getKernel();
15728
+ let cp;
15729
+ try {
15730
+ cp = kernel.checkpoint();
15731
+ } catch (e) {
15732
+ if (!require_occtWasmAdapter.isUnsupportedKernelOperationError(e)) throw e;
15733
+ return fn();
15734
+ }
15735
+ let result;
15736
+ try {
15737
+ result = fn();
15738
+ } catch (e) {
15739
+ try {
15740
+ kernel.restoreCheckpoint(cp);
15741
+ } catch {}
15742
+ throw e;
15743
+ }
15744
+ kernel.restoreCheckpoint(cp);
15745
+ return result;
15746
+ }
15712
15747
  /** Create a disposable handle for any kernel object. */
15713
15748
  function createKernelHandle(ocObj) {
15714
15749
  let disposed = false;
@@ -16649,6 +16684,12 @@ Object.defineProperty(exports, "validSolid", {
16649
16684
  return validSolid;
16650
16685
  }
16651
16686
  });
16687
+ Object.defineProperty(exports, "withArenaCheckpoint", {
16688
+ enumerable: true,
16689
+ get: function() {
16690
+ return withArenaCheckpoint;
16691
+ }
16692
+ });
16652
16693
  Object.defineProperty(exports, "withKernel", {
16653
16694
  enumerable: true,
16654
16695
  get: function() {
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints--5GSuYEm.cjs");
3
- const require_blueprintSketcher = require("./blueprintSketcher-k5dNnvzs.cjs");
4
- const require_drawFns = require("./drawFns-Dqsv_t37.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-8Z_V9-Ir.cjs");
3
+ const require_blueprintSketcher = require("./blueprintSketcher-BMy51I6w.cjs");
4
+ const require_drawFns = require("./drawFns-Cspcghnk.cjs");
5
5
  //#region src/sketching.ts
6
6
  /**
7
7
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
package/dist/sketching.js CHANGED
@@ -1,6 +1,6 @@
1
- import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-VvIRL3M8.js";
2
- import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-8zxP0gC5.js";
3
- import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-C_JaAGiG.js";
1
+ import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-DsJQXRpk.js";
2
+ import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-D26G4W6g.js";
3
+ import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-GmfesKnp.js";
4
4
  //#region src/sketching.ts
5
5
  /**
6
6
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
@@ -1,13 +1,13 @@
1
- const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DbUdKYv8.cjs");
2
2
  const require_errors = require("./errors-CJU8CHng.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-D5hBmDkc.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
6
6
  const require_planeOps = require("./planeOps-Cr25KWWA.cjs");
7
- const require_faceFns = require("./faceFns-C0SwZInk.cjs");
8
- const require_shapeFns = require("./shapeFns-DzXcfZHY.cjs");
7
+ const require_faceFns = require("./faceFns-B4X-xM8V.cjs");
8
+ const require_shapeFns = require("./shapeFns-ql8ziUaG.cjs");
9
9
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
10
- const require_surfaceBuilders = require("./surfaceBuilders-CUNhA_3a.cjs");
10
+ const require_surfaceBuilders = require("./surfaceBuilders-QPtrtoXG.cjs");
11
11
  //#region src/topology/booleanFns.ts
12
12
  /**
13
13
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -1,13 +1,13 @@
1
- import { C as isSolid, R as getShapeKind, S as isShell, d as createSolid, f as createVertex, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, rt as getKernel, s as createCompound, tt as _usingCtx, x as isShape3D } from "./shapeTypes-B5bBKbg9.js";
1
+ import { C as isSolid, R as getShapeKind, S as isShell, d as createSolid, f as createVertex, h as disposeResultShape, i as castShape, it as getKernel, m as disposeDowncastSource, n as castResultShape, nt as _usingCtx, s as createCompound, x as isShape3D } from "./shapeTypes-Cw-8_69M.js";
2
2
  import { I as unwrap, O as ok, S as isErr, d as validationError, g as andThen, i as kernelError, l as typeCastError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
3
- import { f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-MAUFbsSp.js";
3
+ import { f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-BT4CdXa2.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
5
5
  import { h as vecScale, t as vecAdd } from "./vecOps-SKPRvPH-.js";
6
6
  import { o as resolvePlane } from "./planeOps-Cp6GQ23-.js";
7
- import { _ as cast, y as downcast } from "./faceFns-CCu9ULQm.js";
8
- import { _ as collectInputFaceHashes, b as propagateMetadataByHash, y as propagateAllMetadata } from "./shapeFns-BakfS4c9.js";
7
+ import { _ as cast, y as downcast } from "./faceFns-Bk5OdHMb.js";
8
+ import { _ as collectInputFaceHashes, b as propagateMetadataByHash, y as propagateAllMetadata } from "./shapeFns-CsNSoHH6.js";
9
9
  import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
10
- import { r as makeFace } from "./surfaceBuilders-BdUP_OXk.js";
10
+ import { r as makeFace } from "./surfaceBuilders-DI0oXs1Z.js";
11
11
  //#region src/topology/booleanFns.ts
12
12
  /**
13
13
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -1,6 +1,6 @@
1
- import { A as isPlanarFace, W as DisposalScope, c as createEdge, l as createFace, p as createWire, rt as getKernel, tt as _usingCtx, y as isFace } from "./shapeTypes-B5bBKbg9.js";
1
+ import { A as isPlanarFace, W as DisposalScope, c as createEdge, it as getKernel, l as createFace, nt as _usingCtx, p as createWire, y as isFace } from "./shapeTypes-Cw-8_69M.js";
2
2
  import { O as ok, d as validationError, g as andThen, i as kernelError, v as err } from "./errors-B3CDG537.js";
3
- import { _ as cast, u as outerWire } from "./faceFns-CCu9ULQm.js";
3
+ import { _ as cast, u as outerWire } from "./faceFns-Bk5OdHMb.js";
4
4
  //#region src/utils/range.ts
5
5
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
6
6
  function range(len) {
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DbUdKYv8.cjs");
2
2
  const require_errors = require("./errors-CJU8CHng.cjs");
3
- const require_faceFns = require("./faceFns-C0SwZInk.cjs");
3
+ const require_faceFns = require("./faceFns-B4X-xM8V.cjs");
4
4
  //#region src/utils/range.ts
5
5
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
6
6
  function range(len) {
package/dist/text.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints--5GSuYEm.cjs");
3
- const require_textMetrics = require("./textMetrics-CyJlakdR.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-8Z_V9-Ir.cjs");
3
+ const require_textMetrics = require("./textMetrics-CE0SzDYa.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-C_JaAGiG.js";
2
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-829YpBdN.js";
1
+ import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-GmfesKnp.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-Cj4BPjs4.js";
3
3
  export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
@@ -29,19 +29,19 @@ 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-BfOb9vzc.cjs");
32
+ const require_shapeTypes = require("./shapeTypes-DbUdKYv8.cjs");
33
33
  const require_bug = require("./bug-O02CsAmt.cjs");
34
34
  const require_errors = require("./errors-CJU8CHng.cjs");
35
35
  const require_types = require("./types-KjA8tY4Y.cjs");
36
36
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
37
37
  const require_planeOps = require("./planeOps-Cr25KWWA.cjs");
38
- const require_faceFns = require("./faceFns-C0SwZInk.cjs");
39
- const require_curveFns = require("./curveFns-YN8_CsqU.cjs");
38
+ const require_faceFns = require("./faceFns-B4X-xM8V.cjs");
39
+ const require_curveFns = require("./curveFns-CLG5eRx5.cjs");
40
40
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
41
- const require_surfaceBuilders = require("./surfaceBuilders-CUNhA_3a.cjs");
42
- const require_solidBuilders = require("./solidBuilders-BgrXN-GP.cjs");
43
- const require_blueprintSketcher = require("./blueprintSketcher-k5dNnvzs.cjs");
44
- const require_loftFns = require("./loftFns-Bbe5jRA-.cjs");
41
+ const require_surfaceBuilders = require("./surfaceBuilders-QPtrtoXG.cjs");
42
+ const require_solidBuilders = require("./solidBuilders-BLsga6fa.cjs");
43
+ const require_blueprintSketcher = require("./blueprintSketcher-BMy51I6w.cjs");
44
+ const require_loftFns = require("./loftFns-DjHxcgNY.cjs");
45
45
  let opentype_js = require("opentype.js");
46
46
  opentype_js = __toESM(opentype_js, 1);
47
47
  //#region src/sketching/compoundSketch.ts
@@ -1,16 +1,16 @@
1
- import { l as createFace, p as createWire } from "./shapeTypes-B5bBKbg9.js";
1
+ import { l as createFace, p as createWire } from "./shapeTypes-Cw-8_69M.js";
2
2
  import { n as bug } from "./bug-BdOHwn_e.js";
3
3
  import { I as unwrap, O as ok, r as ioError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
4
4
  import { r as toVec3 } from "./types-D24Y27N0.js";
5
5
  import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-SKPRvPH-.js";
6
6
  import { n as createPlane } from "./planeOps-Cp6GQ23-.js";
7
- import { v as copyShape } from "./faceFns-CCu9ULQm.js";
8
- import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-SNQ04JW6.js";
7
+ import { v as copyShape } from "./faceFns-Bk5OdHMb.js";
8
+ import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-Sl36NbVb.js";
9
9
  import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
10
- import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-BdUP_OXk.js";
11
- import { o as makeSolid, p as cutAll, t as makeCompound } from "./solidBuilders-DaTgm_Wj.js";
12
- import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-VvIRL3M8.js";
13
- import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DEReccFa.js";
10
+ import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-DI0oXs1Z.js";
11
+ import { o as makeSolid, p as cutAll, t as makeCompound } from "./solidBuilders-CVs9uVKO.js";
12
+ import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-DsJQXRpk.js";
13
+ import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-RdVrGF1B.js";
14
14
  import opentype from "opentype.js";
15
15
  //#region src/sketching/compoundSketch.ts
16
16
  /**
@@ -1,4 +1,4 @@
1
- const require_textBlueprints = require("./textBlueprints--5GSuYEm.cjs");
1
+ const require_textBlueprints = require("./textBlueprints-8Z_V9-Ir.cjs");
2
2
  const require_errors = require("./errors-CJU8CHng.cjs");
3
3
  //#region src/text/sketchText.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { O as ok, d as validationError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
2
- import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-C_JaAGiG.js";
2
+ import { g as wrapSketchData, i as Sketches, n as getFont, t as textBlueprints, v as CompoundSketch } from "./textBlueprints-GmfesKnp.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
- import { K as createKernelHandle, W as DisposalScope, n as castResultShape, rt as getKernel, tt as _usingCtx, x as isShape3D } from "./shapeTypes-B5bBKbg9.js";
1
+ import { K as createKernelHandle, W as DisposalScope, it as getKernel, n as castResultShape, nt as _usingCtx, x as isShape3D } from "./shapeTypes-Cw-8_69M.js";
2
2
  import { C as isOk, O as ok, d as validationError, n as computationError, r as ioError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
3
3
  import { d as vecNormalize, s as vecIsZero } from "./vecOps-SKPRvPH-.js";
4
- import { b as fromBREP } from "./faceFns-CCu9ULQm.js";
5
- import { s as toBREP } from "./shapeFns-BakfS4c9.js";
6
- import { h as fuseAll } from "./solidBuilders-DaTgm_Wj.js";
7
- import { t as loft } from "./loftFns-DEReccFa.js";
8
- import { c as resolveRefParams } from "./refResolveFns-C_mHlM8R.js";
9
- import { E as wire, h as line } from "./primitiveFns-D2zyQa3w.js";
4
+ import { b as fromBREP } from "./faceFns-Bk5OdHMb.js";
5
+ import { s as toBREP } from "./shapeFns-CsNSoHH6.js";
6
+ import { h as fuseAll } from "./solidBuilders-CVs9uVKO.js";
7
+ import { t as loft } from "./loftFns-RdVrGF1B.js";
8
+ import { c as resolveRefParams } from "./refResolveFns-3u3H3kGf.js";
9
+ import { E as wire, h as line } from "./primitiveFns-D8Vwk98k.js";
10
10
  //#region src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
12
12
  function uuidv() {
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DbUdKYv8.cjs");
2
2
  const require_errors = require("./errors-CJU8CHng.cjs");
3
3
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
4
- const require_faceFns = require("./faceFns-C0SwZInk.cjs");
5
- const require_shapeFns = require("./shapeFns-DzXcfZHY.cjs");
6
- const require_solidBuilders = require("./solidBuilders-BgrXN-GP.cjs");
7
- const require_loftFns = require("./loftFns-Bbe5jRA-.cjs");
8
- const require_refResolveFns = require("./refResolveFns-CHm7tsm2.cjs");
9
- const require_primitiveFns = require("./primitiveFns-DZXN7qDb.cjs");
4
+ const require_faceFns = require("./faceFns-B4X-xM8V.cjs");
5
+ const require_shapeFns = require("./shapeFns-ql8ziUaG.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-BLsga6fa.cjs");
7
+ const require_loftFns = require("./loftFns-DjHxcgNY.cjs");
8
+ const require_refResolveFns = require("./refResolveFns-BIhtsmdZ.cjs");
9
+ const require_primitiveFns = require("./primitiveFns-pxjaTk8i.cjs");
10
10
  //#region src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
12
12
  function uuidv() {
@@ -1,6 +1,22 @@
1
- import { KernelShape, SurfaceType } from '../kernel/types.js';
1
+ import { KernelShape, ShapeType, SurfaceType } from '../kernel/types.js';
2
2
  import { AnyShape, Dimension, Edge, Face, Wire, Vertex, Shell, Solid, CompSolid, ShapeKind } from '../core/shapeTypes.js';
3
3
  import { Vec3 } from '../core/types.js';
4
+ /**
5
+ * Count sub-shapes of a type without materialising (and disposing) a handle per
6
+ * sub-shape. Uses the kernel's native `subShapeCount` when available (occt-wasm
7
+ * >= 3.7.0); otherwise iterates and releases. Prefer this over
8
+ * `getFaces(shape).length` when only the count is needed and the handles aren't
9
+ * — it neither allocates nor warms the topology cache.
10
+ */
11
+ export declare function subShapeCount(shape: AnyShape<Dimension>, type: ShapeType): number;
12
+ /**
13
+ * Deduplicated hashes of a shape's sub-shapes, keyed the same as
14
+ * {@link getKernel}'s `hashCode(_, HASH_CODE_MAX)`. Uses the native
15
+ * `subShapeHashes` when available (occt-wasm >= 3.7.0); otherwise iterates,
16
+ * hashes, and releases. For hash-only paths (origin/tag maps) that would
17
+ * otherwise allocate a handle per sub-shape just to hash it.
18
+ */
19
+ export declare function subShapeHashes(shape: AnyShape<Dimension>, type: ShapeType): number[];
4
20
  /** @internal Cache entry type — exported for originTrackingFns and adjacencyFns. */
5
21
  export interface TopoCacheEntry {
6
22
  edges?: Edge<Dimension>[];
package/dist/topology.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
3
- const require_faceFns = require("./faceFns-C0SwZInk.cjs");
4
- const require_shapeFns = require("./shapeFns-DzXcfZHY.cjs");
5
- const require_curveFns = require("./curveFns-YN8_CsqU.cjs");
6
- const require_meshFns = require("./meshFns-B9pPcwuD.cjs");
7
- const require_solidBuilders = require("./solidBuilders-BgrXN-GP.cjs");
8
- const require_healingFns = require("./healingFns-Bbl5KTIh.cjs");
9
- const require_adjacencyFns = require("./adjacencyFns-h7eAxaRD.cjs");
10
- const require_primitiveFns = require("./primitiveFns-DZXN7qDb.cjs");
2
+ const require_topologyQueryFns = require("./topologyQueryFns-D5hBmDkc.cjs");
3
+ const require_faceFns = require("./faceFns-B4X-xM8V.cjs");
4
+ const require_shapeFns = require("./shapeFns-ql8ziUaG.cjs");
5
+ const require_curveFns = require("./curveFns-CLG5eRx5.cjs");
6
+ const require_meshFns = require("./meshFns-C1-S8YRk.cjs");
7
+ const require_solidBuilders = require("./solidBuilders-BLsga6fa.cjs");
8
+ const require_healingFns = require("./healingFns-B6qvJ_ua.cjs");
9
+ const require_adjacencyFns = require("./adjacencyFns-BHTNz8_O.cjs");
10
+ const require_primitiveFns = require("./primitiveFns-pxjaTk8i.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-MAUFbsSp.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-CCu9ULQm.js";
3
- import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-BakfS4c9.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-SNQ04JW6.js";
5
- import { d as createMeshCache, n as exportSTEP, r as exportSTL, t as exportIGES, u as clearMeshCache } from "./meshFns-C2nLgSf2.js";
6
- import { h as fuseAll, p as cutAll } from "./solidBuilders-DaTgm_Wj.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-D6Bizorp.js";
8
- import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-Dgsl8VJ2.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-D2zyQa3w.js";
1
+ import { C 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-BT4CdXa2.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-Bk5OdHMb.js";
3
+ import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-CsNSoHH6.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-Sl36NbVb.js";
5
+ import { d as createMeshCache, n as exportSTEP, r as exportSTL, t as exportIGES, u as clearMeshCache } from "./meshFns-Bsz0MOp6.js";
6
+ import { h as fuseAll, p as cutAll } from "./solidBuilders-CVs9uVKO.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-CzAgSI4a.js";
8
+ import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-W7QMVMW2.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-D8Vwk98k.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,5 +1,6 @@
1
- import { W as DisposalScope, n as castResultShape, r as castResultShapeWithKnownType, rt as getKernel, tt as _usingCtx, z as getOrQueryType } from "./shapeTypes-B5bBKbg9.js";
1
+ import { W as DisposalScope, it as getKernel, n as castResultShape, nt as _usingCtx, r as castResultShapeWithKnownType, z as getOrQueryType } from "./shapeTypes-Cw-8_69M.js";
2
2
  import { O as ok, f as getSuggestionForCode, p as translateKernelError, v as err } from "./errors-B3CDG537.js";
3
+ import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
3
4
  //#region src/core/kernelCall.ts
4
5
  function buildError(kind, code, message, cause, suggestion) {
5
6
  const base = {
@@ -106,6 +107,37 @@ function castSubShapes(parentShape, type) {
106
107
  for (let i = 0; i < rawShapes.length; i++) result[i] = castResultShapeWithKnownType(rawShapes[i], type);
107
108
  return result;
108
109
  }
110
+ /**
111
+ * Count sub-shapes of a type without materialising (and disposing) a handle per
112
+ * sub-shape. Uses the kernel's native `subShapeCount` when available (occt-wasm
113
+ * >= 3.7.0); otherwise iterates and releases. Prefer this over
114
+ * `getFaces(shape).length` when only the count is needed and the handles aren't
115
+ * — it neither allocates nor warms the topology cache.
116
+ */
117
+ function subShapeCount(shape, type) {
118
+ const kernel = getKernel();
119
+ if (kernel.subShapeCount) return kernel.subShapeCount(shape.wrapped, type);
120
+ const items = kernel.iterShapes(shape.wrapped, type);
121
+ for (const item of items) kernel.dispose(item);
122
+ return items.length;
123
+ }
124
+ /**
125
+ * Deduplicated hashes of a shape's sub-shapes, keyed the same as
126
+ * {@link getKernel}'s `hashCode(_, HASH_CODE_MAX)`. Uses the native
127
+ * `subShapeHashes` when available (occt-wasm >= 3.7.0); otherwise iterates,
128
+ * hashes, and releases. For hash-only paths (origin/tag maps) that would
129
+ * otherwise allocate a handle per sub-shape just to hash it.
130
+ */
131
+ function subShapeHashes(shape, type) {
132
+ const kernel = getKernel();
133
+ if (kernel.subShapeHashes) return kernel.subShapeHashes(shape.wrapped, type, HASH_CODE_MAX);
134
+ const seen = /* @__PURE__ */ new Set();
135
+ for (const item of kernel.iterShapes(shape.wrapped, type)) {
136
+ seen.add(kernel.hashCode(item, HASH_CODE_MAX));
137
+ kernel.dispose(item);
138
+ }
139
+ return [...seen];
140
+ }
109
141
  var topoCache = /* @__PURE__ */ new WeakMap();
110
142
  /**
111
143
  * Release the cached sub-shape handles for a cache entry and drop it. The
@@ -293,10 +325,10 @@ function getCachedIsValid(shape) {
293
325
  function describe(shape) {
294
326
  return {
295
327
  kind: getCachedShapeKind(shape),
296
- faceCount: getFaces(shape).length,
297
- edgeCount: getEdges(shape).length,
298
- wireCount: getWires(shape).length,
299
- vertexCount: getVertices(shape).length,
328
+ faceCount: subShapeCount(shape, "face"),
329
+ edgeCount: subShapeCount(shape, "edge"),
330
+ wireCount: subShapeCount(shape, "wire"),
331
+ vertexCount: subShapeCount(shape, "vertex"),
300
332
  valid: getCachedIsValid(shape),
301
333
  bounds: getBounds(shape)
302
334
  };
@@ -306,4 +338,4 @@ function vertexPosition(vertex) {
306
338
  return getKernel().vertexPosition(vertex.wrapped);
307
339
  }
308
340
  //#endregion
309
- export { kernelCall as C, vertexPosition as S, kernelCallScoped as T, iterFaces as _, getCachedSurfaceType as a, iterVertices as b, getFaces as c, getSolids as d, getVertices as f, iterEdges as g, iterCompSolids as h, getCachedIsValid as i, getOrCreateCache as l, invalidateShapeCache as m, getBounds as n, getCompSolids as o, getWires as p, getCacheEntry as r, getEdges as s, describe as t, getShells as u, iterShells as v, kernelCallRaw as w, iterWires as x, iterSolids as y };
341
+ export { vertexPosition as C, kernelCallScoped as E, subShapeHashes as S, kernelCallRaw as T, iterFaces as _, getCachedSurfaceType as a, iterVertices as b, getFaces as c, getSolids as d, getVertices as f, iterEdges as g, iterCompSolids as h, getCachedIsValid as i, getOrCreateCache as l, invalidateShapeCache as m, getBounds as n, getCompSolids as o, getWires as p, getCacheEntry as r, getEdges as s, describe as t, getShells as u, iterShells as v, kernelCall as w, iterWires as x, iterSolids as y };
@@ -1,5 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DbUdKYv8.cjs");
2
2
  const require_errors = require("./errors-CJU8CHng.cjs");
3
+ const require_constants = require("./constants-BOVyEYGH.cjs");
3
4
  //#region src/core/kernelCall.ts
4
5
  function buildError(kind, code, message, cause, suggestion) {
5
6
  const base = {
@@ -106,6 +107,37 @@ function castSubShapes(parentShape, type) {
106
107
  for (let i = 0; i < rawShapes.length; i++) result[i] = require_shapeTypes.castResultShapeWithKnownType(rawShapes[i], type);
107
108
  return result;
108
109
  }
110
+ /**
111
+ * Count sub-shapes of a type without materialising (and disposing) a handle per
112
+ * sub-shape. Uses the kernel's native `subShapeCount` when available (occt-wasm
113
+ * >= 3.7.0); otherwise iterates and releases. Prefer this over
114
+ * `getFaces(shape).length` when only the count is needed and the handles aren't
115
+ * — it neither allocates nor warms the topology cache.
116
+ */
117
+ function subShapeCount(shape, type) {
118
+ const kernel = require_shapeTypes.getKernel();
119
+ if (kernel.subShapeCount) return kernel.subShapeCount(shape.wrapped, type);
120
+ const items = kernel.iterShapes(shape.wrapped, type);
121
+ for (const item of items) kernel.dispose(item);
122
+ return items.length;
123
+ }
124
+ /**
125
+ * Deduplicated hashes of a shape's sub-shapes, keyed the same as
126
+ * {@link getKernel}'s `hashCode(_, HASH_CODE_MAX)`. Uses the native
127
+ * `subShapeHashes` when available (occt-wasm >= 3.7.0); otherwise iterates,
128
+ * hashes, and releases. For hash-only paths (origin/tag maps) that would
129
+ * otherwise allocate a handle per sub-shape just to hash it.
130
+ */
131
+ function subShapeHashes(shape, type) {
132
+ const kernel = require_shapeTypes.getKernel();
133
+ if (kernel.subShapeHashes) return kernel.subShapeHashes(shape.wrapped, type, require_constants.HASH_CODE_MAX);
134
+ const seen = /* @__PURE__ */ new Set();
135
+ for (const item of kernel.iterShapes(shape.wrapped, type)) {
136
+ seen.add(kernel.hashCode(item, require_constants.HASH_CODE_MAX));
137
+ kernel.dispose(item);
138
+ }
139
+ return [...seen];
140
+ }
109
141
  var topoCache = /* @__PURE__ */ new WeakMap();
110
142
  /**
111
143
  * Release the cached sub-shape handles for a cache entry and drop it. The
@@ -293,10 +325,10 @@ function getCachedIsValid(shape) {
293
325
  function describe(shape) {
294
326
  return {
295
327
  kind: getCachedShapeKind(shape),
296
- faceCount: getFaces(shape).length,
297
- edgeCount: getEdges(shape).length,
298
- wireCount: getWires(shape).length,
299
- vertexCount: getVertices(shape).length,
328
+ faceCount: subShapeCount(shape, "face"),
329
+ edgeCount: subShapeCount(shape, "edge"),
330
+ wireCount: subShapeCount(shape, "wire"),
331
+ vertexCount: subShapeCount(shape, "vertex"),
300
332
  valid: getCachedIsValid(shape),
301
333
  bounds: getBounds(shape)
302
334
  };
@@ -450,6 +482,12 @@ Object.defineProperty(exports, "kernelCallScoped", {
450
482
  return kernelCallScoped;
451
483
  }
452
484
  });
485
+ Object.defineProperty(exports, "subShapeHashes", {
486
+ enumerable: true,
487
+ get: function() {
488
+ return subShapeHashes;
489
+ }
490
+ });
453
491
  Object.defineProperty(exports, "vertexPosition", {
454
492
  enumerable: true,
455
493
  get: function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "18.118.21",
3
+ "version": "18.118.23",
4
4
  "description": "Web CAD library with pluggable geometry kernel",
5
5
  "keywords": [
6
6
  "cad",