Make ProgramMemory and the internals of ExecState private (#5364)

* Make ProgramMemory and the internals of ExecState private

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* snapshot test changes

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-02-13 11:59:57 +13:00
committed by GitHub
parent b9862baed0
commit 59d0e079a1
97 changed files with 153926 additions and 156268 deletions

View File

@ -9,7 +9,6 @@ import {
modify_ast_for_sketch_wasm, modify_ast_for_sketch_wasm,
is_points_ccw, is_points_ccw,
get_tangential_arc_to_info, get_tangential_arc_to_info,
program_memory_init,
make_default_planes, make_default_planes,
coredump, coredump,
toml_stringify, toml_stringify,
@ -43,9 +42,6 @@ import { DeepPartial } from 'lib/types'
import { ProjectConfiguration } from 'wasm-lib/kcl/bindings/ProjectConfiguration' import { ProjectConfiguration } from 'wasm-lib/kcl/bindings/ProjectConfiguration'
import { Sketch } from '../wasm-lib/kcl/bindings/Sketch' import { Sketch } from '../wasm-lib/kcl/bindings/Sketch'
import { ExecOutcome as RustExecOutcome } from 'wasm-lib/kcl/bindings/ExecOutcome' import { ExecOutcome as RustExecOutcome } from 'wasm-lib/kcl/bindings/ExecOutcome'
import { ProgramMemory as RawProgramMemory } from '../wasm-lib/kcl/bindings/ProgramMemory'
import { EnvironmentRef } from '../wasm-lib/kcl/bindings/EnvironmentRef'
import { Environment } from '../wasm-lib/kcl/bindings/Environment'
import { Node } from 'wasm-lib/kcl/bindings/Node' import { Node } from 'wasm-lib/kcl/bindings/Node'
import { CompilationError } from 'wasm-lib/kcl/bindings/CompilationError' import { CompilationError } from 'wasm-lib/kcl/bindings/CompilationError'
import { SourceRange } from 'wasm-lib/kcl/bindings/SourceRange' import { SourceRange } from 'wasm-lib/kcl/bindings/SourceRange'

View File

@ -17,7 +17,6 @@ import {
modify_ast_for_sketch_wasm as ModifyAstForSketch, modify_ast_for_sketch_wasm as ModifyAstForSketch,
is_points_ccw as IsPointsCcw, is_points_ccw as IsPointsCcw,
get_tangential_arc_to_info as GetTangentialArcToInfo, get_tangential_arc_to_info as GetTangentialArcToInfo,
program_memory_init as ProgramMemoryInit,
make_default_planes as MakeDefaultPlanes, make_default_planes as MakeDefaultPlanes,
coredump as CoreDump, coredump as CoreDump,
toml_stringify as TomlStringify, toml_stringify as TomlStringify,
@ -80,9 +79,6 @@ export const get_tangential_arc_to_info: typeof GetTangentialArcToInfo = (
) => { ) => {
return getModule().get_tangential_arc_to_info(...args) return getModule().get_tangential_arc_to_info(...args)
} }
export const program_memory_init: typeof ProgramMemoryInit = (...args) => {
return getModule().program_memory_init(...args)
}
export const make_default_planes: typeof MakeDefaultPlanes = (...args) => { export const make_default_planes: typeof MakeDefaultPlanes = (...args) => {
return getModule().make_default_planes(...args) return getModule().make_default_planes(...args)
} }

View File

@ -442,7 +442,7 @@ fn do_stdlib_inner(
#const_struct #const_struct
fn #boxed_fn_name_ident( fn #boxed_fn_name_ident(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box<dyn std::future::Future<Output = anyhow::Result<crate::execution::KclValue, crate::errors::KclError>> + Send + '_>, Box<dyn std::future::Future<Output = anyhow::Result<crate::execution::KclValue, crate::errors::KclError>> + Send + '_>,
@ -831,7 +831,7 @@ fn generate_code_block_test(fn_name: &str, code_block: &str, index: usize) -> pr
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx.run(&program, &mut crate::ExecState::new(&ctx.settings)).await { if let Err(e) = ctx.run(&program, &mut crate::execution::ExecState::new(&ctx.settings)).await {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e, error: e,
filename: format!("{}{}", #fn_name, #index), filename: format!("{}{}", #fn_name, #index),

View File

@ -15,7 +15,10 @@ mod test_examples_someFn {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -67,7 +70,7 @@ pub(crate) struct SomeFn {}
#[doc = "Std lib function: someFn\nDocs"] #[doc = "Std lib function: someFn\nDocs"]
pub(crate) const SomeFn: SomeFn = SomeFn {}; pub(crate) const SomeFn: SomeFn = SomeFn {};
fn boxed_someFn( fn boxed_someFn(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -15,7 +15,10 @@ mod test_examples_someFn {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -67,7 +70,7 @@ pub(crate) struct SomeFn {}
#[doc = "Std lib function: someFn\nDocs"] #[doc = "Std lib function: someFn\nDocs"]
pub(crate) const SomeFn: SomeFn = SomeFn {}; pub(crate) const SomeFn: SomeFn = SomeFn {};
fn boxed_someFn( fn boxed_someFn(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -73,7 +76,10 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -125,7 +131,7 @@ pub(crate) struct Show {}
#[doc = "Std lib function: show\nThis is some function.\nIt does shit."] #[doc = "Std lib function: show\nThis is some function.\nIt does shit."]
pub(crate) const Show: Show = Show {}; pub(crate) const Show: Show = Show {};
fn boxed_show( fn boxed_show(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -68,7 +71,7 @@ pub(crate) struct Show {}
#[doc = "Std lib function: show\nThis is some function.\nIt does shit."] #[doc = "Std lib function: show\nThis is some function.\nIt does shit."]
pub(crate) const Show: Show = Show {}; pub(crate) const Show: Show = Show {};
fn boxed_show( fn boxed_show(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -17,7 +17,10 @@ mod test_examples_my_func {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -74,7 +77,10 @@ mod test_examples_my_func {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -126,7 +132,7 @@ pub(crate) struct MyFunc {}
#[doc = "Std lib function: myFunc\nThis is some function.\nIt does shit."] #[doc = "Std lib function: myFunc\nThis is some function.\nIt does shit."]
pub(crate) const MyFunc: MyFunc = MyFunc {}; pub(crate) const MyFunc: MyFunc = MyFunc {};
fn boxed_my_func( fn boxed_my_func(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -17,7 +17,10 @@ mod test_examples_line_to {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -74,7 +77,10 @@ mod test_examples_line_to {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -126,7 +132,7 @@ pub(crate) struct LineTo {}
#[doc = "Std lib function: lineTo\nThis is some function.\nIt does shit."] #[doc = "Std lib function: lineTo\nThis is some function.\nIt does shit."]
pub(crate) const LineTo: LineTo = LineTo {}; pub(crate) const LineTo: LineTo = LineTo {};
fn boxed_line_to( fn boxed_line_to(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_min {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -73,7 +76,10 @@ mod test_examples_min {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -125,7 +131,7 @@ pub(crate) struct Min {}
#[doc = "Std lib function: min\nThis is some function.\nIt does shit."] #[doc = "Std lib function: min\nThis is some function.\nIt does shit."]
pub(crate) const Min: Min = Min {}; pub(crate) const Min: Min = Min {};
fn boxed_min( fn boxed_min(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -68,7 +71,7 @@ pub(crate) struct Show {}
#[doc = "Std lib function: show\nThis is some function.\nIt does shit."] #[doc = "Std lib function: show\nThis is some function.\nIt does shit."]
pub(crate) const Show: Show = Show {}; pub(crate) const Show: Show = Show {};
fn boxed_show( fn boxed_show(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_import {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -68,7 +71,7 @@ pub(crate) struct Import {}
#[doc = "Std lib function: import\nThis is some function.\nIt does shit."] #[doc = "Std lib function: import\nThis is some function.\nIt does shit."]
pub(crate) const Import: Import = Import {}; pub(crate) const Import: Import = Import {};
fn boxed_import( fn boxed_import(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_import {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -68,7 +71,7 @@ pub(crate) struct Import {}
#[doc = "Std lib function: import\nThis is some function.\nIt does shit."] #[doc = "Std lib function: import\nThis is some function.\nIt does shit."]
pub(crate) const Import: Import = Import {}; pub(crate) const Import: Import = Import {};
fn boxed_import( fn boxed_import(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_import {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -68,7 +71,7 @@ pub(crate) struct Import {}
#[doc = "Std lib function: import\nThis is some function.\nIt does shit."] #[doc = "Std lib function: import\nThis is some function.\nIt does shit."]
pub(crate) const Import: Import = Import {}; pub(crate) const Import: Import = Import {};
fn boxed_import( fn boxed_import(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -16,7 +16,10 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -68,7 +71,7 @@ pub(crate) struct Show {}
#[doc = "Std lib function: show\nThis is some function.\nIt does shit."] #[doc = "Std lib function: show\nThis is some function.\nIt does shit."]
pub(crate) const Show: Show = Show {}; pub(crate) const Show: Show = Show {};
fn boxed_show( fn boxed_show(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -15,7 +15,10 @@ mod test_examples_some_function {
context_type: crate::execution::ContextType::Mock, context_type: crate::execution::ContextType::Mock,
}; };
if let Err(e) = ctx if let Err(e) = ctx
.run(&program, &mut crate::ExecState::new(&ctx.settings)) .run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.await .await
{ {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
@ -67,7 +70,7 @@ pub(crate) struct SomeFunction {}
#[doc = "Std lib function: someFunction\nDocs"] #[doc = "Std lib function: someFunction\nDocs"]
pub(crate) const SomeFunction: SomeFunction = SomeFunction {}; pub(crate) const SomeFunction: SomeFunction = SomeFunction {};
fn boxed_some_function( fn boxed_some_function(
exec_state: &mut crate::ExecState, exec_state: &mut crate::execution::ExecState,
args: crate::std::Args, args: crate::std::Args,
) -> std::pin::Pin< ) -> std::pin::Pin<
Box< Box<

View File

@ -31,12 +31,12 @@ impl From<KclErrorWithOutputs> for ExecError {
#[derive(Debug)] #[derive(Debug)]
pub struct ExecErrorWithState { pub struct ExecErrorWithState {
pub error: ExecError, pub error: ExecError,
pub exec_state: Option<crate::ExecState>, pub exec_state: Option<crate::execution::ExecState>,
} }
impl ExecErrorWithState { impl ExecErrorWithState {
#[cfg_attr(target_arch = "wasm32", expect(dead_code))] #[cfg_attr(target_arch = "wasm32", expect(dead_code))]
pub fn new(error: ExecError, exec_state: crate::ExecState) -> Self { pub fn new(error: ExecError, exec_state: crate::execution::ExecState) -> Self {
Self { Self {
error, error,
exec_state: Some(exec_state), exec_state: Some(exec_state),

View File

@ -6,13 +6,11 @@ use itertools::{EitherOrBoth, Itertools};
use tokio::sync::RwLock; use tokio::sync::RwLock;
use crate::{ use crate::{
execution::{ExecState, ExecutorSettings}, execution::{memory::ProgramMemory, ExecState, ExecutorSettings},
parsing::ast::types::{Node, NonCodeValue, Program}, parsing::ast::types::{Node, NonCodeValue, Program},
walk::Node as WalkNode, walk::Node as WalkNode,
}; };
use super::ProgramMemory;
lazy_static::lazy_static! { lazy_static::lazy_static! {
/// A static mutable lock for updating the last successful execution state for the cache. /// A static mutable lock for updating the last successful execution state for the cache.
static ref OLD_AST: Arc<RwLock<Option<OldAstState>>> = Default::default(); static ref OLD_AST: Arc<RwLock<Option<OldAstState>>> = Default::default();

View File

@ -10,9 +10,10 @@ use crate::{
annotations, annotations,
cad_op::{OpArg, Operation}, cad_op::{OpArg, Operation},
memory, memory,
memory::ProgramMemory,
state::ModuleState, state::ModuleState,
BodyType, EnvironmentRef, ExecState, ExecutorContext, KclValue, MemoryFunction, Metadata, ProgramMemory, BodyType, EnvironmentRef, ExecState, ExecutorContext, KclValue, MemoryFunction, Metadata, TagEngineInfo,
TagEngineInfo, TagIdentifier, TagIdentifier,
}, },
modules::{ModuleId, ModulePath, ModuleRepr}, modules::{ModuleId, ModulePath, ModuleRepr},
parsing::ast::types::{ parsing::ast::types::{

View File

@ -8,14 +8,15 @@ use crate::{
errors::KclErrorDetails, errors::KclErrorDetails,
exec::Sketch, exec::Sketch,
execution::{ execution::{
Face, Helix, ImportedGeometry, MemoryFunction, Metadata, Plane, SketchSet, Solid, SolidSet, TagIdentifier, ExecState, Face, Helix, ImportedGeometry, MemoryFunction, Metadata, Plane, SketchSet, Solid, SolidSet,
TagIdentifier,
}, },
parsing::{ parsing::{
ast::types::{FunctionExpression, KclNone, LiteralValue, TagDeclarator, TagNode}, ast::types::{FunctionExpression, KclNone, LiteralValue, TagDeclarator, TagNode},
token::NumericSuffix, token::NumericSuffix,
}, },
std::{args::Arg, FnAsArg}, std::{args::Arg, FnAsArg},
ExecState, ExecutorContext, KclError, ModuleId, SourceRange, ExecutorContext, KclError, ModuleId, SourceRange,
}; };
use super::memory::EnvironmentRef; use super::memory::EnvironmentRef;

View File

@ -156,18 +156,14 @@ pub(crate) const RETURN_NAME: &str = "__return";
/// including other modules). Multiple interpretation runs should have fresh instances. /// including other modules). Multiple interpretation runs should have fresh instances.
/// ///
/// See module docs. /// See module docs.
#[derive(Debug, Clone, Deserialize, Serialize, ts_rs::TS, JsonSchema)] #[derive(Debug, Clone)]
#[ts(export)] pub(crate) struct ProgramMemory {
#[serde(rename_all = "camelCase")]
pub struct ProgramMemory {
environments: Vec<Environment>, environments: Vec<Environment>,
/// Invariant: current_env.1.is_none() /// Invariant: current_env.1.is_none()
current_env: EnvironmentRef, current_env: EnvironmentRef,
/// Invariant: forall er in call_stack: er.1.is_none() /// Invariant: forall er in call_stack: er.1.is_none()
call_stack: Vec<EnvironmentRef>, call_stack: Vec<EnvironmentRef>,
/// Statistics about the memory, should not be used for anything other than meta-info. /// Statistics about the memory, should not be used for anything other than meta-info.
#[allow(dead_code)]
#[serde(skip)]
pub(crate) stats: MemoryStats, pub(crate) stats: MemoryStats,
} }
@ -573,7 +569,7 @@ pub(crate) struct MemoryStats {
mod env { mod env {
use super::*; use super::*;
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[derive(Debug, Clone, PartialEq)]
pub(super) struct Environment { pub(super) struct Environment {
bindings: IndexMap<String, KclValue>, bindings: IndexMap<String, KclValue>,
// invariant: self.parent.is_none() => forall s in self.snapshots: s.parent_snapshot.is_none() // invariant: self.parent.is_none() => forall s in self.snapshots: s.parent_snapshot.is_none()
@ -603,7 +599,7 @@ mod env {
} }
} }
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[derive(Debug, Clone, PartialEq)]
struct Snapshot { struct Snapshot {
/// The version of the owning environment's parent environment corresponding to this snapshot. /// The version of the owning environment's parent environment corresponding to this snapshot.
parent_snapshot: Option<SnapshotRef>, parent_snapshot: Option<SnapshotRef>,

View File

@ -39,7 +39,7 @@ pub(crate) use import::{
import_foreign, send_to_engine as send_import_to_engine, PreImportedGeometry, ZOO_COORD_SYSTEM, import_foreign, send_to_engine as send_import_to_engine, PreImportedGeometry, ZOO_COORD_SYSTEM,
}; };
pub use kcl_value::{KclObjectFields, KclValue, UnitAngle, UnitLen}; pub use kcl_value::{KclObjectFields, KclValue, UnitAngle, UnitLen};
pub use memory::{EnvironmentRef, ProgramMemory}; pub use memory::EnvironmentRef;
pub use state::{ExecState, IdGenerator, MetaSettings}; pub use state::{ExecState, IdGenerator, MetaSettings};
pub(crate) mod annotations; pub(crate) mod annotations;
@ -821,7 +821,7 @@ mod tests {
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
use super::*; use super::*;
use crate::{errors::KclErrorDetails, ModuleId}; use crate::{errors::KclErrorDetails, execution::memory::ProgramMemory, ModuleId};
/// Convenience function to get a JSON value from memory and unwrap. /// Convenience function to get a JSON value from memory and unwrap.
#[track_caller] #[track_caller]

View File

@ -8,8 +8,8 @@ use uuid::Uuid;
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
annotations, kcl_value, Artifact, ArtifactCommand, ArtifactGraph, ArtifactId, ExecOutcome, ExecutorSettings, annotations, kcl_value, memory::ProgramMemory, Artifact, ArtifactCommand, ArtifactGraph, ArtifactId,
KclValue, Operation, ProgramMemory, UnitAngle, UnitLen, ExecOutcome, ExecutorSettings, KclValue, Operation, UnitAngle, UnitLen,
}, },
modules::{ModuleId, ModuleInfo, ModuleLoader, ModulePath, ModuleRepr}, modules::{ModuleId, ModuleInfo, ModuleLoader, ModulePath, ModuleRepr},
parsing::ast::types::NonCodeValue, parsing::ast::types::NonCodeValue,
@ -17,16 +17,14 @@ use crate::{
}; };
/// State for executing a program. /// State for executing a program.
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ExecState { pub struct ExecState {
pub global: GlobalState, pub(super) global: GlobalState,
pub mod_local: ModuleState, pub(super) mod_local: ModuleState,
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone)]
#[serde(rename_all = "camelCase")] pub(super) struct GlobalState {
pub struct GlobalState {
/// Program variable bindings. /// Program variable bindings.
pub memory: ProgramMemory, pub memory: ProgramMemory,
/// The stable artifact ID generator. /// The stable artifact ID generator.
@ -52,9 +50,8 @@ pub struct GlobalState {
pub mod_loader: ModuleLoader, pub mod_loader: ModuleLoader,
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone)]
#[serde(rename_all = "camelCase")] pub(super) struct ModuleState {
pub struct ModuleState {
/// The current value of the pipe operator returned from the previous /// The current value of the pipe operator returned from the previous
/// expression. If we're not currently in a pipeline, this will be None. /// expression. If we're not currently in a pipeline, this will be None.
pub pipe_value: Option<KclValue>, pub pipe_value: Option<KclValue>,
@ -125,19 +122,19 @@ impl ExecState {
} }
} }
pub fn memory(&self) -> &ProgramMemory { pub(crate) fn memory(&self) -> &ProgramMemory {
&self.global.memory &self.global.memory
} }
pub fn mut_memory(&mut self) -> &mut ProgramMemory { pub(crate) fn mut_memory(&mut self) -> &mut ProgramMemory {
&mut self.global.memory &mut self.global.memory
} }
pub fn next_uuid(&mut self) -> Uuid { pub(crate) fn next_uuid(&mut self) -> Uuid {
self.global.id_generator.next_uuid() self.global.id_generator.next_uuid()
} }
pub fn add_artifact(&mut self, artifact: Artifact) { pub(crate) fn add_artifact(&mut self, artifact: Artifact) {
let id = artifact.id(); let id = artifact.id();
self.global.artifacts.insert(id, artifact); self.global.artifacts.insert(id, artifact);
} }

View File

@ -98,9 +98,7 @@ pub use source_range::SourceRange;
// Rather than make executor public and make lots of it pub(crate), just re-export into a new module. // Rather than make executor public and make lots of it pub(crate), just re-export into a new module.
// Ideally we wouldn't export these things at all, they should only be used for testing. // Ideally we wouldn't export these things at all, they should only be used for testing.
pub mod exec { pub mod exec {
pub use crate::execution::{ pub use crate::execution::{ArtifactCommand, DefaultPlanes, IdGenerator, KclValue, PlaneType, Sketch};
ArtifactCommand, DefaultPlanes, IdGenerator, KclValue, PlaneType, ProgramMemory, Sketch,
};
} }
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]

View File

@ -33,9 +33,8 @@ impl ModuleId {
} }
} }
#[derive(Debug, Clone, Deserialize, Serialize, Default)] #[derive(Debug, Clone, Default)]
#[serde(rename_all = "camelCase")] pub(crate) struct ModuleLoader {
pub struct ModuleLoader {
/// The stack of import statements for detecting circular module imports. /// The stack of import statements for detecting circular module imports.
/// If this is empty, we're not currently executing an import statement. /// If this is empty, we're not currently executing an import statement.
pub import_stack: Vec<PathBuf>, pub import_stack: Vec<PathBuf>,

View File

@ -102,21 +102,22 @@ async fn execute(test_name: &str, render_to_png: bool) {
if render_to_png { if render_to_png {
twenty_twenty::assert_image(format!("tests/{test_name}/rendered_model.png"), &png, 0.99); twenty_twenty::assert_image(format!("tests/{test_name}/rendered_model.png"), &png, 0.99);
} }
assert_snapshot(test_name, "Program memory after executing", || { let outcome = exec_state.to_wasm_outcome();
insta::assert_json_snapshot!("program_memory", exec_state.memory(), {
".environments[].**[].from[]" => rounded_redaction(4),
".environments[].**[].to[]" => rounded_redaction(4),
".environments[].**[].x[]" => rounded_redaction(4),
".environments[].**[].y[]" => rounded_redaction(4),
".environments[].**[].z[]" => rounded_redaction(4),
});
});
assert_common_snapshots( assert_common_snapshots(
test_name, test_name,
exec_state.mod_local.operations, outcome.operations,
exec_state.global.artifact_commands, outcome.artifact_commands,
exec_state.global.artifact_graph, outcome.artifact_graph,
); );
assert_snapshot(test_name, "Variables in memory after executing", || {
insta::assert_json_snapshot!("program_memory", outcome.variables, {
".**[].from[]" => rounded_redaction(4),
".**[].to[]" => rounded_redaction(4),
".**[].x[]" => rounded_redaction(4),
".**[].y[]" => rounded_redaction(4),
".**[].z[]" => rounded_redaction(4),
})
});
} }
Err(e) => { Err(e) => {
let ok_path_str = format!("tests/{test_name}/program_memory.snap"); let ok_path_str = format!("tests/{test_name}/program_memory.snap");

View File

@ -134,7 +134,7 @@ async fn inner_chamfer(
EdgeReference::Tag(edge_tag) => args.get_tag_engine_info(exec_state, &edge_tag)?.id, EdgeReference::Tag(edge_tag) => args.get_tag_engine_info(exec_state, &edge_tag)?.id,
}; };
let id = exec_state.global.id_generator.next_uuid(); let id = exec_state.next_uuid();
args.batch_end_cmd( args.batch_end_cmd(
id, id,
ModelingCmd::from(mcmd::Solid3dFilletEdge { ModelingCmd::from(mcmd::Solid3dFilletEdge {

View File

@ -218,7 +218,7 @@ async fn straight_line(
} }
}; };
let id = exec_state.global.id_generator.next_uuid(); let id = exec_state.next_uuid();
args.batch_modeling_cmd( args.batch_modeling_cmd(
id, id,
ModelingCmd::from(mcmd::ExtendPath { ModelingCmd::from(mcmd::ExtendPath {

View File

@ -5,9 +5,9 @@ use std::path::PathBuf;
use crate::{ use crate::{
engine::new_zoo_client, engine::new_zoo_client,
errors::ExecErrorWithState, errors::ExecErrorWithState,
execution::{ExecutorContext, ExecutorSettings}, execution::{ExecState, ExecutorContext, ExecutorSettings},
settings::types::UnitLength, settings::types::UnitLength,
ConnectionError, ExecError, ExecState, KclErrorWithOutputs, Program, ConnectionError, ExecError, KclErrorWithOutputs, Program,
}; };
#[derive(serde::Deserialize, serde::Serialize)] #[derive(serde::Deserialize, serde::Serialize)]

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +1,320 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing angled_line.kcl description: Variables in memory after executing angled_line.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
73,
97,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
142,
0
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
148,
174,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
180,
217,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
223,
250,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
256,
264,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
73,
97,
0
]
},
"from": [
4.83,
12.56
],
"tag": null,
"to": [
19.93,
15.04
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
142,
0
]
},
"from": [
19.93,
15.04
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
23.08,
5.19
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
148,
174,
0
]
},
"from": [
23.08,
5.19
],
"tag": null,
"to": [
7.91,
1.09
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
180,
217,
0
]
},
"from": [
7.91,
1.09
],
"tag": null,
"to": [
11.6718,
-10.6731
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
223,
250,
0
]
},
"from": [
11.6718,
-10.6731
],
"tag": null,
"to": [
-1.3482,
-0.6431
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
256,
264,
0
]
},
"from": [
-1.3482,
-0.6431
],
"tag": null,
"to": [
4.83,
12.56
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": [] "__meta": []
}, },
"QUARTER_TURN": { "start": {
"type": "Number", "from": [
"value": 90.0, 4.83,
"__meta": [] 12.56
}, ],
"THREE_QUARTER_TURN": { "to": [
"type": "Number", 4.83,
"value": 270.0, 12.56
"__meta": [] ],
}, "tag": null,
"ZERO": { "__geoMeta": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "sourceRange": [
"value": [ 35,
{ 67,
"faceId": "[uuid]", 0
"id": "[uuid]", ]
"sourceRange": [ }
73, },
97, "tags": {
0 "seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
142,
0
]
},
"from": [
19.93,
15.040000000000001
], ],
"tag": null, "tag": {
"type": "extrudePlane" "end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
23.08,
5.190000000000001
],
"type": "ToPoint"
}, },
{ "surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -59,392 +329,109 @@ description: Program memory after executing angled_line.kcl
"value": "seg01" "value": "seg01"
}, },
"type": "extrudePlane" "type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
148,
174,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
180,
217,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
223,
250,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
256,
264,
0
],
"tag": null,
"type": "extrudePlane"
} }
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
73,
97,
0
]
},
"from": [
4.83,
12.56
],
"tag": null,
"to": [
19.93,
15.04
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
142,
0
]
},
"from": [
19.93,
15.04
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
23.08,
5.19
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
148,
174,
0
]
},
"from": [
23.08,
5.19
],
"tag": null,
"to": [
7.91,
1.09
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
180,
217,
0
]
},
"from": [
7.91,
1.09
],
"tag": null,
"to": [
11.6718,
-10.6731
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
223,
250,
0
]
},
"from": [
11.6718,
-10.6731
],
"tag": null,
"to": [
-1.3482,
-0.6431
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
256,
264,
0
]
},
"from": [
-1.3482,
-0.6431
],
"tag": null,
"to": [
4.83,
12.56
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
4.83,
12.56
],
"to": [
4.83,
12.56
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
67,
0
]
}
},
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
142,
0
]
},
"from": [
19.93,
15.040000000000001
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
23.08,
5.190000000000001
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
142,
0
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
135,
141,
0
]
}
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
67,
0
]
}
]
},
"height": 4.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
}, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
35, 135,
67, 141,
0 0
] ]
} }
] ]
} }
}, },
"seg01": { "artifactId": "[uuid]",
"type": "TagIdentifier", "originalId": "[uuid]",
"type": "TagIdentifier", "units": {
"value": "seg01", "type": "Mm"
"info": { },
"type": "TagEngineInfo", "__meta": [
"id": "[uuid]", {
"sketch": "[uuid]", "sourceRange": [
"path": { 35,
"__geoMeta": { 67,
"id": "[uuid]", 0
"sourceRange": [ ]
103, }
142, ]
0 },
] "height": 4.0,
}, "startCapId": "[uuid]",
"from": [ "endCapId": "[uuid]",
19.93, "units": {
15.040000000000001 "type": "Mm"
], },
"tag": { "__meta": [
"end": 141, {
"start": 135, "sourceRange": [
"type": "TagDeclarator", 35,
"value": "seg01" 67,
}, 0
"to": [
23.08,
5.190000000000001
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
142,
0
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
135,
141,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "seg01": {
0, "type": "TagIdentifier",
0 "type": "TagIdentifier",
], "value": "seg01",
"callStack": [] "info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
142,
0
]
},
"from": [
19.93,
15.040000000000001
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
23.08,
5.190000000000001
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
142,
0
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
135,
141,
0
]
}
]
}
} }

View File

@ -1,172 +1,159 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing array_elem_pop.kcl description: Variables in memory after executing array_elem_pop.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "arr": {
"__meta": [] "type": "Array",
}, "value": [
"arr": { {
"type": "Array", "type": "Number",
"value": [ "value": 1.0,
{ "__meta": [
"type": "Number", {
"value": 1.0, "sourceRange": [
"__meta": [ 7,
{ 8,
"sourceRange": [ 0
7, ]
8, }
0 ]
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
6,
15,
0
]
}
]
},
"new_arr1": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
27,
35,
0
]
}
]
},
"new_arr2": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
47,
60,
0
]
}
]
},
"new_arr3": {
"type": "Array",
"value": [],
"__meta": [
{
"sourceRange": [
72,
85,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "type": "Number",
} "value": 2.0,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 10,
], 11,
"callStack": [] 0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
6,
15,
0
]
}
]
},
"new_arr1": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
27,
35,
0
]
}
]
},
"new_arr2": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
47,
60,
0
]
}
]
},
"new_arr3": {
"type": "Array",
"value": [],
"__meta": [
{
"sourceRange": [
72,
85,
0
]
}
]
}
} }

