brepjs 18.112.0 → 18.114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/brepjs.js CHANGED
@@ -13,8 +13,8 @@ import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as get
13
13
  import { a as meshEdges$1, c as meshMultiLOD, d as createMeshCache, i as mesh$1, l as buildMeshCacheKey, n as exportSTEP, o as meshLODs, r as exportSTL, s as meshLODsProgressive, t as exportIGES, u as clearMeshCache } from "./meshFns-DbmidUzH.js";
14
14
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
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-rkE-jE90.js";
16
- import { _ as section$1, b as split$1, d as booleanPipeline, f as cut$2, g as intersect$3, 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-C32wXQWG.js";
17
- import { A as edgesOfFace, B as toLODGeometryData, C as shellWithEvolution, D as getNurbsCurveData, E as fuseAllBisect, F as verticesOfFace, H as toLineGeometryData, I as wiresOfFace, L as chamferDistAngle, M as facesOfVertex, N as sharedEdges, O as getNurbsSurfaceData, P as verticesOfEdge, R as toBufferGeometryData, S as intersectWithEvolution, T as cutAllBisect, V as toLODGeometryLevels, _ 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 facesOfEdge, k as adjacentFaces, 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, z as toGroupedBufferGeometryData } from "./healingFns-D00TPE9p.js";
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-C32wXQWG.js";
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-2TJHHDg5.js";
18
18
  import { A as setJointValue, B as findNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as quatRotate, G as gridPattern, H as updateNode, I as addChild, J as createAssembly, K as linearPattern, L as collectShapes, M as sphericalJoint, N as quatFromAxisAngle, O as prismaticJoint, P as quatFromTo, R as countNodes, S as addJoint, T as jointTransform, U as walkAssembly, V as removeChild, W as circularPattern, _ 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 exportAssemblySTEP, 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 createAssemblyNode } from "./threadFns-bCOhVQLb.js";
19
19
  import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-7rtwqUHZ.js";
20
20
  import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-DhJwFrkC.js";
@@ -28,7 +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-BnkWAqwS.js";
29
29
  import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-bk9e0F-T.js";
30
30
  import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-COGYk0LE.js";
31
- import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-ChMnsOAF.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-BYnyXXqt.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-CayDQeug.js";
32
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";
33
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-CBrOyk5S.js";
34
35
  //#region \0rolldown/runtime.js
@@ -1186,276 +1187,6 @@ function withKernelDir(v, fn) {
1186
1187
  }
1187
1188
  }
1188
1189
  //#endregion
