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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -300,12 +300,6 @@ extrude001 = extrude(profile001, length = 4)
let first = &result.first().unwrap().2; let first = &result.first().unwrap().2;
let second = &result.last().unwrap().2; let second = &result.last().unwrap().2;
assert!(
first.artifact_commands.len() < second.artifact_commands.len(),
"Second should have all the artifact commands of the first, plus more. first={:?}, second={:?}",
first.artifact_commands.len(),
second.artifact_commands.len()
);
assert!( assert!(
first.artifact_graph.len() < second.artifact_graph.len(), first.artifact_graph.len() < second.artifact_graph.len(),
"Second should have all the artifacts of the first, plus more. first={:?}, second={:?}", "Second should have all the artifacts of the first, plus more. first={:?}, second={:?}",

View File

@ -135,8 +135,10 @@ pub struct KclErrorWithOutputs {
pub non_fatal: Vec<CompilationError>, pub non_fatal: Vec<CompilationError>,
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
pub operations: Vec<Operation>, pub operations: Vec<Operation>,
// TODO: Remove this field. Doing so breaks the ts-rs output for some
// reason.
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
pub artifact_commands: Vec<ArtifactCommand>, pub _artifact_commands: Vec<ArtifactCommand>,
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
pub artifact_graph: ArtifactGraph, pub artifact_graph: ArtifactGraph,
pub filenames: IndexMap<ModuleId, ModulePath>, pub filenames: IndexMap<ModuleId, ModulePath>,
@ -162,7 +164,7 @@ impl KclErrorWithOutputs {
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
operations, operations,
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_commands, _artifact_commands: artifact_commands,
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_graph, artifact_graph,
filenames, filenames,
@ -177,7 +179,7 @@ impl KclErrorWithOutputs {
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
operations: Default::default(), operations: Default::default(),
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_commands: Default::default(), _artifact_commands: Default::default(),
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_graph: Default::default(), artifact_graph: Default::default(),
filenames: Default::default(), filenames: Default::default(),

View File

@ -45,26 +45,6 @@ pub struct ArtifactCommand {
pub command: ModelingCmd, pub command: ModelingCmd,
} }
impl PartialOrd for ArtifactCommand {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
// Order by the source range.
let range = self.range.cmp(&other.range);
if range != std::cmp::Ordering::Equal {
return Some(range);
}
#[cfg(test)]
{
// If the ranges are equal, order by the serde variant.
Some(
crate::variant_name::variant_name(&self.command)
.cmp(&crate::variant_name::variant_name(&other.command)),
)
}
#[cfg(not(test))]
self.cmd_id.partial_cmp(&other.cmd_id)
}
}
pub type DummyPathToNode = Vec<()>; pub type DummyPathToNode = Vec<()>;
fn serialize_dummy_path_to_node<S>(_path_to_node: &DummyPathToNode, serializer: S) -> Result<S::Ok, S::Error> fn serialize_dummy_path_to_node<S>(_path_to_node: &DummyPathToNode, serializer: S) -> Result<S::Ok, S::Error>

View File

@ -111,8 +111,6 @@ impl GlobalState {
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
operations: self.exec_state.artifacts.operations, operations: self.exec_state.artifacts.operations,
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_commands: self.exec_state.artifacts.commands,
#[cfg(feature = "artifact-graph")]
artifact_graph: self.exec_state.artifacts.graph, artifact_graph: self.exec_state.artifacts.graph,
errors: self.exec_state.errors, errors: self.exec_state.errors,
default_planes: ctx.engine.get_default_planes().read().await.clone(), default_planes: ctx.engine.get_default_planes().read().await.clone(),

View File

@ -2,6 +2,8 @@ use indexmap::IndexMap;
use serde::Serialize; use serde::Serialize;
use super::{types::NumericType, ArtifactId, KclValue}; use super::{types::NumericType, ArtifactId, KclValue};
#[cfg(feature = "artifact-graph")]
use crate::parsing::ast::types::{Node, Program};
use crate::{ModuleId, NodePath, SourceRange}; use crate::{ModuleId, NodePath, SourceRange};
/// A CAD modeling operation for display in the feature tree, AKA operations /// A CAD modeling operation for display in the feature tree, AKA operations
@ -37,26 +39,6 @@ pub enum Operation {
GroupEnd, GroupEnd,
} }
/// A way for sorting the operations in the timeline. This is used to sort
/// operations in the timeline and to determine the order of operations.
/// We use this for the multi-threaded snapshotting, so that we can have deterministic
/// output.
impl PartialOrd for Operation {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(match (self, other) {
(Self::StdLibCall { source_range: a, .. }, Self::StdLibCall { source_range: b, .. }) => a.cmp(b),
(Self::StdLibCall { source_range: a, .. }, Self::GroupBegin { source_range: b, .. }) => a.cmp(b),
(Self::StdLibCall { .. }, Self::GroupEnd) => std::cmp::Ordering::Less,
(Self::GroupBegin { source_range: a, .. }, Self::GroupBegin { source_range: b, .. }) => a.cmp(b),
(Self::GroupBegin { source_range: a, .. }, Self::StdLibCall { source_range: b, .. }) => a.cmp(b),
(Self::GroupBegin { .. }, Self::GroupEnd) => std::cmp::Ordering::Less,
(Self::GroupEnd, Self::StdLibCall { .. }) => std::cmp::Ordering::Greater,
(Self::GroupEnd, Self::GroupBegin { .. }) => std::cmp::Ordering::Greater,
(Self::GroupEnd, Self::GroupEnd) => std::cmp::Ordering::Equal,
})
}
}
impl Operation { impl Operation {
/// If the variant is `StdLibCall`, set the `is_error` field. /// If the variant is `StdLibCall`, set the `is_error` field.
pub(crate) fn set_std_lib_call_is_error(&mut self, is_err: bool) { pub(crate) fn set_std_lib_call_is_error(&mut self, is_err: bool) {
@ -65,6 +47,25 @@ impl Operation {
Self::GroupBegin { .. } | Self::GroupEnd => {} Self::GroupBegin { .. } | Self::GroupEnd => {}
} }
} }
#[cfg(feature = "artifact-graph")]
pub(crate) fn fill_node_paths(&mut self, program: &Node<Program>, cached_body_items: usize) {
match self {
Operation::StdLibCall {
node_path,
source_range,
..
}
| Operation::GroupBegin {
node_path,
source_range,
..
} => {
node_path.fill_placeholder(program, cached_body_items, *source_range);
}
Operation::GroupEnd => {}
}
}
} }
#[derive(Debug, Clone, Serialize, PartialEq, ts_rs::TS)] #[derive(Debug, Clone, Serialize, PartialEq, ts_rs::TS)]

View File

@ -11,8 +11,8 @@ use crate::{
memory, memory,
state::ModuleState, state::ModuleState,
types::{NumericType, PrimitiveType, RuntimeType}, types::{NumericType, PrimitiveType, RuntimeType},
BodyType, EnvironmentRef, ExecState, ExecutorContext, KclValue, Metadata, PlaneType, StatementKind, BodyType, EnvironmentRef, ExecState, ExecutorContext, KclValue, Metadata, ModelingCmdMeta, ModuleArtifactState,
TagIdentifier, PlaneType, StatementKind, TagIdentifier,
}, },
fmt, fmt,
modules::{ModuleId, ModulePath, ModuleRepr}, modules::{ModuleId, ModulePath, ModuleRepr},
@ -83,7 +83,7 @@ impl ExecutorContext {
preserve_mem: bool, preserve_mem: bool,
module_id: ModuleId, module_id: ModuleId,
path: &ModulePath, path: &ModulePath,
) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>), KclError> { ) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>, ModuleArtifactState), KclError> {
crate::log::log(format!("enter module {path} {}", exec_state.stack())); crate::log::log(format!("enter module {path} {}", exec_state.stack()));
let mut local_state = ModuleState::new(path.clone(), exec_state.stack().memory.clone(), Some(module_id)); let mut local_state = ModuleState::new(path.clone(), exec_state.stack().memory.clone(), Some(module_id));
@ -108,13 +108,16 @@ impl ExecutorContext {
} else { } else {
exec_state.mut_stack().pop_env() exec_state.mut_stack().pop_env()
}; };
if !preserve_mem { let module_artifacts = if !preserve_mem {
std::mem::swap(&mut exec_state.mod_local, &mut local_state); std::mem::swap(&mut exec_state.mod_local, &mut local_state);
} local_state.artifacts
} else {
Default::default()
};
crate::log::log(format!("leave {path}")); crate::log::log(format!("leave {path}"));
result.map(|result| (result, env_ref, local_state.module_exports)) result.map(|result| (result, env_ref, local_state.module_exports, module_artifacts))
} }
/// Execute an AST's program. /// Execute an AST's program.
@ -450,12 +453,12 @@ impl ExecutorContext {
if matches!(body_type, BodyType::Root) { if matches!(body_type, BodyType::Root) {
// Flush the batch queue. // Flush the batch queue.
self.engine exec_state
.flush_batch( .flush_batch(
ModelingCmdMeta::new(self, SourceRange::new(program.end, program.end, program.module_id)),
// True here tells the engine to flush all the end commands as well like fillets // True here tells the engine to flush all the end commands as well like fillets
// and chamfers where the engine would otherwise eat the ID of the segments. // and chamfers where the engine would otherwise eat the ID of the segments.
true, true,
SourceRange::new(program.end, program.end, program.module_id),
) )
.await?; .await?;
} }
@ -535,12 +538,12 @@ impl ExecutorContext {
let result = match &mut repr { let result = match &mut repr {
ModuleRepr::Root => Err(exec_state.circular_import_error(&path, source_range)), ModuleRepr::Root => Err(exec_state.circular_import_error(&path, source_range)),
ModuleRepr::Kcl(_, Some((_, env_ref, items))) => Ok((*env_ref, items.clone())), ModuleRepr::Kcl(_, Some((_, env_ref, items, _))) => Ok((*env_ref, items.clone())),
ModuleRepr::Kcl(program, cache) => self ModuleRepr::Kcl(program, cache) => self
.exec_module_from_ast(program, module_id, &path, exec_state, source_range, false) .exec_module_from_ast(program, module_id, &path, exec_state, source_range, false)
.await .await
.map(|(val, er, items)| { .map(|(val, er, items, module_artifacts)| {
*cache = Some((val, er, items.clone())); *cache = Some((val, er, items.clone(), module_artifacts.clone()));
(er, items) (er, items)
}), }),
ModuleRepr::Foreign(geom, _) => Err(KclError::new_semantic(KclErrorDetails::new( ModuleRepr::Foreign(geom, _) => Err(KclError::new_semantic(KclErrorDetails::new(
@ -566,28 +569,28 @@ impl ExecutorContext {
let result = match &mut repr { let result = match &mut repr {
ModuleRepr::Root => Err(exec_state.circular_import_error(&path, source_range)), ModuleRepr::Root => Err(exec_state.circular_import_error(&path, source_range)),
ModuleRepr::Kcl(_, Some((val, _, _))) => Ok(val.clone()), ModuleRepr::Kcl(_, Some((val, _, _, _))) => Ok(val.clone()),
ModuleRepr::Kcl(program, cached_items) => { ModuleRepr::Kcl(program, cached_items) => {
let result = self let result = self
.exec_module_from_ast(program, module_id, &path, exec_state, source_range, false) .exec_module_from_ast(program, module_id, &path, exec_state, source_range, false)
.await; .await;
match result { match result {
Ok((val, env, items)) => { Ok((val, env, items, module_artifacts)) => {
*cached_items = Some((val.clone(), env, items)); *cached_items = Some((val.clone(), env, items, module_artifacts));
Ok(val) Ok(val)
} }
Err(e) => Err(e), Err(e) => Err(e),
} }
} }
ModuleRepr::Foreign(_, Some(imported)) => Ok(Some(imported.clone())), ModuleRepr::Foreign(_, Some((imported, _))) => Ok(imported.clone()),
ModuleRepr::Foreign(geom, cached) => { ModuleRepr::Foreign(geom, cached) => {
let result = super::import::send_to_engine(geom.clone(), self) let result = super::import::send_to_engine(geom.clone(), exec_state, self)
.await .await
.map(|geom| Some(KclValue::ImportedGeometry(geom))); .map(|geom| Some(KclValue::ImportedGeometry(geom)));
match result { match result {
Ok(val) => { Ok(val) => {
*cached = val.clone(); *cached = Some((val.clone(), exec_state.mod_local.artifacts.clone()));
Ok(val) Ok(val)
} }
Err(e) => Err(e), Err(e) => Err(e),
@ -609,7 +612,7 @@ impl ExecutorContext {
exec_state: &mut ExecState, exec_state: &mut ExecState,
source_range: SourceRange, source_range: SourceRange,
preserve_mem: bool, preserve_mem: bool,
) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>), KclError> { ) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>, ModuleArtifactState), KclError> {
exec_state.global.mod_loader.enter_module(path); exec_state.global.mod_loader.enter_module(path);
let result = self let result = self
.exec_module_body(program, exec_state, preserve_mem, module_id, path) .exec_module_body(program, exec_state, preserve_mem, module_id, path)

View File

@ -15,7 +15,10 @@ use uuid::Uuid;
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{annotations, typed_path::TypedPath, types::UnitLen, ExecState, ExecutorContext, ImportedGeometry}, execution::{
annotations, typed_path::TypedPath, types::UnitLen, ExecState, ExecutorContext, ImportedGeometry,
ModelingCmdMeta,
},
fs::FileSystem, fs::FileSystem,
parsing::ast::types::{Annotation, Node}, parsing::ast::types::{Annotation, Node},
source_range::SourceRange, source_range::SourceRange,
@ -257,15 +260,22 @@ pub struct PreImportedGeometry {
pub source_range: SourceRange, pub source_range: SourceRange,
} }
pub async fn send_to_engine(pre: PreImportedGeometry, ctxt: &ExecutorContext) -> Result<ImportedGeometry, KclError> { pub async fn send_to_engine(
pre: PreImportedGeometry,
exec_state: &mut ExecState,
ctxt: &ExecutorContext,
) -> Result<ImportedGeometry, KclError> {
let imported_geometry = ImportedGeometry::new( let imported_geometry = ImportedGeometry::new(
pre.id, pre.id,
pre.command.files.iter().map(|f| f.path.to_string()).collect(), pre.command.files.iter().map(|f| f.path.to_string()).collect(),
vec![pre.source_range.into()], vec![pre.source_range.into()],
); );
ctxt.engine exec_state
.async_modeling_cmd(pre.id, pre.source_range, &ModelingCmd::from(pre.command.clone())) .async_modeling_cmd(
ModelingCmdMeta::with_id(ctxt, pre.source_range, pre.id),
&ModelingCmd::from(pre.command.clone()),
)
.await?; .await?;
Ok(imported_geometry) Ok(imported_geometry)

View File

@ -22,8 +22,10 @@ use kcmc::{
}; };
use kittycad_modeling_cmds::{self as kcmc, id::ModelingCmdId}; use kittycad_modeling_cmds::{self as kcmc, id::ModelingCmdId};
pub use memory::EnvironmentRef; pub use memory::EnvironmentRef;
pub(crate) use modeling::ModelingCmdMeta;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
pub(crate) use state::ModuleArtifactState;
pub use state::{ExecState, MetaSettings}; pub use state::{ExecState, MetaSettings};
use uuid::Uuid; use uuid::Uuid;
@ -56,6 +58,7 @@ mod import;
mod import_graph; mod import_graph;
pub(crate) mod kcl_value; pub(crate) mod kcl_value;
mod memory; mod memory;
mod modeling;
mod state; mod state;
pub mod typed_path; pub mod typed_path;
pub(crate) mod types; pub(crate) mod types;
@ -76,9 +79,6 @@ pub struct ExecOutcome {
/// the Feature Tree. /// the Feature Tree.
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
pub operations: Vec<Operation>, pub operations: Vec<Operation>,
/// Output commands to allow building the artifact graph by the caller.
#[cfg(feature = "artifact-graph")]
pub artifact_commands: Vec<ArtifactCommand>,
/// Output artifact graph. /// Output artifact graph.
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
pub artifact_graph: ArtifactGraph, pub artifact_graph: ArtifactGraph,
@ -575,7 +575,7 @@ impl ExecutorContext {
let mut mem = exec_state.stack().clone(); let mut mem = exec_state.stack().clone();
let module_infos = exec_state.global.module_infos.clone(); let module_infos = exec_state.global.module_infos.clone();
let outcome = exec_state.to_mock_exec_outcome(result.0, self).await; let outcome = exec_state.into_mock_exec_outcome(result.0, self).await;
mem.squash_env(result.0); mem.squash_env(result.0);
cache::write_old_memory((mem, module_infos)).await; cache::write_old_memory((mem, module_infos)).await;
@ -773,15 +773,12 @@ impl ExecutorContext {
)) ))
.await; .await;
let outcome = exec_state.to_exec_outcome(result.0, self).await; let outcome = exec_state.into_exec_outcome(result.0, self).await;
Ok(outcome) Ok(outcome)
} }
/// Perform the execution of a program. /// Perform the execution of a program.
/// ///
/// You can optionally pass in some initialization memory for partial
/// execution.
///
/// To access non-fatal errors and warnings, extract them from the `ExecState`. /// To access non-fatal errors and warnings, extract them from the `ExecState`.
pub async fn run( pub async fn run(
&self, &self,
@ -794,9 +791,6 @@ impl ExecutorContext {
/// Perform the execution of a program using a concurrent /// Perform the execution of a program using a concurrent
/// execution model. /// execution model.
/// ///
/// You can optionally pass in some initialization memory for partial
/// execution.
///
/// To access non-fatal errors and warnings, extract them from the `ExecState`. /// To access non-fatal errors and warnings, extract them from the `ExecState`.
pub async fn run_concurrent( pub async fn run_concurrent(
&self, &self,
@ -842,6 +836,8 @@ impl ExecutorContext {
let module_id = *module_id; let module_id = *module_id;
let module_path = module_path.clone(); let module_path = module_path.clone();
let source_range = SourceRange::from(import_stmt); let source_range = SourceRange::from(import_stmt);
// Clone before mutating.
let module_exec_state = exec_state.clone();
self.add_import_module_ops( self.add_import_module_ops(
exec_state, exec_state,
@ -853,7 +849,6 @@ impl ExecutorContext {
); );
let repr = repr.clone(); let repr = repr.clone();
let exec_state = exec_state.clone();
let exec_ctxt = self.clone(); let exec_ctxt = self.clone();
let results_tx = results_tx.clone(); let results_tx = results_tx.clone();
@ -873,11 +868,13 @@ impl ExecutorContext {
result.map(|val| ModuleRepr::Kcl(program.clone(), Some(val))) result.map(|val| ModuleRepr::Kcl(program.clone(), Some(val)))
} }
ModuleRepr::Foreign(geom, _) => { ModuleRepr::Foreign(geom, _) => {
let result = crate::execution::import::send_to_engine(geom.clone(), exec_ctxt) let result = crate::execution::import::send_to_engine(geom.clone(), exec_state, exec_ctxt)
.await .await
.map(|geom| Some(KclValue::ImportedGeometry(geom))); .map(|geom| Some(KclValue::ImportedGeometry(geom)));
result.map(|val| ModuleRepr::Foreign(geom.clone(), val)) result.map(|val| {
ModuleRepr::Foreign(geom.clone(), Some((val, exec_state.mod_local.artifacts.clone())))
})
} }
ModuleRepr::Dummy | ModuleRepr::Root => Err(KclError::new_internal(KclErrorDetails::new( ModuleRepr::Dummy | ModuleRepr::Root => Err(KclError::new_internal(KclErrorDetails::new(
format!("Module {module_path} not found in universe"), format!("Module {module_path} not found in universe"),
@ -889,7 +886,7 @@ impl ExecutorContext {
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
{ {
wasm_bindgen_futures::spawn_local(async move { wasm_bindgen_futures::spawn_local(async move {
let mut exec_state = exec_state; let mut exec_state = module_exec_state;
let exec_ctxt = exec_ctxt; let exec_ctxt = exec_ctxt;
let result = exec_module( let result = exec_module(
@ -911,7 +908,7 @@ impl ExecutorContext {
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
{ {
set.spawn(async move { set.spawn(async move {
let mut exec_state = exec_state; let mut exec_state = module_exec_state;
let exec_ctxt = exec_ctxt; let exec_ctxt = exec_ctxt;
let result = exec_module( let result = exec_module(
@ -964,6 +961,15 @@ impl ExecutorContext {
} }
} }
// Since we haven't technically started executing the root module yet,
// the operations corresponding to the imports will be missing unless we
// track them here.
#[cfg(all(test, feature = "artifact-graph"))]
exec_state
.global
.root_module_artifacts
.extend(exec_state.mod_local.artifacts.clone());
self.inner_run(program, exec_state, preserve_mem).await self.inner_run(program, exec_state, preserve_mem).await
} }
@ -993,6 +999,18 @@ impl ExecutorContext {
Ok((universe, root_imports)) Ok((universe, root_imports))
} }
#[cfg(not(feature = "artifact-graph"))]
fn add_import_module_ops(
&self,
_exec_state: &mut ExecState,
_program: &crate::Program,
_module_id: ModuleId,
_module_path: &ModulePath,
_source_range: SourceRange,
_universe_map: &UniverseMap,
) {
}
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
fn add_import_module_ops( fn add_import_module_ops(
&self, &self,
@ -1042,18 +1060,6 @@ impl ExecutorContext {
} }
} }
#[cfg(not(feature = "artifact-graph"))]
fn add_import_module_ops(
&self,
_exec_state: &mut ExecState,
_program: &crate::Program,
_module_id: ModuleId,
_module_path: &ModulePath,
_source_range: SourceRange,
_universe_map: &UniverseMap,
) {
}
/// Perform the execution of a program. Accept all possible parameters and /// Perform the execution of a program. Accept all possible parameters and
/// output everything. /// output everything.
async fn inner_run( async fn inner_run(
@ -1121,26 +1127,32 @@ impl ExecutorContext {
&ModulePath::Main, &ModulePath::Main,
) )
.await; .await;
#[cfg(all(test, feature = "artifact-graph"))]
let exec_result = exec_result.map(|(_, env_ref, _, module_artifacts)| {
exec_state.global.root_module_artifacts.extend(module_artifacts);
env_ref
});
#[cfg(not(all(test, feature = "artifact-graph")))]
let exec_result = exec_result.map(|(_, env_ref, _, _)| env_ref);
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
{ {
// Fill in NodePath for operations. // Fill in NodePath for operations.
let cached_body_items = exec_state.global.artifacts.cached_body_items(); let cached_body_items = exec_state.global.artifacts.cached_body_items();
for op in exec_state.global.artifacts.operations.iter_mut().skip(start_op) { for op in exec_state.global.artifacts.operations.iter_mut().skip(start_op) {
match op { op.fill_node_paths(program, cached_body_items);
Operation::StdLibCall { }
node_path, #[cfg(test)]
source_range, {
.. for op in exec_state.global.root_module_artifacts.operations.iter_mut() {
op.fill_node_paths(program, cached_body_items);
}
for module in exec_state.global.module_infos.values_mut() {
if let ModuleRepr::Kcl(_, Some((_, _, _, module_artifacts))) = &mut module.repr {
for op in &mut module_artifacts.operations {
op.fill_node_paths(program, cached_body_items);
}
} }
| Operation::GroupBegin {
node_path,
source_range,
..
} => {
node_path.fill_placeholder(program, cached_body_items, *source_range);
}
Operation::GroupEnd => {}
} }
} }
} }
@ -1153,7 +1165,7 @@ impl ExecutorContext {
self.engine.clear_queues().await; self.engine.clear_queues().await;
match exec_state.build_artifact_graph(&self.engine, program).await { match exec_state.build_artifact_graph(&self.engine, program).await {
Ok(_) => exec_result.map(|(_, env_ref, _)| env_ref), Ok(_) => exec_result,
Err(err) => exec_result.and(Err(err)), Err(err) => exec_result.and(Err(err)),
} }
} }

View File

@ -0,0 +1,224 @@
use kcmc::ModelingCmd;
use kittycad_modeling_cmds::{
self as kcmc,
websocket::{ModelingCmdReq, OkWebSocketResponseData},
};
use uuid::Uuid;
#[cfg(feature = "artifact-graph")]
use crate::exec::ArtifactCommand;
use crate::{
exec::{IdGenerator, KclValue},
execution::Solid,
std::Args,
ExecState, ExecutorContext, KclError, SourceRange,
};
/// Context and metadata needed to send a single modeling command.
///
/// Many functions consume Self so that the command ID isn't accidentally reused
/// among multiple modeling commands.
pub(crate) struct ModelingCmdMeta<'a> {
/// The executor context, which contains the engine.
pub ctx: &'a ExecutorContext,
/// The source range of the command, used for error reporting.
pub source_range: SourceRange,
/// The id of the command, if it has been set by the caller or generated.
id: Option<Uuid>,
}
impl<'a> ModelingCmdMeta<'a> {
pub fn new(ctx: &'a ExecutorContext, source_range: SourceRange) -> Self {
ModelingCmdMeta {
ctx,
source_range,
id: None,
}
}
pub fn with_id(ctx: &'a ExecutorContext, source_range: SourceRange, id: Uuid) -> Self {
ModelingCmdMeta {
ctx,
source_range,
id: Some(id),
}
}
pub fn from_args_id(args: &'a Args, id: Uuid) -> Self {
ModelingCmdMeta {
ctx: &args.ctx,
source_range: args.source_range,
id: Some(id),
}
}
pub fn id(&mut self, id_generator: &mut IdGenerator) -> Uuid {
if let Some(id) = self.id {
return id;
}
let id = id_generator.next_uuid();
self.id = Some(id);
id
}
}
impl<'a> From<&'a Args> for ModelingCmdMeta<'a> {
fn from(args: &'a Args) -> Self {
ModelingCmdMeta::new(&args.ctx, args.source_range)
}
}
impl ExecState {
/// Add a modeling command to the batch but don't fire it right away.
pub(crate) async fn batch_modeling_cmd(
&mut self,
mut meta: ModelingCmdMeta<'_>,
cmd: ModelingCmd,
) -> Result<(), crate::errors::KclError> {
let id = meta.id(self.id_generator());
#[cfg(feature = "artifact-graph")]
self.push_command(ArtifactCommand {
cmd_id: id,
range: meta.source_range,
command: cmd.clone(),
});
meta.ctx.engine.batch_modeling_cmd(id, meta.source_range, &cmd).await
}
/// Add multiple modeling commands to the batch but don't fire them right
/// away.
pub(crate) async fn batch_modeling_cmds(
&mut self,
meta: ModelingCmdMeta<'_>,
cmds: &[ModelingCmdReq],
) -> Result<(), crate::errors::KclError> {
#[cfg(feature = "artifact-graph")]
for cmd_req in cmds {
self.push_command(ArtifactCommand {
cmd_id: *cmd_req.cmd_id.as_ref(),
range: meta.source_range,
command: cmd_req.cmd.clone(),
});
}
meta.ctx.engine.batch_modeling_cmds(meta.source_range, cmds).await
}
/// Add a modeling command to the batch that gets executed at the end of the
/// file. This is good for something like fillet or chamfer where the engine
/// would eat the path id if we executed it right away.
pub(crate) async fn batch_end_cmd(
&mut self,
mut meta: ModelingCmdMeta<'_>,
cmd: ModelingCmd,
) -> Result<(), crate::errors::KclError> {
let id = meta.id(self.id_generator());
// TODO: The order of the tracking of these doesn't match the order that
// they're sent to the engine.
#[cfg(feature = "artifact-graph")]
self.push_command(ArtifactCommand {
cmd_id: id,
range: meta.source_range,
command: cmd.clone(),
});
meta.ctx.engine.batch_end_cmd(id, meta.source_range, &cmd).await
}
/// Send the modeling cmd and wait for the response.
pub(crate) async fn send_modeling_cmd(
&mut self,
mut meta: ModelingCmdMeta<'_>,
cmd: ModelingCmd,
) -> Result<OkWebSocketResponseData, KclError> {
let id = meta.id(self.id_generator());
#[cfg(feature = "artifact-graph")]
self.push_command(ArtifactCommand {
cmd_id: id,
range: meta.source_range,
command: cmd.clone(),
});
meta.ctx.engine.send_modeling_cmd(id, meta.source_range, &cmd).await
}
/// Send the modeling cmd async and don't wait for the response.
/// Add it to our list of async commands.
pub(crate) async fn async_modeling_cmd(
&mut self,
mut meta: ModelingCmdMeta<'_>,
cmd: &ModelingCmd,
) -> Result<(), crate::errors::KclError> {
let id = meta.id(self.id_generator());
#[cfg(feature = "artifact-graph")]
self.push_command(ArtifactCommand {
cmd_id: id,
range: meta.source_range,
command: cmd.clone(),
});
meta.ctx.engine.async_modeling_cmd(id, meta.source_range, cmd).await
}
/// Force flush the batch queue.
pub(crate) async fn flush_batch(
&mut self,
meta: ModelingCmdMeta<'_>,
// Whether or not to flush the end commands as well.
// We only do this at the very end of the file.
batch_end: bool,
) -> Result<OkWebSocketResponseData, KclError> {
meta.ctx.engine.flush_batch(batch_end, meta.source_range).await
}
/// Flush just the fillets and chamfers for this specific SolidSet.
pub(crate) async fn flush_batch_for_solids(
&mut self,
meta: ModelingCmdMeta<'_>,
solids: &[Solid],
) -> Result<(), KclError> {
// Make sure we don't traverse sketches more than once.
let mut traversed_sketches = Vec::new();
// Collect all the fillet/chamfer ids for the solids.
let mut ids = Vec::new();
for solid in solids {
// We need to traverse the solids that share the same sketch.
let sketch_id = solid.sketch.id;
if !traversed_sketches.contains(&sketch_id) {
// Find all the solids on the same shared sketch.
ids.extend(
self.stack()
.walk_call_stack()
.filter(|v| matches!(v, KclValue::Solid { value } if value.sketch.id == sketch_id))
.flat_map(|v| match v {
KclValue::Solid { value } => value.get_all_edge_cut_ids(),
_ => unreachable!(),
}),
);
traversed_sketches.push(sketch_id);
}
ids.extend(solid.get_all_edge_cut_ids());
}
// We can return early if there are no fillets or chamfers.
if ids.is_empty() {
return Ok(());
}
// We want to move these fillets and chamfers from batch_end to batch so they get executed
// before what ever we call next.
for id in ids {
// Pop it off the batch_end and add it to the batch.
let Some(item) = meta.ctx.engine.batch_end().write().await.shift_remove(&id) else {
// It might be in the batch already.
continue;
};
// Add it to the batch.
meta.ctx.engine.batch().write().await.push(item);
}
// Run flush.
// Yes, we do need to actually flush the batch here, or references will fail later.
self.flush_batch(meta, false).await?;
Ok(())
}
}

View File

@ -3,7 +3,9 @@ use std::sync::Arc;
use anyhow::Result; use anyhow::Result;
use indexmap::IndexMap; use indexmap::IndexMap;
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
use kittycad_modeling_cmds::websocket::WebSocketResponse; use kcmc::websocket::WebSocketResponse;
#[cfg(feature = "artifact-graph")]
use kittycad_modeling_cmds as kcmc;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use uuid::Uuid; use uuid::Uuid;
@ -50,6 +52,8 @@ pub(super) struct GlobalState {
pub errors: Vec<CompilationError>, pub errors: Vec<CompilationError>,
#[cfg_attr(not(feature = "artifact-graph"), allow(dead_code))] #[cfg_attr(not(feature = "artifact-graph"), allow(dead_code))]
pub artifacts: ArtifactState, pub artifacts: ArtifactState,
#[cfg_attr(not(all(test, feature = "artifact-graph")), expect(dead_code))]
pub root_module_artifacts: ModuleArtifactState,
} }
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
@ -77,6 +81,20 @@ pub(super) struct ArtifactState {
#[derive(Debug, Clone, Default)] #[derive(Debug, Clone, Default)]
pub(super) struct ArtifactState {} pub(super) struct ArtifactState {}
/// Artifact state for a single module.
#[cfg(all(test, feature = "artifact-graph"))]
#[derive(Debug, Clone, Default, PartialEq, Serialize)]
pub struct ModuleArtifactState {
/// Outgoing engine commands.
pub commands: Vec<ArtifactCommand>,
/// Operations that have been performed in execution order.
pub operations: Vec<Operation>,
}
#[cfg(not(all(test, feature = "artifact-graph")))]
#[derive(Debug, Clone, Default, PartialEq, Serialize)]
pub struct ModuleArtifactState {}
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub(super) struct ModuleState { pub(super) struct ModuleState {
/// The id generator for this module. /// The id generator for this module.
@ -96,6 +114,7 @@ pub(super) struct ModuleState {
pub settings: MetaSettings, pub settings: MetaSettings,
pub(super) explicit_length_units: bool, pub(super) explicit_length_units: bool,
pub(super) path: ModulePath, pub(super) path: ModulePath,
pub artifacts: ModuleArtifactState,
} }
impl ExecState { impl ExecState {
@ -133,7 +152,7 @@ impl ExecState {
/// Convert to execution outcome when running in WebAssembly. We want to /// Convert to execution outcome when running in WebAssembly. We want to
/// reduce the amount of data that crosses the WASM boundary as much as /// reduce the amount of data that crosses the WASM boundary as much as
/// possible. /// possible.
pub async fn to_exec_outcome(self, main_ref: EnvironmentRef, ctx: &ExecutorContext) -> ExecOutcome { pub async fn into_exec_outcome(self, main_ref: EnvironmentRef, ctx: &ExecutorContext) -> ExecOutcome {
// Fields are opt-in so that we don't accidentally leak private internal // Fields are opt-in so that we don't accidentally leak private internal
// state when we add more to ExecState. // state when we add more to ExecState.
ExecOutcome { ExecOutcome {
@ -142,22 +161,18 @@ impl ExecState {
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
operations: self.global.artifacts.operations, operations: self.global.artifacts.operations,
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_commands: self.global.artifacts.commands,
#[cfg(feature = "artifact-graph")]
artifact_graph: self.global.artifacts.graph, artifact_graph: self.global.artifacts.graph,
errors: self.global.errors, errors: self.global.errors,
default_planes: ctx.engine.get_default_planes().read().await.clone(), default_planes: ctx.engine.get_default_planes().read().await.clone(),
} }
} }
pub async fn to_mock_exec_outcome(self, main_ref: EnvironmentRef, ctx: &ExecutorContext) -> ExecOutcome { pub async fn into_mock_exec_outcome(self, main_ref: EnvironmentRef, ctx: &ExecutorContext) -> ExecOutcome {
ExecOutcome { ExecOutcome {
variables: self.mod_local.variables(main_ref), variables: self.mod_local.variables(main_ref),
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
operations: Default::default(), operations: Default::default(),
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
artifact_commands: Default::default(),
#[cfg(feature = "artifact-graph")]
artifact_graph: Default::default(), artifact_graph: Default::default(),
errors: self.global.errors, errors: self.global.errors,
filenames: Default::default(), filenames: Default::default(),
@ -188,12 +203,22 @@ impl ExecState {
} }
pub(crate) fn push_op(&mut self, op: Operation) { pub(crate) fn push_op(&mut self, op: Operation) {
#[cfg(all(test, feature = "artifact-graph"))]
self.mod_local.artifacts.operations.push(op.clone());
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
self.global.artifacts.operations.push(op); self.global.artifacts.operations.push(op);
#[cfg(not(feature = "artifact-graph"))] #[cfg(not(feature = "artifact-graph"))]
drop(op); drop(op);
} }
#[cfg(feature = "artifact-graph")]
pub(crate) fn push_command(&mut self, command: ArtifactCommand) {
#[cfg(all(test, feature = "artifact-graph"))]
self.mod_local.artifacts.commands.push(command);
#[cfg(not(all(test, feature = "artifact-graph")))]
drop(command);
}
pub(super) fn next_module_id(&self) -> ModuleId { pub(super) fn next_module_id(&self) -> ModuleId {
ModuleId::from_usize(self.global.path_to_source_id.len()) ModuleId::from_usize(self.global.path_to_source_id.len())
} }
@ -241,6 +266,21 @@ impl ExecState {
self.global.module_infos.get(&id) self.global.module_infos.get(&id)
} }
#[cfg(all(test, feature = "artifact-graph"))]
pub(crate) fn modules(&self) -> &ModuleInfoMap {
&self.global.module_infos
}
#[cfg(all(test, feature = "artifact-graph"))]
pub(crate) fn operations(&self) -> &[Operation] {
&self.global.artifacts.operations
}
#[cfg(all(test, feature = "artifact-graph"))]
pub(crate) fn root_module_artifact_state(&self) -> &ModuleArtifactState {
&self.global.root_module_artifacts
}
pub fn current_default_units(&self) -> NumericType { pub fn current_default_units(&self) -> NumericType {
NumericType::Default { NumericType::Default {
len: self.length_unit(), len: self.length_unit(),
@ -349,6 +389,7 @@ impl GlobalState {
path_to_source_id: Default::default(), path_to_source_id: Default::default(),
module_infos: Default::default(), module_infos: Default::default(),
artifacts: Default::default(), artifacts: Default::default(),
root_module_artifacts: Default::default(),
mod_loader: Default::default(), mod_loader: Default::default(),
errors: Default::default(), errors: Default::default(),
id_to_source: Default::default(), id_to_source: Default::default(),
@ -388,6 +429,15 @@ impl ArtifactState {
} }
} }
impl ModuleArtifactState {
/// When self is a cached state, extend it with new state.
#[cfg(all(test, feature = "artifact-graph"))]
pub(crate) fn extend(&mut self, other: ModuleArtifactState) {
self.commands.extend(other.commands);
self.operations.extend(other.operations);
}
}
impl ModuleState { impl ModuleState {
pub(super) fn new(path: ModulePath, memory: Arc<ProgramMemory>, module_id: Option<ModuleId>) -> Self { pub(super) fn new(path: ModulePath, memory: Arc<ProgramMemory>, module_id: Option<ModuleId>) -> Self {
ModuleState { ModuleState {
@ -403,6 +453,7 @@ impl ModuleState {
default_angle_units: Default::default(), default_angle_units: Default::default(),
kcl_version: "0.1".to_owned(), kcl_version: "0.1".to_owned(),
}, },
artifacts: Default::default(),
} }
} }

View File

@ -104,6 +104,16 @@ impl TypedPath {
} }
} }
#[cfg(not(target_arch = "wasm32"))]
pub fn strip_prefix(&self, base: impl AsRef<std::path::Path>) -> Result<Self, std::path::StripPrefixError> {
self.0.strip_prefix(base).map(|p| TypedPath(p.to_path_buf()))
}
#[cfg(not(target_arch = "wasm32"))]
pub fn canonicalize(&self) -> Result<Self, std::io::Error> {
self.0.canonicalize().map(|p| TypedPath(p.to_path_buf()))
}
pub fn to_string_lossy(&self) -> String { pub fn to_string_lossy(&self) -> String {
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
{ {

View File

@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
exec::KclValue, exec::KclValue,
execution::{typed_path::TypedPath, EnvironmentRef, PreImportedGeometry}, execution::{typed_path::TypedPath, EnvironmentRef, ModuleArtifactState, PreImportedGeometry},
fs::{FileManager, FileSystem}, fs::{FileManager, FileSystem},
parsing::ast::types::{ImportPath, Node, Program}, parsing::ast::types::{ImportPath, Node, Program},
source_range::SourceRange, source_range::SourceRange,
@ -131,8 +131,11 @@ impl ModuleInfo {
pub enum ModuleRepr { pub enum ModuleRepr {
Root, Root,
// AST, memory, exported names // AST, memory, exported names
Kcl(Node<Program>, Option<(Option<KclValue>, EnvironmentRef, Vec<String>)>), Kcl(
Foreign(PreImportedGeometry, Option<KclValue>), Node<Program>,
Option<(Option<KclValue>, EnvironmentRef, Vec<String>, ModuleArtifactState)>,
),
Foreign(PreImportedGeometry, Option<(Option<KclValue>, ModuleArtifactState)>),
Dummy, Dummy,
} }

View File

@ -3,13 +3,18 @@ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
use indexmap::IndexMap;
use insta::rounded_redaction; use insta::rounded_redaction;
use crate::{errors::KclError, ModuleId}; use crate::{
errors::KclError,
execution::{EnvironmentRef, ModuleArtifactState},
ExecOutcome, ExecState, ExecutorContext, ModuleId,
};
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
use crate::{ use crate::{
exec::ArtifactCommand,
execution::{ArtifactGraph, Operation}, execution::{ArtifactGraph, Operation},
modules::{ModulePath, ModuleRepr},
}; };
mod kcl_samples; mod kcl_samples;
@ -19,8 +24,7 @@ mod kcl_samples;
struct Test { struct Test {
/// The name of the test. /// The name of the test.
name: String, name: String,
/// The name of the KCL file that's the entry point, e.g. "main.kcl", in the /// The KCL file that's the entry point, e.g. "main.kcl", in the `input_dir`.
/// `input_dir`.
entry_point: PathBuf, entry_point: PathBuf,
/// Input KCL files are in this directory. /// Input KCL files are in this directory.
input_dir: PathBuf, input_dir: PathBuf,
@ -34,6 +38,9 @@ struct Test {
pub(crate) const RENDERED_MODEL_NAME: &str = "rendered_model.png"; pub(crate) const RENDERED_MODEL_NAME: &str = "rendered_model.png";
#[cfg(feature = "artifact-graph")]
const REPO_ROOT: &str = "../..";
impl Test { impl Test {
fn new(name: &str) -> Self { fn new(name: &str) -> Self {
Self { Self {
@ -52,6 +59,75 @@ impl Test {
} }
} }
impl ExecState {
/// Same as [`Self::into_exec_outcome`], but also returns the module state.
async fn into_test_exec_outcome(
self,
main_ref: EnvironmentRef,
ctx: &ExecutorContext,
project_directory: &Path,
) -> (ExecOutcome, IndexMap<String, ModuleArtifactState>) {
let module_state = self.to_module_state(project_directory);
let outcome = self.into_exec_outcome(main_ref, ctx).await;
(outcome, module_state)
}
#[cfg(not(feature = "artifact-graph"))]
fn to_module_state(&self, _project_directory: &Path) -> IndexMap<String, ModuleArtifactState> {
Default::default()
}
/// The keys of the map are the module paths. Can't use `ModulePath` since
/// it needs to be converted to a string to be a JSON object key. The paths
/// need to be relative so that generating locally works in CI.
#[cfg(feature = "artifact-graph")]
fn to_module_state(&self, _project_directory: &Path) -> IndexMap<String, ModuleArtifactState> {
let project_directory = std::path::Path::new(REPO_ROOT)
.canonicalize()
.unwrap_or_else(|_| panic!("Failed to canonicalize project directory: {REPO_ROOT}"));
let mut module_state = IndexMap::new();
for info in self.modules().values() {
let relative_path = relative_module_path(&info.path, &project_directory).unwrap_or_else(|err| {
panic!(
"Failed to get relative module path for {:?} in {:?}; caused by {err:?}",
&info.path, project_directory
)
});
match &info.repr {
ModuleRepr::Root => {
module_state.insert(relative_path, self.root_module_artifact_state().clone());
}
ModuleRepr::Kcl(_, None) => {
module_state.insert(relative_path, Default::default());
}
ModuleRepr::Kcl(_, Some((_, _, _, module_artifacts))) => {
module_state.insert(relative_path, module_artifacts.clone());
}
ModuleRepr::Foreign(_, Some((_, module_artifacts))) => {
module_state.insert(relative_path, module_artifacts.clone());
}
ModuleRepr::Foreign(_, None) | ModuleRepr::Dummy => {}
}
}
module_state
}
}
#[cfg(feature = "artifact-graph")]
fn relative_module_path(module_path: &ModulePath, abs_project_directory: &Path) -> Result<String, std::io::Error> {
match module_path {
ModulePath::Main => Ok("main".to_owned()),
ModulePath::Local { value: path } => {
let abs_path = path.canonicalize()?;
abs_path
.strip_prefix(abs_project_directory)
.map(|p| p.to_string_lossy())
.map_err(|_| std::io::Error::other(format!("Failed to strip prefix from module path {abs_path:?}")))
}
ModulePath::Std { value } => Ok(format!("std::{value}")),
}
}
fn assert_snapshot<F, R>(test: &Test, operation: &str, f: F) fn assert_snapshot<F, R>(test: &Test, operation: &str, f: F)
where where
F: FnOnce() -> R, F: FnOnce() -> R,
@ -181,7 +257,7 @@ async fn execute_test(test: &Test, render_to_png: bool, export_step: bool) {
panic!("Step data was empty"); panic!("Step data was empty");
} }
} }
let outcome = exec_state.to_exec_outcome(env_ref, &ctx).await; let (outcome, module_state) = exec_state.into_test_exec_outcome(env_ref, &ctx, &test.input_dir).await;
let mem_result = catch_unwind(AssertUnwindSafe(|| { let mem_result = catch_unwind(AssertUnwindSafe(|| {
assert_snapshot(test, "Variables in memory after executing", || { assert_snapshot(test, "Variables in memory after executing", || {
@ -202,13 +278,10 @@ async fn execute_test(test: &Test, render_to_png: bool, export_step: bool) {
}) })
})); }));
#[cfg(not(feature = "artifact-graph"))]
drop(module_state);
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
assert_common_snapshots( assert_artifact_snapshots(test, module_state, outcome.operations, outcome.artifact_graph);
test,
outcome.operations,
outcome.artifact_commands,
outcome.artifact_graph,
);
mem_result.unwrap(); mem_result.unwrap();
} }
Err(e) => { Err(e) => {
@ -238,7 +311,23 @@ async fn execute_test(test: &Test, render_to_png: bool, export_step: bool) {
})); }));
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
assert_common_snapshots(test, error.operations, error.artifact_commands, error.artifact_graph); {
let global_operations = if !error.operations.is_empty() {
error.operations
} else if let Some(exec_state) = &e.exec_state {
// Non-fatal compilation errors don't have artifact
// output attached, so we need to get it from
// ExecState.
exec_state.operations().to_vec()
} else {
Vec::new()
};
let module_state = e
.exec_state
.map(|e| e.to_module_state(&test.input_dir))
.unwrap_or_default();
assert_artifact_snapshots(test, module_state, global_operations, error.artifact_graph);
}
err_result.unwrap(); err_result.unwrap();
} }
e => { e => {
@ -252,56 +341,44 @@ async fn execute_test(test: &Test, render_to_png: bool, export_step: bool) {
} }
} }
/// Assert snapshots that should happen both when KCL execution succeeds and /// Assert snapshots for artifacts that should happen both when KCL execution
/// when it results in an error. /// succeeds and when it results in an error.
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
fn assert_common_snapshots( fn assert_artifact_snapshots(
test: &Test, test: &Test,
operations: Vec<Operation>, module_state: IndexMap<String, ModuleArtifactState>,
artifact_commands: Vec<ArtifactCommand>, global_operations: Vec<Operation>,
artifact_graph: ArtifactGraph, artifact_graph: ArtifactGraph,
) { ) {
let operations = { let module_operations = module_state
// Make the operations deterministic by sorting them by their module ID, .iter()
// then by their range. .map(|(path, s)| (path, &s.operations))
let mut operations = operations.clone(); .collect::<IndexMap<_, _>>();
operations.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal));
operations
};
let artifact_commands = {
// Due to our newfound concurrency, we're going to mess with the
// artifact_commands a bit -- we're going to maintain the order,
// but only for a given module ID. This means the artifact_commands
// is no longer meaningful, but it is deterministic and will hopefully
// catch meaningful changes in behavior.
// We sort by the source range, like we do for the operations.
let mut artifact_commands = artifact_commands.clone();
artifact_commands.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal));
artifact_commands
};
let result1 = catch_unwind(AssertUnwindSafe(|| { let result1 = catch_unwind(AssertUnwindSafe(|| {
assert_snapshot(test, "Operations executed", || { assert_snapshot(test, "Operations executed", || {
insta::assert_json_snapshot!("ops", operations, { insta::assert_json_snapshot!("ops", module_operations, {
"[].*.unlabeledArg.*.value.**[].from[]" => rounded_redaction(3), ".*[].*.unlabeledArg.*.value.**[].from[]" => rounded_redaction(3),
"[].*.unlabeledArg.*.value.**[].to[]" => rounded_redaction(3), ".*[].*.unlabeledArg.*.value.**[].to[]" => rounded_redaction(3),
"[].**.value.value" => rounded_redaction(3), ".*[].**.value.value" => rounded_redaction(3),
"[].*.labeledArgs.*.value.**[].from[]" => rounded_redaction(3), ".*[].*.labeledArgs.*.value.**[].from[]" => rounded_redaction(3),
"[].*.labeledArgs.*.value.**[].to[]" => rounded_redaction(3), ".*[].*.labeledArgs.*.value.**[].to[]" => rounded_redaction(3),
".**.sourceRange" => Vec::new(), ".**.sourceRange" => Vec::new(),
".**.functionSourceRange" => Vec::new(), ".**.functionSourceRange" => Vec::new(),
".**.moduleId" => 0, ".**.moduleId" => 0,
}); });
}) })
})); }));
let module_commands = module_state
.iter()
.map(|(path, s)| (path, &s.commands))
.collect::<IndexMap<_, _>>();
let result2 = catch_unwind(AssertUnwindSafe(|| { let result2 = catch_unwind(AssertUnwindSafe(|| {
assert_snapshot(test, "Artifact commands", || { assert_snapshot(test, "Artifact commands", || {
insta::assert_json_snapshot!("artifact_commands", artifact_commands, { insta::assert_json_snapshot!("artifact_commands", module_commands, {
"[].command.**.value" => rounded_redaction(3), ".*[].command.**.value" => rounded_redaction(3),
"[].command.**.x" => rounded_redaction(3), ".*[].command.**.x" => rounded_redaction(3),
"[].command.**.y" => rounded_redaction(3), ".*[].command.**.y" => rounded_redaction(3),
"[].command.**.z" => rounded_redaction(3), ".*[].command.**.z" => rounded_redaction(3),
".**.range" => Vec::new(), ".**.range" => Vec::new(),
}); });
}) })
@ -337,6 +414,25 @@ fn assert_common_snapshots(
result1.unwrap(); result1.unwrap();
result2.unwrap(); result2.unwrap();
result3.unwrap(); result3.unwrap();
// The global operations should be a superset of the main module. But it
// won't always be a superset of the operations of all modules.
let repo_root = std::path::Path::new(REPO_ROOT).canonicalize().unwrap();
let root_string: String = test
.entry_point
.canonicalize()
.unwrap_or_else(|_| panic!("Should be able to canonicalize the entry point {:?}", &test.entry_point))
.strip_prefix(&repo_root)
.expect("Repo root dir should be a prefix of the entry point")
.to_string_lossy()
.into_owned();
let main_operations = module_operations
.get(&root_string)
.expect("Main module state not found");
assert!(
global_operations.len() >= main_operations.len(),
"global_operations={global_operations:#?}, main_operations={main_operations:#?}"
);
} }
mod cube { mod cube {

View File

@ -106,17 +106,18 @@ async fn inner_appearance(
a: 100.0, a: 100.0,
}; };
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::ObjectSetMaterialParamsPbr { (&args).into(),
object_id: solid_id, ModelingCmd::from(mcmd::ObjectSetMaterialParamsPbr {
color, object_id: solid_id,
metalness: metalness.unwrap_or_default() as f32 / 100.0, color,
roughness: roughness.unwrap_or_default() as f32 / 100.0, metalness: metalness.unwrap_or_default() as f32 / 100.0,
ambient_occlusion: 0.0, roughness: roughness.unwrap_or_default() as f32 / 100.0,
}), ambient_occlusion: 0.0,
) }),
.await?; )
.await?;
// Idk if we want to actually modify the memory for the colors, but I'm not right now since // Idk if we want to actually modify the memory for the colors, but I'm not right now since
// I can't think of a use case for it. // I can't think of a use case for it.

View File

@ -1,14 +1,10 @@
use std::num::NonZeroU32; use std::num::NonZeroU32;
use anyhow::Result; use anyhow::Result;
use kcmc::{
websocket::{ModelingCmdReq, OkWebSocketResponseData},
ModelingCmd,
};
use kittycad_modeling_cmds as kcmc;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::Serialize; use serde::Serialize;
use super::fillet::EdgeReference;
pub use crate::execution::fn_call::Args; pub use crate::execution::fn_call::Args;
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
@ -28,8 +24,6 @@ use crate::{
ModuleId, ModuleId,
}; };
use super::fillet::EdgeReference;
const ERROR_STRING_SKETCH_TO_SOLID_HELPER: &str = const ERROR_STRING_SKETCH_TO_SOLID_HELPER: &str =
"You can convert a sketch (2D) into a Solid (3D) by calling a function like `extrude` or `revolve`"; "You can convert a sketch (2D) into a Solid (3D) by calling a function like `extrude` or `revolve`";
@ -277,36 +271,7 @@ impl Args {
}) })
} }
// Add a modeling command to the batch but don't fire it right away. // TODO: Move this to the modeling module.
pub(crate) async fn batch_modeling_cmd(
&self,
id: uuid::Uuid,
cmd: ModelingCmd,
) -> Result<(), crate::errors::KclError> {
self.ctx.engine.batch_modeling_cmd(id, self.source_range, &cmd).await
}
// Add multiple modeling commands to the batch but don't fire them right away.
pub(crate) async fn batch_modeling_cmds(&self, cmds: &[ModelingCmdReq]) -> Result<(), crate::errors::KclError> {
self.ctx.engine.batch_modeling_cmds(self.source_range, cmds).await
}
// Add a modeling commandSolid> to the batch that gets executed at the end of the file.
// This is good for something like fillet or chamfer where the engine would
// eat the path id if we executed it right away.
pub(crate) async fn batch_end_cmd(&self, id: uuid::Uuid, cmd: ModelingCmd) -> Result<(), crate::errors::KclError> {
self.ctx.engine.batch_end_cmd(id, self.source_range, &cmd).await
}
/// Send the modeling cmd and wait for the response.
pub(crate) async fn send_modeling_cmd(
&self,
id: uuid::Uuid,
cmd: ModelingCmd,
) -> Result<OkWebSocketResponseData, KclError> {
self.ctx.engine.send_modeling_cmd(id, self.source_range, &cmd).await
}
fn get_tag_info_from_memory<'a, 'e>( fn get_tag_info_from_memory<'a, 'e>(
&'a self, &'a self,
exec_state: &'e mut ExecState, exec_state: &'e mut ExecState,
@ -330,6 +295,7 @@ impl Args {
} }
} }
// TODO: Move this to the modeling module.
pub(crate) fn get_tag_engine_info<'a, 'e>( pub(crate) fn get_tag_engine_info<'a, 'e>(
&'a self, &'a self,
exec_state: &'e mut ExecState, exec_state: &'e mut ExecState,
@ -345,6 +311,7 @@ impl Args {
self.get_tag_info_from_memory(exec_state, tag) self.get_tag_info_from_memory(exec_state, tag)
} }
// TODO: Move this to the modeling module.
fn get_tag_engine_info_check_surface<'a, 'e>( fn get_tag_engine_info_check_surface<'a, 'e>(
&'a self, &'a self,
exec_state: &'e mut ExecState, exec_state: &'e mut ExecState,
@ -362,63 +329,6 @@ impl Args {
self.get_tag_info_from_memory(exec_state, tag) self.get_tag_info_from_memory(exec_state, tag)
} }
/// Flush just the fillets and chamfers for this specific SolidSet.
#[allow(clippy::vec_box)]
pub(crate) async fn flush_batch_for_solids(
&self,
exec_state: &mut ExecState,
solids: &[Solid],
) -> Result<(), KclError> {
// Make sure we don't traverse sketches more than once.
let mut traversed_sketches = Vec::new();
// Collect all the fillet/chamfer ids for the solids.
let mut ids = Vec::new();
for solid in solids {
// We need to traverse the solids that share the same sketch.
let sketch_id = solid.sketch.id;
if !traversed_sketches.contains(&sketch_id) {
// Find all the solids on the same shared sketch.
ids.extend(
exec_state
.stack()
.walk_call_stack()
.filter(|v| matches!(v, KclValue::Solid { value } if value.sketch.id == sketch_id))
.flat_map(|v| match v {
KclValue::Solid { value } => value.get_all_edge_cut_ids(),
_ => unreachable!(),
}),
);
traversed_sketches.push(sketch_id);
}
ids.extend(solid.get_all_edge_cut_ids());
}
// We can return early if there are no fillets or chamfers.
if ids.is_empty() {
return Ok(());
}
// We want to move these fillets and chamfers from batch_end to batch so they get executed
// before what ever we call next.
for id in ids {
// Pop it off the batch_end and add it to the batch.
let Some(item) = self.ctx.engine.batch_end().write().await.shift_remove(&id) else {
// It might be in the batch already.
continue;
};
// Add it to the batch.
self.ctx.engine.batch().write().await.push(item);
}
// Run flush.
// Yes, we do need to actually flush the batch here, or references will fail later.
self.ctx.engine.flush_batch(false, self.source_range).await?;
Ok(())
}
pub(crate) fn make_kcl_val_from_point(&self, p: [f64; 2], ty: NumericType) -> Result<KclValue, KclError> { pub(crate) fn make_kcl_val_from_point(&self, p: [f64; 2], ty: NumericType) -> Result<KclValue, KclError> {
let meta = Metadata { let meta = Metadata {
source_range: self.source_range, source_range: self.source_range,
@ -448,6 +358,7 @@ impl Args {
) )
} }
// TODO: Move this to the modeling module.
pub(crate) async fn get_adjacent_face_to_tag( pub(crate) async fn get_adjacent_face_to_tag(
&self, &self,
exec_state: &mut ExecState, exec_state: &mut ExecState,

View File

@ -7,7 +7,10 @@ use kittycad_modeling_cmds as kcmc;
use super::args::TyF64; use super::args::TyF64;
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{types::RuntimeType, ChamferSurface, EdgeCut, ExecState, ExtrudeSurface, GeoMeta, KclValue, Solid}, execution::{
types::RuntimeType, ChamferSurface, EdgeCut, ExecState, ExtrudeSurface, GeoMeta, KclValue, ModelingCmdMeta,
Solid,
},
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{fillet::EdgeReference, Args}, std::{fillet::EdgeReference, Args},
}; };
@ -52,20 +55,21 @@ async fn inner_chamfer(
}; };
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_end_cmd( exec_state
id, .batch_end_cmd(
ModelingCmd::from(mcmd::Solid3dFilletEdge { ModelingCmdMeta::from_args_id(&args, id),
edge_id: None, ModelingCmd::from(mcmd::Solid3dFilletEdge {
edge_ids: vec![edge_id], edge_id: None,
extra_face_ids: vec![], edge_ids: vec![edge_id],
strategy: Default::default(), extra_face_ids: vec![],
object_id: solid.id, strategy: Default::default(),
radius: LengthUnit(length.to_mm()), object_id: solid.id,
tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future. radius: LengthUnit(length.to_mm()),
cut_type: CutType::Chamfer, tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future.
}), cut_type: CutType::Chamfer,
) }),
.await?; )
.await?;
solid.edge_cuts.push(EdgeCut::Chamfer { solid.edge_cuts.push(EdgeCut::Chamfer {
id, id,

View File

@ -16,7 +16,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{NumericType, PrimitiveType, RuntimeType}, types::{NumericType, PrimitiveType, RuntimeType},
ExecState, GeometryWithImportedGeometry, KclValue, Sketch, Solid, ExecState, GeometryWithImportedGeometry, KclValue, ModelingCmdMeta, Sketch, Solid,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{extrude::NamedCapTags, Args}, std::{extrude::NamedCapTags, Args},
@ -64,7 +64,9 @@ async fn inner_clone(
} }
GeometryWithImportedGeometry::Solid(solid) => { GeometryWithImportedGeometry::Solid(solid) => {
// We flush before the clone so all the shit exists. // We flush before the clone so all the shit exists.
args.flush_batch_for_solids(exec_state, &[solid.clone()]).await?; exec_state
.flush_batch_for_solids((&args).into(), &[solid.clone()])
.await?;
let mut new_solid = solid.clone(); let mut new_solid = solid.clone();
new_solid.id = new_id; new_solid.id = new_id;
@ -78,7 +80,11 @@ async fn inner_clone(
return Ok(new_geometry); return Ok(new_geometry);
} }
args.batch_modeling_cmd(new_id, ModelingCmd::from(mcmd::EntityClone { entity_id: old_id })) exec_state
.batch_modeling_cmd(
ModelingCmdMeta::from_args_id(&args, new_id),
ModelingCmd::from(mcmd::EntityClone { entity_id: old_id }),
)
.await?; .await?;
fix_tags_and_references(&mut new_geometry, old_id, exec_state, &args) fix_tags_and_references(&mut new_geometry, old_id, exec_state, &args)
@ -169,9 +175,9 @@ async fn get_old_new_child_map(
args: &Args, args: &Args,
) -> Result<HashMap<uuid::Uuid, uuid::Uuid>> { ) -> Result<HashMap<uuid::Uuid, uuid::Uuid>> {
// Get the old geometries entity ids. // Get the old geometries entity ids.
let response = args let response = exec_state
.send_modeling_cmd( .send_modeling_cmd(
exec_state.next_uuid(), args.into(),
ModelingCmd::from(mcmd::EntityGetAllChildUuids { ModelingCmd::from(mcmd::EntityGetAllChildUuids {
entity_id: old_geometry_id, entity_id: old_geometry_id,
}), }),
@ -188,9 +194,9 @@ async fn get_old_new_child_map(
}; };
// Get the new geometries entity ids. // Get the new geometries entity ids.
let response = args let response = exec_state
.send_modeling_cmd( .send_modeling_cmd(
exec_state.next_uuid(), args.into(),
ModelingCmd::from(mcmd::EntityGetAllChildUuids { ModelingCmd::from(mcmd::EntityGetAllChildUuids {
entity_id: new_geometry_id, entity_id: new_geometry_id,
}), }),

View File

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

View File

@ -9,7 +9,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{ArrayLen, RuntimeType}, types::{ArrayLen, RuntimeType},
ExecState, ExtrudeSurface, KclValue, TagIdentifier, ExecState, ExtrudeSurface, KclValue, ModelingCmdMeta, TagIdentifier,
}, },
std::Args, std::Args,
}; };
@ -35,15 +35,16 @@ async fn inner_get_opposite_edge(
} }
let face_id = args.get_adjacent_face_to_tag(exec_state, &edge, false).await?; let face_id = args.get_adjacent_face_to_tag(exec_state, &edge, false).await?;
let id = exec_state.next_uuid();
let tagged_path = args.get_tag_engine_info(exec_state, &edge)?; let tagged_path = args.get_tag_engine_info(exec_state, &edge)?;
let tagged_path_id = tagged_path.id;
let sketch_id = tagged_path.sketch;
let resp = args let resp = exec_state
.send_modeling_cmd( .send_modeling_cmd(
id, (&args).into(),
ModelingCmd::from(mcmd::Solid3dGetOppositeEdge { ModelingCmd::from(mcmd::Solid3dGetOppositeEdge {
edge_id: tagged_path.id, edge_id: tagged_path_id,
object_id: tagged_path.sketch, object_id: sketch_id,
face_id, face_id,
}), }),
) )
@ -82,15 +83,16 @@ async fn inner_get_next_adjacent_edge(
} }
let face_id = args.get_adjacent_face_to_tag(exec_state, &edge, false).await?; let face_id = args.get_adjacent_face_to_tag(exec_state, &edge, false).await?;
let id = exec_state.next_uuid();
let tagged_path = args.get_tag_engine_info(exec_state, &edge)?; let tagged_path = args.get_tag_engine_info(exec_state, &edge)?;
let tagged_path_id = tagged_path.id;
let sketch_id = tagged_path.sketch;
let resp = args let resp = exec_state
.send_modeling_cmd( .send_modeling_cmd(
id, (&args).into(),
ModelingCmd::from(mcmd::Solid3dGetNextAdjacentEdge { ModelingCmd::from(mcmd::Solid3dGetNextAdjacentEdge {
edge_id: tagged_path.id, edge_id: tagged_path_id,
object_id: tagged_path.sketch, object_id: sketch_id,
face_id, face_id,
}), }),
) )
@ -138,15 +140,16 @@ async fn inner_get_previous_adjacent_edge(
} }
let face_id = args.get_adjacent_face_to_tag(exec_state, &edge, false).await?; let face_id = args.get_adjacent_face_to_tag(exec_state, &edge, false).await?;
let id = exec_state.next_uuid();
let tagged_path = args.get_tag_engine_info(exec_state, &edge)?; let tagged_path = args.get_tag_engine_info(exec_state, &edge)?;
let tagged_path_id = tagged_path.id;
let sketch_id = tagged_path.sketch;
let resp = args let resp = exec_state
.send_modeling_cmd( .send_modeling_cmd(
id, (&args).into(),
ModelingCmd::from(mcmd::Solid3dGetPrevAdjacentEdge { ModelingCmd::from(mcmd::Solid3dGetPrevAdjacentEdge {
edge_id: tagged_path.id, edge_id: tagged_path_id,
object_id: tagged_path.sketch, object_id: sketch_id,
face_id, face_id,
}), }),
) )
@ -221,14 +224,14 @@ async fn inner_get_common_edge(
// TODO: we likely want to be a lot more persnickety _which_ fillets we are flushing // TODO: we likely want to be a lot more persnickety _which_ fillets we are flushing
// but for now, we'll just flush everything. // but for now, we'll just flush everything.
if let Some(ExtrudeSurface::Chamfer { .. } | ExtrudeSurface::Fillet { .. }) = first_tagged_path.surface { if let Some(ExtrudeSurface::Chamfer { .. } | ExtrudeSurface::Fillet { .. }) = first_tagged_path.surface {
args.ctx.engine.flush_batch(true, args.source_range).await?; exec_state.flush_batch((&args).into(), true).await?;
} else if let Some(ExtrudeSurface::Chamfer { .. } | ExtrudeSurface::Fillet { .. }) = second_tagged_path.surface { } else if let Some(ExtrudeSurface::Chamfer { .. } | ExtrudeSurface::Fillet { .. }) = second_tagged_path.surface {
args.ctx.engine.flush_batch(true, args.source_range).await?; exec_state.flush_batch((&args).into(), true).await?;
} }
let resp = args let resp = exec_state
.send_modeling_cmd( .send_modeling_cmd(
id, ModelingCmdMeta::from_args_id(&args, id),
ModelingCmd::from(mcmd::Solid3dGetCommonEdge { ModelingCmd::from(mcmd::Solid3dGetCommonEdge {
object_id: first_tagged_path.sketch, object_id: first_tagged_path.sketch,
face_ids: [first_face_id, second_face_id], face_ids: [first_face_id, second_face_id],

View File

@ -19,8 +19,8 @@ use super::args::TyF64;
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::RuntimeType, ArtifactId, ExecState, ExtrudeSurface, GeoMeta, KclValue, Path, Sketch, SketchSurface, types::RuntimeType, ArtifactId, ExecState, ExtrudeSurface, GeoMeta, KclValue, ModelingCmdMeta, Path, Sketch,
Solid, SketchSurface, Solid,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::Args, std::Args,
@ -85,7 +85,7 @@ async fn inner_extrude(
for sketch in &sketches { for sketch in &sketches {
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmds(&sketch.build_sketch_mode_cmds( let cmds = sketch.build_sketch_mode_cmds(
exec_state, exec_state,
ModelingCmdReq { ModelingCmdReq {
cmd_id: id.into(), cmd_id: id.into(),
@ -96,8 +96,10 @@ async fn inner_extrude(
opposite: opposite.clone(), opposite: opposite.clone(),
}), }),
}, },
)) );
.await?; exec_state
.batch_modeling_cmds(ModelingCmdMeta::from_args_id(&args, id), &cmds)
.await?;
solids.push( solids.push(
do_post_extrude( do_post_extrude(
@ -139,11 +141,12 @@ pub(crate) async fn do_post_extrude<'a>(
) -> Result<Solid, KclError> { ) -> Result<Solid, KclError> {
// Bring the object to the front of the scene. // Bring the object to the front of the scene.
// See: https://github.com/KittyCAD/modeling-app/issues/806 // See: https://github.com/KittyCAD/modeling-app/issues/806
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::ObjectBringToFront { object_id: sketch.id }), args.into(),
) ModelingCmd::from(mcmd::ObjectBringToFront { object_id: sketch.id }),
.await?; )
.await?;
let any_edge_id = if let Some(id) = edge_id { let any_edge_id = if let Some(id) = edge_id {
id id
@ -168,9 +171,9 @@ pub(crate) async fn do_post_extrude<'a>(
sketch.id = face.solid.sketch.id; sketch.id = face.solid.sketch.id;
} }
let solid3d_info = args let solid3d_info = exec_state
.send_modeling_cmd( .send_modeling_cmd(
exec_state.next_uuid(), args.into(),
ModelingCmd::from(mcmd::Solid3dGetExtrusionFaceInfo { ModelingCmd::from(mcmd::Solid3dGetExtrusionFaceInfo {
edge_id: any_edge_id, edge_id: any_edge_id,
object_id: sketch.id, object_id: sketch.id,
@ -193,14 +196,15 @@ pub(crate) async fn do_post_extrude<'a>(
// Getting the ids of a sectional sweep does not work well and we cannot guarantee that // Getting the ids of a sectional sweep does not work well and we cannot guarantee that
// any of these call will not just fail. // any of these call will not just fail.
if !sectional { if !sectional {
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::Solid3dGetAdjacencyInfo { args.into(),
object_id: sketch.id, ModelingCmd::from(mcmd::Solid3dGetAdjacencyInfo {
edge_id: any_edge_id, object_id: sketch.id,
}), edge_id: any_edge_id,
) }),
.await?; )
.await?;
} }
} }

View File

@ -10,7 +10,8 @@ use super::{args::TyF64, DEFAULT_TOLERANCE};
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::RuntimeType, EdgeCut, ExecState, ExtrudeSurface, FilletSurface, GeoMeta, KclValue, Solid, TagIdentifier, types::RuntimeType, EdgeCut, ExecState, ExtrudeSurface, FilletSurface, GeoMeta, KclValue, ModelingCmdMeta,
Solid, TagIdentifier,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::Args, std::Args,
@ -111,20 +112,21 @@ async fn inner_fillet(
for _ in 0..num_extra_ids { for _ in 0..num_extra_ids {
extra_face_ids.push(exec_state.next_uuid()); extra_face_ids.push(exec_state.next_uuid());
} }
args.batch_end_cmd( exec_state
id, .batch_end_cmd(
ModelingCmd::from(mcmd::Solid3dFilletEdge { ModelingCmdMeta::from_args_id(&args, id),
edge_id: None, ModelingCmd::from(mcmd::Solid3dFilletEdge {
edge_ids: edge_ids.clone(), edge_id: None,
extra_face_ids, edge_ids: edge_ids.clone(),
strategy: Default::default(), extra_face_ids,
object_id: solid.id, strategy: Default::default(),
radius: LengthUnit(radius.to_mm()), object_id: solid.id,
tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)), radius: LengthUnit(radius.to_mm()),
cut_type: CutType::Fillet, tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)),
}), cut_type: CutType::Fillet,
) }),
.await?; )
.await?;
let new_edge_cuts = edge_ids.into_iter().map(|edge_id| EdgeCut::Fillet { let new_edge_cuts = edge_ids.into_iter().map(|edge_id| EdgeCut::Fillet {
id, id,

View File

@ -9,7 +9,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{PrimitiveType, RuntimeType}, types::{PrimitiveType, RuntimeType},
ExecState, Helix as HelixValue, KclValue, Solid, ExecState, Helix as HelixValue, KclValue, ModelingCmdMeta, Solid,
}, },
std::{axis_or_reference::Axis3dOrEdgeReference, Args}, std::{axis_or_reference::Axis3dOrEdgeReference, Args},
}; };
@ -124,17 +124,18 @@ async fn inner_helix(
} }
if let Some(cylinder) = cylinder { if let Some(cylinder) = cylinder {
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::EntityMakeHelix { ModelingCmdMeta::from_args_id(&args, id),
cylinder_id: cylinder.id, ModelingCmd::from(mcmd::EntityMakeHelix {
is_clockwise: !helix_result.ccw, cylinder_id: cylinder.id,
length: LengthUnit(length.as_ref().map(|t| t.to_mm()).unwrap_or(cylinder.height_in_mm())), is_clockwise: !helix_result.ccw,
revolutions, length: LengthUnit(length.as_ref().map(|t| t.to_mm()).unwrap_or(cylinder.height_in_mm())),
start_angle: Angle::from_degrees(angle_start), revolutions,
}), start_angle: Angle::from_degrees(angle_start),
) }),
.await?; )
.await?;
} else if let (Some(axis), Some(radius)) = (axis, radius) { } else if let (Some(axis), Some(radius)) = (axis, radius) {
match axis { match axis {
Axis3dOrEdgeReference::Axis { direction, origin } => { Axis3dOrEdgeReference::Axis { direction, origin } => {
@ -146,43 +147,45 @@ async fn inner_helix(
))); )));
}; };
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::EntityMakeHelixFromParams { ModelingCmdMeta::from_args_id(&args, id),
radius: LengthUnit(radius.to_mm()), ModelingCmd::from(mcmd::EntityMakeHelixFromParams {
is_clockwise: !helix_result.ccw, radius: LengthUnit(radius.to_mm()),
length: LengthUnit(length.to_mm()), is_clockwise: !helix_result.ccw,
revolutions, length: LengthUnit(length.to_mm()),
start_angle: Angle::from_degrees(angle_start), revolutions,
axis: Point3d { start_angle: Angle::from_degrees(angle_start),
x: direction[0].to_mm(), axis: Point3d {
y: direction[1].to_mm(), x: direction[0].to_mm(),
z: direction[2].to_mm(), y: direction[1].to_mm(),
}, z: direction[2].to_mm(),
center: Point3d { },
x: LengthUnit(origin[0].to_mm()), center: Point3d {
y: LengthUnit(origin[1].to_mm()), x: LengthUnit(origin[0].to_mm()),
z: LengthUnit(origin[2].to_mm()), y: LengthUnit(origin[1].to_mm()),
}, z: LengthUnit(origin[2].to_mm()),
}), },
) }),
.await?; )
.await?;
} }
Axis3dOrEdgeReference::Edge(edge) => { Axis3dOrEdgeReference::Edge(edge) => {
let edge_id = edge.get_engine_id(exec_state, &args)?; let edge_id = edge.get_engine_id(exec_state, &args)?;
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::EntityMakeHelixFromEdge { ModelingCmdMeta::from_args_id(&args, id),
radius: LengthUnit(radius.to_mm()), ModelingCmd::from(mcmd::EntityMakeHelixFromEdge {
is_clockwise: !helix_result.ccw, radius: LengthUnit(radius.to_mm()),
length: length.map(|t| LengthUnit(t.to_mm())), is_clockwise: !helix_result.ccw,
revolutions, length: length.map(|t| LengthUnit(t.to_mm())),
start_angle: Angle::from_degrees(angle_start), revolutions,
edge_id, start_angle: Angle::from_degrees(angle_start),
}), edge_id,
) }),
.await?; )
.await?;
} }
}; };
} }

View File

@ -11,7 +11,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{NumericType, RuntimeType}, types::{NumericType, RuntimeType},
ExecState, KclValue, Sketch, Solid, ExecState, KclValue, ModelingCmdMeta, Sketch, Solid,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{extrude::do_post_extrude, Args}, std::{extrude::do_post_extrude, Args},
@ -77,17 +77,18 @@ async fn inner_loft(
} }
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::Loft { ModelingCmdMeta::from_args_id(&args, id),
section_ids: sketches.iter().map(|group| group.id).collect(), ModelingCmd::from(mcmd::Loft {
base_curve_index, section_ids: sketches.iter().map(|group| group.id).collect(),
bez_approximate_rational, base_curve_index,
tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)), bez_approximate_rational,
v_degree, tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)),
}), v_degree,
) }),
.await?; )
.await?;
// Using the first sketch as the base curve, idk we might want to change this later. // Using the first sketch as the base curve, idk we might want to change this later.
let mut sketch = sketches[0].clone(); let mut sketch = sketches[0].clone();

View File

@ -52,35 +52,37 @@ async fn inner_mirror_2d(
match axis { match axis {
Axis2dOrEdgeReference::Axis { direction, origin } => { Axis2dOrEdgeReference::Axis { direction, origin } => {
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::EntityMirror { (&args).into(),
ids: starting_sketches.iter().map(|sketch| sketch.id).collect(), ModelingCmd::from(mcmd::EntityMirror {
axis: Point3d { ids: starting_sketches.iter().map(|sketch| sketch.id).collect(),
x: direction[0].to_mm(), axis: Point3d {
y: direction[1].to_mm(), x: direction[0].to_mm(),
z: 0.0, y: direction[1].to_mm(),
}, z: 0.0,
point: Point3d { },
x: LengthUnit(origin[0].to_mm()), point: Point3d {
y: LengthUnit(origin[1].to_mm()), x: LengthUnit(origin[0].to_mm()),
z: LengthUnit(0.0), y: LengthUnit(origin[1].to_mm()),
}, z: LengthUnit(0.0),
}), },
) }),
.await?; )
.await?;
} }
Axis2dOrEdgeReference::Edge(edge) => { Axis2dOrEdgeReference::Edge(edge) => {
let edge_id = edge.get_engine_id(exec_state, &args)?; let edge_id = edge.get_engine_id(exec_state, &args)?;
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::EntityMirrorAcrossEdge { (&args).into(),
ids: starting_sketches.iter().map(|sketch| sketch.id).collect(), ModelingCmd::from(mcmd::EntityMirrorAcrossEdge {
edge_id, ids: starting_sketches.iter().map(|sketch| sketch.id).collect(),
}), edge_id,
) }),
.await?; )
.await?;
} }
}; };
@ -90,9 +92,9 @@ async fn inner_mirror_2d(
// using the IDs we already have. // using the IDs we already have.
// We only do this with mirrors because otherwise it is a waste of a websocket call. // We only do this with mirrors because otherwise it is a waste of a websocket call.
for sketch in &mut starting_sketches { for sketch in &mut starting_sketches {
let response = args let response = exec_state
.send_modeling_cmd( .send_modeling_cmd(
exec_state.next_uuid(), (&args).into(),
ModelingCmd::from(mcmd::EntityGetAllChildUuids { entity_id: sketch.id }), ModelingCmd::from(mcmd::EntityGetAllChildUuids { entity_id: sketch.id }),
) )
.await?; .await?;

View File

@ -149,12 +149,11 @@ async fn send_pattern_transform<T: GeometryTrait>(
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: &Args, args: &Args,
) -> Result<Vec<T>, KclError> { ) -> Result<Vec<T>, KclError> {
let id = exec_state.next_uuid();
let extra_instances = transforms.len(); let extra_instances = transforms.len();
let resp = args let resp = exec_state
.send_modeling_cmd( .send_modeling_cmd(
id, args.into(),
ModelingCmd::from(mcmd::EntityLinearPatternTransform { ModelingCmd::from(mcmd::EntityLinearPatternTransform {
entity_id: if use_original { solid.original_id() } else { solid.id() }, entity_id: if use_original { solid.original_id() } else { solid.id() },
transform: Default::default(), transform: Default::default(),
@ -443,7 +442,7 @@ impl GeometryTrait for Solid {
} }
async fn flush_batch(args: &Args, exec_state: &mut ExecState, solid_set: &Self::Set) -> Result<(), KclError> { async fn flush_batch(args: &Args, exec_state: &mut ExecState, solid_set: &Self::Set) -> Result<(), KclError> {
args.flush_batch_for_solids(exec_state, solid_set).await exec_state.flush_batch_for_solids(args.into(), solid_set).await
} }
} }
@ -874,7 +873,7 @@ async fn inner_pattern_circular_3d(
// Flush the batch for our fillets/chamfers if there are any. // Flush the batch for our fillets/chamfers if there are any.
// If we do not flush these, then you won't be able to pattern something with fillets. // If we do not flush these, then you won't be able to pattern something with fillets.
// Flush just the fillets/chamfers that apply to these solids. // Flush just the fillets/chamfers that apply to these solids.
args.flush_batch_for_solids(exec_state, &solids).await?; exec_state.flush_batch_for_solids((&args).into(), &solids).await?;
let starting_solids = solids; let starting_solids = solids;
@ -919,7 +918,6 @@ async fn pattern_circular(
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: Args, args: Args,
) -> Result<Geometries, KclError> { ) -> Result<Geometries, KclError> {
let id = exec_state.next_uuid();
let num_repetitions = match data.repetitions() { let num_repetitions = match data.repetitions() {
RepetitionsNeeded::More(n) => n, RepetitionsNeeded::More(n) => n,
RepetitionsNeeded::None => { RepetitionsNeeded::None => {
@ -934,9 +932,9 @@ async fn pattern_circular(
}; };
let center = data.center_mm(); let center = data.center_mm();
let resp = args let resp = exec_state
.send_modeling_cmd( .send_modeling_cmd(
id, (&args).into(),
ModelingCmd::from(mcmd::EntityCircularPattern { ModelingCmd::from(mcmd::EntityCircularPattern {
axis: kcmc::shared::Point3d::from(data.axis()), axis: kcmc::shared::Point3d::from(data.axis()),
entity_id: if data.use_original() { entity_id: if data.use_original() {

View File

@ -6,7 +6,7 @@ use kittycad_modeling_cmds as kcmc;
use super::{args::TyF64, sketch::PlaneData}; use super::{args::TyF64, sketch::PlaneData};
use crate::{ use crate::{
errors::KclError, errors::KclError,
execution::{types::RuntimeType, ExecState, KclValue, Plane, PlaneType}, execution::{types::RuntimeType, ExecState, KclValue, ModelingCmdMeta, Plane, PlaneType},
std::Args, std::Args,
}; };
@ -49,28 +49,31 @@ async fn make_offset_plane_in_engine(plane: &Plane, exec_state: &mut ExecState,
a: 0.3, a: 0.3,
}; };
args.batch_modeling_cmd( let meta = ModelingCmdMeta::from_args_id(args, plane.id);
plane.id, exec_state
ModelingCmd::from(mcmd::MakePlane { .batch_modeling_cmd(
clobber: false, meta,
origin: plane.info.origin.into(), ModelingCmd::from(mcmd::MakePlane {
size: LengthUnit(default_size), clobber: false,
x_axis: plane.info.x_axis.into(), origin: plane.info.origin.into(),
y_axis: plane.info.y_axis.into(), size: LengthUnit(default_size),
hide: Some(false), x_axis: plane.info.x_axis.into(),
}), y_axis: plane.info.y_axis.into(),
) hide: Some(false),
.await?; }),
)
.await?;
// Set the color. // Set the color.
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::PlaneSetColor { args.into(),
color, ModelingCmd::from(mcmd::PlaneSetColor {
plane_id: plane.id, color,
}), plane_id: plane.id,
) }),
.await?; )
.await?;
Ok(()) Ok(())
} }

View File

@ -14,7 +14,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{NumericType, PrimitiveType, RuntimeType}, types::{NumericType, PrimitiveType, RuntimeType},
ExecState, KclValue, Sketch, Solid, ExecState, KclValue, ModelingCmdMeta, Sketch, Solid,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{axis_or_reference::Axis2dOrEdgeReference, extrude::do_post_extrude, Args}, std::{axis_or_reference::Axis2dOrEdgeReference, extrude::do_post_extrude, Args},
@ -137,42 +137,44 @@ async fn inner_revolve(
let direction = match &axis { let direction = match &axis {
Axis2dOrEdgeReference::Axis { direction, origin } => { Axis2dOrEdgeReference::Axis { direction, origin } => {
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::Revolve { ModelingCmdMeta::from_args_id(&args, id),
angle, ModelingCmd::from(mcmd::Revolve {
target: sketch.id.into(), angle,
axis: Point3d { target: sketch.id.into(),
x: direction[0].to_mm(), axis: Point3d {
y: direction[1].to_mm(), x: direction[0].to_mm(),
z: 0.0, y: direction[1].to_mm(),
}, z: 0.0,
origin: Point3d { },
x: LengthUnit(origin[0].to_mm()), origin: Point3d {
y: LengthUnit(origin[1].to_mm()), x: LengthUnit(origin[0].to_mm()),
z: LengthUnit(0.0), y: LengthUnit(origin[1].to_mm()),
}, z: LengthUnit(0.0),
tolerance: LengthUnit(tolerance), },
axis_is_2d: true, tolerance: LengthUnit(tolerance),
opposite: opposite.clone(), axis_is_2d: true,
}), opposite: opposite.clone(),
) }),
.await?; )
.await?;
glm::DVec2::new(direction[0].to_mm(), direction[1].to_mm()) glm::DVec2::new(direction[0].to_mm(), direction[1].to_mm())
} }
Axis2dOrEdgeReference::Edge(edge) => { Axis2dOrEdgeReference::Edge(edge) => {
let edge_id = edge.get_engine_id(exec_state, &args)?; let edge_id = edge.get_engine_id(exec_state, &args)?;
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::RevolveAboutEdge { ModelingCmdMeta::from_args_id(&args, id),
angle, ModelingCmd::from(mcmd::RevolveAboutEdge {
target: sketch.id.into(), angle,
edge_id, target: sketch.id.into(),
tolerance: LengthUnit(tolerance), edge_id,
opposite: opposite.clone(), tolerance: LengthUnit(tolerance),
}), opposite: opposite.clone(),
) }),
.await?; )
.await?;
//TODO: fix me! Need to be able to calculate this to ensure the path isn't colinear //TODO: fix me! Need to be able to calculate this to ensure the path isn't colinear
glm::DVec2::new(0.0, 1.0) glm::DVec2::new(0.0, 1.0)
} }

View File

@ -20,7 +20,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{RuntimeType, UnitLen}, types::{RuntimeType, UnitLen},
BasePath, ExecState, GeoMeta, KclValue, Path, Sketch, SketchSurface, BasePath, ExecState, GeoMeta, KclValue, ModelingCmdMeta, Path, Sketch, SketchSurface,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{ std::{
@ -82,20 +82,21 @@ async fn inner_circle(
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Arc { path: sketch.id.into(),
start: angle_start, segment: PathSegment::Arc {
end: angle_end, start: angle_start,
center: KPoint2d::from(point_to_mm(center)).map(LengthUnit), end: angle_end,
radius: LengthUnit(radius.to_mm()), center: KPoint2d::from(point_to_mm(center)).map(LengthUnit),
relative: false, radius: LengthUnit(radius.to_mm()),
}, relative: false,
}), },
) }),
.await?; )
.await?;
let current_path = Path::Circle { let current_path = Path::Circle {
base: BasePath { base: BasePath {
@ -120,7 +121,11 @@ async fn inner_circle(
new_sketch.paths.push(current_path); new_sketch.paths.push(current_path);
args.batch_modeling_cmd(id, ModelingCmd::from(mcmd::ClosePath { path_id: new_sketch.id })) exec_state
.batch_modeling_cmd(
ModelingCmdMeta::from_args_id(&args, id),
ModelingCmd::from(mcmd::ClosePath { path_id: new_sketch.id }),
)
.await?; .await?;
Ok(new_sketch) Ok(new_sketch)
@ -180,20 +185,21 @@ async fn inner_circle_three_point(
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Arc { path: sketch.id.into(),
start: angle_start, segment: PathSegment::Arc {
end: angle_end, start: angle_start,
center: KPoint2d::from(untyped_point_to_mm(center, units)).map(LengthUnit), end: angle_end,
radius: units.adjust_to(radius, UnitLen::Mm).0.into(), center: KPoint2d::from(untyped_point_to_mm(center, units)).map(LengthUnit),
relative: false, radius: units.adjust_to(radius, UnitLen::Mm).0.into(),
}, relative: false,
}), },
) }),
.await?; )
.await?;
let current_path = Path::CircleThreePoint { let current_path = Path::CircleThreePoint {
base: BasePath { base: BasePath {
@ -219,7 +225,11 @@ async fn inner_circle_three_point(
new_sketch.paths.push(current_path); new_sketch.paths.push(current_path);
args.batch_modeling_cmd(id, ModelingCmd::from(mcmd::ClosePath { path_id: new_sketch.id })) exec_state
.batch_modeling_cmd(
ModelingCmdMeta::from_args_id(&args, id),
ModelingCmd::from(mcmd::ClosePath { path_id: new_sketch.id }),
)
.await?; .await?;
Ok(new_sketch) Ok(new_sketch)
@ -326,19 +336,20 @@ async fn inner_polygon(
let from = sketch.current_pen_position()?; let from = sketch.current_pen_position()?;
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Line { path: sketch.id.into(),
end: KPoint2d::from(untyped_point_to_mm(*vertex, units)) segment: PathSegment::Line {
.with_z(0.0) end: KPoint2d::from(untyped_point_to_mm(*vertex, units))
.map(LengthUnit), .with_z(0.0)
relative: false, .map(LengthUnit),
}, relative: false,
}), },
) }),
.await?; )
.await?;
let current_path = Path::ToPoint { let current_path = Path::ToPoint {
base: BasePath { base: BasePath {
@ -360,19 +371,20 @@ async fn inner_polygon(
let from = sketch.current_pen_position()?; let from = sketch.current_pen_position()?;
let close_id = exec_state.next_uuid(); let close_id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
close_id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, close_id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Line { path: sketch.id.into(),
end: KPoint2d::from(untyped_point_to_mm(vertices[0], units)) segment: PathSegment::Line {
.with_z(0.0) end: KPoint2d::from(untyped_point_to_mm(vertices[0], units))
.map(LengthUnit), .with_z(0.0)
relative: false, .map(LengthUnit),
}, relative: false,
}), },
) }),
.await?; )
.await?;
let current_path = Path::ToPoint { let current_path = Path::ToPoint {
base: BasePath { base: BasePath {
@ -389,11 +401,12 @@ async fn inner_polygon(
sketch.paths.push(current_path); sketch.paths.push(current_path);
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::ClosePath { path_id: sketch.id }), (&args).into(),
) ModelingCmd::from(mcmd::ClosePath { path_id: sketch.id }),
.await?; )
.await?;
Ok(sketch) Ok(sketch)
} }

View File

@ -53,7 +53,9 @@ async fn inner_shell(
for solid in &solids { for solid in &solids {
// Flush the batch for our fillets/chamfers if there are any. // 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. // 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 { for tag in &faces {
let extrude_plane_id = tag.get_face_id(solid, exec_state, &args, false).await?; 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
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::Solid3dShellFace { (&args).into(),
hollow: false, ModelingCmd::from(mcmd::Solid3dShellFace {
face_ids, hollow: false,
object_id: solids[0].id, face_ids,
shell_thickness: LengthUnit(thickness.to_mm()), object_id: solids[0].id,
}), shell_thickness: LengthUnit(thickness.to_mm()),
) }),
.await?; )
.await?;
Ok(solids) Ok(solids)
} }
@ -109,18 +112,21 @@ async fn inner_hollow(
) -> Result<Box<Solid>, KclError> { ) -> Result<Box<Solid>, KclError> {
// Flush the batch for our fillets/chamfers if there are any. // 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. // 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
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::Solid3dShellFace { (&args).into(),
hollow: true, ModelingCmd::from(mcmd::Solid3dShellFace {
face_ids: Vec::new(), // This is empty because we want to hollow the entire object. hollow: true,
object_id: solid.id, face_ids: Vec::new(), // This is empty because we want to hollow the entire object.
shell_thickness: LengthUnit(thickness.to_mm()), object_id: solid.id,
}), shell_thickness: LengthUnit(thickness.to_mm()),
) }),
.await?; )
.await?;
Ok(solid) Ok(solid)
} }

View File

@ -18,8 +18,8 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
types::{ArrayLen, NumericType, PrimitiveType, RuntimeType, UnitLen}, types::{ArrayLen, NumericType, PrimitiveType, RuntimeType, UnitLen},
BasePath, ExecState, Face, GeoMeta, KclValue, Path, Plane, PlaneInfo, Point2d, Sketch, SketchSurface, Solid, BasePath, ExecState, Face, GeoMeta, KclValue, ModelingCmdMeta, Path, Plane, PlaneInfo, Point2d, Sketch,
TagEngineInfo, TagIdentifier, SketchSurface, Solid, TagEngineInfo, TagIdentifier,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{ std::{
@ -133,19 +133,20 @@ async fn inner_involute_circular(
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::CircularInvolute { path: sketch.id.into(),
start_radius: LengthUnit(start_radius.to_mm()), segment: PathSegment::CircularInvolute {
end_radius: LengthUnit(end_radius.to_mm()), start_radius: LengthUnit(start_radius.to_mm()),
angle: Angle::from_degrees(angle.to_degrees()), end_radius: LengthUnit(end_radius.to_mm()),
reverse: reverse.unwrap_or_default(), angle: Angle::from_degrees(angle.to_degrees()),
}, reverse: reverse.unwrap_or_default(),
}), },
) }),
.await?; )
.await?;
let from = sketch.current_pen_position()?; let from = sketch.current_pen_position()?;
@ -284,17 +285,18 @@ async fn straight_line(
}; };
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Line { path: sketch.id.into(),
end: KPoint2d::from(point_to_mm(point.clone())).with_z(0.0).map(LengthUnit), segment: PathSegment::Line {
relative: !is_absolute, end: KPoint2d::from(point_to_mm(point.clone())).with_z(0.0).map(LengthUnit),
}, relative: !is_absolute,
}), },
) }),
.await?; )
.await?;
let end = if is_absolute { let end = if is_absolute {
point_to_len_unit(point, from.units) point_to_len_unit(point, from.units)
@ -507,19 +509,20 @@ async fn inner_angled_line_length(
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Line { path: sketch.id.into(),
end: KPoint2d::from(untyped_point_to_mm(delta, from.units)) segment: PathSegment::Line {
.with_z(0.0) end: KPoint2d::from(untyped_point_to_mm(delta, from.units))
.map(LengthUnit), .with_z(0.0)
relative, .map(LengthUnit),
}, relative,
}), },
) }),
.await?; )
.await?;
let current_path = Path::ToPoint { let current_path = Path::ToPoint {
base: BasePath { base: BasePath {
@ -874,18 +877,19 @@ async fn make_sketch_plane_from_orientation(
let clobber = false; let clobber = false;
let size = LengthUnit(60.0); let size = LengthUnit(60.0);
let hide = Some(true); let hide = Some(true);
args.batch_modeling_cmd( exec_state
plane.id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::MakePlane { ModelingCmdMeta::from_args_id(args, plane.id),
clobber, ModelingCmd::from(mcmd::MakePlane {
origin: plane.info.origin.into(), clobber,
size, origin: plane.info.origin.into(),
x_axis: plane.info.x_axis.into(), size,
y_axis: plane.info.y_axis.into(), x_axis: plane.info.x_axis.into(),
hide, y_axis: plane.info.y_axis.into(),
}), hide,
) }),
.await?; )
.await?;
Ok(Box::new(plane)) Ok(Box::new(plane))
} }
@ -917,20 +921,22 @@ pub(crate) async fn inner_start_profile(
SketchSurface::Face(face) => { SketchSurface::Face(face) => {
// Flush the batch for our fillets/chamfers if there are any. // 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. // 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, &[(*face.solid).clone()]) exec_state
.flush_batch_for_solids((&args).into(), &[(*face.solid).clone()])
.await?; .await?;
} }
SketchSurface::Plane(plane) if !plane.is_standard() => { SketchSurface::Plane(plane) if !plane.is_standard() => {
// Hide whatever plane we are sketching on. // Hide whatever plane we are sketching on.
// This is especially helpful for offset planes, which would be visible otherwise. // This is especially helpful for offset planes, which would be visible otherwise.
args.batch_end_cmd( exec_state
exec_state.next_uuid(), .batch_end_cmd(
ModelingCmd::from(mcmd::ObjectVisible { (&args).into(),
object_id: plane.id, ModelingCmd::from(mcmd::ObjectVisible {
hidden: true, object_id: plane.id,
}), hidden: true,
) }),
.await?; )
.await?;
} }
_ => {} _ => {}
} }
@ -938,42 +944,47 @@ pub(crate) async fn inner_start_profile(
let enable_sketch_id = exec_state.next_uuid(); let enable_sketch_id = exec_state.next_uuid();
let path_id = exec_state.next_uuid(); let path_id = exec_state.next_uuid();
let move_pen_id = exec_state.next_uuid(); let move_pen_id = exec_state.next_uuid();
args.batch_modeling_cmds(&[ let disable_sketch_id = exec_state.next_uuid();
// Enter sketch mode on the surface. exec_state
// We call this here so you can reuse the sketch surface for multiple sketches. .batch_modeling_cmds(
ModelingCmdReq { (&args).into(),
cmd: ModelingCmd::from(mcmd::EnableSketchMode { &[
animated: false, // Enter sketch mode on the surface.
ortho: false, // We call this here so you can reuse the sketch surface for multiple sketches.
entity_id: sketch_surface.id(), ModelingCmdReq {
adjust_camera: false, cmd: ModelingCmd::from(mcmd::EnableSketchMode {
planar_normal: if let SketchSurface::Plane(plane) = &sketch_surface { animated: false,
// We pass in the normal for the plane here. ortho: false,
let normal = plane.info.x_axis.axes_cross_product(&plane.info.y_axis); entity_id: sketch_surface.id(),
Some(normal.into()) adjust_camera: false,
} else { planar_normal: if let SketchSurface::Plane(plane) = &sketch_surface {
None // We pass in the normal for the plane here.
let normal = plane.info.x_axis.axes_cross_product(&plane.info.y_axis);
Some(normal.into())
} else {
None
},
}),
cmd_id: enable_sketch_id.into(),
}, },
}), ModelingCmdReq {
cmd_id: enable_sketch_id.into(), cmd: ModelingCmd::from(mcmd::StartPath::default()),
}, cmd_id: path_id.into(),
ModelingCmdReq { },
cmd: ModelingCmd::from(mcmd::StartPath::default()), ModelingCmdReq {
cmd_id: path_id.into(), cmd: ModelingCmd::from(mcmd::MovePathPen {
}, path: path_id.into(),
ModelingCmdReq { to: KPoint2d::from(point_to_mm(at.clone())).with_z(0.0).map(LengthUnit),
cmd: ModelingCmd::from(mcmd::MovePathPen { }),
path: path_id.into(), cmd_id: move_pen_id.into(),
to: KPoint2d::from(point_to_mm(at.clone())).with_z(0.0).map(LengthUnit), },
}), ModelingCmdReq {
cmd_id: move_pen_id.into(), cmd: ModelingCmd::SketchModeDisable(mcmd::SketchModeDisable::default()),
}, cmd_id: disable_sketch_id.into(),
ModelingCmdReq { },
cmd: ModelingCmd::SketchModeDisable(mcmd::SketchModeDisable::default()), ],
cmd_id: exec_state.next_uuid().into(), )
}, .await?;
])
.await?;
// Convert to the units of the module. This is what the frontend expects. // Convert to the units of the module. This is what the frontend expects.
let units = exec_state.length_unit(); let units = exec_state.length_unit();
@ -1077,7 +1088,11 @@ pub(crate) async fn inner_close(
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd(id, ModelingCmd::from(mcmd::ClosePath { path_id: sketch.id })) exec_state
.batch_modeling_cmd(
ModelingCmdMeta::from_args_id(&args, id),
ModelingCmd::from(mcmd::ClosePath { path_id: sketch.id }),
)
.await?; .await?;
let current_path = Path::ToPoint { let current_path = Path::ToPoint {
@ -1178,26 +1193,27 @@ pub async fn absolute_arc(
tag: Option<TagNode>, tag: Option<TagNode>,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
// The start point is taken from the path you are extending. // The start point is taken from the path you are extending.
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::ArcTo { path: sketch.id.into(),
end: kcmc::shared::Point3d { segment: PathSegment::ArcTo {
x: LengthUnit(end_absolute[0].to_mm()), end: kcmc::shared::Point3d {
y: LengthUnit(end_absolute[1].to_mm()), x: LengthUnit(end_absolute[0].to_mm()),
z: LengthUnit(0.0), y: LengthUnit(end_absolute[1].to_mm()),
z: LengthUnit(0.0),
},
interior: kcmc::shared::Point3d {
x: LengthUnit(interior_absolute[0].to_mm()),
y: LengthUnit(interior_absolute[1].to_mm()),
z: LengthUnit(0.0),
},
relative: false,
}, },
interior: kcmc::shared::Point3d { }),
x: LengthUnit(interior_absolute[0].to_mm()), )
y: LengthUnit(interior_absolute[1].to_mm()), .await?;
z: LengthUnit(0.0),
},
relative: false,
},
}),
)
.await?;
let start = [from.x, from.y]; let start = [from.x, from.y];
let end = point_to_len_unit(end_absolute, from.units); let end = point_to_len_unit(end_absolute, from.units);
@ -1252,20 +1268,21 @@ pub async fn relative_arc(
} }
let ccw = a_start < a_end; let ccw = a_start < a_end;
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Arc { path: sketch.id.into(),
start: a_start, segment: PathSegment::Arc {
end: a_end, start: a_start,
center: KPoint2d::from(untyped_point_to_mm(center, from.units)).map(LengthUnit), end: a_end,
radius: LengthUnit(from.units.adjust_to(radius, UnitLen::Mm).0), center: KPoint2d::from(untyped_point_to_mm(center, from.units)).map(LengthUnit),
relative: false, radius: LengthUnit(from.units.adjust_to(radius, UnitLen::Mm).0),
}, relative: false,
}), },
) }),
.await?; )
.await?;
let current_path = Path::Arc { let current_path = Path::Arc {
base: BasePath { base: BasePath {
@ -1421,17 +1438,18 @@ async fn inner_tangential_arc_radius_angle(
radius.to_length_units(from.units), radius.to_length_units(from.units),
); );
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::TangentialArc { path: sketch.id.into(),
radius: LengthUnit(radius.to_mm()), segment: PathSegment::TangentialArc {
offset, radius: LengthUnit(radius.to_mm()),
}, offset,
}), },
) }),
.await?; )
.await?;
(center, to, ccw) (center, to, ccw)
} }
}; };
@ -1521,7 +1539,9 @@ async fn inner_tangential_arc_to_point(
point point
}; };
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd(id, tan_arc_to(&sketch, delta)).await?; exec_state
.batch_modeling_cmd(ModelingCmdMeta::from_args_id(&args, id), tan_arc_to(&sketch, delta))
.await?;
let current_path = Path::TangentialArcTo { let current_path = Path::TangentialArcTo {
base: BasePath { base: BasePath {
@ -1609,37 +1629,39 @@ async fn inner_bezier_curve(
from.y + end[1].to_length_units(from.units), from.y + end[1].to_length_units(from.units),
]; ];
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Bezier { path: sketch.id.into(),
control1: KPoint2d::from(point_to_mm(control1)).with_z(0.0).map(LengthUnit), segment: PathSegment::Bezier {
control2: KPoint2d::from(point_to_mm(control2)).with_z(0.0).map(LengthUnit), control1: KPoint2d::from(point_to_mm(control1)).with_z(0.0).map(LengthUnit),
end: KPoint2d::from(point_to_mm(delta)).with_z(0.0).map(LengthUnit), control2: KPoint2d::from(point_to_mm(control2)).with_z(0.0).map(LengthUnit),
relative: true, end: KPoint2d::from(point_to_mm(delta)).with_z(0.0).map(LengthUnit),
}, relative: true,
}), },
) }),
.await?; )
.await?;
to to
} }
// Absolute // Absolute
(None, None, None, Some(control1), Some(control2), Some(end)) => { (None, None, None, Some(control1), Some(control2), Some(end)) => {
let to = [end[0].to_length_units(from.units), end[1].to_length_units(from.units)]; let to = [end[0].to_length_units(from.units), end[1].to_length_units(from.units)];
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::ExtendPath { ModelingCmdMeta::from_args_id(&args, id),
path: sketch.id.into(), ModelingCmd::from(mcmd::ExtendPath {
segment: PathSegment::Bezier { path: sketch.id.into(),
control1: KPoint2d::from(point_to_mm(control1)).with_z(0.0).map(LengthUnit), segment: PathSegment::Bezier {
control2: KPoint2d::from(point_to_mm(control2)).with_z(0.0).map(LengthUnit), control1: KPoint2d::from(point_to_mm(control1)).with_z(0.0).map(LengthUnit),
end: KPoint2d::from(point_to_mm(end)).with_z(0.0).map(LengthUnit), control2: KPoint2d::from(point_to_mm(control2)).with_z(0.0).map(LengthUnit),
relative: false, end: KPoint2d::from(point_to_mm(end)).with_z(0.0).map(LengthUnit),
}, relative: false,
}), },
) }),
.await?; )
.await?;
to to
} }
_ => { _ => {
@ -1699,25 +1721,27 @@ async fn inner_subtract_2d(
args: Args, args: Args,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
for hole_sketch in tool { for hole_sketch in tool {
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::Solid2dAddHole { ModelingCmdMeta::from(&args),
object_id: sketch.id, ModelingCmd::from(mcmd::Solid2dAddHole {
hole_id: hole_sketch.id, object_id: sketch.id,
}), hole_id: hole_sketch.id,
) }),
.await?; )
.await?;
// suggestion (mike) // suggestion (mike)
// we also hide the source hole since its essentially "consumed" by this operation // we also hide the source hole since its essentially "consumed" by this operation
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::ObjectVisible { ModelingCmdMeta::from(&args),
object_id: hole_sketch.id, ModelingCmd::from(mcmd::ObjectVisible {
hidden: true, object_id: hole_sketch.id,
}), hidden: true,
) }),
.await?; )
.await?;
} }
Ok(sketch) Ok(sketch)