View File

@ -1,237 +1,224 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing array_elem_push.kcl description: Variables in memory after executing array_elem_push.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "arr": {
"__meta": [] "type": "Array",
}, "value": [
"arr": { {
"type": "Array", "type": "Number",
"value": [ "value": 1.0,
{ "__meta": [
"type": "Number", {
"value": 1.0, "sourceRange": [
"__meta": [ 7,
{ 8,
"sourceRange": [ 0
7, ]
8, }
0 ]
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
6,
15,
0
]
}
]
},
"new_arr1": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
},
{
"type": "Number",
"value": 4.0,
"__meta": [
{
"sourceRange": [
37,
38,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
27,
39,
0
]
}
]
},
"new_arr2": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
},
{
"type": "Number",
"value": 4.0,
"__meta": [
{
"sourceRange": [
37,
38,
0
]
}
]
},
{
"type": "Number",
"value": 5.0,
"__meta": [
{
"sourceRange": [
66,
67,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
51,
68,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "type": "Number",
} "value": 2.0,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 10,
], 11,
"callStack": [] 0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
6,
15,
0
]
}
]
},
"new_arr1": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
},
{
"type": "Number",
"value": 4.0,
"__meta": [
{
"sourceRange": [
37,
38,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
27,
39,
0
]
}
]
},
"new_arr2": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
7,
8,
0
]
}
]
},
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
10,
11,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
13,
14,
0
]
}
]
},
{
"type": "Number",
"value": 4.0,
"__meta": [
{
"sourceRange": [
37,
38,
0
]
}
]
},
{
"type": "Number",
"value": 5.0,
"__meta": [
{
"sourceRange": [
66,
67,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
51,
68,
0
]
}
]
}
} }

