brepjs 18.118.21 → 18.118.22

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 (86) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-Dgsl8VJ2.js → adjacencyFns-CME8_Ejy.js} +3 -3
  4. package/dist/{adjacencyFns-h7eAxaRD.cjs → adjacencyFns-Rli_sYu0.cjs} +3 -3
  5. package/dist/{blueprint-DG-2uqNB.cjs → blueprint-DHkhXQ-P.cjs} +5 -5
  6. package/dist/{blueprint-CwQmYoR4.js → blueprint-DN2hNJ08.js} +5 -5
  7. package/dist/{blueprintFns-aCrK18ZR.js → blueprintFns-BRsTIpwS.js} +2 -2
  8. package/dist/{blueprintFns-FAuYTbQQ.cjs → blueprintFns-Bro6pOEx.cjs} +2 -2
  9. package/dist/{blueprintSketcher-VvIRL3M8.js → blueprintSketcher-BRFHrNhR.js} +3 -3
  10. package/dist/{blueprintSketcher-k5dNnvzs.cjs → blueprintSketcher-DmCll228.cjs} +3 -3
  11. package/dist/{boolean2D-BmkwzUgt.cjs → boolean2D-BbkgYbej.cjs} +4 -4
  12. package/dist/{boolean2D-qYYFeLWX.js → boolean2D-DWIQyvn_.js} +4 -4
  13. package/dist/brepjs.cjs +26 -26
  14. package/dist/brepjs.js +26 -26
  15. package/dist/{cameraFns-BZMHFbh9.cjs → cameraFns-Bdkvayeo.cjs} +3 -3
  16. package/dist/{cameraFns-CYU4C4N6.js → cameraFns-x2CiTzWz.js} +3 -3
  17. package/dist/core.cjs +1 -1
  18. package/dist/core.js +1 -1
  19. package/dist/{cornerFinder-BEiSjmuO.cjs → cornerFinder-D1FvVPF_.cjs} +1 -1
  20. package/dist/{cornerFinder-DhOm0L8g.js → cornerFinder-sXfHxiyw.js} +1 -1
  21. package/dist/{curveFns-YN8_CsqU.cjs → curveFns-BnO2rju_.cjs} +1 -1
  22. package/dist/{curveFns-SNQ04JW6.js → curveFns-CjXjOojp.js} +1 -1
  23. package/dist/{drawFns-8zxP0gC5.js → drawFns-CJB8-Alm.js} +12 -12
  24. package/dist/{drawFns-Dqsv_t37.cjs → drawFns-CMEEUHjz.cjs} +12 -12
  25. package/dist/{faceFns-CCu9ULQm.js → faceFns-BGKBw92q.js} +2 -2
  26. package/dist/{faceFns-C0SwZInk.cjs → faceFns-DBv5u_f9.cjs} +2 -2
  27. package/dist/{healingFns-Bbl5KTIh.cjs → healingFns-BY7zqj9G.cjs} +5 -5
  28. package/dist/{healingFns-D6Bizorp.js → healingFns-Wk-8KDXX.js} +5 -5
  29. package/dist/{helpers-By-BruMN.js → helpers-B2KCN_-N.js} +6 -6
  30. package/dist/{helpers-Cv-lOGsc.cjs → helpers-D83P_lxb.cjs} +6 -6
  31. package/dist/{importFns-6eFs1L_G.cjs → importFns-Btu0Taj7.cjs} +2 -2
  32. package/dist/{importFns-Bcza0b4Y.js → importFns-CNYOnxuV.js} +2 -2
  33. package/dist/io.cjs +2 -2
  34. package/dist/io.js +2 -2
  35. package/dist/kernel/interfaces/topologyOps.d.ts +13 -0
  36. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  37. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +2 -0
  38. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  39. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +4 -0
  40. package/dist/kernel/occtWasm/topologyOps.d.ts +4 -0
  41. package/dist/{loftFns-Bbe5jRA-.cjs → loftFns-Dlxh4HWG.cjs} +1 -1
  42. package/dist/{loftFns-DEReccFa.js → loftFns-DwFxOyHA.js} +1 -1
  43. package/dist/{measureFns-DHj5Z-5c.js → measureFns-BHEI76L8.js} +3 -3
  44. package/dist/{measureFns-DMzw5wf0.cjs → measureFns-COF1whvP.cjs} +3 -3
  45. package/dist/measurement.cjs +1 -1
  46. package/dist/measurement.js +1 -1
  47. package/dist/{meshFns-B9pPcwuD.cjs → meshFns-BUpCd8Ad.cjs} +3 -3
  48. package/dist/{meshFns-C2nLgSf2.js → meshFns-UbHsizxI.js} +3 -3
  49. package/dist/{occtWasmAdapter-5_6aHhcD.js → occtWasmAdapter-CYfezu3P.js} +19 -0
  50. package/dist/{occtWasmAdapter-CIxwUim8.cjs → occtWasmAdapter-Hkzb95Fy.cjs} +19 -0
  51. package/dist/operations.cjs +2 -2
  52. package/dist/operations.js +2 -2
  53. package/dist/{primitiveFns-DZXN7qDb.cjs → primitiveFns-Cxclo3Kr.cjs} +4 -4
  54. package/dist/{primitiveFns-D2zyQa3w.js → primitiveFns-thuLjZoA.js} +4 -4
  55. package/dist/projection.cjs +1 -1
  56. package/dist/projection.js +1 -1
  57. package/dist/query.cjs +2 -2
  58. package/dist/query.js +2 -2
  59. package/dist/{refResolveFns-C_mHlM8R.js → refResolveFns-Cdsdnazm.js} +6 -6
  60. package/dist/{refResolveFns-CHm7tsm2.cjs → refResolveFns-CyeqAYfq.cjs} +6 -6
  61. package/dist/{shapeFns-DzXcfZHY.cjs → shapeFns-CO_l0k39.cjs} +3 -7
  62. package/dist/{shapeFns-BakfS4c9.js → shapeFns-CgZA6LDP.js} +3 -7
  63. package/dist/shapeRef.cjs +1 -1
  64. package/dist/shapeRef.js +1 -1
  65. package/dist/{shapeTypes-BfOb9vzc.cjs → shapeTypes-CfvfdzVF.cjs} +1 -1
  66. package/dist/{shapeTypes-B5bBKbg9.js → shapeTypes-DZWeBLpa.js} +1 -1
  67. package/dist/sketching.cjs +3 -3
  68. package/dist/sketching.js +3 -3
  69. package/dist/{solidBuilders-BgrXN-GP.cjs → solidBuilders-DmyjgcA-.cjs} +5 -5
  70. package/dist/{solidBuilders-DaTgm_Wj.js → solidBuilders-PnxdyH9u.js} +5 -5
  71. package/dist/{surfaceBuilders-BdUP_OXk.js → surfaceBuilders-DjjtPLqS.js} +2 -2
  72. package/dist/{surfaceBuilders-CUNhA_3a.cjs → surfaceBuilders-kmpmUZRX.cjs} +2 -2
  73. package/dist/text.cjs +2 -2
  74. package/dist/text.js +2 -2
  75. package/dist/{textBlueprints--5GSuYEm.cjs → textBlueprints-Bk5h559Y.cjs} +7 -7
  76. package/dist/{textBlueprints-C_JaAGiG.js → textBlueprints-IeZPxfnz.js} +7 -7
  77. package/dist/{textMetrics-829YpBdN.js → textMetrics-Bu15lvq_.js} +1 -1
  78. package/dist/{textMetrics-CyJlakdR.cjs → textMetrics-DaeMRXkd.cjs} +1 -1
  79. package/dist/{threadFns-BBELmTZv.cjs → threadFns-B2GWWNfP.cjs} +7 -7
  80. package/dist/{threadFns-H0mRmS6I.js → threadFns-Cf31rpJU.js} +7 -7
  81. package/dist/topology/topologyQueryFns.d.ts +17 -1
  82. package/dist/topology.cjs +9 -9
  83. package/dist/topology.js +9 -9
  84. package/dist/{topologyQueryFns-tns6VXoD.cjs → topologyQueryFns-C4us1DQ1.cjs} +43 -5
  85. package/dist/{topologyQueryFns-MAUFbsSp.js → topologyQueryFns-DiR_wMEy.js} +38 -6
  86. package/package.json +1 -1
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-IeZPxfnz.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-Bu15lvq_.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-CfvfdzVF.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-DBv5u_f9.cjs");
39
+ const require_curveFns = require("./curveFns-BnO2rju_.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-kmpmUZRX.cjs");
42
+ const require_solidBuilders = require("./solidBuilders-DmyjgcA-.cjs");
43
+ const require_blueprintSketcher = require("./blueprintSketcher-DmCll228.cjs");
44
+ const require_loftFns = require("./loftFns-Dlxh4HWG.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-DZWeBLpa.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-BGKBw92q.js";
8
+ import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-CjXjOojp.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-DjjtPLqS.js";
11
+ import { o as makeSolid, p as cutAll, t as makeCompound } from "./solidBuilders-PnxdyH9u.js";
12
+ import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-BRFHrNhR.js";
13
+ import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DwFxOyHA.js";
14
14
  import opentype from "opentype.js";
15
15
  //#region src/sketching/compoundSketch.ts
16
16
  /**
@@ -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-IeZPxfnz.js";
3
3
  //#region src/text/sketchText.ts
4
4
  /**
5
5
  * Render text as 3D sketch outlines on a plane.
@@ -1,4 +1,4 @@
1
- const require_textBlueprints = require("./textBlueprints--5GSuYEm.cjs");
1
+ const require_textBlueprints = require("./textBlueprints-Bk5h559Y.cjs");
2
2
  const require_errors = require("./errors-CJU8CHng.cjs");
3
3
  //#region src/text/sketchText.ts
4
4
  /**
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CfvfdzVF.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-DBv5u_f9.cjs");
5
+ const require_shapeFns = require("./shapeFns-CO_l0k39.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-DmyjgcA-.cjs");
7
+ const require_loftFns = require("./loftFns-Dlxh4HWG.cjs");
8
+ const require_refResolveFns = require("./refResolveFns-CyeqAYfq.cjs");
9
+ const require_primitiveFns = require("./primitiveFns-Cxclo3Kr.cjs");
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
- 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, n as castResultShape, rt as getKernel, tt as _usingCtx, x as isShape3D } from "./shapeTypes-DZWeBLpa.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-BGKBw92q.js";
5
+ import { s as toBREP } from "./shapeFns-CgZA6LDP.js";
6
+ import { h as fuseAll } from "./solidBuilders-PnxdyH9u.js";
7
+ import { t as loft } from "./loftFns-DwFxOyHA.js";
8
+ import { c as resolveRefParams } from "./refResolveFns-Cdsdnazm.js";
9
+ import { E as wire, h as line } from "./primitiveFns-thuLjZoA.js";
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-C4us1DQ1.cjs");
3
+ const require_faceFns = require("./faceFns-DBv5u_f9.cjs");
4
+ const require_shapeFns = require("./shapeFns-CO_l0k39.cjs");
5
+ const require_curveFns = require("./curveFns-BnO2rju_.cjs");
6
+ const require_meshFns = require("./meshFns-BUpCd8Ad.cjs");
7
+ const require_solidBuilders = require("./solidBuilders-DmyjgcA-.cjs");
8
+ const require_healingFns = require("./healingFns-BY7zqj9G.cjs");
9
+ const require_adjacencyFns = require("./adjacencyFns-Rli_sYu0.cjs");
10
+ const require_primitiveFns = require("./primitiveFns-Cxclo3Kr.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-DiR_wMEy.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-BGKBw92q.js";
3
+ import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-CgZA6LDP.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-CjXjOojp.js";
5
+ import { d as createMeshCache, n as exportSTEP, r as exportSTL, t as exportIGES, u as clearMeshCache } from "./meshFns-UbHsizxI.js";
6
+ import { h as fuseAll, p as cutAll } from "./solidBuilders-PnxdyH9u.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-Wk-8KDXX.js";
8
+ import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-CME8_Ejy.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-thuLjZoA.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
- const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CfvfdzVF.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() {
@@ -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, n as castResultShape, r as castResultShapeWithKnownType, rt as getKernel, tt as _usingCtx, z as getOrQueryType } from "./shapeTypes-DZWeBLpa.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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "18.118.21",
3
+ "version": "18.118.22",
4
4
  "description": "Web CAD library with pluggable geometry kernel",
5
5
  "keywords": [
6
6
  "cad",