View File

@ -11,7 +11,7 @@ use crate::{
errors::KclError, errors::KclError,
execution::{ execution::{
types::{NumericType, RuntimeType}, types::{NumericType, RuntimeType},
ExecState, Helix, KclValue, Sketch, Solid, ExecState, Helix, KclValue, ModelingCmdMeta, Sketch, Solid,
}, },
parsing::ast::types::TagNode, parsing::ast::types::TagNode,
std::{extrude::do_post_extrude, Args}, std::{extrude::do_post_extrude, Args},
@ -86,17 +86,18 @@ async fn inner_sweep(
let mut solids = Vec::new(); let mut solids = Vec::new();
for sketch in &sketches { for sketch in &sketches {
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::Sweep { ModelingCmdMeta::from_args_id(&args, id),
target: sketch.id.into(), ModelingCmd::from(mcmd::Sweep {
trajectory, target: sketch.id.into(),
sectional: sectional.unwrap_or(false), trajectory,
tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)), sectional: sectional.unwrap_or(false),
relative_to, tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)),
}), relative_to,
) }),
.await?; )
.await?;
solids.push( solids.push(
do_post_extrude( do_post_extrude(
@ -117,14 +118,15 @@ async fn inner_sweep(
} }
// Hide the artifact from the sketch or helix. // Hide the artifact from the sketch or helix.
args.batch_modeling_cmd( exec_state
exec_state.next_uuid(), .batch_modeling_cmd(
ModelingCmd::from(mcmd::ObjectVisible { (&args).into(),
object_id: trajectory.into(), ModelingCmd::from(mcmd::ObjectVisible {
hidden: true, object_id: trajectory.into(),
}), hidden: true,
) }),
.await?; )
.await?;
Ok(solids) Ok(solids)
} }

View File

@ -68,34 +68,33 @@ async fn inner_scale(
// If we have a solid, flush the fillets and chamfers. // If we have a solid, flush the fillets and chamfers.
// Only transforms needs this, it is very odd, see: https://github.com/KittyCAD/modeling-app/issues/5880 // Only transforms needs this, it is very odd, see: https://github.com/KittyCAD/modeling-app/issues/5880
if let SolidOrSketchOrImportedGeometry::SolidSet(solids) = &objects { if let SolidOrSketchOrImportedGeometry::SolidSet(solids) = &objects {
args.flush_batch_for_solids(exec_state, solids).await?; exec_state.flush_batch_for_solids((&args).into(), solids).await?;
} }
let mut objects = objects.clone(); let mut objects = objects.clone();
for object_id in objects.ids(&args.ctx).await? { for object_id in objects.ids(&args.ctx).await? {
let id = exec_state.next_uuid(); exec_state
.batch_modeling_cmd(
args.batch_modeling_cmd( (&args).into(),
id, ModelingCmd::from(mcmd::SetObjectTransform {
ModelingCmd::from(mcmd::SetObjectTransform { object_id,
object_id, transforms: vec![shared::ComponentTransform {
transforms: vec![shared::ComponentTransform { scale: Some(shared::TransformBy::<Point3d<f64>> {
scale: Some(shared::TransformBy::<Point3d<f64>> { property: Point3d {
property: Point3d { x: x.unwrap_or(1.0),
x: x.unwrap_or(1.0), y: y.unwrap_or(1.0),
y: y.unwrap_or(1.0), z: z.unwrap_or(1.0),
z: z.unwrap_or(1.0), },
}, set: false,
set: false, is_local: !global.unwrap_or(false),
is_local: !global.unwrap_or(false), }),
}), translate: None,
translate: None, rotate_rpy: None,
rotate_rpy: None, rotate_angle_axis: None,
rotate_angle_axis: None, }],
}], }),
}), )
) .await?;
.await?;
} }
Ok(objects) Ok(objects)
@ -141,34 +140,33 @@ async fn inner_translate(
// If we have a solid, flush the fillets and chamfers. // If we have a solid, flush the fillets and chamfers.
// Only transforms needs this, it is very odd, see: https://github.com/KittyCAD/modeling-app/issues/5880 // Only transforms needs this, it is very odd, see: https://github.com/KittyCAD/modeling-app/issues/5880
if let SolidOrSketchOrImportedGeometry::SolidSet(solids) = &objects { if let SolidOrSketchOrImportedGeometry::SolidSet(solids) = &objects {
args.flush_batch_for_solids(exec_state, solids).await?; exec_state.flush_batch_for_solids((&args).into(), solids).await?;
} }
let mut objects = objects.clone(); let mut objects = objects.clone();
for object_id in objects.ids(&args.ctx).await? { for object_id in objects.ids(&args.ctx).await? {
let id = exec_state.next_uuid(); exec_state
.batch_modeling_cmd(
args.batch_modeling_cmd( (&args).into(),
id, ModelingCmd::from(mcmd::SetObjectTransform {
ModelingCmd::from(mcmd::SetObjectTransform { object_id,
object_id, transforms: vec![shared::ComponentTransform {
transforms: vec![shared::ComponentTransform { translate: Some(shared::TransformBy::<Point3d<LengthUnit>> {
translate: Some(shared::TransformBy::<Point3d<LengthUnit>> { property: shared::Point3d {
property: shared::Point3d { x: LengthUnit(x.as_ref().map(|t| t.to_mm()).unwrap_or_default()),
x: LengthUnit(x.as_ref().map(|t| t.to_mm()).unwrap_or_default()), y: LengthUnit(y.as_ref().map(|t| t.to_mm()).unwrap_or_default()),
y: LengthUnit(y.as_ref().map(|t| t.to_mm()).unwrap_or_default()), z: LengthUnit(z.as_ref().map(|t| t.to_mm()).unwrap_or_default()),
z: LengthUnit(z.as_ref().map(|t| t.to_mm()).unwrap_or_default()), },
}, set: false,
set: false, is_local: !global.unwrap_or(false),
is_local: !global.unwrap_or(false), }),
}), scale: None,
scale: None, rotate_rpy: None,
rotate_rpy: None, rotate_angle_axis: None,
rotate_angle_axis: None, }],
}], }),
}), )
) .await?;
.await?;
} }
Ok(objects) Ok(objects)
@ -313,59 +311,59 @@ async fn inner_rotate(
// If we have a solid, flush the fillets and chamfers. // If we have a solid, flush the fillets and chamfers.
// Only transforms needs this, it is very odd, see: https://github.com/KittyCAD/modeling-app/issues/5880 // Only transforms needs this, it is very odd, see: https://github.com/KittyCAD/modeling-app/issues/5880
if let SolidOrSketchOrImportedGeometry::SolidSet(solids) = &objects { if let SolidOrSketchOrImportedGeometry::SolidSet(solids) = &objects {
args.flush_batch_for_solids(exec_state, solids).await?; exec_state.flush_batch_for_solids((&args).into(), solids).await?;
} }
let mut objects = objects.clone(); let mut objects = objects.clone();
for object_id in objects.ids(&args.ctx).await? { for object_id in objects.ids(&args.ctx).await? {
let id = exec_state.next_uuid();
if let (Some(axis), Some(angle)) = (&axis, angle) { if let (Some(axis), Some(angle)) = (&axis, angle) {
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::SetObjectTransform { (&args).into(),
object_id, ModelingCmd::from(mcmd::SetObjectTransform {
transforms: vec![shared::ComponentTransform { object_id,
rotate_angle_axis: Some(shared::TransformBy::<Point4d<f64>> { transforms: vec![shared::ComponentTransform {
property: shared::Point4d { rotate_angle_axis: Some(shared::TransformBy::<Point4d<f64>> {
x: axis[0], property: shared::Point4d {
y: axis[1], x: axis[0],
z: axis[2], y: axis[1],
w: angle, z: axis[2],
}, w: angle,
set: false, },
is_local: !global.unwrap_or(false), set: false,
}), is_local: !global.unwrap_or(false),
scale: None, }),
rotate_rpy: None, scale: None,
translate: None, rotate_rpy: None,
}], translate: None,
}), }],
) }),
.await?; )
.await?;
} else { } else {
// Do roll, pitch, and yaw. // Do roll, pitch, and yaw.
args.batch_modeling_cmd( exec_state
id, .batch_modeling_cmd(
ModelingCmd::from(mcmd::SetObjectTransform { (&args).into(),
object_id, ModelingCmd::from(mcmd::SetObjectTransform {
transforms: vec![shared::ComponentTransform { object_id,
rotate_rpy: Some(shared::TransformBy::<Point3d<f64>> { transforms: vec![shared::ComponentTransform {
property: shared::Point3d { rotate_rpy: Some(shared::TransformBy::<Point3d<f64>> {
x: roll.unwrap_or(0.0), property: shared::Point3d {
y: pitch.unwrap_or(0.0), x: roll.unwrap_or(0.0),
z: yaw.unwrap_or(0.0), y: pitch.unwrap_or(0.0),
}, z: yaw.unwrap_or(0.0),
set: false, },
is_local: !global.unwrap_or(false), set: false,
}), is_local: !global.unwrap_or(false),
scale: None, }),
rotate_angle_axis: None, scale: None,
translate: None, rotate_angle_axis: None,
}], translate: None,
}), }],
) }),
.await?; )
.await?;
} }
} }

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands add_lots.kcl description: Artifact commands add_lots.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/add_lots/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

File diff suppressed because it is too large Load Diff

View File

@ -2,252 +2,239 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands angled_line.kcl description: Artifact commands angled_line.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/angled_line/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
}, "x": 0.0,
{ "y": 0.0,
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 4.83,
"y": 12.56,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 15.1,
"y": 2.48,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 3.15,
"y": -9.85,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
} "x": 0.0,
} "y": 1.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -15.17,
"y": -4.1,
"z": 0.0 "z": 0.0
}, },
"relative": true "size": 60.0,
"clobber": false,
"hide": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "line", "adjust_camera": false,
"end": { "planar_normal": {
"x": 3.762, "x": 0.0,
"y": -11.763, "y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 4.83,
"y": 12.56,
"z": 0.0 "z": 0.0
}, }
"relative": true }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 15.1,
"y": 2.48,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 3.15,
"y": -9.85,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -15.17,
"y": -4.1,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 3.762,
"y": -11.763,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -13.02,
"y": 10.03,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 4.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "extend_path", "std::sketch": [],
"path": "[uuid]", "std::solid": [],
"segment": { "std::sweep": [],
"type": "line", "std::transform": [],
"end": { "std::turns": [],
"x": -13.02, "std::types": [],
"y": 10.03, "std::units": []
"z": 0.0 }
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 4.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
}
]