View File

@ -1,394 +1,381 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing array_range_expr.kcl description: Variables in memory after executing array_range_expr.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "five": {
"__meta": [] "type": "Number",
}, "value": 5.0,
"five": { "__meta": [
"type": "Number", {
"value": 5.0, "sourceRange": [
"__meta": [ 175,
{ 188,
"sourceRange": [ 0
175, ]
188, }
0 ]
] },
} "four": {
] "type": "Number",
}, "value": 4.0,
"four": { "__meta": [
"type": "Number", {
"value": 4.0, "sourceRange": [
"__meta": [ 79,
{ 80,
"sourceRange": [ 0
79, ]
80, }
0 ]
] },
} "r1": {
] "type": "Array",
}, "value": [
"r1": { {
"type": "Array", "type": "Int",
"value": [ "value": 0,
{ "__meta": [
"type": "Int", {
"value": 0, "sourceRange": [
"__meta": [ 5,
{ 11,
"sourceRange": [ 0
5, ]
11, }
0 ]
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
"r2": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
"r3": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 5,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
"r4": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
"zero": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
88,
89,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "type": "Int",
} "value": 1,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 5,
], 11,
"callStack": [] 0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
5,
11,
0
]
}
]
},
"r2": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
95,
107,
0
]
}
]
},
"r3": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
{
"type": "Int",
"value": 5,
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
194,
206,
0
]
}
]
},
"r4": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
341,
373,
0
]
}
]
},
"zero": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
88,
89,
0
]
}
]
}
} }

View File

@ -1,196 +1,183 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing array_range_negative_expr.kcl description: Variables in memory after executing array_range_negative_expr.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "xs": {
"__meta": [] "type": "Array",
}, "value": [
"xs": { {
"type": "Array", "type": "Int",
"value": [ "value": -5,
{ "__meta": [
"type": "Int", {
"value": -5, "sourceRange": [
"__meta": [ 5,
{ 19,
"sourceRange": [ 0
5, ]
19, }
0 ]
]
}
]
},
{
"type": "Int",
"value": -4,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": -3,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": -2,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": -1,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 5,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "type": "Int",
} "value": -4,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 5,
], 19,
"callStack": [] 0
]
}
]
},
{
"type": "Int",
"value": -3,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": -2,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": -1,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 3,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 4,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
},
{
"type": "Int",
"value": 5,
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
5,
19,
0
]
}
]
}
} }

View File

@ -1,228 +1,214 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing artifact_graph_example_code_offset_planes.kcl description: Variables in memory after executing artifact_graph_example_code_offset_planes.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "offsetPlane001": {
"__meta": [] "type": "Plane",
}, "value": {
"offsetPlane001": { "id": "[uuid]",
"type": "Plane", "artifactId": "[uuid]",
"value": { "value": "Custom",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"offsetPlane002": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 50.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"offsetPlane003": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"sketch002": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "sourceRange": [
"value": "Custom", 197,
"origin": { 222,
"x": 0.0, 0
"y": 0.0,
"z": 20.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"offsetPlane002": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 50.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"offsetPlane003": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"sketch002": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
197,
222,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
6.78,
15.01
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
166,
191,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
166,
191,
0
]
}
] ]
} },
"from": [
0.0,
0.0
],
"tag": null,
"to": [
6.78,
15.01
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
166,
191,
0
]
} }
}, },
"snapshots": [], "artifactId": "[uuid]",
"parent": null "originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
166,
191,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,39 +1,268 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing basic_fillet_cube_end.kcl description: Variables in memory after executing basic_fillet_cube_end.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
105,
124,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
171,
179,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
124,
0
]
},
"from": [
0.0,
10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
171,
179,
0
]
},
"from": [
10.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": [] "__meta": []
}, },
"QUARTER_TURN": { "start": {
"type": "Number", "from": [
"value": 90.0, 0.0,
"__meta": [] 0.0
}, ],
"THREE_QUARTER_TURN": { "to": [
"type": "Number", 0.0,
"value": 270.0, 0.0
"__meta": [] ],
}, "tag": null,
"ZERO": { "__geoMeta": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "sourceRange": [
"value": [ 35,
{ 60,
0
]
}
},
"tags": {
"thing": {
"type": "TagIdentifier",
"value": "thing",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -48,19 +277,51 @@ description: Program memory after executing basic_fillet_cube_end.kcl
"value": "thing" "value": "thing"
}, },
"type": "extrudePlane" "type": "extrudePlane"
}, }
},
"__meta": [
{ {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [ "sourceRange": [
105, 92,
124, 98,
0 0
]
}
]
},
"thing2": {
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
], ],
"tag": null, "tag": {
"type": "extrudePlane" "end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
}, },
{ "surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -75,459 +336,185 @@ description: Program memory after executing basic_fillet_cube_end.kcl
"value": "thing2" "value": "thing2"
}, },
"type": "extrudePlane" "type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
171,
179,
0
],
"tag": null,
"type": "extrudePlane"
} }
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
124,
0
]
},
"from": [
0.0,
10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
171,
179,
0
]
},
"from": [
10.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
60,
0
]
}
},
"tags": {
"thing": {
"type": "TagIdentifier",
"value": "thing",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
92,
98,
0
]
}
]
},
"thing2": {
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
157,
164,
0
]
}
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
]
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"edgeCuts": [
{
"type": "fillet",
"id": "[uuid]",
"radius": 2.0,
"edgeId": "[uuid]",
"tag": null
},
{
"type": "fillet",
"id": "[uuid]",
"radius": 2.0,
"edgeId": "[uuid]",
"tag": null
}
],
"units": {
"type": "Mm"
}, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
35, 157,
60, 164,
0 0
] ]
} }
] ]
} }
}, },
"thing": { "artifactId": "[uuid]",
"type": "TagIdentifier", "originalId": "[uuid]",
"type": "TagIdentifier", "units": {
"value": "thing", "type": "Mm"
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
92,
98,
0
]
}
]
}, },
"thing2": { "__meta": [
"type": "TagIdentifier", {
"type": "TagIdentifier", "sourceRange": [
"value": "thing2", 35,
"info": { 60,
"type": "TagEngineInfo", 0
"id": "[uuid]", ]
"sketch": "[uuid]", }
"path": { ]
"__geoMeta": { },
"id": "[uuid]", "height": 10.0,
"sourceRange": [ "startCapId": "[uuid]",
130, "endCapId": "[uuid]",
165, "edgeCuts": [
0 {
] "type": "fillet",
}, "id": "[uuid]",
"from": [ "radius": 2.0,
10.0, "edgeId": "[uuid]",
10.0 "tag": null
], },
"tag": { {
"end": 164, "type": "fillet",
"start": 157, "id": "[uuid]",
"type": "TagDeclarator", "radius": 2.0,
"value": "thing2" "edgeId": "[uuid]",
}, "tag": null
"to": [ }
10.0, ],
0.0 "units": {
], "type": "Mm"
"type": "ToPoint" },
}, "__meta": [
"surface": { {
"faceId": "[uuid]", "sourceRange": [
"id": "[uuid]", 35,
"sourceRange": [ 60,
130, 0
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
157,
164,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "thing": {
0, "type": "TagIdentifier",
0 "type": "TagIdentifier",
], "value": "thing",
"callStack": [] "info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
92,
98,
0
]
}
]
},
"thing2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
157,
164,
0
]
}
]
}
} }

View File

@ -1,39 +1,268 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing basic_fillet_cube_start.kcl description: Variables in memory after executing basic_fillet_cube_start.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
105,
124,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
171,
179,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
124,
0
]
},
"from": [
0.0,
10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
171,
179,
0
]
},
"from": [
10.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": [] "__meta": []
}, },
"QUARTER_TURN": { "start": {
"type": "Number", "from": [
"value": 90.0, 0.0,
"__meta": [] 0.0
}, ],
"THREE_QUARTER_TURN": { "to": [
"type": "Number", 0.0,
"value": 270.0, 0.0
"__meta": [] ],
}, "tag": null,
"ZERO": { "__geoMeta": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "sourceRange": [
"value": [ 35,
{ 60,
0
]
}
},
"tags": {
"thing": {
"type": "TagIdentifier",
"value": "thing",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -48,19 +277,51 @@ description: Program memory after executing basic_fillet_cube_start.kcl
"value": "thing" "value": "thing"
}, },
"type": "extrudePlane" "type": "extrudePlane"
}, }
},
"__meta": [
{ {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [ "sourceRange": [
105, 92,
124, 98,
0 0
]
}
]
},
"thing2": {
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
], ],
"tag": null, "tag": {
"type": "extrudePlane" "end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
}, },
{ "surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -75,459 +336,185 @@ description: Program memory after executing basic_fillet_cube_start.kcl
"value": "thing2" "value": "thing2"
}, },
"type": "extrudePlane" "type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
171,
179,
0
],
"tag": null,
"type": "extrudePlane"
} }
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
124,
0
]
},
"from": [
0.0,
10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
171,
179,
0
]
},
"from": [
10.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
60,
0
]
}
},
"tags": {
"thing": {
"type": "TagIdentifier",
"value": "thing",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
92,
98,
0
]
}
]
},
"thing2": {
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
157,
164,
0
]
}
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
]
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"edgeCuts": [
{
"type": "fillet",
"id": "[uuid]",
"radius": 2.0,
"edgeId": "[uuid]",
"tag": null
},
{
"type": "fillet",
"id": "[uuid]",
"radius": 2.0,
"edgeId": "[uuid]",
"tag": null
}
],
"units": {
"type": "Mm"
}, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
35, 157,
60, 164,
0 0
] ]
} }
] ]
} }
}, },
"thing": { "artifactId": "[uuid]",
"type": "TagIdentifier", "originalId": "[uuid]",
"type": "TagIdentifier", "units": {
"value": "thing", "type": "Mm"
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
92,
98,
0
]
}
]
}, },
"thing2": { "__meta": [
"type": "TagIdentifier", {
"type": "TagIdentifier", "sourceRange": [
"value": "thing2", 35,
"info": { 60,
"type": "TagEngineInfo", 0
"id": "[uuid]", ]
"sketch": "[uuid]", }
"path": { ]
"__geoMeta": { },
"id": "[uuid]", "height": 10.0,
"sourceRange": [ "startCapId": "[uuid]",
130, "endCapId": "[uuid]",
165, "edgeCuts": [
0 {
] "type": "fillet",
}, "id": "[uuid]",
"from": [ "radius": 2.0,
10.0, "edgeId": "[uuid]",
10.0 "tag": null
], },
"tag": { {
"end": 164, "type": "fillet",
"start": 157, "id": "[uuid]",
"type": "TagDeclarator", "radius": 2.0,
"value": "thing2" "edgeId": "[uuid]",
}, "tag": null
"to": [ }
10.0, ],
0.0 "units": {
], "type": "Mm"
"type": "ToPoint" },
}, "__meta": [
"surface": { {
"faceId": "[uuid]", "sourceRange": [
"id": "[uuid]", 35,
"sourceRange": [ 60,
130, 0
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
157,
164,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "thing": {
0, "type": "TagIdentifier",
0 "type": "TagIdentifier",
], "value": "thing",
"callStack": [] "info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
99,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
92,
98,
0
]
}
]
},
"thing2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
130,
165,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
157,
164,
0
]
}
]
}
} }

View File

@ -1,39 +1,227 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing big_number_angle_to_match_length_x.kcl description: Variables in memory after executing big_number_angle_to_match_length_x.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
107,
163,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
169,
177,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
107,
163,
0
]
},
"from": [
1.0,
3.82
],
"tag": null,
"to": [
3.0,
0.4152
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
169,
177,
0
]
},
"from": [
3.0,
0.4152
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": [] "__meta": []
}, },
"QUARTER_TURN": { "start": {
"type": "Number", "from": [
"value": 90.0, 0.0,
"__meta": [] 0.0
}, ],
"THREE_QUARTER_TURN": { "to": [
"type": "Number", 0.0,
"value": 270.0, 0.0
"__meta": [] ],
}, "tag": null,
"ZERO": { "__geoMeta": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "sourceRange": [
"value": [ 35,
{ 60,
0
]
}
},
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -48,310 +236,109 @@ description: Program memory after executing big_number_angle_to_match_length_x.k
"value": "seg01" "value": "seg01"
}, },
"type": "extrudePlane" "type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
107,
163,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
169,
177,
0
],
"tag": null,
"type": "extrudePlane"
} }
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
107,
163,
0
]
},
"from": [
1.0,
3.82
],
"tag": null,
"to": [
3.0,
0.4152
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
169,
177,
0
]
},
"from": [
3.0,
0.4152
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
60,
0
]
}
},
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
94,
100,
0
]
}
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
]
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
}, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
35, 94,
60, 100,
0 0
] ]
} }
] ]
} }
}, },
"seg01": { "artifactId": "[uuid]",
"type": "TagIdentifier", "originalId": "[uuid]",
"type": "TagIdentifier", "units": {
"value": "seg01", "type": "Mm"
"info": { },
"type": "TagEngineInfo", "__meta": [
"id": "[uuid]", {
"sketch": "[uuid]", "sourceRange": [
"path": { 35,
"__geoMeta": { 60,
"id": "[uuid]", 0
"sourceRange": [ ]
66, }
101, ]
0 },
] "height": 10.0,
}, "startCapId": "[uuid]",
"from": [ "endCapId": "[uuid]",
0.0, "units": {
0.0 "type": "Mm"
], },
"tag": { "__meta": [
"end": 100, {
"start": 94, "sourceRange": [
"type": "TagDeclarator", 35,
"value": "seg01" 60,
}, 0
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
94,
100,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "seg01": {
0, "type": "TagIdentifier",
0 "type": "TagIdentifier",
], "value": "seg01",
"callStack": [] "info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
94,
100,
0
]
}
]
}
} }

View File