1189
- //#region src/topology/shapeRef/roleLookup.ts
1190
- /** Euclidean distance between two points. */
1191
- function distance(a, b) {
1192
- const dx = a[0] - b[0];
1193
- const dy = a[1] - b[1];
1194
- const dz = a[2] - b[2];
1195
- return Math.sqrt(dx * dx + dy * dy + dz * dz);
1196
- }
1197
- /** The role whose tracked hashes include this face (reverse lookup). */
1198
- function roleOfFace(face, origin, roles) {
1199
- const originRoles = roles.get(origin);
1200
- if (!originRoles) return void 0;
1201
- const hash = getHashCode(face);
1202
- for (const [role, hashes] of originRoles) if (hashes.includes(hash)) return role;
1203
- }
1204
- /** Current faces a role resolves to — its tracked successors present in `shape`. */
1205
- function facesForRole(shape, origin, role, roles) {
1206
- const hashes = roles.get(origin)?.get(role);
1207
- if (hashes === void 0 || hashes.length === 0) return [];
1208
- return getFaces(shape).filter((f) => hashes.includes(getHashCode(f)));
1209
- }
1210
- //#endregion
1211
- //#region src/topology/shapeRef/edgeRefFns.ts
1212
- /** Midpoint of an edge's endpoint vertices (a closed edge collapses to one). */
1213
- function endpointMidpoint(verts) {
1214
- if (verts.length === 0) return void 0;
1215
- let x = 0;
1216
- let y = 0;
1217
- let z = 0;
1218
- for (const v of verts) {
1219
- const p = vertexPosition(v);
1220
- x += p[0];
1221
- y += p[1];
1222
- z += p[2];
1223
- }
1224
- const n = verts.length;
1225
- return [
1226
- x / n,
1227
- y / n,
1228
- z / n
1229
- ];
1230
- }
1231
- function captureEdgeHint(edge) {
1232
- const lengthResult = measureLength(edge);
1233
- return {
1234
- entityType: "edge",
1235
- length: lengthResult.ok ? lengthResult.value : void 0,
1236
- midpoint: endpointMidpoint(verticesOfEdge(edge))
1237
- };
1238
- }
1239
- function dedupeEdges(edges) {
1240
- const seen = /* @__PURE__ */ new Set();
1241
- const out = [];
1242
- for (const e of edges) {
1243
- const h = getHashCode(e);
1244
- if (!seen.has(h)) {
1245
- seen.add(h);
1246
- out.push(e);
1247
- }
1248
- }
1249
- return out;
1250
- }
1251
- /** Hint scores closer than this are treated as indistinguishable (→ ambiguous). */
1252
- var HINT_MARGIN$1 = 1e-6;
1253
- /**
1254
- * Pick the candidate edge closest to the hint (length + endpoint midpoint).
1255
- * Returns undefined when it genuinely can't discriminate — the hint carries no
1256
- * signal, or the two best candidates score within {@link HINT_MARGIN} — so the
1257
- * caller can report `ambiguous` rather than committing to an arbitrary edge.
1258
- */
1259
- function bestByHint(candidates, hint) {
1260
- if (hint.length === void 0 && hint.midpoint === void 0) return void 0;
1261
- let best;
1262
- let bestScore = Infinity;
1263
- let secondScore = Infinity;
1264
- for (const edge of candidates) {
1265
- let score = 0;
1266
- if (hint.length !== void 0) {
1267
- const len = measureLength(edge);
1268
- if (len.ok) score += Math.abs(len.value - hint.length);
1269
- }
1270
- if (hint.midpoint !== void 0) {
1271
- const mid = endpointMidpoint(verticesOfEdge(edge));
1272
- if (mid !== void 0) score += distance(hint.midpoint, mid);
1273
- }
1274
- if (score < bestScore) {
1275
- secondScore = bestScore;
1276
- bestScore = score;
1277
- best = edge;
1278
- } else if (score < secondScore) secondScore = score;
1279
- }
1280
- if (best === void 0 || secondScore - bestScore < HINT_MARGIN$1) return void 0;
1281
- return best;
1282
- }
1283
- /**
1284
- * Capture a lineage-based reference to `edge`: its two adjacent faces' roles
1285
- * plus a geometric hint. Returns undefined when the edge doesn't bound two faces
1286
- * (a boundary/degenerate edge) or when either bounding face has no role yet.
1287
- */
1288
- function createEdgeRef(origin, edge, shape, roles) {
1289
- const [faceA, faceB] = facesOfEdge(shape, edge);
1290
- if (faceA === void 0 || faceB === void 0) return void 0;
1291
- const roleA = roleOfFace(faceA, origin, roles);
1292
- const roleB = roleOfFace(faceB, origin, roles);
1293
- if (roleA === void 0 || roleB === void 0) return void 0;
1294
- return {
1295
- origin,
1296
- faceRoles: [roleA, roleB],
1297
- hint: captureEdgeHint(edge)
1298
- };
1299
- }
1300
- /**
1301
- * Resolve an EdgeRef in `shape`: resolve its two face-roles to current faces,
1302
- * then return the edge they share. One shared edge → exact; several (the two
1303
- * faces meet along more than one edge) → disambiguate by hint; none, or a
1304
- * missing bounding face → broken.
1305
- */
1306
- function resolveEdgeRef(ref, roles, shape) {
1307
- const [roleA, roleB] = ref.faceRoles;
1308
- const facesA = facesForRole(shape, ref.origin, roleA, roles);
1309
- const facesB = facesForRole(shape, ref.origin, roleB, roles);
1310
- if (facesA.length === 0 || facesB.length === 0) return {
1311
- ref,
1312
- reason: "not-found"
1313
- };
1314
- const candidates = [];
1315
- for (const a of facesA) for (const b of facesB) candidates.push(...sharedEdges(a, b));
1316
- const unique = dedupeEdges(candidates);
1317
- if (unique.length === 1) {
1318
- const [only] = unique;
1319
- if (only !== void 0) return {
1320
- edge: only,
1321
- confidence: "exact"
1322
- };
1323
- }
1324
- if (unique.length > 1) {
1325
- const best = bestByHint(unique, ref.hint);
1326
- if (best !== void 0) return {
1327
- edge: best,
1328
- confidence: "geometric-fallback"
1329
- };
1330
- return {
1331
- ref,
1332
- reason: "ambiguous",
1333
- candidates: unique
1334
- };
1335
- }
1336
- return {
1337
- ref,
1338
- reason: "not-found"
1339
- };
1340
- }
1341
- //#endregion
1342
- //#region src/topology/shapeRef/vertexRefFns.ts
1343
- /** A corner needs at least this many faces to pin a unique point. */
1344
- var MIN_VERTEX_FACES = 3;
1345
- /** Hint distances closer than this are indistinguishable (→ ambiguous). */
1346
- var HINT_MARGIN = 1e-6;
1347
- /** Hashes of all vertices across `faces`, recording one handle per hash. */
1348
- function vertexHashes(faces, handles) {
1349
- const hashes = /* @__PURE__ */ new Set();
1350
- for (const f of faces) for (const v of verticesOfFace(f)) {
1351
- const h = getHashCode(v);
1352
- hashes.add(h);
1353
- if (!handles.has(h)) handles.set(h, v);
1354
- }
1355
- return hashes;
1356
- }
1357
- function intersect$2(a, b) {
1358
- const out = /* @__PURE__ */ new Set();
1359
- for (const h of a) if (b.has(h)) out.add(h);
1360
- return out;
1361
- }
1362
- /** Vertices present in (a face of) every face-set — the shared corner(s). */
1363
- function commonVertices(faceSets) {
1364
- const handles = /* @__PURE__ */ new Map();
1365
- let common;
1366
- for (const faces of faceSets) {
1367
- const hashes = vertexHashes(faces, handles);
1368
- common = common === void 0 ? hashes : intersect$2(common, hashes);
1369
- }
1370
- if (common === void 0) return [];
1371
- const result = [];
1372
- for (const h of common) {
1373
- const v = handles.get(h);
1374
- if (v !== void 0) result.push(v);
1375
- }
1376
- return result;
1377
- }
1378
- /** Nearest candidate to the hint position; undefined if no signal or a tie. */
1379
- function nearestToHint(vertices, hint) {
1380
- if (hint.position === void 0) return void 0;
1381
- let best;
1382
- let bestDist = Infinity;
1383
- let secondDist = Infinity;
1384
- for (const v of vertices) {
1385
- const d = distance(vertexPosition(v), hint.position);
1386
- if (d < bestDist) {
1387
- secondDist = bestDist;
1388
- bestDist = d;
1389
- best = v;
1390
- } else if (d < secondDist) secondDist = d;
1391
- }
1392
- if (best === void 0 || secondDist - bestDist < HINT_MARGIN) return void 0;
1393
- return best;
1394
- }
1395
- /**
1396
- * Capture a lineage-based reference to `vertex`: the roles of the ≥3 faces
1397
- * meeting at it, plus a position hint. Returns undefined when fewer than three
1398
- * named faces meet there (a 2-face "vertex" is ambiguous — an edge has two).
1399
- */
1400
- function createVertexRef(origin, vertex, shape, roles) {
1401
- const faces = facesOfVertex(shape, vertex);
1402
- if (faces.length < MIN_VERTEX_FACES) return void 0;
1403
- const roleSet = /* @__PURE__ */ new Set();
1404
- for (const f of faces) {
1405
- const role = roleOfFace(f, origin, roles);
1406
- if (role !== void 0) roleSet.add(role);
1407
- }
1408
- if (roleSet.size < MIN_VERTEX_FACES) return void 0;
1409
- return {
1410
- origin,
1411
- faceRoles: [...roleSet].sort(),
1412
- hint: {
1413
- entityType: "vertex",
1414
- position: vertexPosition(vertex)
1415
- }
1416
- };
1417
- }
1418
- /**
1419
- * Resolve a VertexRef in `shape`: gather the current faces of each role, then
1420
- * return the vertex common to all of them. One common vertex → exact; several →
1421
- * disambiguate by hint position; none, or a missing role → broken.
1422
- */
1423
- function resolveVertexRef(ref, roles, shape) {
1424
- const faceSets = [];
1425
- for (const role of ref.faceRoles) {
1426
- const faces = facesForRole(shape, ref.origin, role, roles);
1427
- if (faces.length === 0) return {
1428
- ref,
1429
- reason: "not-found"
1430
- };
1431
- faceSets.push(faces);
1432
- }
1433
- const common = commonVertices(faceSets);
1434
- if (common.length === 1) {
1435
- const [only] = common;
1436
- if (only !== void 0) return {
1437
- vertex: only,
1438
- confidence: "exact"
1439
- };
1440
- }
1441
- if (common.length > 1) {
1442
- const best = nearestToHint(common, ref.hint);
1443
- if (best !== void 0) return {
1444
- vertex: best,
1445
- confidence: "geometric-fallback"
1446
- };
1447
- return {
1448
- ref,
1449
- reason: "ambiguous",
1450
- candidates: common
1451
- };
1452
- }
1453
- return {
1454
- ref,
1455
- reason: "not-found"
1456
- };
1457
- }
1458
- //#endregion
1459
1190
  //#region src/topology/surfaceFns.ts