View File

@ -2,86 +2,99 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed angled_line.kcl description: Operations executed angled_line.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/angled_line/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane", "value": {
"artifact_id": "[uuid]" "type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": {}, {
"nodePath": { "type": "StdLibCall",
"steps": [ "name": "extrude",
{ "unlabeledArg": {
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Sketch",
} "value": {
}, "artifactId": "[uuid]"
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 4.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "length": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 4.0,
"index": 0 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}, }
{ }
"type": "PipeBodyItem", },
"index": 8 "sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 8
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands any_type.kcl description: Artifact commands any_type.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/any_type/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -2,34 +2,18 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed any_type.kcl description: Operations executed any_type.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/any_type/input.kcl": [
"type": "GroupBegin", {
"group": { "type": "GroupBegin",
"type": "FunctionCall", "group": {
"name": null, "type": "FunctionCall",
"functionSourceRange": [], "name": "id",
"unlabeledArg": { "functionSourceRange": [],
"value": { "unlabeledArg": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"labeledArgs": {
"accum": {
"value": { "value": {
"type": "Number", "type": "Number",
"value": 0.0, "value": 1.0,
"ty": { "ty": {
"type": "Default", "type": "Default",
"len": { "len": {
@ -41,190 +25,211 @@ description: Operations executed any_type.kcl
} }
}, },
"sourceRange": [] "sourceRange": []
}
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 2
}, },
{ "labeledArgs": {}
"type": "VariableDeclarationDeclaration" },
}, "nodePath": {
{ "steps": [
"type": "VariableDeclarationInit" {
}, "type": "ProgramBodyItem",
{ "index": 3
"type": "FunctionExpressionBody" },
}, {
{ "type": "VariableDeclarationDeclaration"
"type": "FunctionExpressionBodyItem", },
"index": 0 {
}, "type": "VariableDeclarationInit"
{
"type": "ReturnStatementArg"
}
]
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "id",
"functionSourceRange": [],
"unlabeledArg": {
"value": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, ]
"sourceRange": []
}, },
"labeledArgs": {} "sourceRange": []
}, },
"nodePath": { {
"steps": [ "type": "GroupEnd"
{
"type": "ProgramBodyItem",
"index": 3
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
}, },
"sourceRange": [] {
}, "type": "GroupBegin",
{ "group": {
"type": "GroupBegin", "type": "FunctionCall",
"group": { "name": "id",
"type": "FunctionCall", "functionSourceRange": [],
"name": "id", "unlabeledArg": {
"functionSourceRange": [], "value": {
"unlabeledArg": { "type": "String",
"value": { "value": "a"
"type": "String", },
"value": "a" "sourceRange": []
}, },
"sourceRange": [] "labeledArgs": {}
}, },
"labeledArgs": {} "nodePath": {
}, "steps": [
"nodePath": { {
"steps": [ "type": "ProgramBodyItem",
{ "index": 4
"type": "ProgramBodyItem", },
"index": 4 {
}, "type": "VariableDeclarationDeclaration"
{ },
"type": "VariableDeclarationDeclaration" {
}, "type": "VariableDeclarationInit"
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "singleton",
"functionSourceRange": [],
"unlabeledArg": {
"value": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, ]
"sourceRange": []
}, },
"labeledArgs": {} "sourceRange": []
}, },
"nodePath": { {
"steps": [ "type": "GroupEnd"
{
"type": "ProgramBodyItem",
"index": 5
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
}, },
"sourceRange": [] {
}, "type": "GroupBegin",
{ "group": {
"type": "GroupBegin", "type": "FunctionCall",
"group": { "name": "singleton",
"type": "FunctionCall", "functionSourceRange": [],
"name": "len", "unlabeledArg": {
"functionSourceRange": [], "value": {
"unlabeledArg": { "type": "Number",
"value": { "value": 1.0,
"type": "Array", "ty": {
"value": [] "type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
"sourceRange": [] "labeledArgs": {}
}, },
"labeledArgs": {} "nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 5
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
}, },
"nodePath": { {
"steps": [ "type": "GroupEnd"
{
"type": "ProgramBodyItem",
"index": 6
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
}, },
"sourceRange": [] {
}, "type": "GroupBegin",
{ "group": {
"type": "GroupBegin", "type": "FunctionCall",
"group": { "name": "len",
"type": "FunctionCall", "functionSourceRange": [],
"name": "len", "unlabeledArg": {
"functionSourceRange": [], "value": {
"unlabeledArg": { "type": "Array",
"value": { "value": []
"type": "Array", },
"value": [ "sourceRange": []
{ },
"labeledArgs": {}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 6
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "GroupEnd"
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "len",
"functionSourceRange": [],
"unlabeledArg": {
"value": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
},
"sourceRange": []
},
"labeledArgs": {}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": null,
"functionSourceRange": [],
"unlabeledArg": {
"value": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"labeledArgs": {
"accum": {
"value": {
"type": "Number", "type": "Number",
"value": 1.0, "value": 0.0,
"ty": { "ty": {
"type": "Default", "type": "Default",
"len": { "len": {
@ -234,45 +239,53 @@ description: Operations executed any_type.kcl
"type": "Degrees" "type": "Degrees"
} }
} }
} },
] "sourceRange": []
}, }
"sourceRange": []
},
"labeledArgs": {}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
} }
] },
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 2
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ReturnStatementArg"
}
]
},
"sourceRange": []
}, },
"sourceRange": [] {
}, "type": "GroupEnd"
{ },
"type": "GroupEnd" {
}, "type": "GroupEnd"
{ }
"type": "GroupEnd" ],
}, "std::appearance": [],
{ "std::array": [],
"type": "GroupEnd" "std::math": [],
}, "std::prelude": [],
{ "std::sketch": [],
"type": "GroupEnd" "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"type": "GroupEnd" "std::turns": [],
}, "std::types": [],
{ "std::units": []
"type": "GroupEnd" }
}
]

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands argument_error.kcl description: Artifact commands argument_error.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/argument_error/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed argument_error.kcl description: Operations executed argument_error.kcl
--- ---
[] {
"rust/kcl-lib/tests/argument_error/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_elem_pop.kcl description: Artifact commands array_elem_pop.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_elem_pop/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_elem_pop.kcl description: Operations executed array_elem_pop.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_elem_pop/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_elem_pop_empty_fail.kcl description: Artifact commands array_elem_pop_empty_fail.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_elem_pop_empty_fail/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_elem_pop_empty_fail.kcl description: Operations executed array_elem_pop_empty_fail.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_elem_pop_empty_fail/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_elem_pop_fail.kcl description: Artifact commands array_elem_pop_fail.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_elem_pop_fail/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_elem_pop_fail.kcl description: Operations executed array_elem_pop_fail.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_elem_pop_fail/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_elem_push.kcl description: Artifact commands array_elem_push.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_elem_push/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_elem_push.kcl description: Operations executed array_elem_push.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_elem_push/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_elem_push_fail.kcl description: Artifact commands array_elem_push_fail.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_elem_push_fail/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_elem_push_fail.kcl description: Operations executed array_elem_push_fail.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_elem_push_fail/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_index_oob.kcl description: Artifact commands array_index_oob.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_index_oob/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_index_oob.kcl description: Operations executed array_index_oob.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_index_oob/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_push_item_wrong_type.kcl description: Artifact commands array_push_item_wrong_type.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_push_item_wrong_type/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_push_item_wrong_type.kcl description: Operations executed array_push_item_wrong_type.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_push_item_wrong_type/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_range_expr.kcl description: Artifact commands array_range_expr.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_range_expr/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_range_expr.kcl description: Operations executed array_range_expr.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_range_expr/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_range_mismatch_units.kcl description: Artifact commands array_range_mismatch_units.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_range_mismatch_units/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_range_mismatch_units.kcl description: Operations executed array_range_mismatch_units.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_range_mismatch_units/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_range_negative_expr.kcl description: Artifact commands array_range_negative_expr.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_range_negative_expr/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_range_negative_expr.kcl description: Operations executed array_range_negative_expr.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_range_negative_expr/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands array_range_with_units.kcl description: Artifact commands array_range_with_units.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/array_range_with_units/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed array_range_with_units.kcl description: Operations executed array_range_with_units.kcl
--- ---
[] {
"rust/kcl-lib/tests/array_range_with_units/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,406 +2,393 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands artifact_graph_example_code1.kcl description: Artifact commands artifact_graph_example_code1.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_example_code1/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -5.0,
"y": -5.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.55,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "line", "adjust_camera": false,
"end": { "planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -5.0, "x": -5.0,
"y": -5.0, "y": -5.0,
"z": 0.0 "z": 0.0
}, }
"relative": false
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "sketch_mode_disable"
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "extrude", "path": "[uuid]",
"target": "[uuid]", "segment": {
"distance": -10.0, "type": "line",
"faces": null, "end": {
"opposite": "None" "x": 0.0,
} "y": 10.0,
}, "z": 0.0
{ },
"cmdId": "[uuid]", "relative": true
"range": [], }
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]"
],
"radius": 5.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": null
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -2.0,
"y": -6.0,
"z": 0.0
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "sketch_mode_disable" "path": "[uuid]",
} "segment": {
}, "type": "line",
{ "end": {
"cmdId": "[uuid]", "x": 10.55,
"range": [], "y": 0.0,
"command": { "z": 0.0
"type": "start_path" },
} "relative": true
}, }
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 2.0,
"y": 3.0,
"z": 0.0
},
"relative": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "extend_path", "path": "[uuid]",
"path": "[uuid]", "segment": {
"segment": { "type": "line",
"type": "line", "end": {
"end": { "x": 0.0,
"x": 2.0, "y": -10.0,
"y": -3.0, "z": 0.0
"z": 0.0 },
}, "relative": true
"relative": true }
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "extend_path", "path": "[uuid]",
"path": "[uuid]", "segment": {
"segment": { "type": "line",
"type": "line", "end": {
"end": { "x": -5.0,
"y": -5.0,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": -10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]"
],
"radius": 5.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": null
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -2.0, "x": -2.0,
"y": -6.0, "y": -6.0,
"z": 0.0 "z": 0.0
}, }
"relative": false }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 2.0,
"y": 3.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 2.0,
"y": -3.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -2.0,
"y": -6.0,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": null
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 5.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "close_path", "std::sketch": [],
"path_id": "[uuid]" "std::solid": [],
} "std::sweep": [],
}, "std::transform": [],
{ "std::turns": [],
"cmdId": "[uuid]", "std::types": [],
"range": [], "std::units": []
"command": { }
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": null
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 5.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
}
]

