diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png index 8f2d5ce6a7..59a109ca40 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png differ diff --git a/src/lang/KclSingleton.ts b/src/lang/KclSingleton.ts index 35294ba4dd..c452a2a6cc 100644 --- a/src/lang/KclSingleton.ts +++ b/src/lang/KclSingleton.ts @@ -452,6 +452,7 @@ export class KclManager { this.lastSuccessfulProgramMemory = execState.memory this.lastSuccessfulOperations = execState.operations } + this.engineCommandManager.updateArtifactGraph(execState.artifactGraph) } cancelAllExecutions() { this._cancelTokens.forEach((_, key) => { diff --git a/src/wasm-lib/kcl/src/execution/artifact.rs b/src/wasm-lib/kcl/src/execution/artifact.rs index 90d04be5e1..dc43676b59 100644 --- a/src/wasm-lib/kcl/src/execution/artifact.rs +++ b/src/wasm-lib/kcl/src/execution/artifact.rs @@ -580,10 +580,7 @@ fn artifacts_to_update( let uuid = artifact_command.cmd_id; let id = ArtifactId::new(uuid); - let Some(response) = responses.get(&uuid) else { - // Response not found or not successful. - return Ok(Vec::new()); - }; + let response = responses.get(&uuid); let cmd = &artifact_command.command; @@ -693,7 +690,7 @@ fn artifacts_to_update( new_path.seg_ids = vec![id]; return_arr.push(Artifact::Path(new_path)); } - if let OkModelingCmdResponse::ClosePath(close_path) = response { + if let Some(OkModelingCmdResponse::ClosePath(close_path)) = response { return_arr.push(Artifact::Solid2d(Solid2d { id: close_path.face_id.into(), path_id, @@ -734,7 +731,7 @@ fn artifacts_to_update( return Ok(return_arr); } ModelingCmd::Loft(loft_cmd) => { - let OkModelingCmdResponse::Loft(_) = response else { + let Some(OkModelingCmdResponse::Loft(_)) = response else { return Ok(Vec::new()); }; let mut return_arr = Vec::new(); @@ -764,7 +761,7 @@ fn artifacts_to_update( return Ok(return_arr); } ModelingCmd::Solid3dGetExtrusionFaceInfo(_) => { - let OkModelingCmdResponse::Solid3dGetExtrusionFaceInfo(face_info) = response else { + let Some(OkModelingCmdResponse::Solid3dGetExtrusionFaceInfo(face_info)) = response else { return Ok(Vec::new()); }; let mut return_arr = Vec::new(); @@ -852,6 +849,10 @@ fn artifacts_to_update( ModelingCmd::Solid3dGetOppositeEdge(_) => SweepEdgeSubType::Opposite, _ => unreachable!(), }; + // We need a response to continue. + if response.is_none() { + return Ok(Vec::new()); + } let face_id = ArtifactId::new(*face_id); let edge_id = ArtifactId::new(*edge_id); let Some(Artifact::Wall(wall)) = artifacts.get(&face_id) else { @@ -867,7 +868,7 @@ fn artifacts_to_update( return Ok(Vec::new()); }; let response_edge_id = match response { - OkModelingCmdResponse::Solid3dGetNextAdjacentEdge(r) => { + Some(OkModelingCmdResponse::Solid3dGetNextAdjacentEdge(r)) => { let Some(edge_id) = r.edge else { return Err(KclError::Internal(KclErrorDetails { message:format!( @@ -878,7 +879,7 @@ fn artifacts_to_update( }; edge_id.into() } - OkModelingCmdResponse::Solid3dGetOppositeEdge(r) => r.edge.into(), + Some(OkModelingCmdResponse::Solid3dGetOppositeEdge(r)) => r.edge.into(), _ => { return Err(KclError::Internal(KclErrorDetails { message:format!( diff --git a/src/wasm-lib/kcl/tests/basic_fillet_cube_next_adjacent/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/basic_fillet_cube_next_adjacent/artifact_graph_flowchart.snap.md index 1a0572e6a3..7c8a2cf759 100644 --- a/src/wasm-lib/kcl/tests/basic_fillet_cube_next_adjacent/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/basic_fillet_cube_next_adjacent/artifact_graph_flowchart.snap.md @@ -24,6 +24,7 @@ flowchart LR 20["SweepEdge Adjacent"] 21["SweepEdge Opposite"] 22["SweepEdge Adjacent"] + 23["EdgeCut Fillet
[202, 284, 0]"] 1 --- 2 2 --- 3 2 --- 4 @@ -57,4 +58,5 @@ flowchart LR 8 --- 20 8 --- 21 8 --- 22 + 16 <--x 23 ``` diff --git a/src/wasm-lib/kcl/tests/basic_fillet_cube_previous_adjacent/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/basic_fillet_cube_previous_adjacent/artifact_graph_flowchart.snap.md index 1a0572e6a3..a45c6fb5ea 100644 --- a/src/wasm-lib/kcl/tests/basic_fillet_cube_previous_adjacent/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/basic_fillet_cube_previous_adjacent/artifact_graph_flowchart.snap.md @@ -24,6 +24,7 @@ flowchart LR 20["SweepEdge Adjacent"] 21["SweepEdge Opposite"] 22["SweepEdge Adjacent"] + 23["EdgeCut Fillet
[202, 288, 0]"] 1 --- 2 2 --- 3 2 --- 4 @@ -57,4 +58,5 @@ flowchart LR 8 --- 20 8 --- 21 8 --- 22 + 18 <--x 23 ```