brepjs 18.118.8 → 18.118.9

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.
@@ -1,5 +1,5 @@
1
- import { a as castShapeWithKnownType, nt as getKernel } from "./shapeTypes-D8Fprilr.js";
2
- import { l as getOrCreateCache } from "./topologyQueryFns-DfThB5LA.js";
1
+ import { a as castShapeWithKnownType, n as castResultShapeWithKnownType, nt as getKernel } from "./shapeTypes-D8Fprilr.js";
2
+ import { c as getFaces, f as getVertices, l as getOrCreateCache, s as getEdges } from "./topologyQueryFns-DfThB5LA.js";
3
3
  import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
4
4
  //#region src/topology/adjacencyFns.ts
5
5
  /**
@@ -8,6 +8,11 @@ import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
8
8
  * Uses cached topology extraction and an edge→faces adjacency map
9
9
  * (built once per parent shape and cached) to avoid redundant WASM calls.
10
10
  */
11
+ /**
12
+ * Brand cache-owned raw sub-shapes (from the edge/face adjacency maps) without
13
+ * consuming them. Each cast allocates a fresh downcast the caller disposes; the
14
+ * cached source stays intact — so this must NOT release its input.
15
+ */
11
16
  function wrapAll(shapes, type) {
12
17
  return shapes.map((s) => castShapeWithKnownType(s, type));
13
18
  }