1460
1191
  /**
1461
1192
  * Surface creation functions — generate faces from height-map grids.
@@ -3784,7 +3515,7 @@ function cutAll(base, tools, options) {
3784
3515
  }
3785
3516
  /** Compute the intersection of two shapes (boolean common). */
3786
3517
  function intersect(a, b, options) {
3787
- return intersect$3(resolve(a), resolve(b), {
3518
+ return intersect$2(resolve(a), resolve(b), {
3788
3519
  ...options,
3789
3520
  unsafe: true
3790
3521
  });
@@ -5901,7 +5632,7 @@ function evalIntersect(node, ctx) {
5901
5632
  if (!a.ok) return a;
5902
5633
  const b = resolveOperand(ctx, node.b, "Intersect.b");
5903
5634
  if (!b.ok) return b;
5904
- return intersect$3(a.value, b.value, boolOptions(node, ctx));
5635
+ return intersect$2(a.value, b.value, boolOptions(node, ctx));
5905
5636
  }
5906
5637
  function resolveAll(ctx, nodes, where) {
5907
5638
  const out = [];
@@ -7056,4 +6787,4 @@ var csg_exports = /* @__PURE__ */ __exportAll({
7056
6787
  withEvaluator: () => withEvaluator
7057
6788
  });
7058
6789
  //#endregion
7059
- export { BaseSketcher2d, BlueprintSketcher, BrepBugError, BrepErrorCode, BrepWrapperError, BrepkitAdapter, CompoundSketch, DEFAULT_CAPABILITIES, DEG2RAD, DisposalScope, EXACT_BREP_CAPABILITIES, FaceSketcher, HASH_CODE_MAX, OK, OcctWasmAdapter, RAD2DEG, Sketch, Sketcher, Sketches, addChild, addHoles, addJoint, addMate, addStep, adjacentFaces, all, andThen, applyGlue, applyMatrix, approximateCurve, as2D, as3D, asTopo, assignRoles, autoHeal, bezier, blueprintToDXF, booleanPipeline, booleans_exports as booleans, boss, box, bsplineApprox, bug, cameraFromPlane, cameraLookAt, captureHint, cast, castShape, castShape3D, chamfer, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkAllInterferences, checkBoolean, checkInterference, circle, circularPattern, classifyPointOnFace, clearMeshCache, clone, closedWire, collect, collectShapes, colorFaces, colorShape, complexExtrude, composeTransforms, compound, compoundSketchExtrude, compoundSketchFace, compoundSketchLoft, compoundSketchRevolve, computationError, computeStraightSkeleton, cone, construction_exports as construction, convexHull, cornerFinder, countNodes, createAssembly, createAssemblyNode, createBlueprint, createCamera, createCompound, createCompoundBlueprint, createDistanceQuery, createEdge, createEdgeRef, createFace, createHandle, createHistory, createKernelHandle, createMeshCache, createNamedPlane, createOperationRegistry, createPlane, createRef, createRegistry, createShell, createSolid, createTaskQueue, createVertex, createVertexRef, createWire, createWorkerClient, createWorkerHandler, createWorkerPool, csg_exports as csg, currentQuality, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, curveAxis, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cut, cut2D, cutAll, cutAllBisect, cutBlueprints, cutWithEvolution, cylinder, cylindricalJoint, defaultScorer, dequeueTask, describe, deserializeDrawing, deserializeHistory, fromBREP as deserializeShape, downcast, draft, draw, drawCircle, drawEllipse, drawFaceOutline, drawParametricFunction, drawPointsInterpolation, drawPolysides, drawProjection, drawRectangle, drawRoundedRectangle, drawSingleCircle, drawSingleEllipse, drawText, drawingChamfer, drawingCut, drawingFillet, drawingFuse, drawingIntersect, drawingToSketchOnPlane, drill, edgeFinder, edgesOfFace, ellipse, ellipseArc, ellipsoid, enqueueTask, err, exportAssemblySTEP, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, exportURDF, extrude, extrudeAll, face, faceAxis, faceCenter, faceFinder, faceGeomType, faceOrientation, facesOfEdge, facesOfVertex, fieldBoolean, fieldContour, fieldOffset, fieldReinit, fieldShell, fill, filledFace, fillet, filletWithEvolution, findFacesByTag, findNode, findStep, fixSelfIntersection, fixShape, flatMap, flatten, flipFaceOrientation, flipOrientation, fontMetrics, forwardKinematics, fromBREP$1 as fromBREP, fromKernelDir, fromKernelPnt, fromKernelVec, fromNullable, fuse, fuse2D, fuseAll, fuseAllBisect, fuseBlueprints, fuseWithEvolution, gearGeometry, getActiveVoxelId, getBounds, getBounds2D, getCompSolids, getCurveType, getDisposalStats, getEdges, getFaceColor, getFaceOrigins, getFaceTags, getFaces, getFont, getHashCode, getShape as getHistoryShape, getKernel, getKernelCapabilities, getKernelTier, getNurbsCurveData, getNurbsSurfaceData, getOrientation, getOrientation2D, getPerformanceStats, getShapeColor, getShapeKind, getShells, getSingleFace, getSolids, getSurfaceType, getTagMetadata, getVertices, getVoxel, getWires, gridPattern, guidedSweep, heal, healFace, healSolid, healWire, helix, hull, importDXF, importGLB, importIGES, importOBJ, importSTEP, importSTL, importSVG, importSVGPathD, importThreeMF, importURDF, init, initFromManifold, initFromOC, initVoxel, innerWires, instance, instanceCount, instanceGrid, instancedMesh, interpolateCurve, intersect, intersect2D, intersectBlueprints, intersectWithEvolution, invalidateShapeCache, inverseKinematics, ioNs_exports as io, ioError, is2D, is3D, isBatchRequest, isChamferRadius, isClosedWire, isCompSolid, isCompound, isDisposeRequest, isEdge, isEmpty, isEqualShape, isErr, isErrorResponse, isFace, isFilletRadius, isInitRequest, isInside2D, isInstanced, isLive, isManifoldShell, isNumber, isOk, isOperationRequest, isOrientedFace, isPlanarFace, isPlanarWire, isProjectionPlane, isEmpty$1 as isQueueEmpty, isSameShape, isShape1D, isShape3D, isShell, isSolid, isSuccessResponse, isValid, isValidSolid, isVertex, isWire, iterCompSolids, iterEdges, iterFaces, iterShells, iterSolids, iterTopo, iterVertices, iterWires, jointTrajectory, jointTransform, jointsFromDH, kernelCall, kernelCallRaw, kernelCallScoped, kernelError, latticeInfill, latticeInfillShape, line, linearPattern, loadFont, loft, loftAll, makeBaseBox, makeExternalGear, makeInternalGear, makePlane, makePlanetaryGear, makeProjectedEdges, manifoldShell, map, mapBoth, mapErr, match, materialize, measureArea, measureCurvatureAt, measureCurvatureAtMid, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, measurement_exports as measurement, mechanismDOF, mesh, meshEdges, meshLODs, meshLODsProgressive, meshMultiLOD, minkowski, mirror, mirror2D, mirrorDrawing, mirrorJoin, modifiers_exports as modifiers, modifyStep, moduleInitError, multiSectionSweep, normalAt, offset, offsetFace, offsetMesh, offsetShape, offsetWire2D, ok, or, orElse, organiseBlueprints, orientedFace, outerWire, patterns_exports as patterns, pendingCount, pipeline, pivotPlane, planarFace, planarJoint, planarWire, planetPlacements, pocket, pointOnSurface, pointsInside, polygon, polyhedron, polysideInnerRadius, polysidesBlueprint, positionOnCurve, prewarm, primitives_exports as primitives, prismaticJoint, projectEdges, projectPointOnFace, query_exports as query, queryError, rectangularPattern, registerHandler, registerKernel, registerKernelTier, registerOperation, registerShape, registerVoxel, rejectAll, removeChild, removeHolesFromFace, repairMesh, replayFrom, replayHistory, resetDisposalStats, resetPerformanceStats, resize, resolve, resolve3D, resolveDirection, resolveEdgeRef, resolvePlane, resolveRef, resolveVertexRef, reverseCurve, revoluteJoint, revolve, roof, rotate, rotate2D, rotateDrawing, roundedRectangleBlueprint, scale, scale2D, scaleDrawing, box$1 as sdfBox, capsule as sdfCapsule, cone$1 as sdfCone, cylinder$1 as sdfCylinder, fieldAxialRamp as sdfFieldAxialRamp, fieldClamp as sdfFieldClamp, fieldConst as sdfFieldConst, fieldFromSdf as sdfFieldFromSdf, fieldRadialRamp as sdfFieldRadialRamp, lattice as sdfLattice, plane as sdfPlane, roundedBox as sdfRoundedBox, sphere as sdfSphere, strutLattice as sdfStrutLattice, sweep as sdfSweep, torus as sdfTorus, section, sectionToFace, serializeHistory, setJointValue, setJointValues, setShapeOrigin, setTagMetadata, sewShells, shape, shapeToMeshInput, shapeType, sharedEdges, shell, shellMesh, shellShape, shellWithEvolution, simplify, sketchCircle, sketchEllipse, sketchExtrude, sketchFace, sketchFaceOffset, sketchHelix, sketchLoft, sketchOnFace2D, sketchOnPlane2D, sketchParametricFunction, sketchPolysides, sketchRectangle, sketchRevolve, sketchRoundedRectangle, sketchSweep, sketchText, sketchWires, sketcherStateError, slice, solid, solidFromShell, solveAssembly, sphere$1 as sphere, sphericalJoint, split, stepCount, stepsFrom, stretch2D, subFace, supportExtrude, supportsConstraintSketch, supportsProjection, surfaceFromGrid, surfaceFromImage, sweep$1 as sweep, tagFaces, tangentArc, tap, tapErr, textBlueprints, textMetrics, thicken, thread, threePointArc, toBREP, toBufferGeometryData, toGroupedBufferGeometryData, toKernelVec, toLODGeometryData, toLODGeometryLevels, toLineGeometryData, toSVGPathD, toVec2, toVec3, torus$1 as torus, tpmsLattice, transformCopy, transforms_exports as transforms, translate, translate2D, translateDrawing, translatePlane, tryCatch, tryCatchAsync, twistExtrude, typeCastError, undoLast, unsupportedError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, updateNode, updateRoles, uvBounds, uvCoordinates, validSolid, validatePlanetary, validationError, variableFillet, vecAdd, vecAngle, vecCross, vecDistance, vecDot, vecEquals, vecIsZero, vecLength, vecLengthSq, vecNegate, vecNormalize, vecProjectToPlane, vecRepr, vecRotate, vecScale, vecSub, vertex, vertexFinder, vertexPosition, verticesOfEdge, verticesOfFace, voxelBoolean, voxelBooleanField, voxelBooleanFieldShapes, voxelBooleanShapes, voxelField, voxelFieldFromShape, walkAssembly, windingNumbers, wire, wireFinder, wireLoop, wiresOfFace, withKernel, withKernelDir, withKernelPnt, withKernelVec, withQuality, withScope, withScopeResult, withScopeResultAsync, withTier, zip as zipResults };
6790
+ export { BaseSketcher2d, BlueprintSketcher, BrepBugError, BrepErrorCode, BrepWrapperError, BrepkitAdapter, CompoundSketch, DEFAULT_CAPABILITIES, DEG2RAD, DisposalScope, EXACT_BREP_CAPABILITIES, FaceSketcher, HASH_CODE_MAX, OK, OcctWasmAdapter, RAD2DEG, Sketch, Sketcher, Sketches, addChild, addHoles, addJoint, addMate, addStep, adjacentFaces, all, andThen, applyGlue, applyMatrix, approximateCurve, as2D, as3D, asTopo, assignRoles, autoHeal, bezier, blueprintToDXF, booleanPipeline, booleans_exports as booleans, boss, box, bsplineApprox, bug, cameraFromPlane, cameraLookAt, captureHint, cast, castShape, castShape3D, chamfer, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkAllInterferences, checkBoolean, checkInterference, circle, circularPattern, classifyPointOnFace, clearMeshCache, clone, closedWire, collect, collectShapes, colorFaces, colorShape, complexExtrude, composeTransforms, compound, compoundSketchExtrude, compoundSketchFace, compoundSketchLoft, compoundSketchRevolve, computationError, computeStraightSkeleton, cone, construction_exports as construction, convexHull, cornerFinder, countNodes, createAssembly, createAssemblyNode, createBlueprint, createCamera, createCompound, createCompoundBlueprint, createDerivedFaceRef, createDistanceQuery, createEdge, createEdgeRef, createFace, createHandle, createHistory, createKernelHandle, createMeshCache, createNamedPlane, createOperationRegistry, createPlane, createRef, createRegistry, createShell, createSolid, createTaskQueue, createVertex, createVertexRef, createWire, createWorkerClient, createWorkerHandler, createWorkerPool, csg_exports as csg, currentQuality, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, curveAxis, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cut, cut2D, cutAll, cutAllBisect, cutBlueprints, cutWithEvolution, cylinder, cylindricalJoint, defaultScorer, dequeueTask, describe, deserializeDrawing, deserializeHistory, fromBREP as deserializeShape, downcast, draft, draw, drawCircle, drawEllipse, drawFaceOutline, drawParametricFunction, drawPointsInterpolation, drawPolysides, drawProjection, drawRectangle, drawRoundedRectangle, drawSingleCircle, drawSingleEllipse, drawText, drawingChamfer, drawingCut, drawingFillet, drawingFuse, drawingIntersect, drawingToSketchOnPlane, drill, edgeFinder, edgesOfFace, ellipse, ellipseArc, ellipsoid, enqueueTask, err, exportAssemblySTEP, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, exportURDF, extrude, extrudeAll, face, faceAxis, faceCenter, faceFinder, faceGeomType, faceOrientation, facesOfEdge, facesOfVertex, fieldBoolean, fieldContour, fieldOffset, fieldReinit, fieldShell, fill, filledFace, fillet, filletWithEvolution, findFacesByTag, findNode, findStep, fixSelfIntersection, fixShape, flatMap, flatten, flipFaceOrientation, flipOrientation, fontMetrics, forwardKinematics, fromBREP$1 as fromBREP, fromKernelDir, fromKernelPnt, fromKernelVec, fromNullable, fuse, fuse2D, fuseAll, fuseAllBisect, fuseBlueprints, fuseWithEvolution, gearGeometry, getActiveVoxelId, getBounds, getBounds2D, getCompSolids, getCurveType, getDisposalStats, getEdges, getFaceColor, getFaceOrigins, getFaceTags, getFaces, getFont, getHashCode, getShape as getHistoryShape, getKernel, getKernelCapabilities, getKernelTier, getNurbsCurveData, getNurbsSurfaceData, getOrientation, getOrientation2D, getPerformanceStats, getShapeColor, getShapeKind, getShells, getSingleFace, getSolids, getSurfaceType, getTagMetadata, getVertices, getVoxel, getWires, gridPattern, guidedSweep, heal, healFace, healSolid, healWire, helix, hull, importDXF, importGLB, importIGES, importOBJ, importSTEP, importSTL, importSVG, importSVGPathD, importThreeMF, importURDF, init, initFromManifold, initFromOC, initVoxel, innerWires, instance, instanceCount, instanceGrid, instancedMesh, interpolateCurve, intersect, intersect2D, intersectBlueprints, intersectWithEvolution, invalidateShapeCache, inverseKinematics, ioNs_exports as io, ioError, is2D, is3D, isBatchRequest, isChamferRadius, isClosedWire, isCompSolid, isCompound, isDerivedFaceRef, isDisposeRequest, isEdge, isEdgeRef, isEmpty, isEqualShape, isErr, isErrorResponse, isFace, isFaceRef, isFilletRadius, isInitRequest, isInside2D, isInstanced, isLineageRef, isLive, isManifoldShell, isNumber, isOk, isOperationRequest, isOrientedFace, isPlanarFace, isPlanarWire, isProjectionPlane, isEmpty$1 as isQueueEmpty, isSameShape, isShape1D, isShape3D, isShell, isSolid, isSuccessResponse, isValid, isValidSolid, isVertex, isVertexRef, isWire, iterCompSolids, iterEdges, iterFaces, iterShells, iterSolids, iterTopo, iterVertices, iterWires, jointTrajectory, jointTransform, jointsFromDH, kernelCall, kernelCallRaw, kernelCallScoped, kernelError, latticeInfill, latticeInfillShape, line, linearPattern, loadFont, loft, loftAll, makeBaseBox, makeExternalGear, makeInternalGear, makePlane, makePlanetaryGear, makeProjectedEdges, manifoldShell, map, mapBoth, mapErr, match, materialize, measureArea, measureCurvatureAt, measureCurvatureAtMid, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, measurement_exports as measurement, mechanismDOF, mesh, meshEdges, meshLODs, meshLODsProgressive, meshMultiLOD, minkowski, mirror, mirror2D, mirrorDrawing, mirrorJoin, modifiers_exports as modifiers, modifyStep, moduleInitError, multiSectionSweep, normalAt, offset, offsetFace, offsetMesh, offsetShape, offsetWire2D, ok, or, orElse, organiseBlueprints, orientedFace, outerWire, patterns_exports as patterns, pendingCount, pipeline, pivotPlane, planarFace, planarJoint, planarWire, planetPlacements, pocket, pointOnSurface, pointsInside, polygon, polyhedron, polysideInnerRadius, polysidesBlueprint, positionOnCurve, prewarm, primitives_exports as primitives, prismaticJoint, projectEdges, projectPointOnFace, query_exports as query, queryError, rectangularPattern, registerHandler, registerKernel, registerKernelTier, registerOperation, registerShape, registerVoxel, rejectAll, removeChild, removeHolesFromFace, repairMesh, replayFrom, replayHistory, resetDisposalStats, resetPerformanceStats, resize, resolve, resolve3D, resolveDerivedFaceRef, resolveDirection, resolveEdgeRef, resolveLineageRef, resolvePlane, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, reverseCurve, revoluteJoint, revolve, roof, rotate, rotate2D, rotateDrawing, roundedRectangleBlueprint, scale, scale2D, scaleDrawing, box$1 as sdfBox, capsule as sdfCapsule, cone$1 as sdfCone, cylinder$1 as sdfCylinder, fieldAxialRamp as sdfFieldAxialRamp, fieldClamp as sdfFieldClamp, fieldConst as sdfFieldConst, fieldFromSdf as sdfFieldFromSdf, fieldRadialRamp as sdfFieldRadialRamp, lattice as sdfLattice, plane as sdfPlane, roundedBox as sdfRoundedBox, sphere as sdfSphere, strutLattice as sdfStrutLattice, sweep as sdfSweep, torus as sdfTorus, section, sectionToFace, serializeHistory, setJointValue, setJointValues, setShapeOrigin, setTagMetadata, sewShells, shape, shapeToMeshInput, shapeType, sharedEdges, shell, shellMesh, shellShape, shellWithEvolution, simplify, sketchCircle, sketchEllipse, sketchExtrude, sketchFace, sketchFaceOffset, sketchHelix, sketchLoft, sketchOnFace2D, sketchOnPlane2D, sketchParametricFunction, sketchPolysides, sketchRectangle, sketchRevolve, sketchRoundedRectangle, sketchSweep, sketchText, sketchWires, sketcherStateError, slice, solid, solidFromShell, solveAssembly, sphere$1 as sphere, sphericalJoint, split, stepCount, stepsFrom, stretch2D, subFace, supportExtrude, supportsConstraintSketch, supportsProjection, surfaceFromGrid, surfaceFromImage, sweep$1 as sweep, tagFaces, tangentArc, tap, tapErr, textBlueprints, textMetrics, thicken, thread, threePointArc, toBREP, toBufferGeometryData, toGroupedBufferGeometryData, toKernelVec, toLODGeometryData, toLODGeometryLevels, toLineGeometryData, toSVGPathD, toVec2, toVec3, torus$1 as torus, tpmsLattice, transformCopy, transforms_exports as transforms, translate, translate2D, translateDrawing, translatePlane, tryCatch, tryCatchAsync, twistExtrude, typeCastError, undoLast, unsupportedError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, updateNode, updateRoles, uvBounds, uvCoordinates, validSolid, validatePlanetary, validationError, variableFillet, vecAdd, vecAngle, vecCross, vecDistance, vecDot, vecEquals, vecIsZero, vecLength, vecLengthSq, vecNegate, vecNormalize, vecProjectToPlane, vecRepr, vecRotate, vecScale, vecSub, vertex, vertexFinder, vertexPosition, verticesOfEdge, verticesOfFace, voxelBoolean, voxelBooleanField, voxelBooleanFieldShapes, voxelBooleanShapes, voxelField, voxelFieldFromShape, walkAssembly, windingNumbers, wire, wireFinder, wireLoop, wiresOfFace, withKernel, withKernelDir, withKernelPnt, withKernelVec, withQuality, withScope, withScopeResult, withScopeResultAsync, withTier, zip as zipResults };
@@ -1,6 +1,6 @@
1
- import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-Dpu6mD3m.js";
1
+ import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, t as castShape, y as isWire } from "./shapeTypes-Dpu6mD3m.js";
2
2
  import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
3
- import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-BeKaWpNm.js";
3
+ import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-BeKaWpNm.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
5
5
  import { v as downcast } from "./faceFns-B86WGqDg.js";
6
6
  import { g as collectInputFaceHashes, v as propagateAllMetadata } from "./shapeFns-DrZOVwHX.js";
@@ -155,249 +155,6 @@ function chamferDistAngle(shape, edges, distance, angleDeg) {
155
155
  return ok(wrapped);
156
156
  }
157
157
  //#endregion
158
- //#region src/topology/adjacencyFns.ts
159
- /**
160
- * Topology adjacency queries — find related sub-shapes within a parent shape.
161
- *
162
- * Uses cached topology extraction and an edge→faces adjacency map
163
- * (built once per parent shape and cached) to avoid redundant WASM calls.
164
- */
165
- function wrapAll(shapes, type) {
166
- return shapes.map((s) => castShapeWithKnownType(s, type));
167
- }
168
- /**
169
- * Iterate sub-shapes of `parentKernel` of the given `type`, deduplicate by
170
- * hash+isSame, and return branded handles of type `T`.
171
- *
172
- * Used by edgesOfFace, wiresOfFace, and verticesOfEdge — all of which need
173
- * the same deduplicated-children pattern on a raw KernelShape.
174
- */
175
- function deduplicatedSubShapes(parentKernel, type) {
176
- const kernel = getKernel();
177
- const items = kernel.iterShapes(parentKernel, type);
178
- const results = [];
179
- const seen = /* @__PURE__ */ new Map();
180
- for (const item of items) {
181
- const hash = kernel.hashCode(item, HASH_CODE_MAX);
182
- const bucket = seen.get(hash);
183
- if (!bucket) {
184
- seen.set(hash, [item]);
185
- results.push(item);
186
- } else if (!bucket.some((r) => kernel.isSame(r, item))) {
187
- bucket.push(item);
188
- results.push(item);
189
- }
190
- }
191
- return wrapAll(results, type);
192
- }
193
- /**
194
- * Build or retrieve the cached edge→faces adjacency map for a parent shape.
195
- * Maps edge hash codes to edge-face pairs, storing the edge alongside each
196
- * face so facesOfEdge can verify via isSame without re-extracting face edges.
197
- */
198
- function getEdgeToFacesMap(parent) {
199
- const cache = getOrCreateCache(parent);
200
- if (cache.edgeToFaces) return cache.edgeToFaces;
201
- const kernel = getKernel();
202
- const edgeToFaces = /* @__PURE__ */ new Map();
203
- const allFaces = kernel.iterShapes(parent.wrapped, "face");
204
- for (const f of allFaces) {
205
- const edges = kernel.iterShapes(f, "edge");
206
- for (const e of edges) {
207
- const hash = kernel.hashCode(e, HASH_CODE_MAX);
208
- let bucket = edgeToFaces.get(hash);
209
- if (!bucket) {
210
- bucket = [];
211
- edgeToFaces.set(hash, bucket);
212
- }
213
- if (!bucket.some((entry) => kernel.isSame(entry.edge, e) && kernel.isSame(entry.face, f))) bucket.push({
214
- edge: e,
215
- face: f
216
- });
217
- }
218
- }
219
- cache.edgeToFaces = edgeToFaces;
220
- return edgeToFaces;
221
- }
222
- /**
223
- * Build or retrieve the cached vertex→faces adjacency map for a parent shape —
224
- * the vertex analogue of {@link getEdgeToFacesMap}.
225
- */
226
- function getVertexToFacesMap(parent) {
227
- const cache = getOrCreateCache(parent);
228
- if (cache.vertexToFaces) return cache.vertexToFaces;
229
- const kernel = getKernel();
230
- const vertexToFaces = /* @__PURE__ */ new Map();
231
- for (const f of kernel.iterShapes(parent.wrapped, "face")) for (const v of kernel.iterShapes(f, "vertex")) {
232
- const hash = kernel.hashCode(v, HASH_CODE_MAX);
233
- let bucket = vertexToFaces.get(hash);
234
- if (!bucket) {
235
- bucket = [];
236
- vertexToFaces.set(hash, bucket);
237
- }
238
- if (!bucket.some((entry) => kernel.isSame(entry.vertex, v) && kernel.isSame(entry.face, f))) bucket.push({
239
- vertex: v,
240
- face: f
241
- });
242
- }
243
- cache.vertexToFaces = vertexToFaces;
244
- return vertexToFaces;
245
- }
246
- /**
247
- * Get all faces adjacent to a given edge within a parent shape.
248
- *
249
- * An edge typically borders exactly two faces in a solid, or one face
250
- * if the edge is on a boundary.
251
- *
252
- * @param parent - The parent shape to search within.
253
- * @param edge - The edge whose adjacent faces to find.
254
- * @returns Array of unique faces containing the given edge.
255
- */
256
- function facesOfEdge(parent, edge) {
257
- const kernel = getKernel();
258
- const edgeToFaces = getEdgeToFacesMap(parent);
259
- const hash = kernel.hashCode(edge.wrapped, HASH_CODE_MAX);
260
- const bucket = edgeToFaces.get(hash) ?? [];
261
- const results = [];
262
- const seen = /* @__PURE__ */ new Map();
263
- for (const entry of bucket) {
264
- if (!kernel.isSame(entry.edge, edge.wrapped)) continue;
265
- const fHash = kernel.hashCode(entry.face, HASH_CODE_MAX);
266
- const fBucket = seen.get(fHash);
267
- if (!fBucket) {
268
- seen.set(fHash, [entry.face]);
269
- results.push(entry.face);
270
- } else if (!fBucket.some((r) => kernel.isSame(r, entry.face))) {
271
- fBucket.push(entry.face);
272
- results.push(entry.face);
273
- }
274
- }
275
- return wrapAll(results, "face");
276
- }
277
- /**
278
- * Get all faces meeting at a vertex (≥3 for a solid corner, fewer on a
279
- * boundary), via the cached vertex→faces map. The vertex equivalent of
280
- * {@link facesOfEdge}, with the same hash-bucket + isSame verification.
281
- *
282
- * @param parent - The parent shape to search within.
283
- * @param vertex - The vertex whose adjacent faces to find.
284
- */
285
- function facesOfVertex(parent, vertex) {
286
- const kernel = getKernel();
287
- const vertexToFaces = getVertexToFacesMap(parent);
288
- const hash = kernel.hashCode(vertex.wrapped, HASH_CODE_MAX);
289
- const bucket = vertexToFaces.get(hash) ?? [];
290
- const results = [];
291
- const seen = /* @__PURE__ */ new Map();
292
- for (const entry of bucket) {
293
- if (!kernel.isSame(entry.vertex, vertex.wrapped)) continue;
294
- const fHash = kernel.hashCode(entry.face, HASH_CODE_MAX);
295
- const fBucket = seen.get(fHash);
296
- if (!fBucket) {
297
- seen.set(fHash, [entry.face]);
298
- results.push(entry.face);
299
- } else if (!fBucket.some((r) => kernel.isSame(r, entry.face))) {
300
- fBucket.push(entry.face);
301
- results.push(entry.face);
302
- }
303
- }
304
- return wrapAll(results, "face");
305
- }
306
- /**
307
- * Get all edges bounding a face.
308
- *
309
- * @param face - The face whose edges to enumerate.
310
- * @returns Array of unique edges forming the face boundary.
311
- */
312
- function edgesOfFace(face) {
313
- return deduplicatedSubShapes(face.wrapped, "edge");
314
- }
315
- /**
316
- * Get all vertices of a face. The vertex equivalent of {@link edgesOfFace}.
317
- *
318
- * @param face - The face whose vertices to enumerate.
319
- */
320
- function verticesOfFace(face) {
321
- return deduplicatedSubShapes(face.wrapped, "vertex");
322
- }
323
- /**
324
- * Get all wires of a face (outer wire + inner hole wires).
325
- * All wires bounding a face are closed by definition.
326
- *
327
- * @param face - The face whose wires to enumerate.
328
- */
329
- function wiresOfFace(face) {
330
- return deduplicatedSubShapes(face.wrapped, "wire");
331
- }
332
- /**
333
- * Get the start and end vertices of an edge.
334
- *
335
- * @param edge - The edge whose vertices to retrieve.
336
- * @returns Array of 1-2 vertices (1 if degenerate/closed, 2 otherwise).
337
- */
338
- function verticesOfEdge(edge) {
339
- return deduplicatedSubShapes(edge.wrapped, "vertex");
340
- }
341
- /**
342
- * Get all faces that share at least one edge with the given face.
343
- *
344
- * The returned list does not include the input face itself.
345
- * Uses the cached edge→faces adjacency map for the parent shape.
346
- *
347
- * @param parent - The parent shape to search within.
348
- * @param face - The face whose neighbors to find.
349
- * @returns Array of unique adjacent faces (excluding the input face).
350
- */
351
- function adjacentFaces(parent, face) {
352
- const kernel = getKernel();
353
- const edgeToFaces = getEdgeToFacesMap(parent);
354
- const faceEdgeHandles = deduplicatedSubShapes(face.wrapped, "edge");
355
- const neighborRaw = [];
356
- const seen = /* @__PURE__ */ new Map();
357
- for (const edgeHandle of faceEdgeHandles) {
358
- const hash = kernel.hashCode(edgeHandle.wrapped, HASH_CODE_MAX);
359
- const entries = edgeToFaces.get(hash) ?? [];
360
- for (const entry of entries) {
361
- if (kernel.isSame(entry.face, face.wrapped)) continue;
362
- const fHash = kernel.hashCode(entry.face, HASH_CODE_MAX);
363
- const bucket = seen.get(fHash);
364
- if (!bucket) {
365
- seen.set(fHash, [entry.face]);
366
- neighborRaw.push(entry.face);
367
- } else if (!bucket.some((r) => kernel.isSame(r, entry.face))) {
368
- bucket.push(entry.face);
369
- neighborRaw.push(entry.face);
370
- }
371
- }
372
- }
373
- return wrapAll(neighborRaw, "face");
374
- }
375
- /**
376
- * Get all edges shared between two faces.
377
- *
378
- * @param face1 - The first face.
379
- * @param face2 - The second face.
380
- * @returns Array of edges present in both faces (via isSame comparison).
381
- */
382
- function sharedEdges(face1, face2) {
383
- const kernel = getKernel();
384
- const edges1 = kernel.iterShapes(face1.wrapped, "edge");
385
- const edges2 = kernel.iterShapes(face2.wrapped, "edge");
386
- const edge2Map = /* @__PURE__ */ new Map();
387
- for (const e2 of edges2) {
388
- const hash = kernel.hashCode(e2, HASH_CODE_MAX);
389
- let bucket = edge2Map.get(hash);
390
- if (!bucket) {
391
- bucket = [];
392
- edge2Map.set(hash, bucket);
393
- }
394
- bucket.push(e2);
395
- }
396
- const shared = [];
397
- for (const e1 of edges1) if (edge2Map.get(kernel.hashCode(e1, 2147483647))?.some((e2) => kernel.isSame(e1, e2))) shared.push(e1);
398
- return wrapAll(shared, "edge");
399
- }
400
- //#endregion
401
158
  //#region src/topology/nurbsFns.ts
402
159
  /**
403
160
  * Extract NURBS data from a BSpline or Bezier edge.
@@ -1437,4 +1194,4 @@ function fixSelfIntersection(wire) {
1437
1194
  }
1438
1195
  }
1439
1196
  //#endregion
1440
- export { edgesOfFace as A, toLODGeometryData as B, shellWithEvolution as C, getNurbsCurveData as D, fuseAllBisect as E, verticesOfFace as F, toLineGeometryData as H, wiresOfFace as I, chamferDistAngle as L, facesOfVertex as M, sharedEdges as N, getNurbsSurfaceData as O, verticesOfEdge as P, toBufferGeometryData as R, intersectWithEvolution as S, cutAllBisect as T, toLODGeometryLevels as V, positionOnCurve as _, healFace as a, filletWithEvolution as b, isValid as c, draft as d, fillet as f, variableFillet as g, thicken as h, heal as i, facesOfEdge as j, adjacentFaces as k, solidFromShell as l, shell as m, fixSelfIntersection as n, healSolid as o, offset as p, fixShape as r, healWire as s, autoHeal as t, chamfer as u, chamferWithEvolution as v, checkBoolean as w, fuseWithEvolution as x, cutWithEvolution as y, toGroupedBufferGeometryData as z };
1197
+ export { toBufferGeometryData as A, shellWithEvolution as C, getNurbsCurveData as D, fuseAllBisect as E, toLODGeometryData as M, toLODGeometryLevels as N, getNurbsSurfaceData as O, toLineGeometryData as P, intersectWithEvolution as S, cutAllBisect as T, positionOnCurve as _, healFace as a, filletWithEvolution as b, isValid as c, draft as d, fillet as f, variableFillet as g, thicken as h, heal as i, toGroupedBufferGeometryData as j, chamferDistAngle as k, solidFromShell as l, shell as m, fixSelfIntersection as n, healSolid as o, offset as p, fixShape as r, healWire as s, autoHeal as t, chamfer as u, chamferWithEvolution as v, checkBoolean as w, fuseWithEvolution as x, cutWithEvolution as y };