View File

@ -2,237 +2,250 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed artifact_graph_example_code1.kcl description: Operations executed artifact_graph_example_code1.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_example_code1/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"radius": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg01",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 1
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 2 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 0 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"length": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 5.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "length": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": -10.0,
"index": 3 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
}, },
"sourceRange": [] {
} "type": "StdLibCall",
] "name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"radius": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg01",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 1
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 2
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 3
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,294 +2,281 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands artifact_graph_example_code_no_3d.kcl description: Artifact commands artifact_graph_example_code_no_3d.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_example_code_no_3d/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
}, "x": 0.0,
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 1.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 5.82,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -11.54,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 8.21, "y": 1.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
} "x": 0.0,
} "y": 0.0,
}, "z": 1.0
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 11.54,
"y": -0.0,
"z": 0.0
}, },
"relative": true "size": 60.0,
"clobber": false,
"hide": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "line", "adjust_camera": false,
"end": { "planar_normal": {
"x": 1.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 5.82, "x": 5.82,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, }
"relative": false
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "sketch_mode_disable"
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 1.0,
"z": -0.0
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "move_path_pen", "path": "[uuid]",
"path": "[uuid]", "segment": {
"to": { "type": "line",
"x": 0.0, "end": {
"y": 14.36, "x": -11.54,
"z": 0.0 "y": 0.0,
"z": 0.0
},
"relative": true
}
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "sketch_mode_disable" "path": "[uuid]",
} "segment": {
}, "type": "line",
{ "end": {
"cmdId": "[uuid]", "x": 0.0,
"range": [], "y": 8.21,
"command": { "z": 0.0
"type": "start_path" },
} "relative": true
}, }
{ }
"cmdId": "[uuid]", },
"range": [], {
"command": { "cmdId": "[uuid]",
"type": "extend_path", "range": [],
"path": "[uuid]", "command": {
"segment": { "type": "extend_path",
"type": "line", "path": "[uuid]",
"end": { "segment": {
"x": 15.49, "type": "line",
"y": 0.05, "end": {
"x": 11.54,
"y": -0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 5.82,
"y": 0.0,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "tangential_arc_to", "adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 1.0,
"z": -0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": { "to": {
"x": -15.49, "x": 0.0,
"y": -14.41, "y": 14.36,
"z": 0.0 "z": 0.0
}, }
"angle_snap_increment": null }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 15.49,
"y": 0.05,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "tangential_arc_to",
"to": {
"x": -15.49,
"y": -14.41,
"z": 0.0
},
"angle_snap_increment": null
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "tangential_arc_to",
"to": {
"x": -6.8,
"y": 8.17,
"z": 0.0
},
"angle_snap_increment": null
}
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "extend_path", "std::sketch": [],
"path": "[uuid]", "std::solid": [],
"segment": { "std::sweep": [],
"type": "tangential_arc_to", "std::transform": [],
"to": { "std::turns": [],
"x": -6.8, "std::types": [],
"y": 8.17, "std::units": []
"z": 0.0 }
},
"angle_snap_increment": null
}
}
}
]

