Track artifact commands and operations per-module (#7426)

* Change so that operations are stored per module

* Refactor so that all modeling commands go through ExecState

* Remove unneeded PartialOrd implementations

* Remove artifact_commands from KclError since it was only for debugging

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jonathan Tran
2025-06-10 21:30:48 -04:00
committed by GitHub
parent 851ea28bd3
commit 9a549ff379
479 changed files with 11575323 additions and 11565198 deletions

View File

@ -53,7 +53,9 @@ async fn inner_shell(
for solid in &solids {
// Flush the batch for our fillets/chamfers if there are any.
// If we do not do these for sketch on face, things will fail with face does not exist.
args.flush_batch_for_solids(exec_state, &[solid.clone()]).await?;
exec_state
.flush_batch_for_solids((&args).into(), &[solid.clone()])
.await?;
for tag in &faces {
let extrude_plane_id = tag.get_face_id(solid, exec_state, &args, false).await?;
@ -78,16 +80,17 @@ async fn inner_shell(
)));
}
args.batch_modeling_cmd(
exec_state.next_uuid(),
ModelingCmd::from(mcmd::Solid3dShellFace {
hollow: false,
face_ids,
object_id: solids[0].id,
shell_thickness: LengthUnit(thickness.to_mm()),
}),
)
.await?;
exec_state
.batch_modeling_cmd(
(&args).into(),
ModelingCmd::from(mcmd::Solid3dShellFace {
hollow: false,
face_ids,
object_id: solids[0].id,
shell_thickness: LengthUnit(thickness.to_mm()),
}),
)
.await?;
Ok(solids)
}
@ -109,18 +112,21 @@ async fn inner_hollow(
) -> Result<Box<Solid>, KclError> {
// Flush the batch for our fillets/chamfers if there are any.
// If we do not do these for sketch on face, things will fail with face does not exist.
args.flush_batch_for_solids(exec_state, &[(*solid).clone()]).await?;
exec_state
.flush_batch_for_solids((&args).into(), &[(*solid).clone()])
.await?;
args.batch_modeling_cmd(
exec_state.next_uuid(),
ModelingCmd::from(mcmd::Solid3dShellFace {
hollow: true,
face_ids: Vec::new(), // This is empty because we want to hollow the entire object.
object_id: solid.id,
shell_thickness: LengthUnit(thickness.to_mm()),
}),
)
.await?;
exec_state
.batch_modeling_cmd(
(&args).into(),
ModelingCmd::from(mcmd::Solid3dShellFace {
hollow: true,
face_ids: Vec::new(), // This is empty because we want to hollow the entire object.
object_id: solid.id,
shell_thickness: LengthUnit(thickness.to_mm()),
}),
)
.await?;
Ok(solid)
}