Only send one SetSceneUnits call (#1981)

We only intended to send this once, at the start of execution. But the execute function is recursive, so it was sending many SetSceneUnits calls.

Fixes https://github.com/KittyCAD/modeling-app/issues/1971
This commit is contained in:
Adam Chalmers
2024-04-01 16:37:05 -05:00
committed by GitHub
parent f850f80de1
commit 76480f1a43
4 changed files with 17 additions and 7 deletions

View File

@ -41,7 +41,8 @@ async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, uuid
let program = parser.ast()?;
let mut mem: kcl_lib::executor::ProgramMemory = Default::default();
let ctx = kcl_lib::executor::ExecutorContext::new(ws, kittycad::types::UnitLength::Mm).await?;
let memory = kcl_lib::executor::execute(program.clone(), &mut mem, kcl_lib::executor::BodyType::Root, &ctx).await?;
let memory =
kcl_lib::executor::execute_outer(program.clone(), &mut mem, kcl_lib::executor::BodyType::Root, &ctx).await?;
// We need to get the sketch ID.
// Get the sketch group ID from memory.