View File

@ -2,67 +2,80 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed artifact_graph_example_code_no_3d.kcl description: Operations executed artifact_graph_example_code_no_3d.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_example_code_no_3d/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane", "value": {
"artifact_id": "[uuid]" "type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": {}, {
"nodePath": { "type": "StdLibCall",
"steps": [ "name": "startSketchOn",
{ "unlabeledArg": {
"type": "ProgramBodyItem", "value": {
"index": 0 "type": "Plane",
"artifact_id": "[uuid]"
}, },
{ "sourceRange": []
"type": "VariableDeclarationDeclaration" },
}, "labeledArgs": {},
{ "nodePath": {
"type": "VariableDeclarationInit" "steps": [
}, {
{ "type": "ProgramBodyItem",
"type": "PipeBodyItem", "index": 1
"index": 0 },
} {
] "type": "VariableDeclarationDeclaration"
}, },
"sourceRange": [] {
}, "type": "VariableDeclarationInit"
{ },
"type": "StdLibCall", {
"name": "startSketchOn", "type": "PipeBodyItem",
"unlabeledArg": { "index": 0
"value": { }
"type": "Plane", ]
"artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
}, }
"labeledArgs": {}, ],
"nodePath": { "std::appearance": [],
"steps": [ "std::array": [],
{ "std::math": [],
"type": "ProgramBodyItem", "std::prelude": [],
"index": 1 "std::sketch": [],
}, "std::solid": [],
{ "std::sweep": [],
"type": "VariableDeclarationDeclaration" "std::transform": [],
}, "std::turns": [],
{ "std::types": [],
"type": "VariableDeclarationInit" "std::units": []
}, }
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
}
]