@ -1,39 +1,227 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing big_number_angle_to_match_length_y.kcl description: Variables in memory after executing big_number_angle_to_match_length_y.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
107,
163,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
169,
177,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
107,
163,
0
]
},
"from": [
1.0,
3.82
],
"tag": null,
"to": [
3.0,
3.3954
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
169,
177,
0
]
},
"from": [
3.0,
3.3954
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": [] "__meta": []
}, },
"QUARTER_TURN": { "start": {
"type": "Number", "from": [
"value": 90.0, 0.0,
"__meta": [] 0.0
}, ],
"THREE_QUARTER_TURN": { "to": [
"type": "Number", 0.0,
"value": 270.0, 0.0
"__meta": [] ],
}, "tag": null,
"ZERO": { "__geoMeta": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "sourceRange": [
"value": [ 35,
{ 60,
0
]
}
},
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
@ -48,310 +236,109 @@ description: Program memory after executing big_number_angle_to_match_length_y.k
"value": "seg01" "value": "seg01"
}, },
"type": "extrudePlane" "type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
107,
163,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
169,
177,
0
],
"tag": null,
"type": "extrudePlane"
} }
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
107,
163,
0
]
},
"from": [
1.0,
3.82
],
"tag": null,
"to": [
3.0,
3.3954
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
169,
177,
0
]
},
"from": [
3.0,
3.3954
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
60,
0
]
}
},
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
94,
100,
0
]
}
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
]
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
}, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
35, 94,
60, 100,
0 0
] ]
} }
] ]
} }
}, },
"seg01": { "artifactId": "[uuid]",
"type": "TagIdentifier", "originalId": "[uuid]",
"type": "TagIdentifier", "units": {
"value": "seg01", "type": "Mm"
"info": { },
"type": "TagEngineInfo", "__meta": [
"id": "[uuid]", {
"sketch": "[uuid]", "sourceRange": [
"path": { 35,
"__geoMeta": { 60,
"id": "[uuid]", 0
"sourceRange": [ ]
66, }
101, ]
0 },
] "height": 10.0,
}, "startCapId": "[uuid]",
"from": [ "endCapId": "[uuid]",
0.0, "units": {
0.0 "type": "Mm"
], },
"tag": { "__meta": [
"end": 100, {
"start": 94, "sourceRange": [
"type": "TagDeclarator", 35,
"value": "seg01" 60,
}, 0
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
94,
100,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "seg01": {
0, "type": "TagIdentifier",
0 "type": "TagIdentifier",
], "value": "seg01",
"callStack": [] "info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
66,
101,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.0,
3.82
],
"type": "ToPoint"
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
},
"__meta": [
{
"sourceRange": [
94,
100,
0
]
}
]
}
} }

View File

@ -1,171 +1,158 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing boolean_logical_and.kcl description: Variables in memory after executing boolean_logical_and.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "a": {
"__meta": [] "type": "Number",
}, "value": 2.0,
"a": { "__meta": [
"type": "Number", {
"value": 2.0, "sourceRange": [
"__meta": [ 45,
{ 46,
"sourceRange": [ 0
45, ]
46, }
0 ]
] },
} "aa": {
] "type": "Bool",
}, "value": false,
"aa": { "__meta": [
"type": "Bool", {
"value": false, "sourceRange": [
"__meta": [ 5,
{ 9,
"sourceRange": [ 0
5, ]
9,
0
]
},
{
"sourceRange": [
12,
17,
0
]
}
]
},
"b": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
175,
176,
0
]
}
]
},
"bb": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
135,
140,
0
]
},
{
"sourceRange": [
143,
147,
0
]
}
]
},
"c": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
290,
291,
0
]
}
]
},
"cc": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
264,
268,
0
]
},
{
"sourceRange": [
271,
275,
0
]
}
]
},
"d": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
434,
435,
0
]
}
]
},
"dd": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
393,
398,
0
]
},
{
"sourceRange": [
401,
406,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "sourceRange": [
} 12,
], 17,
"currentEnv": [ 0
0, ]
0 }
], ]
"callStack": [] },
"b": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
175,
176,
0
]
}
]
},
"bb": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
135,
140,
0
]
},
{
"sourceRange": [
143,
147,
0
]
}
]
},
"c": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
290,
291,
0
]
}
]
},
"cc": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
264,
268,
0
]
},
{
"sourceRange": [
271,
275,
0
]
}
]
},
"d": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
434,
435,
0
]
}
]
},
"dd": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
393,
398,
0
]
},
{
"sourceRange": [
401,
406,
0
]
}
]
}
} }

View File

@ -1,133 +1,120 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing boolean_logical_multiple.kcl description: Variables in memory after executing boolean_logical_multiple.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "i": {
"__meta": [] "type": "Number",
}, "value": 1.0,
"i": { "__meta": [
"type": "Number", {
"value": 1.0, "sourceRange": [
"__meta": [ 40,
{ 41,
"sourceRange": [ 0
40, ]
41, }
0 ]
] },
} "ii": {
] "type": "Bool",
}, "value": true,
"ii": { "__meta": [
"type": "Bool", {
"value": true, "sourceRange": [
"__meta": [ 5,
{ 9,
"sourceRange": [ 0
5, ]
9,
0
]
},
{
"sourceRange": [
12,
17,
0
]
},
{
"sourceRange": [
20,
25,
0
]
}
]
},
"j": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
166,
167,
0
]
}
]
},
"jj": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
115,
120,
0
]
},
{
"sourceRange": [
123,
127,
0
]
},
{
"sourceRange": [
130,
136,
0
]
},
{
"sourceRange": [
139,
144,
0
]
},
{
"sourceRange": [
147,
151,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "sourceRange": [
} 12,
], 17,
"currentEnv": [ 0
0, ]
0 },
], {
"callStack": [] "sourceRange": [
20,
25,
0
]
}
]
},
"j": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
166,
167,
0
]
}
]
},
"jj": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
115,
120,
0
]
},
{
"sourceRange": [
123,
127,
0
]
},
{
"sourceRange": [
130,
136,
0
]
},
{
"sourceRange": [
139,
144,
0
]
},
{
"sourceRange": [
147,
151,
0
]
}
]
}
} }

View File

@ -1,171 +1,158 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing boolean_logical_or.kcl description: Variables in memory after executing boolean_logical_or.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "a": {
"__meta": [] "type": "Number",
}, "value": 1.0,
"a": { "__meta": [
"type": "Number", {
"value": 1.0, "sourceRange": [
"__meta": [ 32,
{ 33,
"sourceRange": [ 0
32, ]
33, }
0 ]
] },
} "aa": {
] "type": "Bool",
}, "value": true,
"aa": { "__meta": [
"type": "Bool", {
"value": true, "sourceRange": [
"__meta": [ 5,
{ 9,
"sourceRange": [ 0
5, ]
9,
0
]
},
{
"sourceRange": [
12,
17,
0
]
}
]
},
"b": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
158,
159,
0
]
}
]
},
"bb": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
131,
136,
0
]
},
{
"sourceRange": [
139,
143,
0
]
}
]
},
"c": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
284,
285,
0
]
}
]
},
"cc": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
258,
262,
0
]
},
{
"sourceRange": [
265,
269,
0
]
}
]
},
"d": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
427,
428,
0
]
}
]
},
"dd": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
386,
391,
0
]
},
{
"sourceRange": [
394,
399,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "sourceRange": [
} 12,
], 17,
"currentEnv": [ 0
0, ]
0 }
], ]
"callStack": [] },
"b": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
158,
159,
0
]
}
]
},
"bb": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
131,
136,
0
]
},
{
"sourceRange": [
139,
143,
0
]
}
]
},
"c": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
284,
285,
0
]
}
]
},
"cc": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
258,
262,
0
]
},
{
"sourceRange": [
265,
269,
0
]
}
]
},
"d": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
427,
428,
0
]
}
]
},
"dd": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
386,
391,
0
]
},
{
"sourceRange": [
394,
399,
0
]
}
]
}
} }

View File