@@ -16,7 +21,11 @@ function wrapAll(shapes, type) {
16
21
  * hash+isSame, and return branded handles of type `T`.
17
22
  *
18
23
  * Used by edgesOfFace, wiresOfFace, and verticesOfEdge — all of which need
19
- * the same deduplicated-children pattern on a raw KernelShape.
24
+ * the same deduplicated-children pattern on a raw KernelShape. Each iterated
25
+ * sub-shape is a fresh arena slot the caller owns: uniques are cast with
26
+ * `castResultShapeWithKnownType` (releasing the orphaned pre-downcast source),
27
+ * and duplicates are released outright — otherwise every call leaks one slot
28
+ * per sub-shape on the occt-wasm arena kernel.
20
29
  */
21
30
  function deduplicatedSubShapes(parentKernel, type) {
22
31
  const kernel = getKernel();
@@ -26,64 +35,94 @@ function deduplicatedSubShapes(parentKernel, type) {
26
35
  for (const item of items) {
27
36
  const hash = kernel.hashCode(item, HASH_CODE_MAX);
28
37
  const bucket = seen.get(hash);
29
- if (!bucket) {
30
- seen.set(hash, [item]);
31
- results.push(item);
32
- } else if (!bucket.some((r) => kernel.isSame(r, item))) {
33
- bucket.push(item);
34
- results.push(item);
38
+ if (bucket?.some((r) => kernel.isSame(r, item))) {
39
+ kernel.dispose(item);
40
+ continue;
35
41
  }
42
+ const casted = castResultShapeWithKnownType(item, type);
43
+ results.push(casted);
44
+ if (bucket) bucket.push(casted.wrapped);
45
+ else seen.set(hash, [casted.wrapped]);
46
+ }
47
+ return results;
48
+ }
49
+ /** Hash-index branded sub-shapes for isSame lookup by hash code. */
50
+ function indexByHash(items) {
51
+ const kernel = getKernel();
52
+ const index = /* @__PURE__ */ new Map();
53
+ for (const item of items) {
54
+ const hash = kernel.hashCode(item.wrapped, HASH_CODE_MAX);
55
+ const bucket = index.get(hash);
56
+ if (bucket) bucket.push(item);
57
+ else index.set(hash, [item]);
36
58
  }
37
- return wrapAll(results, type);
59
+ return index;
60
+ }
61
+ /** The managed handle matching a raw sub-shape by hash + isSame, or undefined. */
62
+ function findManaged(index, raw, hash) {
63
+ const kernel = getKernel();
64
+ return index.get(hash)?.find((m) => kernel.isSame(m.wrapped, raw));
38
65
  }
39
66
  /**
40
67
  * Build or retrieve the cached edge→faces adjacency map for a parent shape.
41
68
  * Maps edge hash codes to edge-face pairs, storing the edge alongside each
42
69
  * face so facesOfEdge can verify via isSame without re-extracting face edges.
70
+ *
71
+ * The stored handles are the parent's **managed** `getEdges`/`getFaces` handles
72
+ * (owned by the topology cache), never fresh iterated slots — so the map holds
73
+ * no arena slots of its own. The transient per-face edges used only for
74
+ * matching are released immediately.
43
75
  */
44
76
  function getEdgeToFacesMap(parent) {
45
77
  const cache = getOrCreateCache(parent);
46
78
  if (cache.edgeToFaces) return cache.edgeToFaces;
47
79
  const kernel = getKernel();
80
+ const faces = getFaces(parent);
81
+ const edgeIndex = indexByHash(getEdges(parent));
48
82
  const edgeToFaces = /* @__PURE__ */ new Map();
49
- const allFaces = kernel.iterShapes(parent.wrapped, "face");
50
- for (const f of allFaces) {
51
- const edges = kernel.iterShapes(f, "edge");
52
- for (const e of edges) {
53
- const hash = kernel.hashCode(e, HASH_CODE_MAX);
54
- let bucket = edgeToFaces.get(hash);
55
- if (!bucket) {
56
- bucket = [];
57
- edgeToFaces.set(hash, bucket);
58
- }
59
- if (!bucket.some((entry) => kernel.isSame(entry.edge, e) && kernel.isSame(entry.face, f))) bucket.push({
60
- edge: e,
61
- face: f
62
- });
83
+ for (const face of faces) for (const rawEdge of kernel.iterShapes(face.wrapped, "edge")) {
84
+ const hash = kernel.hashCode(rawEdge, HASH_CODE_MAX);
85
+ const managedEdge = findManaged(edgeIndex, rawEdge, hash);
86
+ kernel.dispose(rawEdge);
87
+ if (!managedEdge) continue;
88
+ let bucket = edgeToFaces.get(hash);
89
+ if (!bucket) {
90
+ bucket = [];
91
+ edgeToFaces.set(hash, bucket);
63
92
  }
93
+ if (!bucket.some((entry) => kernel.isSame(entry.edge, managedEdge.wrapped) && kernel.isSame(entry.face, face.wrapped))) bucket.push({
94
+ edge: managedEdge.wrapped,
95
+ face: face.wrapped
96
+ });
64
97
  }
65
98
  cache.edgeToFaces = edgeToFaces;
66
99
  return edgeToFaces;
67
100
  }
68
101
  /**
69
102
  * Build or retrieve the cached vertex→faces adjacency map for a parent shape —
70
- * the vertex analogue of {@link getEdgeToFacesMap}.
103
+ * the vertex analogue of {@link getEdgeToFacesMap}. Stores the parent's managed
104
+ * `getVertices`/`getFaces` handles and releases the transient per-face vertices.
71
105
  */
72
106
  function getVertexToFacesMap(parent) {
73
107
  const cache = getOrCreateCache(parent);
74
108
  if (cache.vertexToFaces) return cache.vertexToFaces;
75
109
  const kernel = getKernel();
110
+ const faces = getFaces(parent);
111
+ const vertexIndex = indexByHash(getVertices(parent));
76
112
  const vertexToFaces = /* @__PURE__ */ new Map();
77
- for (const f of kernel.iterShapes(parent.wrapped, "face")) for (const v of kernel.iterShapes(f, "vertex")) {
78
- const hash = kernel.hashCode(v, HASH_CODE_MAX);
113
+ for (const face of faces) for (const rawVertex of kernel.iterShapes(face.wrapped, "vertex")) {
114
+ const hash = kernel.hashCode(rawVertex, HASH_CODE_MAX);
115
+ const managedVertex = findManaged(vertexIndex, rawVertex, hash);
116
+ kernel.dispose(rawVertex);
117
+ if (!managedVertex) continue;
79
118
  let bucket = vertexToFaces.get(hash);
80
119
  if (!bucket) {
81
120
  bucket = [];
82
121
  vertexToFaces.set(hash, bucket);
83
122
  }
84
- if (!bucket.some((entry) => kernel.isSame(entry.vertex, v) && kernel.isSame(entry.face, f))) bucket.push({
85
- vertex: v,
86
- face: f
123
+ if (!bucket.some((entry) => kernel.isSame(entry.vertex, managedVertex.wrapped) && kernel.isSame(entry.face, face.wrapped))) bucket.push({
124
+ vertex: managedVertex.wrapped,
125
+ face: face.wrapped
87
126
  });
88
127
  }
89
128
  cache.vertexToFaces = vertexToFaces;
@@ -216,6 +255,7 @@ function adjacentFaces(parent, face) {
216
255
  }
217
256
  }
218
257
  }
258
+ for (const e of faceEdgeHandles) e[Symbol.dispose]();
219
259
  return wrapAll(neighborRaw, "face");
220
260
  }
221
261
  /**
@@ -240,8 +280,10 @@ function sharedEdges(face1, face2) {
240
280
  bucket.push(e2);
241
281
  }
242
282
  const shared = [];
243
- for (const e1 of edges1) if (edge2Map.get(kernel.hashCode(e1, 2147483647))?.some((e2) => kernel.isSame(e1, e2))) shared.push(e1);
244
- return wrapAll(shared, "edge");
283
+ for (const e1 of edges1) if (edge2Map.get(kernel.hashCode(e1, 2147483647))?.some((e2) => kernel.isSame(e1, e2))) shared.push(castResultShapeWithKnownType(e1, "edge"));
284
+ else kernel.dispose(e1);
285
+ for (const e2 of edges2) kernel.dispose(e2);
286
+ return shared;
245
287
  }
246
288
  //#endregion
247
289
  export { sharedEdges as a, wiresOfFace as c, facesOfVertex as i, edgesOfFace as n, verticesOfEdge as o, facesOfEdge as r, verticesOfFace as s, adjacentFaces as t };
@@ -8,6 +8,11 @@ const require_constants = require("./constants-BOVyEYGH.cjs");
8
8
  * Uses cached topology extraction and an edge→faces adjacency map
9
9
  * (built once per parent shape and cached) to avoid redundant WASM calls.
10
10
  */
11
+ /**
12
+ * Brand cache-owned raw sub-shapes (from the edge/face adjacency maps) without
13
+ * consuming them. Each cast allocates a fresh downcast the caller disposes; the
14
+ * cached source stays intact — so this must NOT release its input.
15
+ */
11
16
  function wrapAll(shapes, type) {
12
17
  return shapes.map((s) => require_shapeTypes.castShapeWithKnownType(s, type));
13
18
  }
@@ -16,7 +21,11 @@ function wrapAll(shapes, type) {
16
21
  * hash+isSame, and return branded handles of type `T`.
17
22
  *
18
23
  * Used by edgesOfFace, wiresOfFace, and verticesOfEdge — all of which need
19
- * the same deduplicated-children pattern on a raw KernelShape.
24
+ * the same deduplicated-children pattern on a raw KernelShape. Each iterated
25
+ * sub-shape is a fresh arena slot the caller owns: uniques are cast with
26
+ * `castResultShapeWithKnownType` (releasing the orphaned pre-downcast source),
27
+ * and duplicates are released outright — otherwise every call leaks one slot
28
+ * per sub-shape on the occt-wasm arena kernel.
20
29
  */
21
30
  function deduplicatedSubShapes(parentKernel, type) {
22
31
  const kernel = require_shapeTypes.getKernel();
@@ -26,64 +35,94 @@ function deduplicatedSubShapes(parentKernel, type) {
26
35
  for (const item of items) {
27
36
  const hash = kernel.hashCode(item, require_constants.HASH_CODE_MAX);
28
37
  const bucket = seen.get(hash);
29
- if (!bucket) {
30
- seen.set(hash, [item]);
31
- results.push(item);
32
- } else if (!bucket.some((r) => kernel.isSame(r, item))) {
33
- bucket.push(item);
34
- results.push(item);
38
+ if (bucket?.some((r) => kernel.isSame(r, item))) {
39
+ kernel.dispose(item);
40
+ continue;
35
41
  }
42
+ const casted = require_shapeTypes.castResultShapeWithKnownType(item, type);
43
+ results.push(casted);
44
+ if (bucket) bucket.push(casted.wrapped);
45
+ else seen.set(hash, [casted.wrapped]);
46
+ }
47
+ return results;
48
+ }
49
+ /** Hash-index branded sub-shapes for isSame lookup by hash code. */
50
+ function indexByHash(items) {
51
+ const kernel = require_shapeTypes.getKernel();
52
+ const index = /* @__PURE__ */ new Map();
53
+ for (const item of items) {
54
+ const hash = kernel.hashCode(item.wrapped, require_constants.HASH_CODE_MAX);
55
+ const bucket = index.get(hash);
56
+ if (bucket) bucket.push(item);
57
+ else index.set(hash, [item]);
36
58
  }
37
- return wrapAll(results, type);
59
+ return index;
60
+ }
61
+ /** The managed handle matching a raw sub-shape by hash + isSame, or undefined. */
62
+ function findManaged(index, raw, hash) {
63
+ const kernel = require_shapeTypes.getKernel();
64
+ return index.get(hash)?.find((m) => kernel.isSame(m.wrapped, raw));
38
65
  }
39
66
  /**
40
67
  * Build or retrieve the cached edge→faces adjacency map for a parent shape.
41
68
  * Maps edge hash codes to edge-face pairs, storing the edge alongside each
42
69
  * face so facesOfEdge can verify via isSame without re-extracting face edges.
70
+ *
71
+ * The stored handles are the parent's **managed** `getEdges`/`getFaces` handles
72
+ * (owned by the topology cache), never fresh iterated slots — so the map holds
73
+ * no arena slots of its own. The transient per-face edges used only for
74
+ * matching are released immediately.
43
75
  */
44
76
  function getEdgeToFacesMap(parent) {
45
77
  const cache = require_topologyQueryFns.getOrCreateCache(parent);
46
78
  if (cache.edgeToFaces) return cache.edgeToFaces;
47
79
  const kernel = require_shapeTypes.getKernel();
80
+ const faces = require_topologyQueryFns.getFaces(parent);
81
+ const edgeIndex = indexByHash(require_topologyQueryFns.getEdges(parent));
48
82
  const edgeToFaces = /* @__PURE__ */ new Map();
49
- const allFaces = kernel.iterShapes(parent.wrapped, "face");
50
- for (const f of allFaces) {
51
- const edges = kernel.iterShapes(f, "edge");
52
- for (const e of edges) {
53
- const hash = kernel.hashCode(e, require_constants.HASH_CODE_MAX);
54
- let bucket = edgeToFaces.get(hash);
55
- if (!bucket) {
56
- bucket = [];
57
- edgeToFaces.set(hash, bucket);
58
- }
59
- if (!bucket.some((entry) => kernel.isSame(entry.edge, e) && kernel.isSame(entry.face, f))) bucket.push({
60
- edge: e,
61
- face: f
62
- });
83
+ for (const face of faces) for (const rawEdge of kernel.iterShapes(face.wrapped, "edge")) {
84
+ const hash = kernel.hashCode(rawEdge, require_constants.HASH_CODE_MAX);
85
+ const managedEdge = findManaged(edgeIndex, rawEdge, hash);
86
+ kernel.dispose(rawEdge);
87
+ if (!managedEdge) continue;
88
+ let bucket = edgeToFaces.get(hash);
89
+ if (!bucket) {
90
+ bucket = [];
91
+ edgeToFaces.set(hash, bucket);
63
92
  }
93
+ if (!bucket.some((entry) => kernel.isSame(entry.edge, managedEdge.wrapped) && kernel.isSame(entry.face, face.wrapped))) bucket.push({
94
+ edge: managedEdge.wrapped,
95
+ face: face.wrapped
96
+ });
64
97
  }
65
98
  cache.edgeToFaces = edgeToFaces;
66
99
  return edgeToFaces;
67
100
  }
68
101
  /**
69
102
  * Build or retrieve the cached vertex→faces adjacency map for a parent shape —
70
- * the vertex analogue of {@link getEdgeToFacesMap}.
103
+ * the vertex analogue of {@link getEdgeToFacesMap}. Stores the parent's managed
104
+ * `getVertices`/`getFaces` handles and releases the transient per-face vertices.
71
105
  */
72
106
  function getVertexToFacesMap(parent) {
73
107
  const cache = require_topologyQueryFns.getOrCreateCache(parent);
74
108
  if (cache.vertexToFaces) return cache.vertexToFaces;
75
109
  const kernel = require_shapeTypes.getKernel();
110
+ const faces = require_topologyQueryFns.getFaces(parent);
111
+ const vertexIndex = indexByHash(require_topologyQueryFns.getVertices(parent));
76
112
  const vertexToFaces = /* @__PURE__ */ new Map();
77
- for (const f of kernel.iterShapes(parent.wrapped, "face")) for (const v of kernel.iterShapes(f, "vertex")) {
78
- const hash = kernel.hashCode(v, require_constants.HASH_CODE_MAX);
113
+ for (const face of faces) for (const rawVertex of kernel.iterShapes(face.wrapped, "vertex")) {
114
+ const hash = kernel.hashCode(rawVertex, require_constants.HASH_CODE_MAX);
115
+ const managedVertex = findManaged(vertexIndex, rawVertex, hash);
116
+ kernel.dispose(rawVertex);
117
+ if (!managedVertex) continue;
79
118
  let bucket = vertexToFaces.get(hash);
80
119
  if (!bucket) {
81
120
  bucket = [];
82
121
  vertexToFaces.set(hash, bucket);
83
122
  }
84
- if (!bucket.some((entry) => kernel.isSame(entry.vertex, v) && kernel.isSame(entry.face, f))) bucket.push({
85
- vertex: v,
86
- face: f
123
+ if (!bucket.some((entry) => kernel.isSame(entry.vertex, managedVertex.wrapped) && kernel.isSame(entry.face, face.wrapped))) bucket.push({
124
+ vertex: managedVertex.wrapped,
125
+ face: face.wrapped
87
126
  });
88
127
  }
89
128
  cache.vertexToFaces = vertexToFaces;
@@ -216,6 +255,7 @@ function adjacentFaces(parent, face) {
216
255
  }
217
256
  }
218
257
  }
258
+ for (const e of faceEdgeHandles) e[Symbol.dispose]();
219
259
  return wrapAll(neighborRaw, "face");
220
260
  }
221
261
  /**
@@ -240,8 +280,10 @@ function sharedEdges(face1, face2) {
240
280
  bucket.push(e2);
241
281
  }
242
282
  const shared = [];
243
- for (const e1 of edges1) if (edge2Map.get(kernel.hashCode(e1, 2147483647))?.some((e2) => kernel.isSame(e1, e2))) shared.push(e1);
244
- return wrapAll(shared, "edge");
283
+ for (const e1 of edges1) if (edge2Map.get(kernel.hashCode(e1, 2147483647))?.some((e2) => kernel.isSame(e1, e2))) shared.push(require_shapeTypes.castResultShapeWithKnownType(e1, "edge"));
284
+ else kernel.dispose(e1);
285
+ for (const e2 of edges2) kernel.dispose(e2);
286
+ return shared;
245
287
  }
246
288
  //#endregion
247
289
  Object.defineProperty(exports, "adjacentFaces", {
package/dist/brepjs.cjs CHANGED
@@ -17,7 +17,7 @@ const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
17
17
  const require_surfaceBuilders = require("./surfaceBuilders-DUG4Y0qA.cjs");
18
18
  const require_solidBuilders = require("./solidBuilders-CkkgC2se.cjs");
19
19
  const require_healingFns = require("./healingFns-DoJQUwBN.cjs");
20
- const require_threadFns = require("./threadFns-C_BapeNn.cjs");
20
+ const require_threadFns = require("./threadFns-CWIlyEcP.cjs");
21
21
  const require_blueprintSketcher = require("./blueprintSketcher-D5AHgjkT.cjs");
22
22
  const require_helpers = require("./helpers-DKfkqED3.cjs");
23
23
  const require_drawFns = require("./drawFns-Bgug3W7c.cjs");
@@ -29,8 +29,8 @@ const require_importFns = require("./importFns-D8i8O8di.cjs");
29
29
  const require_loftFns = require("./loftFns-BJiGxTys.cjs");
30
30
  const require_cameraFns = require("./cameraFns-taUY1CFZ.cjs");
31
31
  const require_textMetrics = require("./textMetrics-DBdtpVNo.cjs");
32
- const require_adjacencyFns = require("./adjacencyFns-Crb9tLJd.cjs");
33
- const require_refResolveFns = require("./refResolveFns-CT1YEP-7.cjs");
32
+ const require_adjacencyFns = require("./adjacencyFns-Wc3R-UZr.cjs");
33
+ const require_refResolveFns = require("./refResolveFns-AbuzUhGC.cjs");
34
34
  const require_workerPool = require("./workerPool-D30NsiIW.cjs");
35
35
  const require_primitiveFns = require("./primitiveFns-BDdThy3-.cjs");
36
36
  //#region src/topology/shapeBooleans.ts
package/dist/brepjs.js CHANGED
@@ -15,7 +15,7 @@ import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayA
15
15
  import { _ as makeThreePointArc, d as makeCircle, h as makeLine, l as makeBSplineInterpolation, n as fill, r as makeFace, s as assembleWire } from "./surfaceBuilders-B15_8txg.js";
16
16
  import { _ as section$1, b as split$1, d as booleanPipeline, f as cut$2, g as intersect$2, h as fuseAll$2, m as fuse$2, p as cutAll$2, r as makeCylinder, t as makeCompound, v as sectionToFace$1, y as slice$1 } from "./solidBuilders-B_N5miaY.js";
17
17
  import { A as toBufferGeometryData, C as shellWithEvolution, D as getNurbsCurveData, E as fuseAllBisect, M as toLODGeometryData, N as toLODGeometryLevels, O as getNurbsSurfaceData, P as toLineGeometryData, S as intersectWithEvolution, T as cutAllBisect, _ as positionOnCurve, a as healFace, b as filletWithEvolution, c as isValid$1, d as draft$1, f as fillet$1, g as variableFillet, h as thicken$1, i as heal$1, j as toGroupedBufferGeometryData, k as chamferDistAngle, l as solidFromShell, m as shell$1, n as fixSelfIntersection, o as healSolid, p as offset$1, r as fixShape, s as healWire, t as autoHeal, u as chamfer$1, v as chamferWithEvolution, w as checkBoolean, x as fuseWithEvolution, y as cutWithEvolution } from "./healingFns-g8JymEUi.js";
18
- import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as quatMultiply, G as circularPattern, H as removeChild, I as quatRotate, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, N as quatFromAxisAngle, O as prismaticJoint, P as quatFromTo, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, a as deserializeHistory, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, p as serializeHistory, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-BM-VHcSJ.js";
18
+ import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as quatMultiply, G as circularPattern, H as removeChild, I as quatRotate, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, N as quatFromAxisAngle, O as prismaticJoint, P as quatFromTo, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, a as deserializeHistory, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, p as serializeHistory, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-CMdXdlIH.js";
19
19
  import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-cgkF6uCj.js";
20
20
  import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-DzOME9UE.js";
21
21
  import { A as sketchEllipse, 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, _ 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-BksvLjN1.js";
@@ -28,8 +28,8 @@ import { a as revolve$1, c as multiSectionSweep, d as twistExtrude, i as extrude
28
28
  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, n as getFont, o as compoundSketchExtrude, p as sketchRevolve, r as loadFont, s as compoundSketchFace, t as textBlueprints, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-BYz-7-MZ.js";
29
29
  import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-xD28Tsqu.js";
30
30
  import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-yyHcpdUd.js";
31
- import { a as sharedEdges, c as wiresOfFace, i as facesOfVertex, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-BcEHCYK3.js";
32
- import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-xqQ8Z8vC.js";
31
+ import { a as sharedEdges, c as wiresOfFace, i as facesOfVertex, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-CTNUxf0c.js";
32
+ import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-BNzUtX4y.js";
33
33
  import { _ as isSuccessResponse, a as createWorkerClient, c as enqueueTask, d as rejectAll, f as isBatchRequest, g as isOperationRequest, h as isInitRequest, i as registerHandler, l as isEmpty$1, m as isErrorResponse, n as createOperationRegistry, o as createTaskQueue, p as isDisposeRequest, r as createWorkerHandler, s as dequeueTask, t as createWorkerPool, u as pendingCount } from "./workerPool-XcYX2UZ0.js";
34
34
  import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere$1, 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$1, x as subFace, y as solid } from "./primitiveFns-D-hFA6e9.js";
35
35
  //#region \0rolldown/runtime.js
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_threadFns = require("./threadFns-C_BapeNn.cjs");
2
+ const require_threadFns = require("./threadFns-CWIlyEcP.cjs");
3
3
  const require_loftFns = require("./loftFns-BJiGxTys.cjs");
4
4
  exports.addChild = require_threadFns.addChild;
5
5
  exports.addJoint = require_threadFns.addJoint;
@@ -1,3 +1,3 @@
1
- import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-BM-VHcSJ.js";
1
+ import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-CMdXdlIH.js";
2
2
  import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-CK4PP1IR.js";
3
3
  export { addChild, addJoint, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, cylindricalJoint, exportAssemblySTEP, exportURDF, findNode, findStep, forwardKinematics, getShape as getHistoryShape, gridPattern, importURDF, inverseKinematics, jointTrajectory, jointTransform, jointsFromDH, linearPattern, mechanismDOF, modifyStep, planarJoint, prismaticJoint, registerOperation, registerShape, removeChild, replayFrom, replayHistory, revoluteJoint, setJointValue, setJointValues, sphericalJoint, stepCount, stepsFrom, supportExtrude, sweep, thread, twistExtrude, undoLast, updateNode, walkAssembly };
@@ -3,7 +3,7 @@ const require_topologyQueryFns = require("./topologyQueryFns-BJbOwoZm.cjs");
3
3
  const require_faceFns = require("./faceFns-BhBJ_Hsb.cjs");
4
4
  const require_shapeFns = require("./shapeFns-1aqO2bz4.cjs");
5
5
  const require_measureFns = require("./measureFns-DJ1SESSY.cjs");
6
- const require_adjacencyFns = require("./adjacencyFns-Crb9tLJd.cjs");
6
+ const require_adjacencyFns = require("./adjacencyFns-Wc3R-UZr.cjs");
7
7
  //#region src/topology/shapeRef/scoring.ts
8
8
  /**
9
9
  * Default face scorer combining surface type, normal alignment, centroid proximity,
@@ -3,7 +3,7 @@ import { S as vertexPosition, c as getFaces } from "./topologyQueryFns-DfThB5LA.
3
3
  import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-Bm3-D75M.js";
4
4
  import { n as getHashCode } from "./shapeFns-Dqlpy8wm.js";
5
5
  import { n as measureArea, s as measureLength } from "./measureFns-1akKMnXO.js";
6
- import { a as sharedEdges, i as facesOfVertex, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-BcEHCYK3.js";
6
+ import { a as sharedEdges, i as facesOfVertex, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-CTNUxf0c.js";
7
7
  //#region src/topology/shapeRef/scoring.ts
8
8
  /**
9
9
  * Default face scorer combining surface type, normal alignment, centroid proximity,
package/dist/shapeRef.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_refResolveFns = require("./refResolveFns-CT1YEP-7.cjs");
2
+ const require_refResolveFns = require("./refResolveFns-AbuzUhGC.cjs");
3
3
  exports.assignRoles = require_refResolveFns.assignRoles;
4
4
  exports.captureHint = require_refResolveFns.captureHint;
5
5
  exports.createDerivedFaceRef = require_refResolveFns.createDerivedFaceRef;
package/dist/shapeRef.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-xqQ8Z8vC.js";
1
+ import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-BNzUtX4y.js";
2
2
  export { assignRoles, captureHint, createDerivedFaceRef, createEdgeRef, createRef, createVertexRef, defaultScorer, isDerivedFaceRef, isEdgeRef, isFaceRef, isLineageRef, isVertexRef, resolveDerivedFaceRef, resolveEdgeRef, resolveLineageRef, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, updateRoles };
@@ -5,7 +5,7 @@ import { b as fromBREP } from "./faceFns-Bm3-D75M.js";
5
5
  import { s as toBREP } from "./shapeFns-Dqlpy8wm.js";
6
6
  import { h as fuseAll } from "./solidBuilders-B_N5miaY.js";
7
7
  import { t as loft } from "./loftFns-CK4PP1IR.js";
8
- import { c as resolveRefParams } from "./refResolveFns-xqQ8Z8vC.js";
8
+ import { c as resolveRefParams } from "./refResolveFns-BNzUtX4y.js";
9
9
  import { E as wire, h as line } from "./primitiveFns-D-hFA6e9.js";
10
10
  //#region src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
@@ -5,7 +5,7 @@ const require_faceFns = require("./faceFns-BhBJ_Hsb.cjs");
5
5
  const require_shapeFns = require("./shapeFns-1aqO2bz4.cjs");
6
6
  const require_solidBuilders = require("./solidBuilders-CkkgC2se.cjs");
7
7
  const require_loftFns = require("./loftFns-BJiGxTys.cjs");
8
- const require_refResolveFns = require("./refResolveFns-CT1YEP-7.cjs");
8
+ const require_refResolveFns = require("./refResolveFns-AbuzUhGC.cjs");
9
9
  const require_primitiveFns = require("./primitiveFns-BDdThy3-.cjs");
10
10
  //#region src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
package/dist/topology.cjs CHANGED
@@ -6,7 +6,7 @@ const require_curveFns = require("./curveFns-Bb3wuFj4.cjs");
6
6
  const require_meshFns = require("./meshFns-s-c0lABa.cjs");
7
7
  const require_solidBuilders = require("./solidBuilders-CkkgC2se.cjs");
8
8
  const require_healingFns = require("./healingFns-DoJQUwBN.cjs");
9
- const require_adjacencyFns = require("./adjacencyFns-Crb9tLJd.cjs");
9
+ const require_adjacencyFns = require("./adjacencyFns-Wc3R-UZr.cjs");
10
10
  const require_primitiveFns = require("./primitiveFns-BDdThy3-.cjs");
11
11
  exports.addHoles = require_primitiveFns.addHoles;
12
12
  exports.adjacentFaces = require_adjacencyFns.adjacentFaces;
package/dist/topology.js CHANGED
@@ -5,6 +5,6 @@ import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as get
5
5
  import { d as createMeshCache, n as exportSTEP, r as exportSTL, t as exportIGES, u as clearMeshCache } from "./meshFns-Dt93gFGp.js";
6
6
  import { h as fuseAll, p as cutAll } from "./solidBuilders-B_N5miaY.js";
7
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-g8JymEUi.js";
8
- import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-BcEHCYK3.js";
8
+ import { a as sharedEdges, c as wiresOfFace, n as edgesOfFace, o as verticesOfEdge, r as facesOfEdge, t as adjacentFaces } from "./adjacencyFns-CTNUxf0c.js";
9
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-D-hFA6e9.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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "18.118.8",
3
+ "version": "18.118.9",
4
4
  "description": "Web CAD library with pluggable geometry kernel",
5
5
  "keywords": [
6
6
  "cad",