View File

@ -2,217 +2,204 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands artifact_graph_example_code_offset_planes.kcl description: Artifact commands artifact_graph_example_code_offset_planes.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_example_code_offset_planes/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
}, "x": 0.0,
{ "y": 0.0,
"cmdId": "[uuid]", "z": 20.0
"range": [], },
"command": { "x_axis": {
"type": "object_visible", "x": 1.0,
"object_id": "[uuid]", "y": 0.0,
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 100.0,
"clobber": false,
"hide": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 50.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 6.78,
"y": 15.01,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 100.0,
"clobber": false,
"hide": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 50.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 6.78,
"y": 15.01,
"z": 0.0
},
"relative": true
}
} }
} }
} ],
] "std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,168 +2,181 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed artifact_graph_example_code_offset_planes.kcl description: Operations executed artifact_graph_example_code_offset_planes.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_example_code_offset_planes/input.kcl": [
"type": "StdLibCall", {
"name": "offsetPlane", "type": "StdLibCall",
"unlabeledArg": { "name": "offsetPlane",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"offset": {
"value": { "value": {
"type": "Number", "type": "Plane",
"value": 20.0, "artifact_id": "[uuid]"
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "offset": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 20.0,
"index": 0 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
}, {
{ "type": "ProgramBodyItem",
"type": "StdLibCall", "index": 0
"name": "offsetPlane", },
"unlabeledArg": { {
"value": { "type": "VariableDeclarationDeclaration"
"type": "Plane", },
"artifact_id": "[uuid]" {
"type": "VariableDeclarationInit"
}
]
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"offset": { "type": "StdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Plane",
"value": -50.0, "artifact_id": "[uuid]"
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "offset": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": -50.0,
"index": 1 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
}, {
{ "type": "ProgramBodyItem",
"type": "StdLibCall", "index": 1
"name": "offsetPlane", },
"unlabeledArg": { {
"value": { "type": "VariableDeclarationDeclaration"
"type": "Plane", },
"artifact_id": "[uuid]" {
"type": "VariableDeclarationInit"
}
]
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"offset": { "type": "StdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Plane",
"value": 10.0, "artifact_id": "[uuid]"
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "offset": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 10.0,
"index": 2 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
}, {
{ "type": "ProgramBodyItem",
"type": "StdLibCall", "index": 2
"name": "startSketchOn", },
"unlabeledArg": { {
"value": { "type": "VariableDeclarationDeclaration"
"type": "Plane", },
"artifact_id": "[uuid]" {
"type": "VariableDeclarationInit"
}
]
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": {}, {
"nodePath": { "type": "StdLibCall",
"steps": [ "name": "startSketchOn",
{ "unlabeledArg": {
"type": "ProgramBodyItem", "value": {
"index": 3 "type": "Plane",
"artifact_id": "[uuid]"
}, },
{ "sourceRange": []
"type": "VariableDeclarationDeclaration" },
}, "labeledArgs": {},
{ "nodePath": {
"type": "VariableDeclarationInit" "steps": [
}, {
{ "type": "ProgramBodyItem",
"type": "PipeBodyItem", "index": 3
"index": 0 },
} {
] "type": "VariableDeclarationDeclaration"
}, },
"sourceRange": [] {
} "type": "VariableDeclarationInit"
] },
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,345 +2,358 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed artifact_graph_sketch_on_face_etc.kcl description: Operations executed artifact_graph_sketch_on_face_etc.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/artifact_graph_sketch_on_face_etc/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 6.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "TagIdentifier",
"value": "seg01",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 2 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 0 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"length": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 5.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 3
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "labeledArgs": {
}, "length": {
"labeledArgs": { "value": {
"face": { "type": "Number",
"value": { "value": 6.0,
"type": "String", "ty": {
"value": "END" "type": "Default",
}, "len": {
"sourceRange": [] "type": "Mm"
} },
}, "angle": {
"nodePath": { "type": "Degrees"
"steps": [ }
{
"type": "ProgramBodyItem",
"index": 4
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 4.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
} }
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
} }
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "face": {
"steps": [ "value": {
{ "type": "TagIdentifier",
"type": "ProgramBodyItem", "value": "seg01",
"index": 5 "artifact_id": "[uuid]"
}, },
{ "sourceRange": []
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
} }
}, },
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 2
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"face": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "TagIdentifier", "type": "Sketch",
"value": "seg02", "value": {
"artifact_id": "[uuid]" "artifactId": "[uuid]"
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 6
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 3.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "length": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 5.0,
"index": 7 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 3
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
}, },
"sourceRange": [] {
} "type": "StdLibCall",
] "name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "String",
"value": "END"
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 4
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 4.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 5
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 6
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 3.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands ascription_unknown_type.kcl description: Artifact commands ascription_unknown_type.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/ascription_unknown_type/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed ascription_unknown_type.kcl description: Operations executed ascription_unknown_type.kcl
--- ---
[] {
"rust/kcl-lib/tests/ascription_unknown_type/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,439 +2,429 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands assembly_mixed_units_cubes.kcl description: Artifact commands assembly_mixed_units_cubes.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/assembly_mixed_units_cubes/cube-inches.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -254.0,
"y": -254.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 127.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": -127.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -127.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "line", "adjust_camera": false,
"end": { "planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -254.0, "x": -254.0,
"y": -254.0, "y": -254.0,
"z": 0.0 "z": 0.0
}, }
"relative": false
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "sketch_mode_disable"
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "extrude", "path": "[uuid]",
"target": "[uuid]", "segment": {
"distance": 127.0, "type": "line",
"faces": null, "end": {
"opposite": "None" "x": 127.0,
} "y": 0.0,
}, "z": 0.0
{ },
"cmdId": "[uuid]", "relative": true
"range": [], }
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "move_path_pen", "path": "[uuid]",
"path": "[uuid]", "segment": {
"to": { "type": "line",
"x": 10.0, "end": {
"y": 10.0, "x": 0.0,
"z": 0.0 "y": -127.0,
"z": 0.0
},
"relative": true
}
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "sketch_mode_disable" "path": "[uuid]",
} "segment": {
}, "type": "line",
{ "end": {
"cmdId": "[uuid]", "x": -127.0,
"range": [], "y": 0.0,
"command": { "z": 0.0
"type": "start_path" },
} "relative": true
}, }
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 5.0,
"y": 0.0,
"z": 0.0
},
"relative": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "extend_path",
"type": "extend_path", "path": "[uuid]",
"path": "[uuid]", "segment": {
"segment": { "type": "line",
"type": "line", "end": {
"end": { "x": -254.0,
"y": -254.0,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0, "x": 0.0,
"y": -5.0, "y": 0.0,
"z": 0.0 "z": 1.0
}, }
"relative": true }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 127.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
} }
} }
}, ],
{ "rust/kcl-lib/tests/assembly_mixed_units_cubes/cube-mm.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "extend_path", "command": {
"path": "[uuid]", "type": "make_plane",
"segment": { "origin": {
"type": "line", "x": 0.0,
"end": {
"x": -5.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "line", "adjust_camera": false,
"end": { "planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 10.0, "x": 10.0,
"y": 10.0, "y": 10.0,
"z": 0.0 "z": 0.0
}, }
"relative": false }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 5.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -5.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -5.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 10.0,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 5.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
} }
} }
}, ],
{ "rust/kcl-lib/tests/assembly_mixed_units_cubes/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "close_path", "std::prelude": [],
"path_id": "[uuid]" "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "enable_sketch_mode", }
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 5.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
}
]