@ -1,171 +1,157 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing circle_three_point.kcl description: Variables in memory after executing circle_three_point.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "sketch001": {
"__meta": [] "type": "Solid",
}, "value": {
"sketch001": { "type": "Solid",
"type": "Solid", "id": "[uuid]",
"value": { "artifactId": "[uuid]",
"type": "Solid", "value": [
"id": "[uuid]", {
"artifactId": "[uuid]", "faceId": "[uuid]",
"value": [ "id": "[uuid]",
{ "sourceRange": [
"faceId": "[uuid]", 37,
"id": "[uuid]", 98,
"sourceRange": [ 0
37, ],
98, "tag": null,
0 "type": "extrudeArc"
], }
"tag": null, ],
"type": "extrudeArc" "sketch": {
} "type": "Sketch",
], "id": "[uuid]",
"sketch": { "paths": [
"type": "Sketch", {
"__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 37,
"__geoMeta": { 98,
"id": "[uuid]", 0
"sourceRange": [
37,
98,
0
]
},
"ccw": true,
"center": [
24.749999999999996,
19.749999999999996
],
"from": [
30.0059,
19.75
],
"radius": 5.255949010407163,
"tag": null,
"to": [
30.0059,
19.75
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
30.00594901040716,
19.749999999999996
],
"to": [
30.00594901040716,
19.749999999999996
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
37,
98,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
37,
98,
0
]
}
] ]
}, },
"height": 10.0, "ccw": true,
"startCapId": "[uuid]", "center": [
"endCapId": "[uuid]", 24.749999999999996,
"units": { 19.749999999999996
"type": "Mm" ],
}, "from": [
"__meta": [ 30.0059,
{ 19.75
"sourceRange": [ ],
37, "radius": 5.255949010407163,
98, "tag": null,
0 "to": [
] 30.0059,
} 19.75
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
30.00594901040716,
19.749999999999996
],
"to": [
30.00594901040716,
19.749999999999996
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
37,
98,
0
] ]
} }
} },
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
37,
98,
0
]
}
]
}, },
"snapshots": [], "height": 10.0,
"parent": null "startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
37,
98,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,39 +1,26 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing comparisons.kcl description: Variables in memory after executing comparisons.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", }
"value": 0.0,
"__meta": []
}
},
"snapshots": [],
"parent": null
}
],
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,197 +1,184 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing computed_var.kcl description: Variables in memory after executing computed_var.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "arr": {
"__meta": [] "type": "Array",
}, "value": [
"arr": { {
"type": "Array", "type": "Number",
"value": [ "value": 0.0,
{ "__meta": [
"type": "Number", {
"value": 0.0, "sourceRange": [
"__meta": [ 44,
{ 45,
"sourceRange": [ 0
44, ]
45, }
0 ]
]
}
]
},
{
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
47,
48,
0
]
}
]
},
{
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
50,
51,
0
]
}
]
},
{
"type": "Number",
"value": 10.0,
"__meta": [
{
"sourceRange": [
53,
55,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
43,
56,
0
]
}
]
},
"i": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
61,
62,
0
]
}
]
},
"obj": {
"type": "Object",
"value": {
"bar": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
150,
151,
0
]
}
]
},
"foo": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
141,
142,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
133,
153,
0
]
}
]
},
"one": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
141,
142,
0
]
}
]
},
"p": {
"type": "String",
"value": "foo",
"__meta": [
{
"sourceRange": [
121,
126,
0
]
}
]
},
"ten": {
"type": "Number",
"value": 10.0,
"__meta": [
{
"sourceRange": [
53,
55,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "type": "Number",
} "value": 0.0,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 47,
], 48,
"callStack": [] 0
]
}
]
},
{
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
50,
51,
0
]
}
]
},
{
"type": "Number",
"value": 10.0,
"__meta": [
{
"sourceRange": [
53,
55,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
43,
56,
0
]
}
]
},
"i": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
61,
62,
0
]
}
]
},
"obj": {
"type": "Object",
"value": {
"bar": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
150,
151,
0
]
}
]
},
"foo": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
141,
142,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
133,
153,
0
]
}
]
},
"one": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
141,
142,
0
]
}
]
},
"p": {
"type": "String",
"value": "foo",
"__meta": [
{
"sourceRange": [
121,
126,
0
]
}
]
},
"ten": {
"type": "Number",
"value": 10.0,
"__meta": [
{
"sourceRange": [
53,
55,
0
]
}
]
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,277 +1,243 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing double_map_fn.kcl description: Variables in memory after executing double_map_fn.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "increment": {
"__meta": [] "type": "Function",
}, "expression": {
"increment": { "body": {
"type": "Function", "body": [
"expression": { {
"body": { "argument": {
"body": [ "end": 32,
{ "left": {
"argument": { "end": 28,
"end": 32, "name": "i",
"left": { "start": 27,
"end": 28, "type": "Identifier",
"name": "i", "type": "Identifier"
"start": 27, },
"type": "Identifier", "operator": "+",
"type": "Identifier" "right": {
}, "end": 32,
"operator": "+", "raw": "1",
"right": { "start": 31,
"end": 32, "type": "Literal",
"raw": "1", "type": "Literal",
"start": 31, "value": {
"type": "Literal", "value": 1.0,
"type": "Literal", "suffix": "None"
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 27,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 32,
"start": 20,
"type": "ReturnStatement",
"type": "ReturnStatement"
} }
], },
"end": 34, "start": 27,
"start": 16 "type": "BinaryExpression",
"type": "BinaryExpression"
}, },
"end": 34, "end": 32,
"params": [ "start": 20,
{ "type": "ReturnStatement",
"type": "Parameter", "type": "ReturnStatement"
"identifier": { }
"end": 14, ],
"name": "i", "end": 34,
"start": 13, "start": 16
"type": "Identifier"
}
}
],
"start": 12,
"type": "FunctionExpression"
},
"memory": [
0,
1
],
"__meta": [
{
"sourceRange": [
12,
34,
0
]
}
]
},
"xs": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
},
"ys": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
},
{
"sourceRange": [
31,
32,
0
]
},
{
"sourceRange": [
31,
32,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
},
{
"sourceRange": [
31,
32,
0
]
},
{
"sourceRange": [
31,
32,
0
]
}
]
},
{
"type": "Number",
"value": 4.0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
},
{
"sourceRange": [
31,
32,
0
]
},
{
"sourceRange": [
31,
32,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
84,
101,
0
]
}
]
}
}, },
"snapshots": [ "end": 34,
"params": [
{ {
"parent_snapshot": null, "type": "Parameter",
"data": { "identifier": {
"increment": { "end": 14,
"type": "Tombstone", "name": "i",
"value": null, "start": 13,
"__meta": [] "type": "Identifier"
},
"xs": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"ys": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} }
], ],
"parent": null "start": 12,
} "type": "FunctionExpression"
], },
"currentEnv": [ "memory": [
0, 0,
0 1
], ],
"callStack": [] "__meta": [
{
"sourceRange": [
12,
34,
0
]
}
]
},
"xs": {
"type": "Array",
"value": [
{
"type": "Int",
"value": 0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
},
{
"type": "Int",
"value": 1,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
},
{
"type": "Int",
"value": 2,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
41,
47,
0
]
}
]
},
"ys": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
},
{
"sourceRange": [
31,
32,
0
]
},
{
"sourceRange": [
31,
32,
0
]
}
]
},
{
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
},
{
"sourceRange": [
31,
32,
0
]
},
{
"sourceRange": [
31,
32,
0
]
}
]
},
{
"type": "Number",
"value": 4.0,
"__meta": [
{
"sourceRange": [
41,
47,
0
]
},
{
"sourceRange": [
31,
32,
0
]
},
{
"sourceRange": [
31,
32,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
84,
101,
0
]
}
]
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,171 +1,157 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing helix_ccw.kcl description: Variables in memory after executing helix_ccw.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "part001": {
"__meta": [] "type": "Solid",
}, "value": {
"part001": { "type": "Solid",
"type": "Solid", "id": "[uuid]",
"value": { "artifactId": "[uuid]",
"type": "Solid", "value": [
"id": "[uuid]", {
"artifactId": "[uuid]", "faceId": "[uuid]",
"value": [ "id": "[uuid]",
{ "sourceRange": [
"faceId": "[uuid]", 35,
"id": "[uuid]", 78,
"sourceRange": [ 0
35, ],
78, "tag": null,
0 "type": "extrudeArc"
], }
"tag": null, ],
"type": "extrudeArc" "sketch": {
} "type": "Sketch",
], "id": "[uuid]",
"sketch": { "paths": [
"type": "Sketch", {
"__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 35,
"__geoMeta": { 78,
"id": "[uuid]", 0
"sourceRange": [
35,
78,
0
]
},
"ccw": true,
"center": [
5.0,
5.0
],
"from": [
15.0,
5.0
],
"radius": 10.0,
"tag": null,
"to": [
15.0,
5.0
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
15.0,
5.0
],
"to": [
15.0,
5.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
78,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
78,
0
]
}
] ]
}, },
"height": 10.0, "ccw": true,
"startCapId": "[uuid]", "center": [
"endCapId": "[uuid]", 5.0,
"units": { 5.0
"type": "Mm" ],
}, "from": [
"__meta": [ 15.0,
{ 5.0
"sourceRange": [ ],
35, "radius": 10.0,
78, "tag": null,
0 "to": [
] 15.0,
} 5.0
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
15.0,
5.0
],
"to": [
15.0,
5.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
78,
0
] ]
} }
} },
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
78,
0
]
}
]
}, },
"snapshots": [], "height": 10.0,
"parent": null "startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
78,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,34 +1,178 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing helix_simple.kcl description: Variables in memory after executing helix_simple.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"edge001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
102,
137,
0
]
}, },
"QUARTER_TURN": { "from": [
"type": "Number", 0.0,
"value": 90.0, 0.0
"__meta": [] ],
"tag": {
"end": 136,
"start": 128,
"type": "TagDeclarator",
"value": "edge001"
}, },
"THREE_QUARTER_TURN": { "to": [
"type": "Number", 0.0,
"value": 270.0, 10.0
"__meta": [] ],
"type": "ToPoint"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
128,
136,
0
]
}
]
},
"helixPath": {
"type": "Helix",
"value": {
"value": "[uuid]",
"artifactId": "[uuid]",
"revolutions": 5.0,
"angleStart": 0.0,
"ccw": true,
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
151,
257,
0
]
}
]
}
},
"helper001": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
102,
137,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 136,
"start": 128,
"type": "TagDeclarator",
"value": "edge001"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}, },
"ZERO": { "xAxis": {
"type": "Number", "x": 1.0,
"value": 0.0, "y": 0.0,
"__meta": [] "z": 0.0
}, },
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
71,
96,
0
]
}
},
"tags": {
"edge001": { "edge001": {
"type": "TagIdentifier",
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge001", "value": "edge001",
"info": { "info": {
@ -71,180 +215,22 @@ snapshot_kind: text
] ]
} }
] ]
},
"helixPath": {
"type": "Helix",
"value": {
"value": "[uuid]",
"artifactId": "[uuid]",
"revolutions": 5.0,
"angleStart": 0.0,
"ccw": true,
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
151,
257,
0
]
}
]
}
},
"helper001": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
102,
137,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 136,
"start": 128,
"type": "TagDeclarator",
"value": "edge001"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
71,
96,
0
]
}
},
"tags": {
"edge001": {
"type": "TagIdentifier",
"value": "edge001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
102,
137,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 136,
"start": 128,
"type": "TagDeclarator",
"value": "edge001"
},
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
128,
136,
0
]
}
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
71,
96,
0
]
}
]
}
} }
}, },
"snapshots": [], "artifactId": "[uuid]",
"parent": null "originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
71,
96,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,78 +1,65 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing if_else.kcl description: Variables in memory after executing if_else.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "a": {
"__meta": [] "type": "Number",
}, "value": 3.0,
"a": { "__meta": [
"type": "Number", {
"value": 3.0, "sourceRange": [
"__meta": [ 64,
{ 65,
"sourceRange": [ 0
64, ]
65, }
0 ]
] },
} "b": {
] "type": "Number",
}, "value": 4.0,
"b": { "__meta": [
"type": "Number", {
"value": 4.0, "sourceRange": [
"__meta": [ 199,
{ 200,
"sourceRange": [ 0
199, ]
200, }
0 ]
] },
} "c": {
] "type": "Number",
}, "value": 5.0,
"c": { "__meta": [
"type": "Number", {
"value": 5.0, "sourceRange": [
"__meta": [ 332,
{ 333,
"sourceRange": [ 0
332, ]
333, }
0 ]
] }
}
]
}
},
"snapshots": [],
"parent": null
}
],
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,91 +1,39 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_constant.kcl description: Variables in memory after executing import_constant.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "three": {
"__meta": [] "type": "Number",
}, "value": 3.0,
"three": { "__meta": [
"type": "Number", {
"value": 3.0, "sourceRange": [
"__meta": [ 15,
{ 16,
"sourceRange": [ 1
15, ]
16, }
1 ]
] }
}
]
}
},
"snapshots": [],
"parent": null
},
{
"bindings": {
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
15,
16,
1
]
}
]
}
},
"snapshots": [],
"parent": null
}
],
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,130 +1,39 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_export.kcl description: Variables in memory after executing import_export.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "three": {
"__meta": [] "type": "Number",
}, "value": 3.0,
"three": { "__meta": [
"type": "Number", {
"value": 3.0, "sourceRange": [
"__meta": [ 15,
{ 16,
"sourceRange": [ 2
15, ]
16, }
2 ]
] }
}
]
}
},
"snapshots": [],
"parent": null
},
{
"bindings": {
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
15,
16,
2
]
}
]
}
},
"snapshots": [],
"parent": null
},
{
"bindings": {
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
15,
16,
2
]
}
]
}
},
"snapshots": [],
"parent": null
}
],
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,68 +1,55 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_foreign.kcl description: Variables in memory after executing import_foreign.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "cube": {
"__meta": [] "type": "Module",
}, "value": 1,
"cube": { "__meta": [
"type": "Module", {
"value": 1, "sourceRange": [
"__meta": [ 0,
{ 36,
"sourceRange": [ 0
0, ]
36, }
0 ]
] },
} "model": {
] "type": "ImportedGeometry",
}, "id": "[uuid]",
"model": { "value": [
"type": "ImportedGeometry", "cube.gltf"
"id": "[uuid]", ],
"value": [ "__meta": [
"cube.gltf" {
], "sourceRange": [
"__meta": [ 0,
{ 36,
"sourceRange": [ 0
0, ]
36, }
0 ]
] }
}
]
}
},
"snapshots": [],
"parent": null
}
],
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,592 +1,140 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_function_not_sketch.kcl description: Variables in memory after executing import_function_not_sketch.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "one": {
"__meta": [] "type": "Function",
}, "expression": {
"one": { "body": {
"type": "Function", "body": [
"expression": { {
"body": { "argument": {
"body": [ "end": 106,
{ "left": {
"argument": { "arguments": [],
"end": 106, "callee": {
"left": { "end": 100,
"arguments": [], "name": "two",
"callee": { "start": 97,
"end": 100, "type": "Identifier"
"name": "two", },
"start": 97, "end": 102,
"type": "Identifier" "start": 97,
}, "type": "CallExpression",
"end": 102, "type": "CallExpression"
"start": 97, },
"type": "CallExpression", "operator": "-",
"type": "CallExpression" "right": {
}, "end": 106,
"operator": "-", "raw": "1",
"right": { "start": 105,
"end": 106, "type": "Literal",
"raw": "1", "type": "Literal",
"start": 105, "value": {
"type": "Literal", "value": 1.0,
"type": "Literal", "suffix": "None"
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 97,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 106,
"start": 90,
"type": "ReturnStatement",
"type": "ReturnStatement"
} }
], },
"end": 108, "start": 97,
"start": 86 "type": "BinaryExpression",
"type": "BinaryExpression"
}, },
"end": 108, "end": 106,
"params": [], "start": 90,
"start": 83, "type": "ReturnStatement",
"type": "FunctionExpression" "type": "ReturnStatement"
},
"memory": [
0,
1
],
"__meta": [
{
"sourceRange": [
83,
108,
0
]
}
]
},
"two": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 388,
"moduleId": 1,
"raw": "5",
"start": 387,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"end": 388,
"moduleId": 1,
"start": 380,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 390,
"moduleId": 1,
"start": 378
},
"end": 390,
"moduleId": 1,
"params": [],
"start": 372,
"type": "FunctionExpression"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
372,
390,
1
]
}
]
}
},
"snapshots": [
{
"parent_snapshot": null,
"data": {
"one": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} ],
], "end": 108,
"parent": null "start": 86
},
"end": 108,
"params": [],
"start": 83,
"type": "FunctionExpression"
}, },
{ "memory": [
"bindings": { 0,
"HALF_TURN": { 1
"type": "Number", ],
"value": 180.0, "__meta": [
"__meta": [] {
}, "sourceRange": [
"QUARTER_TURN": { 83,
"type": "Number", 108,
"value": 90.0, 0
"__meta": [] ]
}, }
"THREE_QUARTER_TURN": { ]
"type": "Number", },
"value": 270.0, "two": {
"__meta": [] "type": "Function",
}, "expression": {
"ZERO": { "body": {
"type": "Number", "body": [
"value": 0.0, {
"__meta": [] "argument": {
}, "end": 388,
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
109,
127,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
133,
152,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
158,
177,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
183,
202,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
208,
233,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
239,
260,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
266,
285,
1
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
291,
298,
1
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
109,
127,
1
]
},
"from": [
4.0,
12.0
],
"tag": null,
"to": [
6.0,
12.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
133,
152,
1
]
},
"from": [
6.0,
12.0
],
"tag": null,
"to": [
6.0,
6.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
158,
177,
1
]
},
"from": [
6.0,
6.0
],
"tag": null,
"to": [
10.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
183,
202,
1
]
},
"from": [
10.0,
0.0
],
"tag": null,
"to": [
10.0,
-6.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
208,
233,
1
]
},
"from": [
10.0,
-6.0
],
"tag": null,
"to": [
6.25,
-10.5
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
239,
260,
1
]
},
"from": [
6.25,
-10.5
],
"tag": null,
"to": [
6.25,
-16.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
266,
285,
1
]
},
"from": [
6.25,
-16.0
],
"tag": null,
"to": [
4.25,
-16.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
291,
298,
1
]
},
"from": [
4.25,
-16.0
],
"tag": null,
"to": [
4.0,
12.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
4.0,
12.0
],
"to": [
4.0,
12.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
77,
103,
1
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
77,
103,
1
]
}
]
},
"height": 0.0,
"startCapId": null,
"endCapId": null,
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
77,
103,
1
]
}
]
}
},
"two": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 388,
"moduleId": 1,
"raw": "5",
"start": 387,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"end": 388,
"moduleId": 1,
"start": 380,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 390,
"moduleId": 1, "moduleId": 1,
"start": 378 "raw": "5",
"start": 387,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
}, },
"end": 390, "end": 388,
"moduleId": 1, "moduleId": 1,
"params": [], "start": 380,
"start": 372, "type": "ReturnStatement",
"type": "FunctionExpression" "type": "ReturnStatement"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
372,
390,
1
]
}
]
}
},
"snapshots": [
{
"parent_snapshot": null,
"data": {
"two": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} ],
], "end": 390,
"parent": null "moduleId": 1,
} "start": 378
], },
"currentEnv": [ "end": 390,
0, "moduleId": 1,
0 "params": [],
], "start": 372,
"callStack": [] "type": "FunctionExpression"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
372,
390,
1
]
}
]
}
} }

View File

@ -1,200 +1,88 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_glob.kcl description: Variables in memory after executing import_glob.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "foo": {
"__meta": [] "type": "Function",
}, "expression": {
"foo": { "body": {
"type": "Function", "body": [
"expression": { {
"body": { "argument": {
"body": [ "end": 47,
{
"argument": {
"end": 47,
"moduleId": 1,
"raw": "42",
"start": 45,
"type": "Literal",
"type": "Literal",
"value": {
"value": 42.0,
"suffix": "None"
}
},
"end": 47,
"moduleId": 1,
"start": 38,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 49,
"moduleId": 1, "moduleId": 1,
"start": 34 "raw": "42",
"start": 45,
"type": "Literal",
"type": "Literal",
"value": {
"value": 42.0,
"suffix": "None"
}
}, },
"end": 49, "end": 47,
"moduleId": 1, "moduleId": 1,
"params": [], "start": 38,
"start": 31, "type": "ReturnStatement",
"type": "FunctionExpression" "type": "ReturnStatement"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
31,
49,
1
]
}
]
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
15,
16,
1
]
}
]
}
},
"snapshots": [],
"parent": null
},
{
"bindings": {
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"foo": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 47,
"moduleId": 1,
"raw": "42",
"start": 45,
"type": "Literal",
"type": "Literal",
"value": {
"value": 42.0,
"suffix": "None"
}
},
"end": 47,
"moduleId": 1,
"start": 38,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 49,
"moduleId": 1,
"start": 34
},
"end": 49,
"moduleId": 1,
"params": [],
"start": 31,
"type": "FunctionExpression"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
31,
49,
1
]
}
]
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
15,
16,
1
]
}
]
}
},
"snapshots": [
{
"parent_snapshot": null,
"data": {
"foo": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} ],
], "end": 49,
"parent": null "moduleId": 1,
} "start": 34
], },
"currentEnv": [ "end": 49,
0, "moduleId": 1,
0 "params": [],
], "start": 31,
"callStack": [] "type": "FunctionExpression"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
31,
49,
1
]
}
]
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
15,
16,
1
]
}
]
}
} }

View File

