brepjs 18.115.1 → 18.116.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.cjs +2 -2
- package/dist/brepjs.js +2 -2
- package/dist/operations.cjs +1 -1
- package/dist/operations.js +1 -1
- package/dist/{refResolveFns-pRVyjy35.cjs → refResolveFns-BiEBAREW.cjs} +26 -7
- package/dist/{refResolveFns-hEOEcFZ8.js → refResolveFns-Ck6kJzLE.js} +26 -7
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{threadFns-bCOhVQLb.js → threadFns-Dgr2qyJv.js} +20 -3
- package/dist/{threadFns-C8bErjVC.cjs → threadFns-KrG_i9_w.cjs} +19 -2
- package/dist/topology/shapeRef/refResolveFns.d.ts +5 -4
- package/package.json +1 -1
package/dist/brepjs.cjs
CHANGED
|
@@ -17,7 +17,7 @@ const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
|
17
17
|
const require_surfaceBuilders = require("./surfaceBuilders-UyyfZy8w.cjs");
|
|
18
18
|
const require_solidBuilders = require("./solidBuilders-DiUv_mD0.cjs");
|
|
19
19
|
const require_healingFns = require("./healingFns-xLJ6Cp_O.cjs");
|
|
20
|
-
const require_threadFns = require("./threadFns-
|
|
20
|
+
const require_threadFns = require("./threadFns-KrG_i9_w.cjs");
|
|
21
21
|
const require_blueprintSketcher = require("./blueprintSketcher-RK-cH6ps.cjs");
|
|
22
22
|
const require_helpers = require("./helpers-BSLPCflF.cjs");
|
|
23
23
|
const require_drawFns = require("./drawFns-DNxs7PAT.cjs");
|
|
@@ -30,7 +30,7 @@ const require_loftFns = require("./loftFns-fpTmrIdd.cjs");
|
|
|
30
30
|
const require_cameraFns = require("./cameraFns-uo1sZbBT.cjs");
|
|
31
31
|
const require_textMetrics = require("./textMetrics-IC_IoI7l.cjs");
|
|
32
32
|
const require_adjacencyFns = require("./adjacencyFns-d8ZabkvX.cjs");
|
|
33
|
-
const require_refResolveFns = require("./refResolveFns-
|
|
33
|
+
const require_refResolveFns = require("./refResolveFns-BiEBAREW.cjs");
|
|
34
34
|
const require_workerPool = require("./workerPool-D30NsiIW.cjs");
|
|
35
35
|
const require_primitiveFns = require("./primitiveFns-DLIWtQWA.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-rkE-jE90.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-C32wXQWG.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-2TJHHDg5.js";
|
|
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-
|
|
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-Dgr2qyJv.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";
|
|
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-SQIBls6p.js";
|
|
@@ -29,7 +29,7 @@ import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft,
|
|
|
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
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-
|
|
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-Ck6kJzLE.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-CBrOyk5S.js";
|
|
35
35
|
//#region \0rolldown/runtime.js
|
package/dist/operations.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_threadFns = require("./threadFns-
|
|
2
|
+
const require_threadFns = require("./threadFns-KrG_i9_w.cjs");
|
|
3
3
|
const require_loftFns = require("./loftFns-fpTmrIdd.cjs");
|
|
4
4
|
exports.addChild = require_threadFns.addChild;
|
|
5
5
|
exports.addJoint = require_threadFns.addJoint;
|
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as setJointValue, B as findNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as gridPattern, H as updateNode, I as addChild, J as createAssembly, K as linearPattern, L as collectShapes, M as sphericalJoint, O as prismaticJoint, R as countNodes, S as addJoint, T as jointTransform, U as walkAssembly, V as removeChild, W as circularPattern, _ 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 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-
|
|
1
|
+
import { A as setJointValue, B as findNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as gridPattern, H as updateNode, I as addChild, J as createAssembly, K as linearPattern, L as collectShapes, M as sphericalJoint, O as prismaticJoint, R as countNodes, S as addJoint, T as jointTransform, U as walkAssembly, V as removeChild, W as circularPattern, _ 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 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-Dgr2qyJv.js";
|
|
2
2
|
import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-CmShFQlv.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 };
|
|
@@ -739,19 +739,38 @@ function resolveRefIn(ref, shape) {
|
|
|
739
739
|
return resolveLineageRef(ref, rolesFor(ref, shape, /* @__PURE__ */ new Map()), shape);
|
|
740
740
|
}
|
|
741
741
|
/**
|
|
742
|
+
* A plain options object worth recursing into for nested refs — a literal `{}`
|
|
743
|
+
* (or null-prototype) that isn't a lineage ref, a shape handle, or a Date/Map/
|
|
744
|
+
* class instance (which `Object.entries` would silently flatten away).
|
|
745
|
+
*/
|
|
746
|
+
function isPlainOptions(value) {
|
|
747
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
748
|
+
const proto = Object.getPrototypeOf(value);
|
|
749
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
750
|
+
return !("wrapped" in value);
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
742
753
|
* Replace every lineage ref in an operation's params with the live entity it
|
|
743
|
-
* resolves to in `shape`, recursing into arrays (
|
|
744
|
-
*
|
|
745
|
-
* re-derived once per `origin` and
|
|
746
|
-
* replay engine pass stable entity
|
|
754
|
+
* resolves to in `shape`, recursing into arrays (a fillet's edge list) and
|
|
755
|
+
* nested plain objects (a `{ selection: { edge } }` options bag). Refs that
|
|
756
|
+
* can't resolve are left as-is. Role tables are re-derived once per `origin` and
|
|
757
|
+
* reused across the whole params map. Lets a replay engine pass stable entity
|
|
758
|
+
* selections that survive upstream edits.
|
|
747
759
|
*/
|
|
748
760
|
function resolveRefParams(params, shape) {
|
|
749
761
|
const roleCache = /* @__PURE__ */ new Map();
|
|
750
762
|
const resolveValue = (value) => {
|
|
763
|
+
if (isLineageRef(value)) {
|
|
764
|
+
const res = resolveLineageRef(value, rolesFor(value, shape, roleCache), shape);
|
|
765
|
+
return res.ok ? res.entity : value;
|
|
766
|
+
}
|
|
751
767
|
if (Array.isArray(value)) return value.map(resolveValue);
|
|
752
|
-
if (
|
|
753
|
-
|
|
754
|
-
|
|
768
|
+
if (isPlainOptions(value)) {
|
|
769
|
+
const nested = {};
|
|
770
|
+
for (const [k, v] of Object.entries(value)) nested[k] = resolveValue(v);
|
|
771
|
+
return nested;
|
|
772
|
+
}
|
|
773
|
+
return value;
|
|
755
774
|
};
|
|
756
775
|
const out = { ...params };
|
|
757
776
|
for (const [key, value] of Object.entries(params)) out[key] = resolveValue(value);
|
|
@@ -739,19 +739,38 @@ function resolveRefIn(ref, shape) {
|
|
|
739
739
|
return resolveLineageRef(ref, rolesFor(ref, shape, /* @__PURE__ */ new Map()), shape);
|
|
740
740
|
}
|
|
741
741
|
/**
|
|
742
|
+
* A plain options object worth recursing into for nested refs — a literal `{}`
|
|
743
|
+
* (or null-prototype) that isn't a lineage ref, a shape handle, or a Date/Map/
|
|
744
|
+
* class instance (which `Object.entries` would silently flatten away).
|
|
745
|
+
*/
|
|
746
|
+
function isPlainOptions(value) {
|
|
747
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
748
|
+
const proto = Object.getPrototypeOf(value);
|
|
749
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
750
|
+
return !("wrapped" in value);
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
742
753
|
* Replace every lineage ref in an operation's params with the live entity it
|
|
743
|
-
* resolves to in `shape`, recursing into arrays (
|
|
744
|
-
*
|
|
745
|
-
* re-derived once per `origin` and
|
|
746
|
-
* replay engine pass stable entity
|
|
754
|
+
* resolves to in `shape`, recursing into arrays (a fillet's edge list) and
|
|
755
|
+
* nested plain objects (a `{ selection: { edge } }` options bag). Refs that
|
|
756
|
+
* can't resolve are left as-is. Role tables are re-derived once per `origin` and
|
|
757
|
+
* reused across the whole params map. Lets a replay engine pass stable entity
|
|
758
|
+
* selections that survive upstream edits.
|
|
747
759
|
*/
|
|
748
760
|
function resolveRefParams(params, shape) {
|
|
749
761
|
const roleCache = /* @__PURE__ */ new Map();
|
|
750
762
|
const resolveValue = (value) => {
|
|
763
|
+
if (isLineageRef(value)) {
|
|
764
|
+
const res = resolveLineageRef(value, rolesFor(value, shape, roleCache), shape);
|
|
765
|
+
return res.ok ? res.entity : value;
|
|
766
|
+
}
|
|
751
767
|
if (Array.isArray(value)) return value.map(resolveValue);
|
|
752
|
-
if (
|
|
753
|
-
|
|
754
|
-
|
|
768
|
+
if (isPlainOptions(value)) {
|
|
769
|
+
const nested = {};
|
|
770
|
+
for (const [k, v] of Object.entries(value)) nested[k] = resolveValue(v);
|
|
771
|
+
return nested;
|
|
772
|
+
}
|
|
773
|
+
return value;
|
|
755
774
|
};
|
|
756
775
|
const out = { ...params };
|
|
757
776
|
for (const [key, value] of Object.entries(params)) out[key] = resolveValue(value);
|
package/dist/shapeRef.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_refResolveFns = require("./refResolveFns-
|
|
2
|
+
const require_refResolveFns = require("./refResolveFns-BiEBAREW.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-
|
|
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-Ck6kJzLE.js";
|
|
2
2
|
export { assignRoles, captureHint, createDerivedFaceRef, createEdgeRef, createRef, createVertexRef, defaultScorer, isDerivedFaceRef, isEdgeRef, isFaceRef, isLineageRef, isVertexRef, resolveDerivedFaceRef, resolveEdgeRef, resolveLineageRef, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, updateRoles };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { B as createKernelHandle, R as DisposalScope, Y as _usingCtx, Z as getKernel, t as castShape } from "./shapeTypes-Dpu6mD3m.js";
|
|
1
|
+
import { B as createKernelHandle, R as DisposalScope, Y as _usingCtx, Z as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-Dpu6mD3m.js";
|
|
2
2
|
import { A as ok, T as isOk, b as err, d as validationError, n as computationError, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
|
|
3
3
|
import { d as vecNormalize, s as vecIsZero } from "./vecOps-SKPRvPH-.js";
|
|
4
4
|
import { y as fromBREP } from "./faceFns-B86WGqDg.js";
|
|
5
5
|
import { s as toBREP } from "./shapeFns-DrZOVwHX.js";
|
|
6
6
|
import { h as fuseAll } from "./solidBuilders-C32wXQWG.js";
|
|
7
7
|
import { t as loft } from "./loftFns-CmShFQlv.js";
|
|
8
|
+
import { c as resolveRefParams } from "./refResolveFns-Ck6kJzLE.js";
|
|
8
9
|
import { E as wire, h as line } from "./primitiveFns-CBrOyk5S.js";
|
|
9
10
|
//#region src/utils/uuid.ts
|
|
10
11
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
@@ -1300,6 +1301,22 @@ function registerOperation(registry, type, fn) {
|
|
|
1300
1301
|
return { operations: ops };
|
|
1301
1302
|
}
|
|
1302
1303
|
/**
|
|
1304
|
+
* Resolve any lineage refs in a step's params against its input shape, so an
|
|
1305
|
+
* operation re-targets the SAME entity (edge/face/vertex) after an upstream
|
|
1306
|
+
* parameter edit rebuilds the model. The stored step keeps its refs; resolution
|
|
1307
|
+
* happens fresh at replay.
|
|
1308
|
+
*
|
|
1309
|
+
* Only **single-input** steps auto-resolve: with multiple inputs we can't tell
|
|
1310
|
+
* which input a ref targets, and resolving against the wrong one could silently
|
|
1311
|
+
* return an entity from the wrong shape. Multi-input refs (and ref-free or non-3D
|
|
1312
|
+
* cases) are left raw for the operation to resolve against the input it chooses.
|
|
1313
|
+
*/
|
|
1314
|
+
function resolveStepParams(params, inputs) {
|
|
1315
|
+
const [primary, second] = inputs;
|
|
1316
|
+
if (primary !== void 0 && second === void 0 && isShape3D(primary)) return resolveRefParams(params, primary);
|
|
1317
|
+
return { ...params };
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1303
1320
|
* Replay an entire history from scratch using the given registry.
|
|
1304
1321
|
*
|
|
1305
1322
|
* All initial shapes (those not produced by any step) must already be in the
|
|
@@ -1323,7 +1340,7 @@ function replayHistory(history, registry) {
|
|
|
1323
1340
|
inputs.push(shape);
|
|
1324
1341
|
}
|
|
1325
1342
|
try {
|
|
1326
|
-
const output = fn(inputs, step.parameters);
|
|
1343
|
+
const output = fn(inputs, resolveStepParams(step.parameters, inputs));
|
|
1327
1344
|
current = addStep(current, {
|
|
1328
1345
|
id: step.id,
|
|
1329
1346
|
type: step.type,
|
|
@@ -1367,7 +1384,7 @@ function replayFrom(history, stepId, registry) {
|
|
|
1367
1384
|
inputs.push(shape);
|
|
1368
1385
|
}
|
|
1369
1386
|
try {
|
|
1370
|
-
const output = fn(inputs, step.parameters);
|
|
1387
|
+
const output = fn(inputs, resolveStepParams(step.parameters, inputs));
|
|
1371
1388
|
current = addStep(current, {
|
|
1372
1389
|
id: step.id,
|
|
1373
1390
|
type: step.type,
|
|
@@ -5,6 +5,7 @@ const require_faceFns = require("./faceFns-BV0GnTlt.cjs");
|
|
|
5
5
|
const require_shapeFns = require("./shapeFns-ybo0INGL.cjs");
|
|
6
6
|
const require_solidBuilders = require("./solidBuilders-DiUv_mD0.cjs");
|
|
7
7
|
const require_loftFns = require("./loftFns-fpTmrIdd.cjs");
|
|
8
|
+
const require_refResolveFns = require("./refResolveFns-BiEBAREW.cjs");
|
|
8
9
|
const require_primitiveFns = require("./primitiveFns-DLIWtQWA.cjs");
|
|
9
10
|
//#region src/utils/uuid.ts
|
|
10
11
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
@@ -1300,6 +1301,22 @@ function registerOperation(registry, type, fn) {
|
|
|
1300
1301
|
return { operations: ops };
|
|
1301
1302
|
}
|
|
1302
1303
|
/**
|
|
1304
|
+
* Resolve any lineage refs in a step's params against its input shape, so an
|
|
1305
|
+
* operation re-targets the SAME entity (edge/face/vertex) after an upstream
|
|
1306
|
+
* parameter edit rebuilds the model. The stored step keeps its refs; resolution
|
|
1307
|
+
* happens fresh at replay.
|
|
1308
|
+
*
|
|
1309
|
+
* Only **single-input** steps auto-resolve: with multiple inputs we can't tell
|
|
1310
|
+
* which input a ref targets, and resolving against the wrong one could silently
|
|
1311
|
+
* return an entity from the wrong shape. Multi-input refs (and ref-free or non-3D
|
|
1312
|
+
* cases) are left raw for the operation to resolve against the input it chooses.
|
|
1313
|
+
*/
|
|
1314
|
+
function resolveStepParams(params, inputs) {
|
|
1315
|
+
const [primary, second] = inputs;
|
|
1316
|
+
if (primary !== void 0 && second === void 0 && require_shapeTypes.isShape3D(primary)) return require_refResolveFns.resolveRefParams(params, primary);
|
|
1317
|
+
return { ...params };
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1303
1320
|
* Replay an entire history from scratch using the given registry.
|
|
1304
1321
|
*
|
|
1305
1322
|
* All initial shapes (those not produced by any step) must already be in the
|
|
@@ -1323,7 +1340,7 @@ function replayHistory(history, registry) {
|
|
|
1323
1340
|
inputs.push(shape);
|
|
1324
1341
|
}
|
|
1325
1342
|
try {
|
|
1326
|
-
const output = fn(inputs, step.parameters);
|
|
1343
|
+
const output = fn(inputs, resolveStepParams(step.parameters, inputs));
|
|
1327
1344
|
current = addStep(current, {
|
|
1328
1345
|
id: step.id,
|
|
1329
1346
|
type: step.type,
|
|
@@ -1367,7 +1384,7 @@ function replayFrom(history, stepId, registry) {
|
|
|
1367
1384
|
inputs.push(shape);
|
|
1368
1385
|
}
|
|
1369
1386
|
try {
|
|
1370
|
-
const output = fn(inputs, step.parameters);
|
|
1387
|
+
const output = fn(inputs, resolveStepParams(step.parameters, inputs));
|
|
1371
1388
|
current = addStep(current, {
|
|
1372
1389
|
id: step.id,
|
|
1373
1390
|
type: step.type,
|
|
@@ -45,9 +45,10 @@ export declare function resolveLineageRef(ref: LineageRef, roles: RoleTable, sha
|
|
|
45
45
|
export declare function resolveRefIn(ref: LineageRef, shape: Shape3D): LineageResolution;
|
|
46
46
|
/**
|
|
47
47
|
* Replace every lineage ref in an operation's params with the live entity it
|
|
48
|
-
* resolves to in `shape`, recursing into arrays (
|
|
49
|
-
*
|
|
50
|
-
* re-derived once per `origin` and
|
|
51
|
-
* replay engine pass stable entity
|
|
48
|
+
* resolves to in `shape`, recursing into arrays (a fillet's edge list) and
|
|
49
|
+
* nested plain objects (a `{ selection: { edge } }` options bag). Refs that
|
|
50
|
+
* can't resolve are left as-is. Role tables are re-derived once per `origin` and
|
|
51
|
+
* reused across the whole params map. Lets a replay engine pass stable entity
|
|
52
|
+
* selections that survive upstream edits.
|
|
52
53
|
*/
|
|
53
54
|
export declare function resolveRefParams(params: Readonly<Record<string, unknown>>, shape: Shape3D): Record<string, unknown>;
|