View File

@ -2,45 +2,164 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed assembly_mixed_units_cubes.kcl description: Operations executed assembly_mixed_units_cubes.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/assembly_mixed_units_cubes/cube-inches.kcl": [
"type": "GroupBegin", {
"group": { "type": "StdLibCall",
"type": "ModuleInstance", "name": "startSketchOn",
"name": "cube-inches.kcl", "unlabeledArg": {
"moduleId": 0 "value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": []
},
"sourceRange": []
}, },
"nodePath": { {
"steps": [ "type": "StdLibCall",
{ "name": "extrude",
"type": "ProgramBodyItem", "unlabeledArg": {
"index": 0 "value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
"nodePath": {
"steps": []
},
"sourceRange": []
}
],
"rust/kcl-lib/tests/assembly_mixed_units_cubes/cube-mm.kcl": [
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": []
},
"sourceRange": []
}, },
"sourceRange": [] {
}, "type": "StdLibCall",
{ "name": "extrude",
"type": "GroupBegin", "unlabeledArg": {
"group": { "value": {
"type": "ModuleInstance", "type": "Sketch",
"name": "cube-mm.kcl", "value": {
"moduleId": 0 "artifactId": "[uuid]"
}, }
"nodePath": { },
"steps": [ "sourceRange": []
{ },
"type": "ProgramBodyItem", "labeledArgs": {
"index": 1 "length": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
} }
] },
"nodePath": {
"steps": []
},
"sourceRange": []
}
],
"rust/kcl-lib/tests/assembly_mixed_units_cubes/input.kcl": [
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "cube-inches.kcl",
"moduleId": 0
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
}
]
},
"sourceRange": []
}, },
"sourceRange": [] {
}, "type": "GroupEnd"
{ },
"type": "GroupEnd" {
}, "type": "GroupBegin",
{ "group": {
"type": "GroupEnd" "type": "ModuleInstance",
} "name": "cube-mm.kcl",
] "moduleId": 0
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
}
]
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,233 +2,224 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands assembly_non_default_units.kcl description: Artifact commands assembly_non_default_units.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/assembly_non_default_units/globals.kcl": [],
"cmdId": "[uuid]", "rust/kcl-lib/tests/assembly_non_default_units/input.kcl": [],
"range": [], "rust/kcl-lib/tests/assembly_non_default_units/other1.kcl": [
"command": { {
"type": "edge_lines_visible", "cmdId": "[uuid]",
"hidden": false "range": [],
} "command": {
}, "type": "make_plane",
{ "origin": {
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": -1.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 0.0, "x": 0.0,
"y": 0.0 "y": 0.0,
"z": 0.0
}, },
"radius": 25.4, "x_axis": {
"start": { "x": 1.0,
"unit": "degrees", "y": 0.0,
"value": 0.0 "z": 0.0
}, },
"end": { "y_axis": {
"unit": "degrees",
"value": 360.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 25.4,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": -1.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 0.0, "x": 0.0,
"y": 50.8 "y": 0.0,
"z": 1.0
}, },
"radius": 25.4, "size": 60.0,
"start": { "clobber": false,
"unit": "degrees", "hide": true
"value": 0.0 }
}, },
"end": { {
"unit": "degrees", "cmdId": "[uuid]",
"value": 360.0 "range": [],
}, "command": {
"relative": false "type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": -1.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 25.4,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 0.0,
"y": 0.0
},
"radius": 25.4,
"start": {
"unit": "degrees",
"value": 0.0
},
"end": {
"unit": "degrees",
"value": 360.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
} }
} }
}, ],
{ "rust/kcl-lib/tests/assembly_non_default_units/other2.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "move_path_pen", "command": {
"path": "[uuid]", "type": "make_plane",
"to": { "origin": {
"x": 25.4, "x": 0.0,
"y": 50.8, "y": 0.0,
"z": 0.0 "z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": -1.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 25.4,
"y": 50.8,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 0.0,
"y": 50.8
},
"radius": 25.4,
"start": {
"unit": "degrees",
"value": 0.0
},
"end": {
"unit": "degrees",
"value": 360.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "sketch_mode_disable" "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "start_path" }
}
}
]