@ -1,277 +1,75 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_side_effect.kcl description: Variables in memory after executing import_side_effect.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "foo": {
"__meta": [] "type": "Function",
}, "expression": {
"foo": { "body": {
"type": "Function", "body": [
"expression": { {
"body": { "argument": {
"body": [ "end": 32,
{
"argument": {
"end": 32,
"moduleId": 1,
"raw": "0",
"start": 31,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"end": 32,
"moduleId": 1,
"start": 24,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 34,
"moduleId": 1, "moduleId": 1,
"start": 22 "raw": "0",
"start": 31,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}, },
"end": 34, "end": 32,
"moduleId": 1, "moduleId": 1,
"params": [], "start": 24,
"start": 16, "type": "ReturnStatement",
"type": "FunctionExpression" "type": "ReturnStatement"
}, }
"memory": [ ],
1, "end": 34,
1 "moduleId": 1,
], "start": 22
"__meta": [
{
"sourceRange": [
16,
34,
1
]
}
]
}
}, },
"snapshots": [], "end": 34,
"parent": null "moduleId": 1,
"params": [],
"start": 16,
"type": "FunctionExpression"
}, },
{ "memory": [
"bindings": { 1,
"HALF_TURN": { 1
"type": "Number", ],
"value": 180.0, "__meta": [
"__meta": [] {
}, "sourceRange": [
"QUARTER_TURN": { 16,
"type": "Number", 34,
"value": 90.0, 1
"__meta": [] ]
}, }
"THREE_QUARTER_TURN": { ]
"type": "Number", }
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"foo": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 32,
"moduleId": 1,
"raw": "0",
"start": 31,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"end": 32,
"moduleId": 1,
"start": 24,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 34,
"moduleId": 1,
"start": 22
},
"end": 34,
"moduleId": 1,
"params": [],
"start": 16,
"type": "FunctionExpression"
},
"memory": [
1,
1
],
"__meta": [
{
"sourceRange": [
16,
34,
1
]
}
]
},
"part001": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
106,
149,
1
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
10.0,
0.0
],
"radius": 10.0,
"tag": null,
"to": [
10.0,
0.0
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
10.0,
0.0
],
"to": [
10.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
106,
149,
1
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
106,
149,
1
]
}
]
}
}
},
"snapshots": [
{
"parent_snapshot": null,
"data": {
"foo": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"part001": {
"type": "Tombstone",
"value": null,
"__meta": []
}
}
}
],
"parent": null
}
],
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,210 +1,170 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing import_whole.kcl description: Variables in memory after executing import_whole.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "bar": {
"__meta": [] "type": "Solid",
}, "value": {
"bar": { "type": "Solid",
"type": "Solid", "id": "[uuid]",
"value": { "artifactId": "[uuid]",
"type": "Solid", "value": [
"id": "[uuid]", {
"artifactId": "[uuid]", "faceId": "[uuid]",
"value": [ "id": "[uuid]",
{ "sourceRange": [
"faceId": "[uuid]", 61,
"id": "[uuid]", 104,
"sourceRange": [ 1
61, ],
104, "tag": null,
1 "type": "extrudeArc"
], }
"tag": null, ],
"type": "extrudeArc" "sketch": {
} "type": "Sketch",
], "id": "[uuid]",
"sketch": { "paths": [
"type": "Sketch", {
"__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 61,
"__geoMeta": { 104,
"id": "[uuid]", 1
"sourceRange": [
61,
104,
1
]
},
"ccw": true,
"center": [
5.0,
5.0
],
"from": [
15.0,
5.0
],
"radius": 10.0,
"tag": null,
"to": [
15.0,
5.0
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Inches"
},
"__meta": []
},
"start": {
"from": [
15.0,
5.0
],
"to": [
15.0,
5.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
61,
104,
1
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Inches"
},
"__meta": [
{
"sourceRange": [
61,
104,
1
]
}
] ]
}, },
"height": 10.0, "ccw": true,
"startCapId": "[uuid]", "center": [
"endCapId": "[uuid]", 5.0,
"units": { 5.0
"type": "Inches" ],
}, "from": [
"__meta": [ 15.0,
{ 5.0
"sourceRange": [ ],
61, "radius": 10.0,
104, "tag": null,
1 "to": [
] 15.0,
} 5.0
],
"type": "Circle"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Inches"
},
"__meta": []
},
"start": {
"from": [
15.0,
5.0
],
"to": [
15.0,
5.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
61,
104,
1
] ]
} }
}, },
"foo": { "artifactId": "[uuid]",
"type": "Module", "originalId": "[uuid]",
"value": 1, "units": {
"__meta": [ "type": "Inches"
{ },
"sourceRange": [ "__meta": [
34, {
66, "sourceRange": [
0 61,
] 104,
} 1
]
}
]
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Inches"
},
"__meta": [
{
"sourceRange": [
61,
104,
1
] ]
} }
}, ]
"snapshots": [],
"parent": null
},
{
"bindings": {
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
}
},
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "foo": {
0, "type": "Module",
0 "value": 1,
], "__meta": [
"callStack": [] {
"sourceRange": [
34,
66,
0
]
}
]
}
} }

View File

@ -1,131 +1,118 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing index_of_array.kcl description: Variables in memory after executing index_of_array.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "arr": {
"__meta": [] "type": "Array",
}, "value": [
"arr": { {
"type": "Array", "type": "Number",
"value": [ "value": 90.0,
{ "__meta": [
"type": "Number", {
"value": 90.0, "sourceRange": [
"__meta": [ 42,
{ 44,
"sourceRange": [ 0
42, ]
44, }
0 ]
]
}
]
},
{
"type": "Number",
"value": 91.0,
"__meta": [
{
"sourceRange": [
46,
48,
0
]
}
]
},
{
"type": "Number",
"value": 92.0,
"__meta": [
{
"sourceRange": [
50,
52,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
41,
53,
0
]
}
]
},
"i": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
252,
262,
0
]
}
]
},
"result0": {
"type": "Number",
"value": 91.0,
"__meta": [
{
"sourceRange": [
46,
48,
0
]
}
]
},
"result1": {
"type": "Number",
"value": 91.0,
"__meta": [
{
"sourceRange": [
46,
48,
0
]
}
]
}
}, },
"snapshots": [], {
"parent": null "type": "Number",
} "value": 91.0,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 46,
], 48,
"callStack": [] 0
]
}
]
},
{
"type": "Number",
"value": 92.0,
"__meta": [
{
"sourceRange": [
50,
52,
0
]
}
]
}
],
"__meta": [
{
"sourceRange": [
41,
53,
0
]
}
]
},
"i": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
252,
262,
0
]
}
]
},
"result0": {
"type": "Number",
"value": 91.0,
"__meta": [
{
"sourceRange": [
46,
48,
0
]
}
]
},
"result1": {
"type": "Number",
"value": 91.0,
"__meta": [
{
"sourceRange": [
46,
48,
0
]
}
]
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,255 +1,211 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing kw_fn.kcl description: Variables in memory after executing kw_fn.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "add": {
"__meta": [] "type": "Function",
}, "expression": {
"add": { "body": {
"type": "Function", "body": [
"expression": { {
"body": { "argument": {
"body": [ "end": 75,
{ "left": {
"argument": { "end": 67,
"end": 75, "name": "x",
"left": { "start": 66,
"end": 67, "type": "Identifier",
"name": "x", "type": "Identifier"
"start": 66,
"type": "Identifier",
"type": "Identifier"
},
"operator": "+",
"right": {
"end": 75,
"name": "delta",
"start": 70,
"type": "Identifier",
"type": "Identifier"
},
"start": 66,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 75,
"start": 59,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 77,
"start": 55
},
"end": 77,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 46,
"name": "x",
"start": 45,
"type": "Identifier"
},
"labeled": false
}, },
{ "operator": "+",
"type": "Parameter", "right": {
"identifier": { "end": 75,
"end": 53, "name": "delta",
"name": "delta", "start": 70,
"start": 48, "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} },
} "start": 66,
], "type": "BinaryExpression",
"start": 43, "type": "BinaryExpression"
"type": "FunctionExpression"
},
"memory": [
0,
2
],
"__meta": [
{
"sourceRange": [
43,
77,
0
]
}
]
},
"increment": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 33,
"left": {
"end": 29,
"name": "x",
"start": 28,
"type": "Identifier",
"type": "Identifier"
},
"operator": "+",
"right": {
"end": 33,
"raw": "1",
"start": 32,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 28,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 33,
"start": 21,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 35,
"start": 17
}, },
"end": 35, "end": 75,
"params": [ "start": 59,
{ "type": "ReturnStatement",
"type": "Parameter", "type": "ReturnStatement"
"identifier": {
"end": 15,
"name": "x",
"start": 14,
"type": "Identifier"
},
"labeled": false
}
],
"start": 12,
"type": "FunctionExpression"
},
"memory": [
0,
1
],
"__meta": [
{
"sourceRange": [
12,
35,
0
]
}
]
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
110,
111,
0
]
},
{
"sourceRange": [
121,
122,
0
]
}
]
},
"two": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
95,
96,
0
]
},
{
"sourceRange": [
32,
33,
0
]
}
]
}
},
"snapshots": [
{
"parent_snapshot": null,
"data": {
"increment": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
],
"end": 77,
"start": 55
},
"end": 77,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 46,
"name": "x",
"start": 45,
"type": "Identifier"
},
"labeled": false
}, },
{ {
"parent_snapshot": null, "type": "Parameter",
"data": { "identifier": {
"add": { "end": 53,
"type": "Tombstone", "name": "delta",
"value": null, "start": 48,
"__meta": [] "type": "Identifier"
},
"three": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"two": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} }
], ],
"parent": null "start": 43,
} "type": "FunctionExpression"
], },
"currentEnv": [ "memory": [
0, 0,
0 2
], ],
"callStack": [] "__meta": [
{
"sourceRange": [
43,
77,
0
]
}
]
},
"increment": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 33,
"left": {
"end": 29,
"name": "x",
"start": 28,
"type": "Identifier",
"type": "Identifier"
},
"operator": "+",
"right": {
"end": 33,
"raw": "1",
"start": 32,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 28,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 33,
"start": 21,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 35,
"start": 17
},
"end": 35,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 15,
"name": "x",
"start": 14,
"type": "Identifier"
},
"labeled": false
}
],
"start": 12,
"type": "FunctionExpression"
},
"memory": [
0,
1
],
"__meta": [
{
"sourceRange": [
12,
35,
0
]
}
]
},
"three": {
"type": "Number",
"value": 3.0,
"__meta": [
{
"sourceRange": [
110,
111,
0
]
},
{
"sourceRange": [
121,
122,
0
]
}
]
},
"two": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
95,
96,
0
]
},
{
"sourceRange": [
32,
33,
0
]
}
]
}
} }

View File

