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:
@ -12,7 +12,7 @@ use kittycad_modeling_cmds::{
|
||||
use super::{args::TyF64, DEFAULT_TOLERANCE};
|
||||
use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
execution::{types::RuntimeType, ExecState, KclValue, Solid},
|
||||
execution::{types::RuntimeType, ExecState, KclValue, ModelingCmdMeta, Solid},
|
||||
std::{patterns::GeometryTrait, Args},
|
||||
};
|
||||
|
||||
@ -50,11 +50,11 @@ pub(crate) async fn inner_union(
|
||||
}
|
||||
|
||||
// Flush the fillets for the solids.
|
||||
args.flush_batch_for_solids(exec_state, &solids).await?;
|
||||
exec_state.flush_batch_for_solids((&args).into(), &solids).await?;
|
||||
|
||||
let result = args
|
||||
let result = exec_state
|
||||
.send_modeling_cmd(
|
||||
solid_out_id,
|
||||
ModelingCmdMeta::from_args_id(&args, solid_out_id),
|
||||
ModelingCmd::from(mcmd::BooleanUnion {
|
||||
solid_ids: solids.iter().map(|s| s.id).collect(),
|
||||
tolerance: LengthUnit(tolerance.map(|t| t.n).unwrap_or(DEFAULT_TOLERANCE)),
|
||||
@ -115,11 +115,11 @@ pub(crate) async fn inner_intersect(
|
||||
}
|
||||
|
||||
// Flush the fillets for the solids.
|
||||
args.flush_batch_for_solids(exec_state, &solids).await?;
|
||||
exec_state.flush_batch_for_solids((&args).into(), &solids).await?;
|
||||
|
||||
let result = args
|
||||
let result = exec_state
|
||||
.send_modeling_cmd(
|
||||
solid_out_id,
|
||||
ModelingCmdMeta::from_args_id(&args, solid_out_id),
|
||||
ModelingCmd::from(mcmd::BooleanIntersection {
|
||||
solid_ids: solids.iter().map(|s| s.id).collect(),
|
||||
tolerance: LengthUnit(tolerance.map(|t| t.n).unwrap_or(DEFAULT_TOLERANCE)),
|
||||
@ -176,11 +176,13 @@ pub(crate) async fn inner_subtract(
|
||||
|
||||
// Flush the fillets for the solids and the tools.
|
||||
let combined_solids = solids.iter().chain(tools.iter()).cloned().collect::<Vec<Solid>>();
|
||||
args.flush_batch_for_solids(exec_state, &combined_solids).await?;
|
||||
exec_state
|
||||
.flush_batch_for_solids((&args).into(), &combined_solids)
|
||||
.await?;
|
||||
|
||||
let result = args
|
||||
let result = exec_state
|
||||
.send_modeling_cmd(
|
||||
solid_out_id,
|
||||
ModelingCmdMeta::from_args_id(&args, solid_out_id),
|
||||
ModelingCmd::from(mcmd::BooleanSubtract {
|
||||
target_ids: solids.iter().map(|s| s.id).collect(),
|
||||
tool_ids: tools.iter().map(|s| s.id).collect(),
|
||||
|
Reference in New Issue
Block a user