Move artifact graph out of engine connection (#6062)

* cleanups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cleanups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-29 17:25:26 -07:00
committed by GitHub
parent db5ce7ba85
commit 57d78b6094
23 changed files with 229 additions and 247 deletions

View File

@ -766,7 +766,7 @@ export const modelingMachine = setup({
axisOrEdge,
axis,
edge,
engineCommandManager.artifactGraph,
kclManager.artifactGraph,
selection.graphSelections[0]?.artifact
)
if (trap(revolveSketchRes)) return
@ -1123,9 +1123,7 @@ export const modelingMachine = setup({
}),
're-eval nodePaths': assign(({ context: { sketchDetails } }) => {
if (!sketchDetails) return {}
const planeArtifact = [
...engineCommandManager.artifactGraph.values(),
].find(
const planeArtifact = [...kclManager.artifactGraph.values()].find(
(artifact) =>
artifact.type === 'plane' &&
stringifyPathToNode(artifact.codeRef.pathToNode) ===
@ -1134,7 +1132,7 @@ export const modelingMachine = setup({
if (planeArtifact?.type !== 'plane') return {}
const newPaths = getPathsFromPlaneArtifact(
planeArtifact,
engineCommandManager.artifactGraph,
kclManager.artifactGraph,
kclManager.ast
)
return {
@ -1794,7 +1792,7 @@ export const modelingMachine = setup({
node: ast,
pathToNode,
artifact: selection.graphSelections[0].artifact,
artifactGraph: engineCommandManager.artifactGraph,
artifactGraph: kclManager.artifactGraph,
distance:
'variableName' in distance
? distance.variableIdentifierAst
@ -1987,7 +1985,7 @@ export const modelingMachine = setup({
const extrudeLookupResult = getPathToExtrudeForSegmentSelection(
clonedAstForGetExtrude,
cylinder.graphSelections[0],
engineCommandManager.artifactGraph
kclManager.artifactGraph
)
if (err(extrudeLookupResult)) {
return extrudeLookupResult
@ -2249,7 +2247,7 @@ export const modelingMachine = setup({
const extrudeLookupResult = getPathToExtrudeForSegmentSelection(
clonedAstForGetExtrude,
graphSelection,
engineCommandManager.artifactGraph
kclManager.artifactGraph
)
if (err(extrudeLookupResult)) {
return new Error(