@ -1,177 +1,143 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing kw_fn_with_defaults.kcl description: Variables in memory after executing kw_fn_with_defaults.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "increment": {
"__meta": [] "type": "Function",
}, "expression": {
"increment": { "body": {
"type": "Function", "body": [
"expression": { {
"body": { "argument": {
"body": [ "end": 43,
{ "left": {
"argument": { "end": 38,
"end": 43, "name": "x",
"left": { "start": 37,
"end": 38, "type": "Identifier",
"name": "x", "type": "Identifier"
"start": 37,
"type": "Identifier",
"type": "Identifier"
},
"operator": "+",
"right": {
"end": 43,
"name": "by",
"start": 41,
"type": "Identifier",
"type": "Identifier"
},
"start": 37,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 43,
"start": 30,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 45,
"start": 26
},
"end": 45,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 15,
"name": "x",
"start": 14,
"type": "Identifier"
},
"labeled": false
}, },
{ "operator": "+",
"type": "Parameter", "right": {
"identifier": { "end": 43,
"end": 19, "name": "by",
"name": "by", "start": 41,
"start": 17, "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"default_value": { "start": 37,
"type": "Literal", "type": "BinaryExpression",
"type": "Literal", "type": "BinaryExpression"
"value": {
"value": 1.0,
"suffix": "None"
},
"raw": "1"
}
}
],
"start": 12,
"type": "FunctionExpression"
},
"memory": [
0,
1
],
"__meta": [
{
"sourceRange": [
12,
45,
0
]
}
]
},
"twentyOne": {
"type": "Number",
"value": 21.0,
"__meta": [
{
"sourceRange": [
88,
89,
0
]
}, },
{ "end": 43,
"sourceRange": [ "start": 30,
96, "type": "ReturnStatement",
98, "type": "ReturnStatement"
0 }
] ],
} "end": 45,
] "start": 26
},
"two": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
63,
64,
0
]
}
]
}
}, },
"snapshots": [ "end": 45,
"params": [
{ {
"parent_snapshot": null, "type": "Parameter",
"data": { "identifier": {
"increment": { "end": 15,
"type": "Tombstone", "name": "x",
"value": null, "start": 14,
"__meta": [] "type": "Identifier"
},
"labeled": false
},
{
"type": "Parameter",
"identifier": {
"end": 19,
"name": "by",
"start": 17,
"type": "Identifier"
},
"default_value": {
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}, },
"twentyOne": { "raw": "1"
"type": "Tombstone",
"value": null,
"__meta": []
},
"two": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} }
], ],
"parent": null "start": 12,
} "type": "FunctionExpression"
], },
"currentEnv": [ "memory": [
0, 0,
0 1
], ],
"callStack": [] "__meta": [
{
"sourceRange": [
12,
45,
0
]
}
]
},
"twentyOne": {
"type": "Number",
"value": 21.0,
"__meta": [
{
"sourceRange": [
88,
89,
0
]
},
{
"sourceRange": [
96,
98,
0
]
}
]
},
"two": {
"type": "Number",
"value": 2.0,
"__meta": [
{
"sourceRange": [
63,
64,
0
]
}
]
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,227 +1,213 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing neg_xz_plane.kcl description: Variables in memory after executing neg_xz_plane.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
67,
97,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 90.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
103,
131,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"THREE_QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 270.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
}, 137,
"ZERO": { 145,
"type": "Number", 0
"value": 0.0, ],
"__meta": [] "tag": null,
}, "type": "extrudePlane"
"part001": { }
"type": "Solid", ],
"value": { "sketch": {
"type": "Solid", "type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "paths": [
"value": [ {
{ "__geoMeta": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
67,
97,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
131,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
137,
145,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 67,
"__geoMeta": { 97,
"id": "[uuid]", 0
"sourceRange": [
67,
97,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
100.0,
100.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
131,
0
]
},
"from": [
100.0,
100.0
],
"tag": null,
"to": [
100.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
145,
0
]
},
"from": [
100.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
36,
61,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
36,
61,
0
]
}
] ]
}, },
"height": 12.0, "from": [
"startCapId": "[uuid]", 0.0,
"endCapId": "[uuid]", 0.0
"units": { ],
"type": "Mm" "tag": null,
"to": [
100.0,
100.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
103,
131,
0
]
}, },
"__meta": [ "from": [
{ 100.0,
"sourceRange": [ 100.0
36, ],
61, "tag": null,
0 "to": [
] 100.0,
} 0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
145,
0
]
},
"from": [
100.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
36,
61,
0
] ]
} }
} },
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
36,
61,
0
]
}
]
}, },
"snapshots": [], "height": 12.0,
"parent": null "startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
36,
61,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,424 +1,410 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing parametric.kcl description: Variables in memory after executing parametric.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "FOS": {
{ "type": "Number",
"bindings": { "value": 2.0,
"FOS": { "__meta": [
"type": "Number", {
"value": 2.0, "sourceRange": [
"__meta": [ 105,
{ 106,
0
]
}
]
},
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"bracket": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
284,
305,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
311,
332,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
338,
365,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
371,
405,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
411,
445,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
451,
459,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [ "sourceRange": [
105, 284,
106, 305,
0 0
] ]
} },
] "from": [
}, 0.0,
"HALF_TURN": { 0.0
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"bracket": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
284,
305,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
311,
332,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
338,
365,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
371,
405,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
411,
445,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
451,
459,
0
],
"tag": null,
"type": "extrudePlane"
}
], ],
"sketch": { "tag": null,
"type": "Sketch", "to": [
0.0,
5.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 311,
"__geoMeta": { 332,
"id": "[uuid]", 0
"sourceRange": [
284,
305,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
5.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
311,
332,
0
]
},
"from": [
0.0,
5.0
],
"tag": null,
"to": [
8.0,
5.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
338,
365,
0
]
},
"from": [
8.0,
5.0
],
"tag": null,
"to": [
8.0,
4.8148
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
371,
405,
0
]
},
"from": [
8.0,
4.8148
],
"tag": null,
"to": [
0.1852,
4.8148
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
411,
445,
0
]
},
"from": [
0.1852,
4.8148
],
"tag": null,
"to": [
0.1852,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
451,
459,
0
]
},
"from": [
0.1852,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
253,
278,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
253,
278,
0
]
}
] ]
}, },
"height": 9.0, "from": [
"startCapId": "[uuid]", 0.0,
"endCapId": "[uuid]", 5.0
"units": { ],
"type": "Mm" "tag": null,
"to": [
8.0,
5.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
338,
365,
0
]
}, },
"__meta": [ "from": [
{ 8.0,
"sourceRange": [ 5.0
253, ],
278, "tag": null,
0 "to": [
] 8.0,
} 4.8148
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
371,
405,
0
]
},
"from": [
8.0,
4.8148
],
"tag": null,
"to": [
0.1852,
4.8148
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
411,
445,
0
]
},
"from": [
0.1852,
4.8148
],
"tag": null,
"to": [
0.1852,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
451,
459,
0
]
},
"from": [
0.1852,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
253,
278,
0
] ]
} }
}, },
"distance": { "artifactId": "[uuid]",
"type": "Number", "originalId": "[uuid]",
"value": 6.0, "units": {
"__meta": [ "type": "Mm"
{
"sourceRange": [
87,
88,
0
]
}
]
}, },
"leg1": { "__meta": [
"type": "Number", {
"value": 5.0, "sourceRange": [
"__meta": [ 253,
{ 278,
"sourceRange": [ 0
115, ]
116, }
0 ]
] },
} "height": 9.0,
] "startCapId": "[uuid]",
}, "endCapId": "[uuid]",
"leg2": { "units": {
"type": "Number", "type": "Mm"
"value": 8.0, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
134, 253,
135, 278,
0 0
]
}
]
},
"p": {
"type": "Number",
"value": 150.0,
"__meta": [
{
"sourceRange": [
48,
51,
0
]
}
]
},
"sigmaAllow": {
"type": "Number",
"value": 35000.0,
"__meta": [
{
"sourceRange": [
13,
18,
0
]
}
]
},
"thickness": {
"type": "Number",
"value": 0.1851640199545103,
"__meta": [
{
"sourceRange": [
158,
207,
0
]
}
]
},
"width": {
"type": "Number",
"value": 9.0,
"__meta": [
{
"sourceRange": [
34,
35,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "distance": {
0, "type": "Number",
0 "value": 6.0,
], "__meta": [
"callStack": [] {
"sourceRange": [
87,
88,
0
]
}
]
},
"leg1": {
"type": "Number",
"value": 5.0,
"__meta": [
{
"sourceRange": [
115,
116,
0
]
}
]
},
"leg2": {
"type": "Number",
"value": 8.0,
"__meta": [
{
"sourceRange": [
134,
135,
0
]
}
]
},
"p": {
"type": "Number",
"value": 150.0,
"__meta": [
{
"sourceRange": [
48,
51,
0
]
}
]
},
"sigmaAllow": {
"type": "Number",
"value": 35000.0,
"__meta": [
{
"sourceRange": [
13,
18,
0
]
}
]
},
"thickness": {
"type": "Number",
"value": 0.1851640199545103,
"__meta": [
{
"sourceRange": [
158,
207,
0
]
}
]
},
"width": {
"type": "Number",
"value": 9.0,
"__meta": [
{
"sourceRange": [
34,
35,
0
]
}
]
}
} }

View File

@ -1,516 +1,502 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing parametric_with_tan_arc.kcl description: Variables in memory after executing parametric_with_tan_arc.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "FOS": {
{ "type": "Number",
"bindings": { "value": 2.0,
"FOS": { "__meta": [
"type": "Number", {
"value": 2.0, "sourceRange": [
"__meta": [ 107,
{ 108,
0
]
}
]
},
"HALF_TURN": {
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"bracket": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
266,
293,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
299,
350,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
356,
385,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
391,
418,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
424,
452,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
458,
541,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
547,
575,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
581,
589,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [ "sourceRange": [
107, 266,
108, 293,
0 0
] ]
} },
] "from": [
}, 0.0,
"HALF_TURN": { 0.0
"type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"bracket": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
266,
293,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
299,
350,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
356,
385,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
391,
418,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
424,
452,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
458,
541,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
547,
575,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
581,
589,
0
],
"tag": null,
"type": "extrudePlane"
}
], ],
"sketch": { "tag": null,
"type": "Sketch", "to": [
0.0,
8.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 299,
"__geoMeta": { 350,
"id": "[uuid]", 0
"sourceRange": [
266,
293,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
8.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
299,
350,
0
]
},
"ccw": true,
"center": [
-0.7236272269866327,
8.0
],
"from": [
0.0,
8.0
],
"tag": null,
"to": [
-0.7236,
8.7236
],
"type": "TangentialArc"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
356,
385,
0
]
},
"from": [
-0.7236,
8.7236
],
"tag": null,
"to": [
-9.7236,
8.7236
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
391,
418,
0
]
},
"from": [
-9.7236,
8.7236
],
"tag": null,
"to": [
-9.7236,
8.3618
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
424,
452,
0
]
},
"from": [
-9.7236,
8.3618
],
"tag": null,
"to": [
-0.7236,
8.3618
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
458,
541,
0
]
},
"ccw": false,
"center": [
-0.7236272269866326,
8.0
],
"from": [
-0.7236,
8.3618
],
"tag": null,
"to": [
-0.3618,
8.0
],
"type": "TangentialArc"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
547,
575,
0
]
},
"from": [
-0.3618,
8.0
],
"tag": null,
"to": [
-0.3618,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
581,
589,
0
]
},
"from": [
-0.3618,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
239,
260,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
239,
260,
0
]
}
] ]
}, },
"height": 11.0, "ccw": true,
"startCapId": "[uuid]", "center": [
"endCapId": "[uuid]", -0.7236272269866327,
"units": { 8.0
"type": "Mm" ],
"from": [
0.0,
8.0
],
"tag": null,
"to": [
-0.7236,
8.7236
],
"type": "TangentialArc"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
356,
385,
0
]
}, },
"__meta": [ "from": [
{ -0.7236,
"sourceRange": [ 8.7236
239, ],
260, "tag": null,
0 "to": [
] -9.7236,
} 8.7236
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
391,
418,
0
]
},
"from": [
-9.7236,
8.7236
],
"tag": null,
"to": [
-9.7236,
8.3618
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
424,
452,
0
]
},
"from": [
-9.7236,
8.3618
],
"tag": null,
"to": [
-0.7236,
8.3618
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
458,
541,
0
]
},
"ccw": false,
"center": [
-0.7236272269866326,
8.0
],
"from": [
-0.7236,
8.3618
],
"tag": null,
"to": [
-0.3618,
8.0
],
"type": "TangentialArc"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
547,
575,
0
]
},
"from": [
-0.3618,
8.0
],
"tag": null,
"to": [
-0.3618,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
581,
589,
0
]
},
"from": [
-0.3618,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
239,
260,
0
] ]
} }
}, },
"distance": { "artifactId": "[uuid]",
"type": "Number", "originalId": "[uuid]",
"value": 12.0, "units": {
"__meta": [ "type": "Mm"
{
"sourceRange": [
88,
90,
0
]
}
]
}, },
"filletR": { "__meta": [
"type": "Number", {
"value": 0.7236272269866327, "sourceRange": [
"__meta": [ 239,
{ 260,
"sourceRange": [ 0
121, ]
172, }
0 ]
] },
}, "height": 11.0,
{ "startCapId": "[uuid]",
"sourceRange": [ "endCapId": "[uuid]",
195, "units": {
196, "type": "Mm"
0 },
] "__meta": [
} {
] "sourceRange": [
}, 239,
"p": { 260,
"type": "Number", 0
"value": 150.0,
"__meta": [
{
"sourceRange": [
49,
52,
0
]
}
]
},
"shelfMountL": {
"type": "Number",
"value": 9.0,
"__meta": [
{
"sourceRange": [
211,
212,
0
]
}
]
},
"sigmaAllow": {
"type": "Number",
"value": 15000.0,
"__meta": [
{
"sourceRange": [
13,
18,
0
]
}
]
},
"thickness": {
"type": "Number",
"value": 0.36181361349331637,
"__meta": [
{
"sourceRange": [
121,
172,
0
]
}
]
},
"wallMountL": {
"type": "Number",
"value": 8.0,
"__meta": [
{
"sourceRange": [
226,
227,
0
]
}
]
},
"width": {
"type": "Number",
"value": 11.0,
"__meta": [
{
"sourceRange": [
34,
36,
0
]
}
] ]
} }
}, ]
"snapshots": [],
"parent": null
} }
], },
"currentEnv": [ "distance": {
0, "type": "Number",
0 "value": 12.0,
], "__meta": [
"callStack": [] {
"sourceRange": [
88,
90,
0
]
}
]
},
"filletR": {
"type": "Number",
"value": 0.7236272269866327,
"__meta": [
{
"sourceRange": [
121,
172,
0
]
},
{
"sourceRange": [
195,
196,
0
]
}
]
},
"p": {
"type": "Number",
"value": 150.0,
"__meta": [
{
"sourceRange": [
49,
52,
0
]
}
]
},
"shelfMountL": {
"type": "Number",
"value": 9.0,
"__meta": [
{
"sourceRange": [
211,
212,
0
]
}
]
},
"sigmaAllow": {
"type": "Number",
"value": 15000.0,
"__meta": [
{
"sourceRange": [
13,
18,
0
]
}
]
},
"thickness": {
"type": "Number",
"value": 0.36181361349331637,
"__meta": [
{
"sourceRange": [
121,
172,
0
]
}
]
},
"wallMountL": {
"type": "Number",
"value": 8.0,
"__meta": [
{
"sourceRange": [
226,
227,
0
]
}
]
},
"width": {
"type": "Number",
"value": 11.0,
"__meta": [
{
"sourceRange": [
34,
36,
0
]
}
]
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,198 +1,185 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing property_of_object.kcl description: Variables in memory after executing property_of_object.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "obj": {
"__meta": [] "type": "Object",
}, "value": {
"obj": { "bar": {
"type": "Object", "type": "Number",
"value": { "value": 0.0,
"bar": { "__meta": [
"type": "Number", {
"value": 0.0, "sourceRange": [
"__meta": [ 73,
{ 74,
"sourceRange": [ 0
73, ]
74, }
0 ]
]
}
]
},
"foo": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
56,
76,
0
]
}
]
},
"obj2": {
"type": "Object",
"value": {
"inner": {
"type": "Object",
"value": {
"bar": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
73,
74,
0
]
}
]
},
"foo": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
56,
76,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
531,
546,
0
]
}
]
},
"one_a": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"one_b": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"one_c": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"one_d": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"p": {
"type": "String",
"value": "foo",
"__meta": [
{
"sourceRange": [
344,
349,
0
]
}
]
}
}, },
"snapshots": [], "foo": {
"parent": null "type": "Number",
} "value": 1.0,
], "__meta": [
"currentEnv": [ {
0, "sourceRange": [
0 64,
], 65,
"callStack": [] 0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
56,
76,
0
]
}
]
},
"obj2": {
"type": "Object",
"value": {
"inner": {
"type": "Object",
"value": {
"bar": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
73,
74,
0
]
}
]
},
"foo": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
56,
76,
0
]
}
]
}
},
"__meta": [
{
"sourceRange": [
531,
546,
0
]
}
]
},
"one_a": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"one_b": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"one_c": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"one_d": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
64,
65,
0
]
}
]
},
"p": {
"type": "String",
"value": "foo",
"__meta": [
{
"sourceRange": [
344,
349,
0
]
}
]
}
} }

View File