View File

@ -2,45 +2,95 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed assembly_non_default_units.kcl description: Operations executed assembly_non_default_units.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/assembly_non_default_units/globals.kcl": [],
"type": "GroupBegin", "rust/kcl-lib/tests/assembly_non_default_units/input.kcl": [
"group": { {
"type": "ModuleInstance", "type": "GroupBegin",
"name": "other1.kcl", "group": {
"moduleId": 0 "type": "ModuleInstance",
"name": "other2.kcl",
"moduleId": 0
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
}
]
},
"sourceRange": []
}, },
"nodePath": { {
"steps": [ "type": "GroupEnd"
{
"type": "ProgramBodyItem",
"index": 0
}
]
}, },
"sourceRange": [] {
}, "type": "GroupBegin",
{ "group": {
"type": "GroupBegin", "type": "ModuleInstance",
"group": { "name": "other1.kcl",
"type": "ModuleInstance", "moduleId": 0
"name": "other2.kcl", },
"moduleId": 0 "nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
}
]
},
"sourceRange": []
}, },
"nodePath": { {
"steps": [ "type": "GroupEnd"
{ }
"type": "ProgramBodyItem", ],
"index": 1 "rust/kcl-lib/tests/assembly_non_default_units/other1.kcl": [
} {
] "type": "StdLibCall",
}, "name": "startSketchOn",
"sourceRange": [] "unlabeledArg": {
}, "value": {
{ "type": "Plane",
"type": "GroupEnd" "artifact_id": "[uuid]"
}, },
{ "sourceRange": []
"type": "GroupEnd" },
} "labeledArgs": {},
] "nodePath": {
"steps": []
},
"sourceRange": []
}
],
"rust/kcl-lib/tests/assembly_non_default_units/other2.kcl": [
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": []
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands bad_units_in_annotation.kcl description: Artifact commands bad_units_in_annotation.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/bad_units_in_annotation/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed bad_units_in_annotation.kcl description: Operations executed bad_units_in_annotation.kcl
--- ---
[] {
"rust/kcl-lib/tests/bad_units_in_annotation/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,248 +2,235 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands basic_fillet_cube_close_opposite.kcl description: Artifact commands basic_fillet_cube_close_opposite.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_close_opposite/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": [
"[uuid]"
]
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "close_path", "std::sketch": [],
"path_id": "[uuid]" "std::solid": [],
} "std::sweep": [],
}, "std::transform": [],
{ "std::turns": [],
"cmdId": "[uuid]", "std::types": [],
"range": [], "std::units": []
"command": { }
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": [
"[uuid]"
]
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
}
]

View File

@ -2,153 +2,166 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_close_opposite.kcl description: Operations executed basic_fillet_cube_close_opposite.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_close_opposite/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
} "artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 0 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 6 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"radius": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 2.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
}, },
"tags": { "labeledArgs": {
"value": { "length": {
"type": "Array", "value": {
"value": [ "type": "Number",
{ "value": 10.0,
"type": "TagIdentifier", "ty": {
"value": "thing3", "type": "Default",
"artifact_id": "[uuid]" "len": {
}, "type": "Mm"
{ },
"type": "Uuid", "angle": {
"value": "[uuid]" "type": "Degrees"
}
} }
] },
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 6
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "radius": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 2.0,
"index": 0 "ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
{ "tags": {
"type": "VariableDeclarationDeclaration" "value": {
}, "type": "Array",
{ "value": [
"type": "VariableDeclarationInit" {
}, "type": "TagIdentifier",
{ "value": "thing3",
"type": "PipeBodyItem", "artifact_id": "[uuid]"
"index": 7 },
{
"type": "Uuid",
"value": "[uuid]"
}
]
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 7
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,248 +2,235 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands basic_fillet_cube_end.kcl description: Artifact commands basic_fillet_cube_end.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_end/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": [
"[uuid]"
]
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "close_path", "std::sketch": [],
"path_id": "[uuid]" "std::solid": [],
} "std::sweep": [],
}, "std::transform": [],
{ "std::turns": [],
"cmdId": "[uuid]", "std::types": [],
"range": [], "std::units": []
"command": { }
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": [
"[uuid]"
]
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
}
]

View File

@ -2,153 +2,166 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_end.kcl description: Operations executed basic_fillet_cube_end.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_end/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
} "artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 0 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 6 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"radius": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 2.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
}, },
"tags": { "labeledArgs": {
"value": { "length": {
"type": "Array", "value": {
"value": [ "type": "Number",
{ "value": 10.0,
"type": "TagIdentifier", "ty": {
"value": "thing", "type": "Default",
"artifact_id": "[uuid]" "len": {
}, "type": "Mm"
{ },
"type": "Uuid", "angle": {
"value": "[uuid]" "type": "Degrees"
}
} }
] },
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 6
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "radius": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 2.0,
"index": 0 "ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
{ "tags": {
"type": "VariableDeclarationDeclaration" "value": {
}, "type": "Array",
{ "value": [
"type": "VariableDeclarationInit" {
}, "type": "TagIdentifier",
{ "value": "thing",
"type": "PipeBodyItem", "artifact_id": "[uuid]"
"index": 7 },
{
"type": "Uuid",
"value": "[uuid]"
}
]
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 7
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,245 +2,232 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands basic_fillet_cube_next_adjacent.kcl description: Artifact commands basic_fillet_cube_next_adjacent.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_next_adjacent/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "close_path", "std::sketch": [],
"path_id": "[uuid]" "std::solid": [],
} "std::sweep": [],
}, "std::transform": [],
{ "std::turns": [],
"cmdId": "[uuid]", "std::types": [],
"range": [], "std::units": []
"command": { }
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
}
]

View File

@ -2,148 +2,161 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_next_adjacent.kcl description: Operations executed basic_fillet_cube_next_adjacent.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_next_adjacent/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
} "artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 0 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 6 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"radius": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 2.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
}, },
"tags": { "labeledArgs": {
"value": { "length": {
"type": "Array", "value": {
"value": [ "type": "Number",
{ "value": 10.0,
"type": "Uuid", "ty": {
"value": "[uuid]" "type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
] },
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 6
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "radius": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 2.0,
"index": 0 "ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
{ "tags": {
"type": "VariableDeclarationDeclaration" "value": {
}, "type": "Array",
{ "value": [
"type": "VariableDeclarationInit" {
}, "type": "Uuid",
{ "value": "[uuid]"
"type": "PipeBodyItem", }
"index": 7 ]
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 7
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,245 +2,232 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands basic_fillet_cube_previous_adjacent.kcl description: Artifact commands basic_fillet_cube_previous_adjacent.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_previous_adjacent/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_prev_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "close_path", "std::sketch": [],
"path_id": "[uuid]" "std::solid": [],
} "std::sweep": [],
}, "std::transform": [],
{ "std::turns": [],
"cmdId": "[uuid]", "std::types": [],
"range": [], "std::units": []
"command": { }
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_prev_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
}
]

View File

@ -2,148 +2,161 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_previous_adjacent.kcl description: Operations executed basic_fillet_cube_previous_adjacent.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_previous_adjacent/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
} "artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 0 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 6 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"radius": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 2.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
}, },
"tags": { "labeledArgs": {
"value": { "length": {
"type": "Array", "value": {
"value": [ "type": "Number",
{ "value": 10.0,
"type": "Uuid", "ty": {
"value": "[uuid]" "type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
] },
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 6
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "radius": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 2.0,
"index": 0 "ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
{ "tags": {
"type": "VariableDeclarationDeclaration" "value": {
}, "type": "Array",
{ "value": [
"type": "VariableDeclarationInit" {
}, "type": "Uuid",
{ "value": "[uuid]"
"type": "PipeBodyItem", }
"index": 7 ]
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 7
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,238 +2,225 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands basic_fillet_cube_start.kcl description: Artifact commands basic_fillet_cube_start.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_start/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0, "x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "x_axis": {
} "x": 1.0,
} "y": 0.0,
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0 "z": 0.0
}, },
"relative": true "y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": [
"[uuid]"
]
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "close_path", "std::sketch": [],
"path_id": "[uuid]" "std::solid": [],
} "std::sweep": [],
}, "std::transform": [],
{ "std::turns": [],
"cmdId": "[uuid]", "std::types": [],
"range": [], "std::units": []
"command": { }
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 2.0,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": [
"[uuid]"
]
}
}
]

View File

@ -2,154 +2,167 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_start.kcl description: Operations executed basic_fillet_cube_start.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_fillet_cube_start/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
} "artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {},
"nodePath": { "nodePath": {
"steps": [ "steps": [
{ {
"type": "ProgramBodyItem", "type": "ProgramBodyItem",
"index": 0 "index": 0
}, },
{ {
"type": "VariableDeclarationDeclaration" "type": "VariableDeclarationDeclaration"
}, },
{ {
"type": "VariableDeclarationInit" "type": "VariableDeclarationInit"
}, },
{ {
"type": "PipeBodyItem", "type": "PipeBodyItem",
"index": 6 "index": 0
} }
] ]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": { {
"radius": { "type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": { "value": {
"type": "Number", "type": "Sketch",
"value": 2.0, "value": {
"ty": { "artifactId": "[uuid]"
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
}, },
"tags": { "labeledArgs": {
"value": { "length": {
"type": "Array", "value": {
"value": [ "type": "Number",
{ "value": 10.0,
"type": "TagIdentifier", "ty": {
"value": "thing", "type": "Default",
"artifact_id": "[uuid]" "len": {
}, "type": "Mm"
{ },
"type": "TagIdentifier", "angle": {
"value": "thing2", "type": "Degrees"
"artifact_id": "[uuid]" }
} }
] },
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 6
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "fillet",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "radius": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 2.0,
"index": 0 "ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
{ "tags": {
"type": "VariableDeclarationDeclaration" "value": {
}, "type": "Array",
{ "value": [
"type": "VariableDeclarationInit" {
}, "type": "TagIdentifier",
{ "value": "thing",
"type": "PipeBodyItem", "artifact_id": "[uuid]"
"index": 7 },
{
"type": "TagIdentifier",
"value": "thing2",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 7
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,183 +2,170 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands basic_revolve_circle.kcl description: Artifact commands basic_revolve_circle.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_revolve_circle/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
}, "x": 0.0,
{ "y": 0.0,
"cmdId": "[uuid]", "z": 0.0
"range": [], },
"command": { "x_axis": {
"type": "object_visible", "x": 1.0,
"object_id": "[uuid]", "y": 0.0,
"hidden": true "z": 0.0
} },
}, "y_axis": {
{ "x": 0.0,
"cmdId": "[uuid]", "y": 1.0,
"range": [], "z": 0.0
"command": { },
"type": "object_visible", "size": 60.0,
"object_id": "[uuid]", "clobber": false,
"hidden": true "hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
} }
} },
}, {
{ "cmdId": "[uuid]",
"cmdId": "[uuid]", "range": [],
"range": [], "command": {
"command": { "type": "enable_sketch_mode",
"type": "extend_path", "entity_id": "[uuid]",
"path": "[uuid]", "ortho": false,
"segment": { "animated": false,
"type": "arc", "adjust_camera": false,
"center": { "planar_normal": {
"x": 15.0, "x": 0.0,
"y": 0.0 "y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 20.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 15.0,
"y": 0.0
},
"radius": 5.0,
"start": {
"unit": "degrees",
"value": 0.0
},
"end": {
"unit": "degrees",
"value": 360.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "revolve",
"target": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}, },
"radius": 5.0, "axis": {
"start": { "x": 0.0,
"unit": "degrees", "y": 1.0,
"value": 0.0 "z": 0.0
}, },
"end": { "axis_is_2d": true,
"angle": {
"unit": "degrees", "unit": "degrees",
"value": 360.0 "value": 360.0
}, },
"relative": false "tolerance": 0.0000001,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "move_path_pen", "std::sketch": [],
"path": "[uuid]", "std::solid": [],
"to": { "std::sweep": [],
"x": 20.0, "std::transform": [],
"y": 0.0, "std::turns": [],
"z": 0.0 "std::types": [],
} "std::units": []
} }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "revolve",
"target": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"axis_is_2d": true,
"angle": {
"unit": "degrees",
"value": 360.0
},
"tolerance": 0.0000001,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
}
]

View File

@ -2,156 +2,169 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed basic_revolve_circle.kcl description: Operations executed basic_revolve_circle.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/basic_revolve_circle/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "revolve",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Plane",
} "artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"angle": {
"value": {
"type": "Number",
"value": 360.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}, },
"sourceRange": [] "sourceRange": []
}, },
"axis": { "labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "revolve",
"unlabeledArg": {
"value": { "value": {
"type": "Object", "type": "Sketch",
"value": { "value": {
"direction": { "artifactId": "[uuid]"
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
},
"origin": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
}
} }
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "angle": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 360.0,
"index": 0 "ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}, },
{ "axis": {
"type": "VariableDeclarationDeclaration" "value": {
}, "type": "Object",
{ "value": {
"type": "VariableDeclarationInit" "direction": {
}, "type": "Array",
{ "value": [
"type": "PipeBodyItem", {
"index": 2 "type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
},
"origin": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
}
}
},
"sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 2
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands boolean_logical_and.kcl description: Artifact commands boolean_logical_and.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/boolean_logical_and/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed boolean_logical_and.kcl description: Operations executed boolean_logical_and.kcl
--- ---
[] {
"rust/kcl-lib/tests/boolean_logical_and/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands boolean_logical_multiple.kcl description: Artifact commands boolean_logical_multiple.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/boolean_logical_multiple/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed boolean_logical_multiple.kcl description: Operations executed boolean_logical_multiple.kcl
--- ---
[] {
"rust/kcl-lib/tests/boolean_logical_multiple/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,31 +2,17 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands boolean_logical_or.kcl description: Artifact commands boolean_logical_or.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/boolean_logical_or/input.kcl": [],
"cmdId": "[uuid]", "std::appearance": [],
"range": [], "std::array": [],
"command": { "std::math": [],
"type": "edge_lines_visible", "std::prelude": [],
"hidden": false "std::sketch": [],
} "std::solid": [],
}, "std::sweep": [],
{ "std::transform": [],
"cmdId": "[uuid]", "std::turns": [],
"range": [], "std::types": [],
"command": { "std::units": []
"type": "object_visible", }
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -1,5 +1,18 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed boolean_logical_or.kcl description: Operations executed boolean_logical_or.kcl
--- ---
[] {
"rust/kcl-lib/tests/boolean_logical_or/input.kcl": [],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

View File

@ -2,192 +2,179 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Artifact commands circle_three_point.kcl description: Artifact commands circle_three_point.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/circle_three_point/input.kcl": [
"cmdId": "[uuid]", {
"range": [], "cmdId": "[uuid]",
"command": { "range": [],
"type": "edge_lines_visible", "command": {
"hidden": false "type": "make_plane",
} "origin": {
}, "x": 0.0,
{ "y": 0.0,
"cmdId": "[uuid]", "z": 0.0
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 24.75,
"y": 19.75
}, },
"radius": 5.25594901040716, "x_axis": {
"start": { "x": 1.0,
"unit": "degrees", "y": 0.0,
"value": 0.0 "z": 0.0
}, },
"end": { "y_axis": {
"unit": "degrees", "x": 0.0,
"value": 360.0 "y": 1.0,
"z": 0.0
}, },
"relative": false "size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 30.006,
"y": 19.75,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 24.75,
"y": 19.75
},
"radius": 5.25594901040716,
"start": {
"unit": "degrees",
"value": 0.0
},
"end": {
"unit": "degrees",
"value": 360.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
} }
} }
}, ],
{ "std::appearance": [],
"cmdId": "[uuid]", "std::array": [],
"range": [], "std::math": [],
"command": { "std::prelude": [],
"type": "move_path_pen", "std::sketch": [],
"path": "[uuid]", "std::solid": [],
"to": { "std::sweep": [],
"x": 30.006, "std::transform": [],
"y": 19.75, "std::turns": [],
"z": 0.0 "std::types": [],
} "std::units": []
} }
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_adjacency_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
}
]

View File

@ -2,86 +2,99 @@
source: kcl-lib/src/simulation_tests.rs source: kcl-lib/src/simulation_tests.rs
description: Operations executed circle_three_point.kcl description: Operations executed circle_three_point.kcl
--- ---
[ {
{ "rust/kcl-lib/tests/circle_three_point/input.kcl": [
"type": "StdLibCall", {
"name": "startSketchOn", "type": "StdLibCall",
"unlabeledArg": { "name": "startSketchOn",
"value": { "unlabeledArg": {
"type": "Plane", "value": {
"artifact_id": "[uuid]" "type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
}, },
"sourceRange": [] "sourceRange": []
}, },
"labeledArgs": {}, {
"nodePath": { "type": "StdLibCall",
"steps": [ "name": "extrude",
{ "unlabeledArg": {
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": { "value": {
"artifactId": "[uuid]" "type": "Sketch",
} "value": {
}, "artifactId": "[uuid]"
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
} }
}, },
"sourceRange": [] "sourceRange": []
} },
}, "labeledArgs": {
"nodePath": { "length": {
"steps": [ "value": {
{ "type": "Number",
"type": "ProgramBodyItem", "value": 10.0,
"index": 0 "ty": {
}, "type": "Default",
{ "len": {
"type": "VariableDeclarationDeclaration" "type": "Mm"
}, },
{ "angle": {
"type": "VariableDeclarationInit" "type": "Degrees"
}, }
{ }
"type": "PipeBodyItem", },
"index": 2 "sourceRange": []
} }
] },
}, "nodePath": {
"sourceRange": [] "steps": [
} {
] "type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 2
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [],
"std::prelude": [],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

Some files were not shown because too many files have changed in this diff Show More