@ -1,529 +1,480 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing riddle_small.kcl description: Variables in memory after executing riddle_small.kcl
--- ---
{ {
"environments": [ "ANSWER": {
{ "type": "Number",
"bindings": { "value": 41803.0,
"ANSWER": { "__meta": [
"type": "Number", {
"value": 41803.0, "sourceRange": [
"__meta": [ 9,
{ 14,
"sourceRange": [ 0
9, ]
14, }
0 ]
] },
} "HALF_TURN": {
] "type": "Number",
"value": 180.0,
"__meta": []
},
"QUARTER_TURN": {
"type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"ox": {
"type": "Number",
"value": -26.0,
"__meta": [
{
"sourceRange": [
96,
98,
0
]
},
{
"sourceRange": [
9,
14,
0
]
},
{
"sourceRange": [
73,
79,
0
]
},
{
"sourceRange": [
49,
54,
0
]
},
{
"sourceRange": [
58,
64,
0
]
},
{
"sourceRange": [
110,
112,
0
]
}
]
},
"oy": {
"type": "Number",
"value": 34.0,
"__meta": [
{
"sourceRange": [
119,
121,
0
]
},
{
"sourceRange": [
9,
14,
0
]
},
{
"sourceRange": [
85,
90,
0
]
},
{
"sourceRange": [
49,
54,
0
]
},
{
"sourceRange": [
58,
64,
0
]
},
{
"sourceRange": [
133,
135,
0
]
}
]
},
"r": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
199,
217,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"HALF_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 180.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
223,
242,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 90.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
248,
267,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"THREE_QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 270.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
}, 273,
"ZERO": { 281,
"type": "Number", 0
"value": 0.0, ],
"__meta": [] "tag": null,
}, "type": "extrudePlane"
"ox": { }
"type": "Number", ],
"value": -26.0, "sketch": {
"__meta": [ "type": "Sketch",
{ "id": "[uuid]",
"sourceRange": [ "paths": [
96, {
98, "__geoMeta": {
0
]
},
{
"sourceRange": [
9,
14,
0
]
},
{
"sourceRange": [
73,
79,
0
]
},
{
"sourceRange": [
49,
54,
0
]
},
{
"sourceRange": [
58,
64,
0
]
},
{
"sourceRange": [
110,
112,
0
]
}
]
},
"oy": {
"type": "Number",
"value": 34.0,
"__meta": [
{
"sourceRange": [
119,
121,
0
]
},
{
"sourceRange": [
9,
14,
0
]
},
{
"sourceRange": [
85,
90,
0
]
},
{
"sourceRange": [
49,
54,
0
]
},
{
"sourceRange": [
58,
64,
0
]
},
{
"sourceRange": [
133,
135,
0
]
}
]
},
"r": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
199,
217,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
223,
242,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
248,
267,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
273,
281,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 199,
"__geoMeta": { 217,
"id": "[uuid]", 0
"sourceRange": [
199,
217,
0
]
},
"from": [
-26.0,
34.0
],
"tag": null,
"to": [
-25.0,
34.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
223,
242,
0
]
},
"from": [
-25.0,
34.0
],
"tag": null,
"to": [
-25.0,
33.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
248,
267,
0
]
},
"from": [
-25.0,
33.0
],
"tag": null,
"to": [
-26.0,
33.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
273,
281,
0
]
},
"from": [
-26.0,
33.0
],
"tag": null,
"to": [
-26.0,
34.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
-26.0,
34.0
],
"to": [
-26.0,
34.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
166,
193,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
166,
193,
0
]
}
] ]
}, },
"height": 1.0, "from": [
"startCapId": "[uuid]", -26.0,
"endCapId": "[uuid]", 34.0
"units": { ],
"type": "Mm" "tag": null,
"to": [
-25.0,
34.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
223,
242,
0
]
}, },
"__meta": [ "from": [
{ -25.0,
"sourceRange": [ 34.0
166, ],
193, "tag": null,
0 "to": [
] -25.0,
} 33.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
248,
267,
0
]
},
"from": [
-25.0,
33.0
],
"tag": null,
"to": [
-26.0,
33.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
273,
281,
0
]
},
"from": [
-26.0,
33.0
],
"tag": null,
"to": [
-26.0,
34.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
-26.0,
34.0
],
"to": [
-26.0,
34.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
166,
193,
0
] ]
} }
}, },
"t": { "artifactId": "[uuid]",
"type": "Function", "originalId": "[uuid]",
"expression": { "units": {
"body": { "type": "Mm"
"body": [
{
"argument": {
"end": 64,
"left": {
"end": 54,
"left": {
"end": 46,
"left": {
"end": 42,
"name": "ANSWER",
"start": 36,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 46,
"name": "s",
"start": 45,
"type": "Identifier",
"type": "Identifier"
},
"start": 36,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "+",
"right": {
"end": 54,
"raw": "12345",
"start": 49,
"type": "Literal",
"type": "Literal",
"value": {
"value": 12345.0,
"suffix": "None"
}
},
"start": 36,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "%",
"right": {
"end": 64,
"raw": "214748",
"start": 58,
"type": "Literal",
"type": "Literal",
"value": {
"value": 214748.0,
"suffix": "None"
}
},
"start": 36,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 64,
"start": 28,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 66,
"start": 24
},
"end": 66,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 22,
"name": "s",
"start": 21,
"type": "Identifier"
}
}
],
"start": 20,
"type": "FunctionExpression"
},
"memory": [
0,
1
],
"__meta": [
{
"sourceRange": [
20,
66,
0
]
}
]
}, },
"xs": { "__meta": [
"type": "Number", {
"value": 205804.0, "sourceRange": [
"__meta": [ 166,
{ 193,
"sourceRange": [ 0
73, ]
79, }
0 ]
] },
} "height": 1.0,
] "startCapId": "[uuid]",
}, "endCapId": "[uuid]",
"ys": { "units": {
"type": "Number", "type": "Mm"
"value": 71816.0, },
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
85, 166,
90, 193,
0 0
]
}
] ]
} }
]
}
},
"t": {
"type": "Function",
"expression": {
"body": {
"body": [
{
"argument": {
"end": 64,
"left": {
"end": 54,
"left": {
"end": 46,
"left": {
"end": 42,
"name": "ANSWER",
"start": 36,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 46,
"name": "s",
"start": 45,
"type": "Identifier",
"type": "Identifier"
},
"start": 36,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "+",
"right": {
"end": 54,
"raw": "12345",
"start": 49,
"type": "Literal",
"type": "Literal",
"value": {
"value": 12345.0,
"suffix": "None"
}
},
"start": 36,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "%",
"right": {
"end": 64,
"raw": "214748",
"start": 58,
"type": "Literal",
"type": "Literal",
"value": {
"value": 214748.0,
"suffix": "None"
}
},
"start": 36,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 64,
"start": 28,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 66,
"start": 24
}, },
"snapshots": [ "end": 66,
"params": [
{ {
"parent_snapshot": null, "type": "Parameter",
"data": { "identifier": {
"ox": { "end": 22,
"type": "Tombstone", "name": "s",
"value": null, "start": 21,
"__meta": [] "type": "Identifier"
},
"oy": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"r": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"t": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"xs": {
"type": "Tombstone",
"value": null,
"__meta": []
},
"ys": {
"type": "Tombstone",
"value": null,
"__meta": []
}
} }
} }
], ],
"parent": null "start": 20,
} "type": "FunctionExpression"
], },
"currentEnv": [ "memory": [
0, 0,
0 1
], ],
"callStack": [] "__meta": [
{
"sourceRange": [
20,
66,
0
]
}
]
},
"xs": {
"type": "Number",
"value": 205804.0,
"__meta": [
{
"sourceRange": [
73,
79,
0
]
}
]
},
"ys": {
"type": "Number",
"value": 71816.0,
"__meta": [
{
"sourceRange": [
85,
90,
0
]
}
]
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,254 +1,241 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing tan_arc_x_line.kcl description: Variables in memory after executing tan_arc_x_line.kcl
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 90.0,
"QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 90.0, "THREE_QUARTER_TURN": {
"__meta": [] "type": "Number",
}, "value": 270.0,
"THREE_QUARTER_TURN": { "__meta": []
"type": "Number", },
"value": 270.0, "ZERO": {
"__meta": [] "type": "Number",
}, "value": 0.0,
"ZERO": { "__meta": []
"type": "Number", },
"value": 0.0, "angleOffset": {
"__meta": [] "type": "Number",
}, "value": 135.0,
"angleOffset": { "__meta": [
"type": "Number", {
"value": 135.0, "sourceRange": [
"__meta": [ 36,
{ 39,
"sourceRange": [ 0
36, ]
39, }
0 ]
] },
} "angleStart": {
"type": "Number",
"value": 110.0,
"__meta": [
{
"sourceRange": [
59,
62,
0
]
}
]
},
"arc1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
191,
252,
0
] ]
}, },
"angleStart": { "ccw": true,
"type": "Number", "center": [
"value": 110.0, -0.9396929628060517,
"__meta": [ -0.34201920363304794
{ ],
"sourceRange": [ "from": [
59, -0.0000003420201433256687,
62, 0.0000009396926207859084
0 ],
] "tag": {
} "end": 251,
] "start": 246,
"type": "TagDeclarator",
"value": "arc1"
}, },
"arc1": { "to": [
"type": "TagIdentifier", -1.8460007498427018,
"type": "TagIdentifier", 0.08059905810765156
"value": "arc1", ],
"info": { "type": "TangentialArc"
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
191,
252,
0
]
},
"ccw": true,
"center": [
-0.9396929628060517,
-0.34201920363304794
],
"from": [
-0.0000003420201433256687,
0.0000009396926207859084
],
"tag": {
"end": 251,
"start": 246,
"type": "TagDeclarator",
"value": "arc1"
},
"to": [
-1.8460007498427018,
0.08059905810765156
],
"type": "TangentialArc"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
246,
251,
0
]
}
]
},
"arc2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
258,
344,
0
]
},
"ccw": true,
"center": [
-1.3928468563243768,
-0.13071007276269808
],
"from": [
-1.8460007498427018,
0.08059905810765156
],
"tag": {
"end": 343,
"start": 338,
"type": "TagDeclarator",
"value": "arc2"
},
"to": [
-1.2218367846615423,
-0.6005563831556522
],
"type": "TangentialArc"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
338,
343,
0
]
}
]
},
"arc3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
350,
437,
0
]
},
"ccw": false,
"center": [
-1.050826712998708,
-1.0704026935486064
],
"from": [
-1.2218367846615423,
-0.6005563831556522
],
"tag": {
"end": 436,
"start": 431,
"type": "TagDeclarator",
"value": "arc3"
},
"to": [
-0.5976728194803829,
-1.281711824418956
],
"type": "TangentialArc"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
431,
436,
0
]
}
]
},
"r": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
44,
45,
0
]
}
]
},
"startX": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
9,
10,
0
]
}
]
},
"startY": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
20,
21,
0
]
}
]
}
}, },
"snapshots": [], "surface": null
"parent": null },
} "__meta": [
], {
"currentEnv": [ "sourceRange": [
0, 246,
0 251,
], 0
"callStack": [] ]
}
]
},
"arc2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
258,
344,
0
]
},
"ccw": true,
"center": [
-1.3928468563243768,
-0.13071007276269808
],
"from": [
-1.8460007498427018,
0.08059905810765156
],
"tag": {
"end": 343,
"start": 338,
"type": "TagDeclarator",
"value": "arc2"
},
"to": [
-1.2218367846615423,
-0.6005563831556522
],
"type": "TangentialArc"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
338,
343,
0
]
}
]
},
"arc3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
350,
437,
0
]
},
"ccw": false,
"center": [
-1.050826712998708,
-1.0704026935486064
],
"from": [
-1.2218367846615423,
-0.6005563831556522
],
"tag": {
"end": 436,
"start": 431,
"type": "TagDeclarator",
"value": "arc3"
},
"to": [
-0.5976728194803829,
-1.281711824418956
],
"type": "TangentialArc"
},
"surface": null
},
"__meta": [
{
"sourceRange": [
431,
436,
0
]
}
]
},
"r": {
"type": "Number",
"value": 1.0,
"__meta": [
{
"sourceRange": [
44,
45,
0
]
}
]
},
"startX": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
9,
10,
0
]
}
]
},
"startY": {
"type": "Number",
"value": 0.0,
"__meta": [
{
"sourceRange": [
20,
21,
0
]
}
]
}
} }

View File

@ -1,232 +1,218 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing tangential_arc.kcl description: Variables in memory after executing tangential_arc.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"boxSketch": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
39,
58,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 90.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
64,
109,
0
],
"tag": null,
"type": "extrudeArc"
}, },
"THREE_QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 270.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
}, 115,
"ZERO": { 135,
"type": "Number", 0
"value": 0.0, ],
"__meta": [] "tag": null,
}, "type": "extrudePlane"
"boxSketch": { }
"type": "Solid", ],
"value": { "sketch": {
"type": "Solid", "type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "paths": [
"value": [ {
{ "__geoMeta": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
39,
58,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
64,
109,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
115,
135,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 39,
"__geoMeta": { 58,
"id": "[uuid]", 0
"sourceRange": [
39,
58,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
64,
109,
0
]
},
"ccw": true,
"center": [
-5.0,
10.0
],
"from": [
0.0,
10.0
],
"tag": null,
"to": [
-5.0,
15.0
],
"type": "TangentialArc"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
115,
135,
0
]
},
"from": [
-5.0,
15.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
12,
33,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
12,
33,
0
]
}
] ]
}, },
"height": 10.0, "from": [
"startCapId": "[uuid]", 0.0,
"endCapId": "[uuid]", 0.0
"units": { ],
"type": "Mm" "tag": null,
"to": [
0.0,
10.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
64,
109,
0
]
}, },
"__meta": [ "ccw": true,
{ "center": [
"sourceRange": [ -5.0,
12, 10.0
33, ],
0 "from": [
] 0.0,
} 10.0
],
"tag": null,
"to": [
-5.0,
15.0
],
"type": "TangentialArc"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
115,
135,
0
]
},
"from": [
-5.0,
15.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
12,
33,
0
] ]
} }
} },
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
12,
33,
0
]
}
]
}, },
"snapshots": [], "height": 10.0,
"parent": null "startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
12,
33,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -1,227 +1,213 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Program memory after executing xz_plane.kcl description: Variables in memory after executing xz_plane.kcl
snapshot_kind: text
--- ---
{ {
"environments": [ "HALF_TURN": {
{ "type": "Number",
"bindings": { "value": 180.0,
"HALF_TURN": { "__meta": []
"type": "Number", },
"value": 180.0, "QUARTER_TURN": {
"__meta": [] "type": "Number",
"value": 90.0,
"__meta": []
},
"THREE_QUARTER_TURN": {
"type": "Number",
"value": 270.0,
"__meta": []
},
"ZERO": {
"type": "Number",
"value": 0.0,
"__meta": []
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
96,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 90.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
102,
130,
0
],
"tag": null,
"type": "extrudePlane"
}, },
"THREE_QUARTER_TURN": { {
"type": "Number", "faceId": "[uuid]",
"value": 270.0, "id": "[uuid]",
"__meta": [] "sourceRange": [
}, 136,
"ZERO": { 144,
"type": "Number", 0
"value": 0.0, ],
"__meta": [] "tag": null,
}, "type": "extrudePlane"
"part001": { }
"type": "Solid", ],
"value": { "sketch": {
"type": "Solid", "type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"artifactId": "[uuid]", "paths": [
"value": [ {
{ "__geoMeta": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
96,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
102,
130,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
136,
144,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]", "id": "[uuid]",
"paths": [ "sourceRange": [
{ 66,
"__geoMeta": { 96,
"id": "[uuid]", 0
"sourceRange": [
66,
96,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
100.0,
100.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
102,
130,
0
]
},
"from": [
100.0,
100.0
],
"tag": null,
"to": [
100.0,
0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
136,
144,
0
]
},
"from": [
100.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
60,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
] ]
}, },
"height": 12.0, "from": [
"startCapId": "[uuid]", 0.0,
"endCapId": "[uuid]", 0.0
"units": { ],
"type": "Mm" "tag": null,
"to": [
100.0,
100.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
102,
130,
0
]
}, },
"__meta": [ "from": [
{ 100.0,
"sourceRange": [ 100.0
35, ],
60, "tag": null,
0 "to": [
] 100.0,
} 0.0
],
"type": "ToPoint"
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
136,
144,
0
]
},
"from": [
100.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint"
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XZ",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
35,
60,
0
] ]
} }
} },
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
]
}, },
"snapshots": [], "height": 12.0,
"parent": null "startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
35,
60,
0
]
}
]
} }
], }
"currentEnv": [
0,
0
],
"callStack": []
} }

View File

@ -421,18 +421,6 @@ pub fn get_tangential_arc_to_info(
} }
} }
/// Create the default program memory.
#[wasm_bindgen]
pub fn program_memory_init() -> Result<JsValue, String> {
console_error_panic_hook::set_once();
let memory = kcl_lib::exec::ProgramMemory::new();
// The serde-wasm-bindgen does not work here because of weird HashMap issues so we use the
// gloo-serialize crate instead.
JsValue::from_serde(&memory).map_err(|e| e.to_string())
}
/// Get a coredump. /// Get a coredump.
#[wasm_bindgen] #[wasm_bindgen]
pub async fn coredump(core_dump_manager: kcl_lib::wasm_engine::CoreDumpManager) -> Result<JsValue, String> { pub async fn coredump(core_dump_manager: kcl_lib::wasm_engine::CoreDumpManager) -> Result<JsValue, String> {

View File

@ -12,11 +12,11 @@ async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, Modu
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default()).await?; let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default()).await?;
let mut exec_state = ExecState::new(&ctx.settings); let mut exec_state = ExecState::new(&ctx.settings);
ctx.run(&program, &mut exec_state).await?; ctx.run(&program, &mut exec_state).await?;
let outcome = exec_state.to_wasm_outcome();
// We need to get the sketch ID. // We need to get the sketch ID.
// Get the sketch ID from memory. let KclValue::Sketch { value: sketch } = outcome.variables.get(name).unwrap() else {
let KclValue::Sketch { value: sketch } = exec_state.memory().get(name, SourceRange::default()).unwrap() else { anyhow::bail!("part001 not found in: {:?}", outcome.variables);
anyhow::bail!("part001 not found in memory: {:?}", exec_state.memory());
}; };
let sketch_id = sketch.id; let sketch_id = sketch.id;