Compare commits

...

4 Commits

Author SHA1 Message Date
75a975b1e1 Replace snapshot mechanism with epochs (#5764)
* Make tag identifiers monotonic

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

* Use epochs rather than snapshots in memory

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-17 12:28:51 +13:00
3f02bb2065 deterministic id generator per module (#5811)
* deterministic id generator per module

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* non

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* do not remake the planes if they are alreaady made;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* do not remake the planes if they are alreaady made;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-15 17:08:39 +00:00
9c986d3aa8 Fix window creation failures on Mac (most noteable in CI) (#5809)
Allow window to be larger than screen on mac as well, fixing tests
2025-03-14 21:29:00 +00:00
4741d9592b Add edit flow for Shell thickness (#5525)
* WIP: Add edit flow for Shell thickness
Would fix #5406 but not like this :sad:

* Early win with working edit on shell

* Extend to logic to walls with tags

* Remove skip

* Add wall test

* Fixing inconsistencies in code. Tests not working on win

* Refactor addShell for consitency

* Clean up

* More clean up

* Add validation on both params

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Passing tests

* Prettier

* Change from test.skip to comment

* Clean up for review

* Add review suggestions and disable thickness validator

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Remove uneccessary changes

* Add edit flow for Shell thickness
Fixes #5406

* Enable edit step in test that works only if the start code is properly formatted

* Clean up for review

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-14 16:05:41 -04:00
140 changed files with 10131 additions and 88239 deletions

File diff suppressed because it is too large Load Diff

View File

@ -122,7 +122,6 @@ Any KCL value.
|----------|------|-------------|----------|
| `type` |enum: [`TagIdentifier`](/docs/kcl/types#tag-identifier)| | No |
| `value` |[`string`](/docs/kcl/types/string)| | No |
| `info` |[`TagEngineInfo`](/docs/kcl/types/TagEngineInfo)| | No |
----
@ -338,22 +337,6 @@ Data for an imported geometry.
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Tombstone`| | No |
| `value` |`null`| | No |
----

View File

@ -1024,7 +1024,7 @@ openSketch = startSketchOn('XY')
await page.waitForTimeout(15000)
await test.step(`Look for the blue of the XZ plane`, async () => {
await scene.expectPixelColor([50, 51, 96], testPoint, 15)
//await scene.expectPixelColor([50, 51, 96], testPoint, 15) // FIXME
})
await test.step(`Go through the command bar flow`, async () => {
await toolbar.offsetPlaneButton.click()
@ -1066,7 +1066,7 @@ openSketch = startSketchOn('XY')
)
await operationButton.click({ button: 'left' })
await page.keyboard.press('Delete')
await scene.expectPixelColor([50, 51, 96], testPoint, 15)
//await scene.expectPixelColor([50, 51, 96], testPoint, 15) // FIXME
})
})
@ -2271,8 +2271,8 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
cmdBar,
}) => {
const initialCode = `sketch001 = startSketchOn('XZ')
|> circle(center = [0, 0], radius = 30)
extrude001 = extrude(sketch001, length = 30)
|> circle(center = [0, 0], radius = 30)
extrude001 = extrude(sketch001, length = 30)
`
await context.addInitScript((initialCode) => {
localStorage.setItem('persistCode', initialCode)
@ -2286,6 +2286,8 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
const shellDeclaration =
"shell001 = shell(extrude001, faces = ['end'], thickness = 5)"
const editedShellDeclaration =
"shell001 = shell(extrude001, faces = ['end'], thickness = 2)"
await test.step(`Look for the grey of the shape`, async () => {
await scene.expectPixelColor([127, 127, 127], testPoint, 15)
@ -2352,6 +2354,45 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
})
await scene.expectPixelColor([146, 146, 146], testPoint, 15)
})
await test.step('Edit shell via feature tree selection works', async () => {
await toolbar.closePane('code')
await toolbar.openPane('feature-tree')
const operationButton = await toolbar.getFeatureTreeOperation(
'Shell',
0
)
await operationButton.dblclick()
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'thickness',
currentArgValue: '5',
headerArguments: {
Thickness: '5',
},
highlightedHeaderArg: 'thickness',
commandName: 'Shell',
})
await page.keyboard.insertText('2')
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
Thickness: '2',
},
commandName: 'Shell',
})
await cmdBar.progressCmdBar()
await toolbar.closePane('feature-tree')
await scene.expectPixelColor([150, 150, 150], testPoint, 15)
await toolbar.openPane('code')
await editor.expectEditor.toContain(editedShellDeclaration)
await editor.expectState({
diagnostics: [],
activeLines: [editedShellDeclaration],
highlightedCode: '',
})
})
})
})
@ -2387,6 +2428,8 @@ extrude001 = extrude(sketch001, length = 40)
const mutatedCode = 'xLine(length = -40, tag = $seg01)'
const shellDeclaration =
"shell001 = shell(extrude001, faces = ['end', seg01], thickness = 5)"
const editedShellDeclaration =
"shell001 = shell(extrude001, faces = ['end', seg01], thickness = 1)"
await test.step(`Look for the grey of the shape`, async () => {
await scene.expectPixelColor([99, 99, 99], testPoint, 15)
@ -2435,6 +2478,41 @@ extrude001 = extrude(sketch001, length = 40)
await scene.expectPixelColor([49, 49, 49], testPoint, 15)
})
await test.step('Edit shell via feature tree selection works', async () => {
await editor.closePane()
const operationButton = await toolbar.getFeatureTreeOperation('Shell', 0)
await operationButton.dblclick({ button: 'left' })
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'thickness',
currentArgValue: '5',
headerArguments: {
Thickness: '5',
},
highlightedHeaderArg: 'thickness',
commandName: 'Shell',
})
await page.keyboard.insertText('1')
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
Thickness: '1',
},
commandName: 'Shell',
})
await cmdBar.progressCmdBar()
await toolbar.closePane('feature-tree')
await scene.expectPixelColor([150, 150, 150], testPoint, 15)
await toolbar.openPane('code')
await editor.expectEditor.toContain(editedShellDeclaration)
await editor.expectState({
diagnostics: [],
activeLines: [editedShellDeclaration],
highlightedCode: '',
})
})
await test.step('Delete shell via feature tree selection', async () => {
await editor.closePane()
const operationButton = await toolbar.getFeatureTreeOperation('Shell', 0)
@ -2529,7 +2607,7 @@ extrude002 = extrude(sketch002, length = 50)
highlightedCode: '',
})
await toolbar.closePane('code')
await scene.expectPixelColor([73, 73, 73], testPoint, 15)
await scene.expectPixelColor([80, 80, 80], testPoint, 15)
})
})
})

View File

@ -1174,7 +1174,7 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
|> line(endAbsolute = [
railWideWidth / 2,
railClampable / 2 + railBaseLength
], $seg01)
], tag = $seg01)
|> line(endAbsolute = [railTop / 2, railBaseLength])
|> line(endAbsolute = [railBaseWidth / 2, railBaseLength])
|> line(endAbsolute = [railBaseWidth / 2, 0])

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

File diff suppressed because one or more lines are too long

7
rust/Cargo.lock generated
View File

@ -3463,6 +3463,12 @@ dependencies = [
"digest",
]
[[package]]
name = "sha1_smol"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d"
[[package]]
name = "sha2"
version = "0.10.8"
@ -4378,6 +4384,7 @@ dependencies = [
"getrandom 0.3.1",
"js-sys",
"serde",
"sha1_smol",
"wasm-bindgen",
]

View File

@ -802,7 +802,7 @@ fn generate_code_block_test(fn_name: &str, code_block: &str, index: usize) -> pr
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx.run(&program, &mut crate::execution::ExecState::new(&ctx.settings)).await {
if let Err(e) = ctx.run(&program, &mut crate::execution::ExecState::new(&ctx)).await {
return Err(miette::Report::new(crate::errors::Report {
error: e.error,
filename: format!("{}{}", #fn_name, #index),

View File

@ -15,10 +15,7 @@ mod test_examples_someFn {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -15,10 +15,7 @@ mod test_examples_someFn {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -17,10 +17,7 @@ mod test_examples_my_func {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -17,10 +17,7 @@ mod test_examples_line_to {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_min {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_import {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_import {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_import {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -16,10 +16,7 @@ mod test_examples_show {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -15,10 +15,7 @@ mod test_examples_some_function {
context_type: crate::execution::ContextType::Mock,
};
if let Err(e) = ctx
.run(
&program,
&mut crate::execution::ExecState::new(&ctx.settings),
)
.run(&program, &mut crate::execution::ExecState::new(&ctx))
.await
{
return Err(miette::Report::new(crate::errors::Report {

View File

@ -80,7 +80,7 @@ ts-rs = { version = "10.1.0", features = [
] }
tynm = "0.1.10"
url = { version = "2.5.4", features = ["serde"] }
uuid = { workspace = true, features = ["v4", "js", "serde"] }
uuid = { workspace = true, features = ["v4", "v5", "js", "serde"] }
validator = { version = "0.20.0", features = ["derive"] }
web-time = "1.1"
winnow = "=0.6.24"

View File

@ -77,7 +77,7 @@ fn run_benchmarks(c: &mut Criterion) {
b.iter(|| {
if let Err(err) = rt.block_on(async {
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default()).await?;
let mut exec_state = kcl_lib::ExecState::new(&ctx.settings);
let mut exec_state = kcl_lib::ExecState::new(&ctx);
ctx.run(black_box(&program), &mut exec_state).await?;
ctx.close().await;
Ok::<(), anyhow::Error>(())

View File

@ -2053,7 +2053,7 @@ sketch000 = startSketchOn('XY')
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default())
.await
.unwrap();
let mut exec_state = kcl_lib::ExecState::new(&ctx.settings);
let mut exec_state = kcl_lib::ExecState::new(&ctx);
let program = kcl_lib::Program::parse_no_errs(code).unwrap();
ctx.run(&program, &mut exec_state).await.unwrap();
@ -2078,7 +2078,7 @@ async fn kcl_test_ensure_nothing_left_in_batch_multi_file() {
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default())
.await
.unwrap();
let mut exec_state = kcl_lib::ExecState::new(&ctx.settings);
let mut exec_state = kcl_lib::ExecState::new(&ctx);
let program = kcl_lib::Program::parse_no_errs(&code).unwrap();
ctx.run(&program, &mut exec_state).await.unwrap();

View File

@ -10,9 +10,9 @@ use pretty_assertions::assert_eq;
async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, ModuleId, uuid::Uuid)> {
let program = Program::parse_no_errs(code)?;
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);
let result = ctx.run(&program, &mut exec_state).await?;
let outcome = exec_state.to_wasm_outcome(result.0);
let outcome = exec_state.to_wasm_outcome(result.0).await;
// We need to get the sketch ID.
let KclValue::Sketch { value: sketch } = outcome.variables.get(name).unwrap() else {

View File

@ -1153,7 +1153,7 @@ fn find_examples(text: &str, filename: &str) -> Vec<(String, String)> {
async fn run_example(text: &str) -> Result<()> {
let program = crate::Program::parse_no_errs(text)?;
let ctx = ExecutorContext::new_with_default_client(crate::UnitLength::Mm).await?;
let mut exec_state = crate::execution::ExecState::new(&ctx.settings);
let mut exec_state = crate::execution::ExecState::new(&ctx);
ctx.run(&program, &mut exec_state).await?;
Ok(())
}

View File

@ -378,22 +378,8 @@ impl EngineManager for EngineConnection {
original
}
async fn default_planes(
&self,
id_generator: &mut IdGenerator,
source_range: SourceRange,
) -> Result<DefaultPlanes, KclError> {
{
let opt = self.default_planes.read().await.as_ref().cloned();
if let Some(planes) = opt {
return Ok(planes);
}
} // drop the read lock
let new_planes = self.new_default_planes(id_generator, source_range).await?;
*self.default_planes.write().await = Some(new_planes.clone());
Ok(new_planes)
fn get_default_planes(&self) -> Arc<RwLock<Option<DefaultPlanes>>> {
self.default_planes.clone()
}
async fn clear_scene_post_hook(

View File

@ -30,6 +30,8 @@ pub struct EngineConnection {
batch_end: Arc<RwLock<IndexMap<uuid::Uuid, (WebSocketRequest, SourceRange)>>>,
artifact_commands: Arc<RwLock<Vec<ArtifactCommand>>>,
execution_kind: Arc<RwLock<ExecutionKind>>,
/// The default planes for the scene.
default_planes: Arc<RwLock<Option<DefaultPlanes>>>,
}
impl EngineConnection {
@ -39,6 +41,7 @@ impl EngineConnection {
batch_end: Arc::new(RwLock::new(IndexMap::new())),
artifact_commands: Arc::new(RwLock::new(Vec::new())),
execution_kind: Default::default(),
default_planes: Default::default(),
})
}
}
@ -73,12 +76,8 @@ impl crate::engine::EngineManager for EngineConnection {
original
}
async fn default_planes(
&self,
_id_generator: &mut IdGenerator,
_source_range: SourceRange,
) -> Result<DefaultPlanes, KclError> {
Ok(DefaultPlanes::default())
fn get_default_planes(&self) -> Arc<RwLock<Option<DefaultPlanes>>> {
self.default_planes.clone()
}
async fn clear_scene_post_hook(

View File

@ -31,12 +31,6 @@ extern "C" {
idToRangeStr: String,
) -> Result<js_sys::Promise, js_sys::Error>;
#[wasm_bindgen(method, js_name = wasmGetDefaultPlanes, catch)]
fn get_default_planes(this: &EngineCommandManager) -> Result<js_sys::Promise, js_sys::Error>;
#[wasm_bindgen(method, js_name = clearDefaultPlanes, catch)]
fn clear_default_planes(this: &EngineCommandManager) -> Result<(), js_sys::Error>;
#[wasm_bindgen(method, js_name = startNewSession, catch)]
fn start_new_session(this: &EngineCommandManager) -> Result<js_sys::Promise, js_sys::Error>;
}
@ -49,6 +43,8 @@ pub struct EngineConnection {
responses: Arc<RwLock<IndexMap<Uuid, WebSocketResponse>>>,
artifact_commands: Arc<RwLock<Vec<ArtifactCommand>>>,
execution_kind: Arc<RwLock<ExecutionKind>>,
/// The default planes for the scene.
default_planes: Arc<RwLock<Option<DefaultPlanes>>>,
}
// Safety: WebAssembly will only ever run in a single-threaded context.
@ -65,6 +61,7 @@ impl EngineConnection {
responses: Arc::new(RwLock::new(IndexMap::new())),
artifact_commands: Arc::new(RwLock::new(Vec::new())),
execution_kind: Default::default(),
default_planes: Default::default(),
})
}
@ -160,59 +157,18 @@ impl crate::engine::EngineManager for EngineConnection {
original
}
async fn default_planes(
&self,
_id_generator: &mut IdGenerator,
source_range: SourceRange,
) -> Result<DefaultPlanes, KclError> {
// Get the default planes.
let promise = self.manager.get_default_planes().map_err(|e| {
KclError::Engine(KclErrorDetails {
message: e.to_string().into(),
source_ranges: vec![source_range],
})
})?;
let value = crate::wasm::JsFuture::from(promise).await.map_err(|e| {
KclError::Engine(KclErrorDetails {
message: format!("Failed to wait for promise from get default planes: {:?}", e),
source_ranges: vec![source_range],
})
})?;
// Parse the value as a string.
let s = value.as_string().ok_or_else(|| {
KclError::Engine(KclErrorDetails {
message: format!(
"Failed to get string from response from get default planes: `{:?}`",
value
),
source_ranges: vec![source_range],
})
})?;
// Deserialize the response.
let default_planes: DefaultPlanes = serde_json::from_str(&s).map_err(|e| {
KclError::Engine(KclErrorDetails {
message: format!("Failed to deserialize default planes: {:?}", e),
source_ranges: vec![source_range],
})
})?;
Ok(default_planes)
fn get_default_planes(&self) -> Arc<RwLock<Option<DefaultPlanes>>> {
self.default_planes.clone()
}
async fn clear_scene_post_hook(
&self,
_id_generator: &mut IdGenerator,
id_generator: &mut IdGenerator,
source_range: SourceRange,
) -> Result<(), KclError> {
self.manager.clear_default_planes().map_err(|e| {
KclError::Engine(KclErrorDetails {
message: e.to_string().into(),
source_ranges: vec![source_range],
})
})?;
// Remake the default planes, since they would have been removed after the scene was cleared.
let new_planes = self.new_default_planes(id_generator, source_range).await?;
*self.default_planes.write().await = Some(new_planes);
// Start a new session.
let promise = self.manager.start_new_session().map_err(|e| {

View File

@ -95,11 +95,26 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
async fn replace_execution_kind(&self, execution_kind: ExecutionKind) -> ExecutionKind;
/// Get the default planes.
fn get_default_planes(&self) -> Arc<RwLock<Option<DefaultPlanes>>>;
/// Get the default planes, creating them if they don't exist.
async fn default_planes(
&self,
id_generator: &mut IdGenerator,
_source_range: SourceRange,
) -> Result<DefaultPlanes, crate::errors::KclError>;
source_range: SourceRange,
) -> Result<DefaultPlanes, KclError> {
{
let opt = self.get_default_planes().read().await.as_ref().cloned();
if let Some(planes) = opt {
return Ok(planes);
}
} // drop the read lock
let new_planes = self.new_default_planes(id_generator, source_range).await?;
*self.get_default_planes().write().await = Some(new_planes.clone());
Ok(new_planes)
}
/// Helpers to be called after clearing a scene.
/// (These really only apply to wasm for now).

View File

@ -4,7 +4,7 @@ use thiserror::Error;
use tower_lsp::lsp_types::{Diagnostic, DiagnosticSeverity};
use crate::{
execution::{ArtifactCommand, ArtifactGraph, Operation},
execution::{ArtifactCommand, ArtifactGraph, DefaultPlanes, Operation},
lsp::IntoDiagnostic,
modules::{ModulePath, ModuleSource},
source_range::SourceRange,
@ -131,6 +131,7 @@ pub struct KclErrorWithOutputs {
pub artifact_graph: ArtifactGraph,
pub filenames: IndexMap<ModuleId, ModulePath>,
pub source_files: IndexMap<ModuleId, ModuleSource>,
pub default_planes: Option<DefaultPlanes>,
}
impl KclErrorWithOutputs {
@ -141,6 +142,7 @@ impl KclErrorWithOutputs {
artifact_graph: ArtifactGraph,
filenames: IndexMap<ModuleId, ModulePath>,
source_files: IndexMap<ModuleId, ModuleSource>,
default_planes: Option<DefaultPlanes>,
) -> Self {
Self {
error,
@ -149,6 +151,7 @@ impl KclErrorWithOutputs {
artifact_graph,
filenames,
source_files,
default_planes,
}
}
pub fn no_outputs(error: KclError) -> Self {
@ -159,6 +162,7 @@ impl KclErrorWithOutputs {
artifact_graph: Default::default(),
filenames: Default::default(),
source_files: Default::default(),
default_planes: Default::default(),
}
}
pub fn into_miette_report_with_outputs(self, code: &str) -> anyhow::Result<ReportWithOutputs> {

View File

@ -244,7 +244,7 @@ impl From<&KclValue> for OpKclValue {
}
KclValue::TagIdentifier(tag_identifier) => Self::TagIdentifier {
value: tag_identifier.value.clone(),
artifact_id: tag_identifier.info.as_ref().map(|info| ArtifactId::new(info.id)),
artifact_id: tag_identifier.get_cur_info().map(|info| ArtifactId::new(info.id)),
},
KclValue::TagDeclarator(node) => Self::TagDeclarator {
name: node.name.clone(),
@ -295,7 +295,6 @@ impl From<&KclValue> for OpKclValue {
KclValue::Module { .. } => Self::Module {},
KclValue::KclNone { .. } => Self::KclNone {},
KclValue::Type { .. } => Self::Type {},
KclValue::Tombstone { .. } => unreachable!("Tombstone OpKclValue"),
}
}
}

View File

@ -94,6 +94,7 @@ impl ExecutorContext {
exec_state: &mut ExecState,
exec_kind: ExecutionKind,
preserve_mem: bool,
module_id: ModuleId,
path: &ModulePath,
) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>), KclError> {
crate::log::log(format!("enter module {path} {}", exec_state.stack()));
@ -101,7 +102,12 @@ impl ExecutorContext {
let old_units = exec_state.length_unit();
let original_execution = self.engine.replace_execution_kind(exec_kind).await;
let mut local_state = ModuleState::new(&self.settings, path.std_path(), exec_state.stack().memory.clone());
let mut local_state = ModuleState::new(
&self.settings,
path.std_path(),
exec_state.stack().memory.clone(),
Some(module_id),
);
if !preserve_mem {
std::mem::swap(&mut exec_state.mod_local, &mut local_state);
}
@ -452,7 +458,7 @@ impl ExecutorContext {
ModuleRepr::Root => Err(exec_state.circular_import_error(&path, source_range)),
ModuleRepr::Kcl(_, Some((env_ref, items))) => Ok((*env_ref, items.clone())),
ModuleRepr::Kcl(program, cache) => self
.exec_module_from_ast(program, &path, exec_state, exec_kind, source_range)
.exec_module_from_ast(program, module_id, &path, exec_state, exec_kind, source_range)
.await
.map(|(_, er, items)| {
*cache = Some((er, items.clone()));
@ -483,7 +489,7 @@ impl ExecutorContext {
let result = match &repr {
ModuleRepr::Root => Err(exec_state.circular_import_error(&path, source_range)),
ModuleRepr::Kcl(program, _) => self
.exec_module_from_ast(program, &path, exec_state, exec_kind, source_range)
.exec_module_from_ast(program, module_id, &path, exec_state, exec_kind, source_range)
.await
.map(|(val, _, _)| val),
ModuleRepr::Foreign(geom) => super::import::send_to_engine(geom.clone(), self)
@ -499,13 +505,16 @@ impl ExecutorContext {
async fn exec_module_from_ast(
&self,
program: &Node<Program>,
module_id: ModuleId,
path: &ModulePath,
exec_state: &mut ExecState,
exec_kind: ExecutionKind,
source_range: SourceRange,
) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>), KclError> {
exec_state.global.mod_loader.enter_module(path);
let result = self.exec_module_body(program, exec_state, exec_kind, false, path).await;
let result = self
.exec_module_body(program, exec_state, exec_kind, false, module_id, path)
.await;
exec_state.global.mod_loader.leave_module(path);
result.map_err(|err| {
@ -699,7 +708,7 @@ fn coerce(value: KclValue, ty: &Node<Type>, exec_state: &mut ExecState) -> Resul
meta: meta.clone(),
})?;
let id = exec_state.global.id_generator.next_uuid();
let id = exec_state.next_uuid();
let plane = Plane {
id,
artifact_id: id.into(),
@ -745,33 +754,7 @@ impl BinaryPart {
}
impl Node<MemberExpression> {
pub fn get_result_array(&self, exec_state: &mut ExecState, index: usize) -> Result<KclValue, KclError> {
let array = match &self.object {
MemberObject::MemberExpression(member_expr) => member_expr.get_result(exec_state)?,
MemberObject::Identifier(identifier) => {
let value = exec_state.stack().get(&identifier.name, identifier.into())?;
value.clone()
}
};
let KclValue::MixedArray { value: array, meta: _ } = array else {
return Err(KclError::Semantic(KclErrorDetails {
message: format!("MemberExpression array is not an array: {:?}", array),
source_ranges: vec![self.clone().into()],
}));
};
if let Some(value) = array.get(index) {
Ok(value.to_owned())
} else {
Err(KclError::UndefinedValue(KclErrorDetails {
message: format!("index {} not found in array", index),
source_ranges: vec![self.clone().into()],
}))
}
}
pub fn get_result(&self, exec_state: &mut ExecState) -> Result<KclValue, KclError> {
fn get_result(&self, exec_state: &mut ExecState) -> Result<KclValue, KclError> {
let property = Property::try_from(self.computed, self.property.clone(), exec_state, self.into())?;
let object = match &self.object {
// TODO: Don't use recursion here, use a loop.
@ -1372,11 +1355,22 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
// TODO: This could probably be done in a better way, but as of now this was my only idea
// and it works.
match result {
KclValue::Sketch { value: ref mut sketch } => {
for (_, tag) in sketch.tags.iter() {
exec_state
.mut_stack()
.insert_or_update(tag.value.clone(), KclValue::TagIdentifier(Box::new(tag.clone())));
KclValue::Sketch { value } => {
for (name, tag) in value.tags.iter() {
if exec_state.stack().cur_frame_contains(name) {
exec_state.mut_stack().update(name, |v, _| {
v.as_mut_tag().unwrap().merge_info(tag);
});
} else {
exec_state
.mut_stack()
.add(
name.to_owned(),
KclValue::TagIdentifier(Box::new(tag.clone())),
SourceRange::default(),
)
.unwrap();
}
}
}
KclValue::Solid { ref mut value } => {
@ -1385,7 +1379,7 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
// Get the past tag and update it.
let tag_id = if let Some(t) = value.sketch.tags.get(&tag.name) {
let mut t = t.clone();
let Some(ref info) = t.info else {
let Some(info) = t.get_cur_info() else {
return Err(KclError::Internal(KclErrorDetails {
message: format!("Tag {} does not have path info", tag.name),
source_ranges: vec![tag.into()],
@ -1395,59 +1389,65 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
let mut info = info.clone();
info.surface = Some(v.clone());
info.sketch = value.id;
t.info = Some(info);
t.info.push((exec_state.stack().current_epoch(), info));
t
} else {
// It's probably a fillet or a chamfer.
// Initialize it.
TagIdentifier {
value: tag.name.clone(),
info: Some(TagEngineInfo {
id: v.get_id(),
surface: Some(v.clone()),
path: None,
sketch: value.id,
}),
info: vec![(
exec_state.stack().current_epoch(),
TagEngineInfo {
id: v.get_id(),
surface: Some(v.clone()),
path: None,
sketch: value.id,
},
)],
meta: vec![Metadata {
source_range: tag.clone().into(),
}],
}
};
exec_state
.mut_stack()
.insert_or_update(tag.name.clone(), KclValue::TagIdentifier(Box::new(tag_id.clone())));
// update the sketch tags.
value.sketch.tags.insert(tag.name.clone(), tag_id);
value.sketch.merge_tags(Some(&tag_id).into_iter());
if exec_state.stack().cur_frame_contains(&tag.name) {
exec_state.mut_stack().update(&tag.name, |v, _| {
v.as_mut_tag().unwrap().merge_info(&tag_id);
});
} else {
exec_state
.mut_stack()
.add(
tag.name.clone(),
KclValue::TagIdentifier(Box::new(tag_id)),
SourceRange::default(),
)
.unwrap();
}
}
}
// Find the stale sketch in memory and update it.
if !value.sketch.tags.is_empty() {
let updates: Vec<_> = exec_state
let sketches_to_update: Vec<_> = exec_state
.stack()
.find_all_in_current_env(|v| match v {
.find_keys_in_current_env(|v| match v {
KclValue::Sketch { value: sk } => sk.artifact_id == value.sketch.artifact_id,
_ => false,
})
.map(|(k, v)| {
let mut sketch = v.as_sketch().unwrap().clone();
for (tag_name, tag_id) in value.sketch.tags.iter() {
sketch.tags.insert(tag_name.clone(), tag_id.clone());
}
(
k.clone(),
KclValue::Sketch {
value: Box::new(sketch),
},
)
})
.cloned()
.collect();
updates
.into_iter()
.for_each(|(k, v)| exec_state.mut_stack().insert_or_update(k, v))
for k in sketches_to_update {
exec_state.mut_stack().update(&k, |v, _| {
let sketch = v.as_mut_sketch().unwrap();
sketch.merge_tags(value.sketch.tags.values());
});
}
}
}
_ => {}
@ -1459,7 +1459,7 @@ impl Node<TagDeclarator> {
pub async fn execute(&self, exec_state: &mut ExecState) -> Result<KclValue, KclError> {
let memory_item = KclValue::TagIdentifier(Box::new(TagIdentifier {
value: self.name.clone(),
info: None,
info: Vec::new(),
meta: vec![Metadata {
source_range: self.into(),
}],
@ -1966,14 +1966,16 @@ impl FunctionSource {
#[cfg(test)]
mod test {
use std::sync::Arc;
use super::*;
use crate::{
execution::{memory::Stack, parse_execute},
execution::{memory::Stack, parse_execute, ContextType},
parsing::ast::types::{DefaultParamVal, Identifier, Parameter},
};
#[test]
fn test_assign_args_to_params() {
#[tokio::test(flavor = "multi_thread")]
async fn test_assign_args_to_params() {
// Set up a little framework for this test.
fn mem(number: usize) -> KclValue {
KclValue::Number {
@ -2084,7 +2086,16 @@ mod test {
digest: None,
});
let args = args.into_iter().map(Arg::synthetic).collect();
let mut exec_state = ExecState::new(&Default::default());
let exec_ctxt = ExecutorContext {
engine: Arc::new(Box::new(
crate::engine::conn_mock::EngineConnection::new().await.unwrap(),
)),
fs: Arc::new(crate::fs::FileManager::new()),
stdlib: Arc::new(crate::std::StdLib::new()),
settings: Default::default(),
context_type: ContextType::Mock,
};
let mut exec_state = ExecState::new(&exec_ctxt);
exec_state.mod_local.stack = Stack::new_for_tests();
let actual = assign_args_to_params(func_expr, args, &mut exec_state).map(|_| exec_state.mod_local.stack);
assert_eq!(

View File

@ -370,7 +370,7 @@ impl Plane {
}
pub(crate) fn from_plane_data(value: PlaneData, exec_state: &mut ExecState) -> Self {
let id = exec_state.global.id_generator.next_uuid();
let id = exec_state.next_uuid();
match value {
PlaneData::XY => Plane {
id,
@ -443,17 +443,20 @@ impl Plane {
x_axis,
y_axis,
z_axis,
} => Plane {
id,
artifact_id: id.into(),
origin,
x_axis,
y_axis,
z_axis,
value: PlaneType::Custom,
units: exec_state.length_unit(),
meta: vec![],
},
} => {
let id = exec_state.next_uuid();
Plane {
id,
artifact_id: id.into(),
origin,
x_axis,
y_axis,
z_axis,
value: PlaneType::Custom,
units: exec_state.length_unit(),
meta: vec![],
}
}
}
}
@ -636,19 +639,35 @@ impl GetTangentialInfoFromPathsResult {
}
impl Sketch {
pub(crate) fn add_tag(&mut self, tag: NodeRef<'_, TagDeclarator>, current_path: &Path) {
pub(crate) fn add_tag(&mut self, tag: NodeRef<'_, TagDeclarator>, current_path: &Path, exec_state: &ExecState) {
let mut tag_identifier: TagIdentifier = tag.into();
let base = current_path.get_base();
tag_identifier.info = Some(TagEngineInfo {
id: base.geo_meta.id,
sketch: self.id,
path: Some(current_path.clone()),
surface: None,
});
tag_identifier.info.push((
exec_state.stack().current_epoch(),
TagEngineInfo {
id: base.geo_meta.id,
sketch: self.id,
path: Some(current_path.clone()),
surface: None,
},
));
self.tags.insert(tag.name.to_string(), tag_identifier);
}
pub(crate) fn merge_tags<'a>(&mut self, tags: impl Iterator<Item = &'a TagIdentifier>) {
for t in tags {
match self.tags.get_mut(&t.value) {
Some(id) => {
id.merge_info(t);
}
None => {
self.tags.insert(t.value.clone(), t.clone());
}
}
}
}
/// Get the path most recently sketched.
pub(crate) fn latest_path(&self) -> Option<&Path> {
self.paths.last()

View File

@ -0,0 +1,83 @@
//! A generator for ArtifactIds that can be stable across executions.
use crate::execution::ModuleId;
const NAMESPACE_KCL: uuid::Uuid = uuid::uuid!("efcd6508-4ce6-4a09-8317-e6a6994a3cd7");
/// A generator for ArtifactIds that can be stable across executions.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct IdGenerator {
module_id: Option<ModuleId>,
next_id: u64,
}
impl IdGenerator {
pub fn new(module_id: Option<ModuleId>) -> Self {
Self { module_id, next_id: 0 }
}
pub fn next_uuid(&mut self) -> uuid::Uuid {
let next_id = self.next_id;
let next = format!(
"{} {}",
self.module_id.map(|id| id.to_string()).unwrap_or("none".to_string()),
next_id
);
let next_uuid = uuid::Uuid::new_v5(&NAMESPACE_KCL, next.as_bytes());
self.next_id += 1;
next_uuid
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_id_generator() {
let mut generator = IdGenerator::new(Some(ModuleId::default()));
let uuid1 = generator.next_uuid();
let uuid2 = generator.next_uuid();
assert_ne!(uuid1, uuid2);
}
#[test]
// Test that the same generator produces the same UUIDs.
fn test_id_generator_stable() {
let mut generator = IdGenerator::new(Some(ModuleId::default()));
let uuid1 = generator.next_uuid();
let uuid2 = generator.next_uuid();
let mut generator = IdGenerator::new(Some(ModuleId::default()));
let uuid3 = generator.next_uuid();
let uuid4 = generator.next_uuid();
assert_eq!(uuid1, uuid3);
assert_eq!(uuid2, uuid4);
}
#[test]
// Generate 20 uuids and make sure all are unique.
fn test_id_generator_unique() {
let mut generator = IdGenerator::new(Some(ModuleId::default()));
let mut uuids = Vec::new();
for _ in 0..20 {
uuids.push(generator.next_uuid());
}
for i in 0..uuids.len() {
for j in i + 1..uuids.len() {
assert_ne!(uuids[i], uuids[j]);
}
}
}
}

View File

@ -111,12 +111,6 @@ pub enum KclValue {
#[serde(skip)]
meta: Vec<Metadata>,
},
// Only used for memory management. Should never be visible outside of the memory module.
Tombstone {
value: (),
#[serde(skip)]
meta: Vec<Metadata>,
},
}
#[derive(Debug, Clone, PartialEq, Default)]
@ -201,7 +195,6 @@ impl From<KclValue> for Vec<SourceRange> {
KclValue::Uuid { meta, .. } => to_vec_sr(&meta),
KclValue::Type { meta, .. } => to_vec_sr(&meta),
KclValue::KclNone { meta, .. } => to_vec_sr(&meta),
KclValue::Tombstone { .. } => unreachable!("Tombstone SourceRange"),
}
}
}
@ -233,7 +226,6 @@ impl From<&KclValue> for Vec<SourceRange> {
KclValue::Module { meta, .. } => to_vec_sr(meta),
KclValue::KclNone { meta, .. } => to_vec_sr(meta),
KclValue::Type { meta, .. } => to_vec_sr(meta),
KclValue::Tombstone { .. } => unreachable!("Tombstone &SourceRange"),
}
}
}
@ -268,7 +260,6 @@ impl KclValue {
KclValue::Module { meta, .. } => meta.clone(),
KclValue::KclNone { meta, .. } => meta.clone(),
KclValue::Type { meta, .. } => meta.clone(),
KclValue::Tombstone { .. } => unreachable!("Tombstone Metadata"),
}
}
@ -340,7 +331,6 @@ impl KclValue {
KclValue::Module { .. } => "module",
KclValue::Type { .. } => "type",
KclValue::KclNone { .. } => "None",
KclValue::Tombstone { .. } => "TOMBSTONE",
}
}
@ -367,16 +357,14 @@ impl KclValue {
}
}
pub(crate) fn map_env_ref(&self, env_map: &HashMap<EnvironmentRef, EnvironmentRef>) -> Self {
pub(crate) fn map_env_ref(&self, old_env: usize, new_env: usize) -> Self {
let mut result = self.clone();
if let KclValue::Function {
value: FunctionSource::User { ref mut memory, .. },
..
} = result
{
if let Some(new) = env_map.get(memory) {
*memory = *new;
}
memory.replace_env(old_env, new_env);
}
result
}
@ -493,7 +481,7 @@ impl KclValue {
}
}
pub fn as_sketch(&self) -> Option<&Sketch> {
pub fn as_mut_sketch(&mut self) -> Option<&mut Sketch> {
if let KclValue::Sketch { value } = self {
Some(value)
} else {
@ -501,6 +489,13 @@ impl KclValue {
}
}
pub fn as_mut_tag(&mut self) -> Option<&mut TagIdentifier> {
if let KclValue::TagIdentifier(value) = self {
Some(value)
} else {
None
}
}
pub fn as_f64(&self) -> Option<f64> {
if let KclValue::Number { value, .. } = &self {
Some(*value)
@ -563,17 +558,6 @@ impl KclValue {
}
}
/// Get an optional tag from a memory item.
pub fn get_tag_declarator_opt(&self) -> Result<Option<TagNode>, KclError> {
match self {
KclValue::TagDeclarator(t) => Ok(Some((**t).clone())),
_ => Err(KclError::Semantic(KclErrorDetails {
message: format!("Not a tag declarator: {:?}", self),
source_ranges: self.clone().into(),
})),
}
}
/// If this KCL value is a bool, retrieve it.
pub fn get_bool(&self) -> Result<bool, KclError> {
let Self::Bool { value: b, .. } = self else {
@ -626,8 +610,7 @@ impl KclValue {
| KclValue::TagDeclarator(_)
| KclValue::KclNone { .. }
| KclValue::Type { .. }
| KclValue::Uuid { .. }
| KclValue::Tombstone { .. } => None,
| KclValue::Uuid { .. } => None,
}
}
@ -741,8 +724,7 @@ impl KclValue {
| KclValue::Plane { .. }
| KclValue::Face { .. }
| KclValue::KclNone { .. }
| KclValue::Type { .. }
| KclValue::Tombstone { .. } => None,
| KclValue::Type { .. } => None,
}
}
}

View File

@ -6,18 +6,18 @@
//! one per execution. It has no explicit support for caching between executions.
//!
//! Memory is mostly immutable (since KCL does not support mutation or reassignment). However, tags
//! may change as code is executed and that mutates memory. Therefore,
//! may change as code is executed and that mutates memory. Therefore to some extent,
//! ProgramMemory supports mutability and does not rely on KCL's (mostly) immutable nature.
//!
//! ProgramMemory is observably monotonic, i.e., it only grows and even when we pop a stack frame,
//! the frame is retained unless we can prove it is unreferenced. We remove some values which we
//! know cannot be referenced, but we should in the future do better garbage collection (of values
//! and envs).
//! and envs).
//!
//! ## Concepts
//!
//! There are three main moving parts for ProgramMemory: environments, snapshots, and stacks. I'll
//! cover environments (and the call stack) first as if snapshots didn't exist, then describe snapshots.
//! There are three main moving parts for ProgramMemory: environments, epochs, and stacks. I'll
//! cover environments (and the call stack) first as if epochs didn't exist, then describe epochs.
//!
//! An environment is a set of bindings (i.e., a map from names to values). Environments handle
//! both scoping and context switching. A new lexical scope means a new environment. Nesting of scopes
@ -81,12 +81,25 @@
//! temporally) the definition of `c`. (Note that although KCL does not permit mutation, objects
//! can change due to the way tags are implemented).
//!
//! To make this work, when we save a reference to an enclosing scope we take a snapshot of memory at
//! that point and save a reference to that snapshot. When we call a function, the parent of the new
//! callee env is that snapshot, not the current version of the enclosing scope.
//! To make this work, we have the concept of an epoch. An epoch is a simple, global, monotonic counter
//! which is incremented at any significant moment in execution (we use the term snapshot). When a
//! value is saved in memory we also save the epoch at which it was stored.
//!
//! Entering an inline scope (e.g., the body of an `if` statement) means pushing an env whose parent
//! is the current env. We don't need to snapshot in this case.
//! When we save a reference to an enclosing scope we take a snapshot and save that epoch as part of
//! the reference. When we call a function, we use the epoch when it was defined to look up variables,
//! ignoring any variables which have a creation time later than the saved epoch.
//!
//! Because the callee could create new variables (with a creation time of the current epoch) which
//! the callee should be able to read, we can't simply check the epoch with the callees (and we'd need
//! to maintain a stack of callee epochs for further calls, etc.). Instead a stack frame consists of
//! a reference to an environment and an epoch at which reads should take place. When we call a function
//! this creates a new env using the current epoch, and it's parent env (which is the enclosing scope
//! of the function declaration) includes the epoch at which the function was declared.
//!
//! So far, this handles variables created after a function is declared, but does not handle mutation.
//! Mutation must be handled internally in values, see for example `TagIdentifier`. It is suggested
//! that objects rely on epochs for this. Since epochs are linked to the stack frame, only objects in
//! the current stack frame should be mutated.
//!
//! ### Std
//!
@ -107,53 +120,17 @@
//! Pushing and popping stack frames is straightforward. Most get/set/update operations don't touch
//! the call stack other than the current env (updating tags on function return is the exception).
//!
//! Snapshots are maintained within an environment and are always specific to an environment. Snapshots
//! must also have a parent reference (since they are logically a snapshot of all memory). This parent
//! refers to a snapshot within the parent env. When a snapshot is created, we must create a snapshot
//! object for each parent env. When using a snapshot we must check the parent snapshot whenever
//! we check the parent env (and not the current version of the parent env).
//!
//! An environment will have many snapshots, they are kept in time order, and do not reference each
//! other. (The parent of a snapshot is always in another env).
//!
//! A snapshot is created empty (we don't copy memory) and we use a copy-on-write design: when a
//! value in an environment is modified, we copy the old version into the most recent snapshot (note
//! that we never overwrite a value in the snapshot, if a value is modified multiple times, we want
//! to keep the original version, not an intermediate one). Likewise, if we insert a new variable,
//! we put a tombstone value in the snapshot.
//!
//! When we read from the current version of an environment, we simply read from the bindings in the
//! env and ignore the snapshots. When we read from a snapshot, we first check the specific snapshot
//! for the key, then check any newer snapshots, then finally check the env bindings.
//!
//! A minor optimisation is that when creating a snapshot, if the previous one is empty, then
//! we can reuse that rather than creating a new one. Since we only create a snapshot when a function
//! is declared and the function decl is immediately saved into the new snapshot, the empty snapshot
//! optimisation only happens with parent snapshots (though if the env tree is deep this means we
//! can save a lot of snapshots).
//!
//! ## Invariants
//!
//! There's obviously a bunch of invariants in this design, some are kinda obvious, some are limited
//! in scope and are documented inline, here are some others:
//!
//! - The current env and all envs in the call stack are 'just envs', never a snapshot (we could
//! use just a ref to an env, rather than to a snapshot but this is pretty inconvenient, so just
//! know that the snapshot ref is always to the current version). Only the parent envs or saved refs
//! can be refs to snapshots.
//! - We only ever write into the current env, never into any parent envs (though we can read from
//! both).
//! - Therefore, there is no concept of writing into a snapshot, only reading from one.
//! - The env ref saved with a function decl is always to a snapshot, never to the current version.
//! - If there are no snapshots in an environment and it is no longer in the call stack, then there
//! are no references from function decls to the env (if it is the parent of an env with extant refs
//! then there would be snapshots in the child env and that implies there must be a snapshot in the
//! parent to be the parent of that snapshot).
//! - We only ever write (or mutate) at the most recent epoch, never at an older one.
//! - The env ref saved with a function decl is always to an historic epoch, never to the current one.
//! - Since KCL does not have submodules and decls are not visible outside of a nested scope, all
//! references to variables in other modules must be in the root scope of a module.
//! - Therefore, an active env must either be on the call stack, have snapshots, or be a root env. This
//! is however a conservative approximation since snapshots may exist even if there are no live
//! references to an env.
//!
//! ## Concurrency and thread-safety
//!
@ -227,7 +204,6 @@
use std::{
cell::UnsafeCell,
collections::HashMap,
fmt,
pin::Pin,
sync::{
@ -267,6 +243,7 @@ pub(crate) struct ProgramMemory {
/// Statistics about the memory, should not be used for anything other than meta-info.
pub(crate) stats: MemoryStats,
next_stack_id: AtomicUsize,
epoch: AtomicUsize,
write_lock: AtomicBool,
}
@ -307,7 +284,7 @@ impl fmt::Display for Stack {
.call_stack
.iter()
.chain(Some(&self.current_env))
.map(|e| format!("EnvRef({}, {})", e.0, e.1 .0))
.map(|e| format!("EnvRef({}, {})", e.0, e.1))
.collect();
write!(f, "Stack {}\nstack frames:\n{}", self.id, stack.join("\n"))
}
@ -322,6 +299,7 @@ impl ProgramMemory {
std: None,
stats: MemoryStats::default(),
next_stack_id: AtomicUsize::new(1),
epoch: AtomicUsize::new(1),
write_lock: AtomicBool::new(false),
})
}
@ -340,10 +318,12 @@ impl ProgramMemory {
std: self.std,
stats: MemoryStats::default(),
next_stack_id: AtomicUsize::new(self.next_stack_id.load(Ordering::Relaxed)),
epoch: AtomicUsize::new(self.epoch.load(Ordering::Relaxed)),
write_lock: AtomicBool::new(false),
})
}
/// Create a new stack object referencing this `ProgramMemory`.
pub fn new_stack(self: Arc<Self>) -> Stack {
let id = self.next_stack_id.fetch_add(1, Ordering::Relaxed);
assert!(id > 0);
@ -367,7 +347,7 @@ impl ProgramMemory {
self.std.is_none()
}
/// Get a value from a specific snapshot of the memory.
/// Get a value from a specific environment of the memory at a specific point in time.
pub fn get_from(
&self,
var: &str,
@ -438,7 +418,7 @@ impl ProgramMemory {
let new_env = Environment::new(parent, is_root_env, owner);
self.with_envs(|envs| {
let result = EnvironmentRef(envs.len(), SnapshotRef::none());
let result = EnvironmentRef(envs.len(), usize::MAX);
// Note this might reallocate, which would hold the `with_envs` spin lock for way too long
// so somehow we should make sure we don't do that (though honestly the chance of that
// happening while another thread is waiting for the lock is pretty small).
@ -490,23 +470,12 @@ impl ProgramMemory {
})
}
#[cfg(test)]
fn update_with_env(&self, key: &str, value: KclValue, env: usize, owner: usize) {
self.stats.mutation_count.fetch_add(1, Ordering::Relaxed);
self.get_env(env).insert_or_update(key.to_owned(), value, owner);
}
/// Get a value from memory without checking for ownership of the env.
///
/// This is not safe to use in general and should only be used if you have unique access to
/// the `self` which is generally only true during testing.
#[cfg(test)]
pub fn get_from_unchecked(
&self,
var: &str,
mut env_ref: EnvironmentRef,
source_range: SourceRange,
) -> Result<&KclValue, KclError> {
pub fn get_from_unchecked(&self, var: &str, mut env_ref: EnvironmentRef) -> Result<&KclValue, KclError> {
loop {
let env = self.get_env(env_ref.index());
env_ref = match env.get_unchecked(var, env_ref.1) {
@ -518,7 +487,7 @@ impl ProgramMemory {
Err(KclError::UndefinedValue(KclErrorDetails {
message: format!("memory item key `{}` is not defined", var),
source_ranges: vec![source_range],
source_ranges: vec![],
}))
}
}
@ -544,6 +513,11 @@ impl Stack {
stack
}
/// Get the current (globally most recent) epoch.
pub fn current_epoch(&self) -> usize {
self.memory.epoch.load(Ordering::Relaxed)
}
/// Push a new (standard KCL) stack frame on to the call stack.
///
/// `parent` is the environment where the function being called is declared (not the caller's
@ -577,7 +551,7 @@ impl Stack {
// Rust functions shouldn't try to set or access anything in their environment, so don't
// waste time and space on a new env. Using usize::MAX means we'll get an overflow if we
// try to access anything rather than a silent error.
self.current_env = EnvironmentRef(usize::MAX, SnapshotRef::none());
self.current_env = EnvironmentRef(usize::MAX, 0);
}
/// Push a new stack frame on to the call stack with no connection to a parent environment.
@ -596,7 +570,6 @@ impl Stack {
/// SAFETY: the env must not be being used by another `Stack` since we'll move the env from
/// read-only to owned.
pub fn restore_env(&mut self, env: EnvironmentRef) {
assert!(env.1.is_none());
self.call_stack.push(self.current_env);
self.memory.get_env(env.index()).restore_owner(self.id);
self.current_env = env;
@ -642,25 +615,28 @@ impl Stack {
}
let mut old_env = self.memory.take_env(old);
if old_env.is_empty() {
return;
}
// Map of any old env refs to the current env.
let snapshot_map: HashMap<_, _> = old_env
.snapshot_parents()
.map(|(s, p)| (EnvironmentRef(old.0, s), (EnvironmentRef(self.current_env.0, p))))
.collect();
// Make a new scope so we override variables properly.
self.push_new_env_for_scope();
// Move the variables in the popped env into the current env.
let env = self.memory.get_env(self.current_env.index());
for (k, v) in old_env.as_mut().take_bindings() {
env.insert_or_update(k.clone(), v.map_env_ref(&snapshot_map), self.id);
for (k, (e, v)) in old_env.as_mut().take_bindings() {
env.insert(k, e, v.map_env_ref(old.0, self.current_env.0), self.id);
}
}
/// Snapshot the current state of the memory.
pub fn snapshot(&mut self) -> EnvironmentRef {
self.memory.stats.snapshot_count.fetch_add(1, Ordering::Relaxed);
let snapshot = env::snapshot(&self.memory, self.current_env, self.id);
EnvironmentRef(self.current_env.0, snapshot)
self.memory.stats.epoch_count.fetch_add(1, Ordering::Relaxed);
let env = self.memory.get_env(self.current_env.index());
env.mark_as_refed();
let prev_epoch = self.memory.epoch.fetch_add(1, Ordering::Relaxed);
EnvironmentRef(self.current_env.0, prev_epoch)
}
/// Add a value to the program memory (in the current scope). The value must not already exist.
@ -675,16 +651,21 @@ impl Stack {
self.memory.stats.mutation_count.fetch_add(1, Ordering::Relaxed);
env.insert(key, value, self.id);
env.insert(key, self.memory.epoch.load(Ordering::Relaxed), value, self.id);
Ok(())
}
pub fn insert_or_update(&mut self, key: String, value: KclValue) {
/// Update a variable in memory. `key` must exist in memory. If it doesn't, this function will panic
/// in debug builds and do nothing in release builds.
pub fn update(&mut self, key: &str, f: impl Fn(&mut KclValue, usize)) {
self.memory.stats.mutation_count.fetch_add(1, Ordering::Relaxed);
self.memory
.get_env(self.current_env.index())
.insert_or_update(key, value, self.id);
self.memory.get_env(self.current_env.index()).update(
key,
f,
self.memory.epoch.load(Ordering::Relaxed),
self.id,
);
}
/// Get a value from the program memory.
@ -693,38 +674,41 @@ impl Stack {
self.memory.get_from(var, self.current_env, source_range, self.id)
}
/// Whether the current frame of the stack contains a variable with the given name.
pub fn cur_frame_contains(&self, var: &str) -> bool {
let env = self.memory.get_env(self.current_env.index());
env.contains_key(var)
}
/// Get a key from the first KCL (i.e., non-Rust) stack frame on the call stack.
pub fn get_from_call_stack(&self, key: &str, source_range: SourceRange) -> Result<&KclValue, KclError> {
pub fn get_from_call_stack(&self, key: &str, source_range: SourceRange) -> Result<(usize, &KclValue), KclError> {
if !self.current_env.skip_env() {
return self.get(key, source_range);
return Ok((self.current_env.1, self.get(key, source_range)?));
}
for env in self.call_stack.iter().rev() {
if !env.skip_env() {
return self.memory.get_from(key, *env, source_range, self.id);
return Ok((env.1, self.memory.get_from(key, *env, source_range, self.id)?));
}
}
unreachable!("It can't be Rust frames all the way down");
}
/// Iterate over all key/value pairs in the current environment which satisfy the provided
/// predicate.
pub fn find_all_in_current_env<'a>(
/// Iterate over all keys in the current environment which satisfy the provided predicate.
pub fn find_keys_in_current_env<'a>(
&'a self,
pred: impl Fn(&KclValue) -> bool + 'a,
) -> impl Iterator<Item = (&'a String, &'a KclValue)> {
self.memory.find_all_in_env(self.current_env, pred, self.id)
) -> impl Iterator<Item = &'a String> {
self.memory
.find_all_in_env(self.current_env, pred, self.id)
.map(|(k, _)| k)
}
/// Iterate over all key/value pairs in the specified environment which satisfy the provided
/// predicate. `env` must either be read-only or owned by `self`.
pub fn find_all_in_env<'a>(
&'a self,
env: EnvironmentRef,
pred: impl Fn(&KclValue) -> bool + 'a,
) -> impl Iterator<Item = (&'a String, &'a KclValue)> {
self.memory.find_all_in_env(env, pred, self.id)
pub fn find_all_in_env(&self, env: EnvironmentRef) -> impl Iterator<Item = (&String, &KclValue)> {
self.memory.find_all_in_env(env, |_| true, self.id)
}
/// Walk all values accessible from any environment in the call stack.
@ -781,7 +765,7 @@ impl<'a> Iterator for CallStackIterator<'a> {
return next;
}
if let Some(env_ref) = self.stack.memory.get_env(self.cur_env.index()).parent(self.cur_env.1) {
if let Some(env_ref) = self.stack.memory.get_env(self.cur_env.index()).parent() {
self.cur_env = env_ref;
self.init_iter();
} else {
@ -816,23 +800,32 @@ impl<'a> Iterator for CallStackIterator<'a> {
#[cfg(test)]
impl PartialEq for Stack {
fn eq(&self, other: &Self) -> bool {
let vars: Vec<_> = self.find_all_in_current_env(|_| true).collect();
let vars_other: Vec<_> = other.find_all_in_current_env(|_| true).collect();
vars == vars_other
let vars: Vec<_> = self.find_keys_in_current_env(|_| true).collect();
let vars_other: Vec<_> = other.find_keys_in_current_env(|_| true).collect();
if vars != vars_other {
return false;
}
vars.iter()
.all(|k| self.get(k, SourceRange::default()).unwrap() == other.get(k, SourceRange::default()).unwrap())
}
}
/// An index pointing to an environment at a point in time (either a snapshot or the current version, see the module docs).
/// An index pointing to an environment at a point in time.
///
/// The first field indexes an environment, the second field is an epoch. An epoch of 0 is indicates
/// a dummy, error, or placeholder env ref, an epoch of `usize::MAX` represents the current most
/// recent epoch.
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Hash, Eq, ts_rs::TS, JsonSchema)]
pub struct EnvironmentRef(usize, SnapshotRef);
pub struct EnvironmentRef(usize, usize);
impl EnvironmentRef {
fn dummy() -> Self {
Self(usize::MAX, SnapshotRef(usize::MAX))
Self(usize::MAX, 0)
}
fn is_regular(&self) -> bool {
self.0 < usize::MAX && self.1 .0 < usize::MAX
self.0 < usize::MAX && self.1 > 0
}
fn index(&self) -> usize {
@ -842,33 +835,11 @@ impl EnvironmentRef {
fn skip_env(&self) -> bool {
self.0 == usize::MAX
}
}
/// An index pointing to a snapshot within a specific (unspecified) environment.
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Hash, Eq, ts_rs::TS, JsonSchema)]
struct SnapshotRef(usize);
impl SnapshotRef {
/// Represents no snapshot, use the current version of the environment.
fn none() -> Self {
Self(0)
}
/// `self` represents a snapshot.
fn is_some(self) -> bool {
self.0 > 0
}
/// `self` represents the current version.
fn is_none(self) -> bool {
self.0 == 0
}
// Precondition: self.is_some()
fn index(&self) -> usize {
// Note that `0` is a distinguished value meaning 'no snapshot', so the reference value
// is one greater than the index into the list of snapshots.
self.0 - 1
pub fn replace_env(&mut self, old: usize, new: usize) {
if self.0 == old {
self.0 = new;
}
}
}
@ -877,8 +848,8 @@ impl SnapshotRef {
pub(crate) struct MemoryStats {
// Total number of environments created.
env_count: AtomicUsize,
// Total number of snapshots created.
snapshot_count: AtomicUsize,
// Total number of epochs.
epoch_count: AtomicUsize,
// Total number of values inserted or updated.
mutation_count: AtomicUsize,
// The number of envs we delete when popped from the call stack.
@ -900,12 +871,10 @@ mod env {
#[derive(Debug)]
pub(super) struct Environment {
bindings: UnsafeCell<IndexMap<String, KclValue>>,
// invariant: self.parent.is_none() => forall s in self.snapshots: s.parent_snapshot.is_none()
snapshots: UnsafeCell<Vec<Snapshot>>,
bindings: UnsafeCell<IndexMap<String, (usize, KclValue)>>,
// An outer scope, if one exists.
parent: Option<EnvironmentRef>,
is_root_env: bool,
might_be_refed: AtomicBool,
// The id of the `Stack` if this `Environment` is on a call stack. If this is >0 then it may
// only be read or written by that `Stack`; if 0 then the env is read-only.
owner: AtomicUsize,
@ -918,9 +887,8 @@ mod env {
assert!(self.owner.load(Ordering::Acquire) == 0);
Self {
bindings: UnsafeCell::new(self.get_bindings().clone()),
snapshots: UnsafeCell::new(self.iter_snapshots().cloned().collect()),
parent: self.parent,
is_root_env: self.is_root_env,
might_be_refed: AtomicBool::new(self.might_be_refed.load(Ordering::Acquire)),
owner: AtomicUsize::new(0),
_unpin: PhantomPinned,
}
@ -931,45 +899,19 @@ mod env {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let parent = self
.parent
.map(|e| format!("EnvRef({}, {})", e.0, e.1 .0))
.map(|e| format!("EnvRef({}, {})", e.0, e.1))
.unwrap_or("_".to_owned());
let data: Vec<String> = self
.get_bindings()
.iter()
.map(|(k, v)| format!("{k}: {}", v.human_friendly_type()))
.map(|(k, v)| format!("{k}: {}@{}", v.1.human_friendly_type(), v.0))
.collect();
let snapshots: Vec<String> = self.iter_snapshots().map(|s| s.to_string()).collect();
write!(
f,
"Env {{\n parent: {parent},\n owner: {},\n is root: {},\n bindings:\n {},\n snapshots:\n {}\n}}",
"Env {{\n parent: {parent},\n owner: {},\n ref'ed?: {},\n bindings:\n {}\n}}",
self.owner.load(Ordering::Relaxed),
self.is_root_env,
self.might_be_refed.load(Ordering::Relaxed),
data.join("\n "),
snapshots.join("\n ")
)
}
}
#[derive(Debug, Clone, PartialEq)]
struct Snapshot {
/// The version of the owning environment's parent environment corresponding to this snapshot.
parent_snapshot: Option<SnapshotRef>,
/// CoW'ed data from the environment.
data: IndexMap<String, KclValue>,
}
impl fmt::Display for Snapshot {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let parent = self.parent_snapshot.map(|s| s.0.to_string()).unwrap_or("_".to_owned());
let data: Vec<String> = self
.data
.iter()
.map(|(k, v)| format!("{k}: {}", v.human_friendly_type()))
.collect();
write!(
f,
"Snapshot {{\n parent: {parent},\n data: {},\n }}",
data.join("\n ")
)
}
}
@ -977,80 +919,47 @@ mod env {
impl Environment {
/// Create a new environment, parent points to it's surrounding lexical scope or the std
/// env if it's a root scope.
pub(super) fn new(parent: Option<EnvironmentRef>, is_root_env: bool, owner: usize) -> Self {
pub(super) fn new(parent: Option<EnvironmentRef>, might_be_refed: bool, owner: usize) -> Self {
assert!(parent.map(|p| p.is_regular()).unwrap_or(true));
Self {
bindings: UnsafeCell::new(IndexMap::new()),
snapshots: UnsafeCell::new(Vec::new()),
parent,
is_root_env,
might_be_refed: AtomicBool::new(might_be_refed),
owner: AtomicUsize::new(owner),
_unpin: PhantomPinned,
}
}
// Mark this env as read-only (see module docs).
/// Mark this env as read-only (see module docs).
pub(super) fn read_only(&self) {
self.owner.store(0, Ordering::Release);
}
// Mark this env as owned (see module docs).
/// Mark this env as owned (see module docs).
pub(super) fn restore_owner(&self, owner: usize) {
self.owner.store(owner, Ordering::Release);
}
// SAFETY: either the owner of the env is on the Rust stack or the env is read-only.
fn snapshots_len(&self) -> usize {
unsafe { self.snapshots.get().as_ref().unwrap().len() }
/// Mark this environment as possibly having external references.
pub(super) fn mark_as_refed(&self) {
self.might_be_refed.store(true, Ordering::Release);
}
// SAFETY: either the owner of the env is on the Rust stack or the env is read-only.
fn get_shapshot(&self, index: usize) -> &Snapshot {
unsafe { &self.snapshots.get().as_ref().unwrap()[index] }
}
// SAFETY: either the owner of the env is on the Rust stack or the env is read-only.
fn iter_snapshots(&self) -> impl Iterator<Item = &Snapshot> {
unsafe { self.snapshots.get().as_ref().unwrap().iter() }
}
fn cur_snapshot(&self, owner: usize) -> Option<&mut Snapshot> {
assert!(owner > 0 && self.owner.load(Ordering::Acquire) == owner);
unsafe { self.snapshots.get().as_mut().unwrap().last_mut() }
}
// SAFETY: either the owner of the env is on the Rust stack or the env is read-only.
fn get_bindings(&self) -> &IndexMap<String, KclValue> {
fn get_bindings(&self) -> &IndexMap<String, (usize, KclValue)> {
unsafe { self.bindings.get().as_ref().unwrap() }
}
// SAFETY do not call this function while a previous mutable reference is live
#[allow(clippy::mut_from_ref)]
fn get_mut_bindings(&self, owner: usize) -> &mut IndexMap<String, KclValue> {
fn get_mut_bindings(&self, owner: usize) -> &mut IndexMap<String, (usize, KclValue)> {
assert!(owner > 0 && self.owner.load(Ordering::Acquire) == owner);
unsafe { self.bindings.get().as_mut().unwrap() }
}
// True if the env is empty and not a root env.
// True if the env is empty and has no external references.
pub(super) fn is_empty(&self) -> bool {
self.snapshots_len() == 0 && self.get_bindings().is_empty() && !self.is_root_env
}
fn push_snapshot(&self, parent: Option<SnapshotRef>, owner: usize) -> SnapshotRef {
let env_owner = self.owner.load(Ordering::Acquire);
// The env is read-only, no need to snapshot.
if env_owner == 0 {
return SnapshotRef::none();
}
assert!(
owner > 0 && env_owner == owner,
"mutating owner: {owner}, env: {self}({env_owner})"
);
unsafe {
let snapshots = self.snapshots.get().as_mut().unwrap();
snapshots.push(Snapshot::new(parent));
SnapshotRef(snapshots.len())
}
self.get_bindings().is_empty() && !self.might_be_refed.load(Ordering::Acquire)
}
/// Possibly compress this environment by deleting the memory.
@ -1062,116 +971,61 @@ mod env {
/// See module docs for more details.
pub(super) fn compact(&self, owner: usize) {
// Don't compress if there might be a closure or import referencing us.
if self.snapshots_len() != 0 || self.is_root_env {
if self.might_be_refed.load(Ordering::Acquire) {
return;
}
*self.get_mut_bindings(owner) = IndexMap::new();
}
pub(super) fn get(
&self,
key: &str,
snapshot: SnapshotRef,
owner: usize,
) -> Result<&KclValue, Option<EnvironmentRef>> {
pub(super) fn get(&self, key: &str, epoch: usize, owner: usize) -> Result<&KclValue, Option<EnvironmentRef>> {
let env_owner = self.owner.load(Ordering::Acquire);
assert!(env_owner == 0 || env_owner == owner);
self.get_unchecked(key, snapshot)
self.get_unchecked(key, epoch)
}
/// Get a value from memory without checking the env's ownership invariant. Prefer to use `get`.
pub(super) fn get_unchecked(
&self,
key: &str,
snapshot: SnapshotRef,
) -> Result<&KclValue, Option<EnvironmentRef>> {
if snapshot.is_some() {
for i in snapshot.index()..self.snapshots_len() {
match self.get_shapshot(i).data.get(key) {
Some(KclValue::Tombstone { .. }) => return Err(self.parent(snapshot)),
Some(v) => return Ok(v),
None => {}
}
}
}
pub(super) fn get_unchecked(&self, key: &str, epoch: usize) -> Result<&KclValue, Option<EnvironmentRef>> {
self.get_bindings()
.get(key)
.and_then(|v| match v {
KclValue::Tombstone { .. } => None,
_ => Some(v),
})
.ok_or(self.parent(snapshot))
.and_then(|(e, v)| if *e <= epoch { Some(v) } else { None })
.ok_or(self.parent)
}
/// Find the `EnvironmentRef` of the parent of this environment corresponding to the specified snapshot.
pub(super) fn parent(&self, snapshot: SnapshotRef) -> Option<EnvironmentRef> {
if snapshot.is_none() {
return self.parent;
}
pub(super) fn update(&self, key: &str, f: impl Fn(&mut KclValue, usize), epoch: usize, owner: usize) {
let Some((_, value)) = self.get_mut_bindings(owner).get_mut(key) else {
debug_assert!(false, "Missing memory entry for {key}");
return;
};
match self.get_shapshot(snapshot.index()).parent_snapshot {
Some(sr) => Some(EnvironmentRef(self.parent.unwrap().0, sr)),
None => self.parent,
}
f(value, epoch);
}
/// Iterate over all values in the environment at the specified snapshot.
pub(super) fn values<'a>(&'a self, snapshot: SnapshotRef) -> Box<dyn Iterator<Item = &'a KclValue> + 'a> {
if snapshot.is_none() {
return Box::new(self.get_bindings().values());
}
pub(super) fn parent(&self) -> Option<EnvironmentRef> {
self.parent
}
/// Iterate over all values in the environment at the specified epoch.
pub(super) fn values<'a>(&'a self, epoch: usize) -> Box<dyn Iterator<Item = &'a KclValue> + 'a> {
Box::new(
self.get_bindings()
.iter()
.filter_map(move |(k, v)| {
(!self.snapshot_contains_key(k, snapshot) && !matches!(v, KclValue::Tombstone { .. }))
.then_some(v)
})
.chain(
self.iter_snapshots()
.flat_map(|s| s.data.values().filter(|v| !matches!(v, KclValue::Tombstone { .. }))),
),
.values()
.filter_map(move |(e, v)| (*e <= epoch).then_some(v)),
)
}
/// Pure insert, panics if `key` is already in this environment.
///
/// Precondition: !self.contains_key(key)
pub(super) fn insert(&self, key: String, value: KclValue, owner: usize) {
pub(super) fn insert(&self, key: String, epoch: usize, value: KclValue, owner: usize) {
debug_assert!(!self.get_bindings().contains_key(&key));
if let Some(s) = self.cur_snapshot(owner) {
s.data.insert(key.clone(), tombstone());
}
self.get_mut_bindings(owner).insert(key, value);
}
pub(super) fn insert_or_update(&self, key: String, value: KclValue, owner: usize) {
if let Some(s) = self.cur_snapshot(owner) {
if !s.data.contains_key(&key) {
let old_value = self.get_bindings().get(&key).cloned().unwrap_or_else(tombstone);
s.data.insert(key.clone(), old_value);
}
}
self.get_mut_bindings(owner).insert(key, value);
}
/// Was the key contained in this environment at the specified point in time.
fn snapshot_contains_key(&self, key: &str, snapshot: SnapshotRef) -> bool {
for i in snapshot.index()..self.snapshots_len() {
if self.get_shapshot(i).data.contains_key(key) {
return true;
}
}
false
self.get_mut_bindings(owner).insert(key, (epoch, value));
}
/// Is the key currently contained in this environment.
pub(super) fn contains_key(&self, key: &str) -> bool {
!matches!(self.get_bindings().get(key), Some(KclValue::Tombstone { .. }) | None)
self.get_bindings().contains_key(key)
}
/// Iterate over all key/value pairs currently in this environment where the value satisfies
@ -1186,61 +1040,14 @@ mod env {
self.get_bindings()
.iter()
.filter(move |(_, v)| f(v) && !matches!(v, KclValue::Tombstone { .. }))
.filter_map(move |(k, (_, v))| f(v).then_some((k, v)))
}
/// Take all bindings from the environment.
pub(super) fn take_bindings(self: Pin<&mut Self>) -> impl Iterator<Item = (String, KclValue)> {
pub(super) fn take_bindings(self: Pin<&mut Self>) -> impl Iterator<Item = (String, (usize, KclValue))> {
// SAFETY: caller must have unique access since self is mut. We're not moving or invalidating `self`.
let bindings = std::mem::take(unsafe { self.bindings.get().as_mut().unwrap() });
bindings
.into_iter()
.filter(move |(_, v)| !matches!(v, KclValue::Tombstone { .. }))
}
/// Returns an iterator over any snapshots in this environment, returning the ref to the
/// snapshot and its parent.
pub(super) fn snapshot_parents(&self) -> impl Iterator<Item = (SnapshotRef, SnapshotRef)> + '_ {
self.iter_snapshots()
.enumerate()
.map(|(i, s)| (SnapshotRef(i + 1), s.parent_snapshot.unwrap()))
}
}
impl Snapshot {
fn new(parent_snapshot: Option<SnapshotRef>) -> Self {
Snapshot {
parent_snapshot,
data: IndexMap::new(),
}
}
}
/// Build a new snapshot of the specified environment at the current moment.
///
/// This is non-trival since we have to build the tree of parent snapshots.
pub(super) fn snapshot(mem: &ProgramMemory, env_ref: EnvironmentRef, owner: usize) -> SnapshotRef {
let env = mem.get_env(env_ref.index());
let parent_snapshot = env.parent.map(|p| snapshot(mem, p, owner));
let env = mem.get_env(env_ref.index());
if env.snapshots_len() == 0 {
return env.push_snapshot(parent_snapshot, owner);
}
let prev_snapshot = env.cur_snapshot(owner).unwrap();
if prev_snapshot.data.is_empty() && prev_snapshot.parent_snapshot == parent_snapshot {
// If the prev snapshot is empty, reuse it.
return SnapshotRef(env.snapshots_len());
}
env.push_snapshot(parent_snapshot, owner)
}
fn tombstone() -> KclValue {
KclValue::Tombstone {
value: (),
meta: Vec::new(),
bindings.into_iter()
}
}
}
@ -1270,16 +1077,9 @@ mod test {
}
}
fn expect_small_number(value: &KclValue) -> Option<i64> {
match value {
KclValue::Number { value, .. } if value > &0.0 && value < &10.0 => Some(*value as i64),
_ => None,
}
}
#[track_caller]
fn assert_get_from(mem: &Stack, key: &str, n: i64, snapshot: EnvironmentRef) {
match mem.memory.get_from_unchecked(key, snapshot, sr()).unwrap() {
match mem.memory.get_from_unchecked(key, snapshot).unwrap() {
KclValue::Number { value, .. } => assert_eq!(*value as i64, n),
_ => unreachable!(),
}
@ -1318,7 +1118,7 @@ mod test {
assert_get(mem, "a", 1);
mem.add("b".to_owned(), val(3), sr()).unwrap();
assert_get(mem, "b", 3);
mem.memory.get_from_unchecked("b", sn, sr()).unwrap_err();
mem.memory.get_from_unchecked("b", sn).unwrap_err();
}
#[test]
@ -1337,11 +1137,11 @@ mod test {
assert_get(mem, "b", 3);
assert_get(mem, "c", 6);
assert_get_from(mem, "a", 1, sn1);
mem.memory.get_from_unchecked("b", sn1, sr()).unwrap_err();
mem.memory.get_from_unchecked("c", sn1, sr()).unwrap_err();
mem.memory.get_from_unchecked("b", sn1).unwrap_err();
mem.memory.get_from_unchecked("c", sn1).unwrap_err();
assert_get_from(mem, "a", 1, sn2);
assert_get_from(mem, "b", 3, sn2);
mem.memory.get_from_unchecked("c", sn2, sr()).unwrap_err();
mem.memory.get_from_unchecked("c", sn2).unwrap_err();
}
#[test]
@ -1481,7 +1281,7 @@ mod test {
mem.pop_env();
// old snapshot still untouched
mem.memory.get_from_unchecked("b", sn, sr()).unwrap_err();
mem.memory.get_from_unchecked("b", sn).unwrap_err();
}
#[test]
@ -1503,62 +1303,22 @@ mod test {
mem.pop_env();
// old snapshots still untouched
mem.memory.get_from_unchecked("b", sn1, sr()).unwrap_err();
mem.memory.get_from_unchecked("b", sn1).unwrap_err();
assert_get_from(mem, "b", 3, sn2);
mem.memory.get_from_unchecked("c", sn2, sr()).unwrap_err();
mem.memory.get_from_unchecked("c", sn2).unwrap_err();
assert_get_from(mem, "b", 4, sn3);
mem.memory.get_from_unchecked("c", sn3, sr()).unwrap_err();
}
#[test]
fn snap_env_two_updates() {
let mem = &mut Stack::new_for_tests();
mem.add("a".to_owned(), val(1), sr()).unwrap();
let sn1 = mem.snapshot();
mem.add("b".to_owned(), val(3), sr()).unwrap();
let sn2 = mem.snapshot();
let callee_env = mem.current_env.0;
mem.push_new_env_for_call(sn2);
let sn3 = mem.snapshot();
mem.add("b".to_owned(), val(4), sr()).unwrap();
let sn4 = mem.snapshot();
mem.insert_or_update("b".to_owned(), val(6));
mem.memory.update_with_env("b", val(7), callee_env, mem.id);
assert_get(mem, "b", 6);
assert_get_from(mem, "b", 3, sn3);
assert_get_from(mem, "b", 4, sn4);
let vals: Vec<_> = mem.walk_call_stack().filter_map(expect_small_number).collect();
let expected = [6, 1, 3, 1, 7];
assert_eq!(vals, expected);
let popped = mem.pop_env();
assert_get(mem, "b", 7);
mem.memory.get_from_unchecked("b", sn1, sr()).unwrap_err();
assert_get_from(mem, "b", 3, sn2);
let vals: Vec<_> = mem.walk_call_stack().filter_map(expect_small_number).collect();
let expected = [1, 7];
assert_eq!(vals, expected);
let popped_env = mem.memory.get_env(popped.index());
let sp: Vec<_> = popped_env.snapshot_parents().collect();
assert_eq!(
sp,
vec![(SnapshotRef(1), SnapshotRef(2)), (SnapshotRef(2), SnapshotRef(2))]
);
mem.memory.get_from_unchecked("c", sn3).unwrap_err();
}
#[test]
fn squash_env() {
let mem = &mut Stack::new_for_tests();
mem.add("a".to_owned(), val(1), sr()).unwrap();
mem.add("b".to_owned(), val(3), sr()).unwrap();
let sn1 = mem.snapshot();
mem.push_new_env_for_call(sn1);
mem.add("b".to_owned(), val(2), sr()).unwrap();
let sn2 = mem.snapshot();
mem.add(
"f".to_owned(),
@ -1581,11 +1341,10 @@ mod test {
KclValue::Function {
value: FunctionSource::User { memory, .. },
..
} if memory == &sn1 => {}
v => panic!("{v:#?}"),
} if memory.0 == mem.current_env.0 => {}
v => panic!("{v:#?}, expected {sn1:?}"),
}
assert_eq!(mem.memory.envs().len(), 1);
assert_eq!(mem.current_env, EnvironmentRef(0, SnapshotRef(0)));
assert_eq!(mem.memory.envs().len(), 2);
}
#[test]

View File

@ -10,6 +10,7 @@ use cache::OldAstState;
pub use cache::{bust_cache, clear_mem_cache};
pub use cad_op::Operation;
pub use geometry::*;
pub use id_generator::IdGenerator;
pub(crate) use import::{
import_foreign, send_to_engine as send_import_to_engine, PreImportedGeometry, ZOO_COORD_SYSTEM,
};
@ -25,7 +26,7 @@ use kittycad_modeling_cmds as kcmc;
pub use memory::EnvironmentRef;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
pub use state::{ExecState, IdGenerator, MetaSettings};
pub use state::{ExecState, MetaSettings};
use crate::{
engine::EngineManager,
@ -49,6 +50,7 @@ pub(crate) mod cache;
mod cad_op;
mod exec_ast;
mod geometry;
mod id_generator;
mod import;
pub(crate) mod kcl_value;
mod memory;
@ -72,6 +74,8 @@ pub struct ExecOutcome {
pub errors: Vec<CompilationError>,
/// File Names in module Id array index order
pub filenames: IndexMap<ModuleId, ModulePath>,
/// The default planes.
pub default_planes: Option<DefaultPlanes>,
}
#[derive(Debug, Default, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
@ -91,11 +95,46 @@ pub struct DefaultPlanes {
#[serde(tag = "type", rename_all = "camelCase")]
pub struct TagIdentifier {
pub value: String,
pub info: Option<TagEngineInfo>,
// Multi-version representation of info about the tag. Kept ordered. The usize is the epoch at which the info
// was written. Note that there might be multiple versions of tag info from the same epoch, the version with
// the higher index will be the most recent.
#[serde(skip)]
pub info: Vec<(usize, TagEngineInfo)>,
#[serde(skip)]
pub meta: Vec<Metadata>,
}
impl TagIdentifier {
/// Get the tag info for this tag at a specified epoch.
pub fn get_info(&self, at_epoch: usize) -> Option<&TagEngineInfo> {
for (e, info) in self.info.iter().rev() {
if *e <= at_epoch {
return Some(info);
}
}
None
}
/// Get the most recent tag info for this tag.
pub fn get_cur_info(&self) -> Option<&TagEngineInfo> {
self.info.last().map(|i| &i.1)
}
/// Add info from a different instance of this tag.
pub fn merge_info(&mut self, other: &TagIdentifier) {
assert_eq!(&self.value, &other.value);
'new_info: for (oe, ot) in &other.info {
for (e, _) in &self.info {
if e > oe {
continue 'new_info;
}
}
self.info.push((*oe, ot.clone()));
}
}
}
impl Eq for TagIdentifier {}
impl std::fmt::Display for TagIdentifier {
@ -110,7 +149,7 @@ impl std::str::FromStr for TagIdentifier {
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self {
value: s.to_string(),
info: None,
info: Vec::new(),
meta: Default::default(),
})
}
@ -367,22 +406,14 @@ impl ExecutorContext {
}
#[cfg(target_arch = "wasm32")]
pub async fn new(
engine_manager: crate::engine::conn_wasm::EngineCommandManager,
fs_manager: crate::fs::wasm::FileSystemManager,
settings: ExecutorSettings,
) -> Result<Self, String> {
Ok(ExecutorContext {
engine: Arc::new(Box::new(
crate::engine::conn_wasm::EngineConnection::new(engine_manager)
.await
.map_err(|e| format!("{:?}", e))?,
)),
fs: Arc::new(FileManager::new(fs_manager)),
pub fn new(engine: Arc<Box<dyn EngineManager>>, fs: Arc<FileManager>, settings: ExecutorSettings) -> Self {
ExecutorContext {
engine,
fs,
stdlib: Arc::new(StdLib::new()),
settings,
context_type: ContextType::Live,
})
}
}
#[cfg(not(target_arch = "wasm32"))]
@ -499,7 +530,7 @@ impl ExecutorContext {
source_range: crate::execution::SourceRange,
) -> Result<(), KclError> {
self.engine
.clear_scene(&mut exec_state.global.id_generator, source_range)
.clear_scene(&mut exec_state.mod_local.id_generator, source_range)
.await
}
@ -518,7 +549,7 @@ impl ExecutorContext {
) -> Result<ExecOutcome, KclErrorWithOutputs> {
assert!(self.is_mock());
let mut exec_state = ExecState::new(&self.settings);
let mut exec_state = ExecState::new(self);
if use_prev_memory {
match cache::read_old_memory().await {
Some(mem) => *exec_state.mut_stack() = mem,
@ -539,7 +570,7 @@ impl ExecutorContext {
// memory, not to the exec_state which is not cached for mock execution.
let mut mem = exec_state.stack().clone();
let outcome = exec_state.to_mock_wasm_outcome(result.0);
let outcome = exec_state.to_mock_wasm_outcome(result.0).await;
mem.squash_env(result.0);
cache::write_old_memory(mem).await;
@ -607,13 +638,13 @@ impl ExecutorContext {
})
.await;
let outcome = old_state.to_wasm_outcome(result_env);
let outcome = old_state.to_wasm_outcome(result_env).await;
return Ok(outcome);
}
(true, program)
}
CacheResult::NoAction(false) => {
let outcome = old_state.to_wasm_outcome(result_env);
let outcome = old_state.to_wasm_outcome(result_env).await;
return Ok(outcome);
}
};
@ -621,7 +652,7 @@ impl ExecutorContext {
let (exec_state, preserve_mem) = if clear_scene {
// Pop the execution state, since we are starting fresh.
let mut exec_state = old_state;
exec_state.reset(&self.settings);
exec_state.reset(self);
// We don't do this in mock mode since there is no engine connection
// anyways and from the TS side we override memory and don't want to clear it.
@ -638,7 +669,7 @@ impl ExecutorContext {
(program, exec_state, preserve_mem)
} else {
let mut exec_state = ExecState::new(&self.settings);
let mut exec_state = ExecState::new(self);
self.send_clear_scene(&mut exec_state, Default::default())
.await
.map_err(KclErrorWithOutputs::no_outputs)?;
@ -663,7 +694,7 @@ impl ExecutorContext {
})
.await;
let outcome = exec_state.to_wasm_outcome(result.0);
let outcome = exec_state.to_wasm_outcome(result.0).await;
Ok(outcome)
}
@ -699,6 +730,7 @@ impl ExecutorContext {
.await
.map_err(KclErrorWithOutputs::no_outputs)?;
let default_planes = self.engine.get_default_planes().read().await.clone();
let env_ref = self
.execute_and_build_graph(&program.ast, exec_state, preserve_mem)
.await
@ -717,6 +749,7 @@ impl ExecutorContext {
exec_state.global.artifact_graph.clone(),
module_id_to_module_path,
exec_state.global.id_to_source.clone(),
default_planes,
)
})?;
@ -754,6 +787,7 @@ impl ExecutorContext {
exec_state,
ExecutionKind::Normal,
preserve_mem,
ModuleId::default(),
&ModulePath::Main,
)
.await;
@ -933,7 +967,7 @@ pub(crate) async fn parse_execute(code: &str) -> Result<ExecTestResults, KclErro
settings: Default::default(),
context_type: ContextType::Mock,
};
let mut exec_state = ExecState::new(&exec_ctxt.settings);
let mut exec_state = ExecState::new(&exec_ctxt);
let result = exec_ctxt.run(&program, &mut exec_state).await?;
Ok(ExecTestResults {
@ -963,11 +997,7 @@ mod tests {
/// Convenience function to get a JSON value from memory and unwrap.
#[track_caller]
fn mem_get_json(memory: &Stack, env: EnvironmentRef, name: &str) -> KclValue {
memory
.memory
.get_from_unchecked(name, env, SourceRange::default())
.unwrap()
.to_owned()
memory.memory.get_from_unchecked(name, env).unwrap().to_owned()
}
#[tokio::test(flavor = "multi_thread")]
@ -1880,10 +1910,14 @@ let w = f() + f()
let old_program = crate::Program::parse_no_errs(code).unwrap();
// Execute the program.
ctx.run_with_caching(old_program).await.unwrap();
if let Err(err) = ctx.run_with_caching(old_program).await {
let report = err.into_miette_report_with_outputs(code).unwrap();
let report = miette::Report::new(report);
panic!("Error executing program: {:?}", report);
}
// Get the id_generator from the first execution.
let id_generator = cache::read_old_ast().await.unwrap().exec_state.global.id_generator;
let id_generator = cache::read_old_ast().await.unwrap().exec_state.mod_local.id_generator;
let code = r#"sketch001 = startSketchOn(XZ)
|> startProfileAt([62.74, 206.13], %)
@ -1904,7 +1938,7 @@ let w = f() + f()
// Execute the program.
ctx.run_with_caching(program).await.unwrap();
let new_id_generator = cache::read_old_ast().await.unwrap().exec_state.global.id_generator;
let new_id_generator = cache::read_old_ast().await.unwrap().exec_state.mod_local.id_generator;
assert_eq!(id_generator, new_id_generator);
}
@ -1933,7 +1967,6 @@ let w = f() + f()
// Execute the program.
ctx.run_with_caching(old_program.clone()).await.unwrap();
// Get the id_generator from the first execution.
let settings_state = cache::read_old_ast().await.unwrap().settings;
// Ensure the settings are as expected.
@ -1945,7 +1978,6 @@ let w = f() + f()
// Execute the program.
ctx.run_with_caching(old_program.clone()).await.unwrap();
// Get the id_generator from the first execution.
let settings_state = cache::read_old_ast().await.unwrap().settings;
// Ensure the settings are as expected.
@ -1957,7 +1989,6 @@ let w = f() + f()
// Execute the program.
ctx.run_with_caching(old_program).await.unwrap();
// Get the id_generator from the first execution.
let settings_state = cache::read_old_ast().await.unwrap().settings;
// Ensure the settings are as expected.
@ -1976,4 +2007,41 @@ let w = f() + f()
let result = ctx2.run_mock(program2, true).await.unwrap();
assert_eq!(result.variables.get("z").unwrap().as_f64().unwrap(), 3.0);
}
#[tokio::test(flavor = "multi_thread")]
async fn read_tag_version() {
let ast = r#"fn bar(t) {
return startSketchOn(XY)
|> startProfileAt([0,0], %)
|> angledLine({
angle = -60,
length = segLen(t),
}, %)
|> line(end = [0, 0])
|> close()
}
sketch = startSketchOn(XY)
|> startProfileAt([0,0], %)
|> line(end = [0, 10])
|> line(end = [10, 0], tag = $tag0)
|> line(end = [0, 0])
fn foo() {
// tag0 tags an edge
return bar(tag0)
}
solid = sketch |> extrude(length = 10)
// tag0 tags a face
sketch2 = startSketchOn(solid, tag0)
|> startProfileAt([0,0], %)
|> line(end = [0, 1])
|> line(end = [1, 0])
|> line(end = [0, 0])
foo() |> extrude(length = 1)
"#;
parse_execute(ast).await.unwrap();
}
}

View File

@ -10,7 +10,9 @@ use uuid::Uuid;
use crate::{
errors::{KclError, KclErrorDetails, Severity},
execution::{
annotations, kcl_value,
annotations,
id_generator::IdGenerator,
kcl_value,
memory::{ProgramMemory, Stack},
Artifact, ArtifactCommand, ArtifactGraph, ArtifactId, EnvironmentRef, ExecOutcome, ExecutorSettings, KclValue,
Operation, UnitAngle, UnitLen,
@ -26,12 +28,11 @@ use crate::{
pub struct ExecState {
pub(super) global: GlobalState,
pub(super) mod_local: ModuleState,
pub(super) exec_context: Option<super::ExecutorContext>,
}
#[derive(Debug, Clone)]
pub(super) struct GlobalState {
/// The stable artifact ID generator.
pub id_generator: IdGenerator,
/// Map from source file absolute path to module ID.
pub path_to_source_id: IndexMap<ModulePath, ModuleId>,
/// Map from module ID to source file.
@ -62,6 +63,8 @@ pub(super) struct GlobalState {
#[derive(Debug, Clone)]
pub(super) struct ModuleState {
/// The id generator for this module.
pub id_generator: IdGenerator,
pub stack: Stack,
/// The current value of the pipe operator returned from the previous
/// expression. If we're not currently in a pipeline, this will be None.
@ -73,25 +76,21 @@ pub(super) struct ModuleState {
}
impl ExecState {
pub fn new(exec_settings: &ExecutorSettings) -> Self {
pub fn new(exec_context: &super::ExecutorContext) -> Self {
ExecState {
global: GlobalState::new(exec_settings),
mod_local: ModuleState::new(exec_settings, None, ProgramMemory::new()),
global: GlobalState::new(&exec_context.settings),
mod_local: ModuleState::new(&exec_context.settings, None, ProgramMemory::new(), Default::default()),
exec_context: Some(exec_context.clone()),
}
}
pub(super) fn reset(&mut self, exec_settings: &ExecutorSettings) {
let mut id_generator = self.global.id_generator.clone();
// We do not pop the ids, since we want to keep the same id generator.
// This is for the front end to keep track of the ids.
id_generator.next_id = 0;
let mut global = GlobalState::new(exec_settings);
global.id_generator = id_generator;
pub(super) fn reset(&mut self, exec_context: &super::ExecutorContext) {
let global = GlobalState::new(&exec_context.settings);
*self = ExecState {
global,
mod_local: ModuleState::new(exec_settings, None, ProgramMemory::new()),
mod_local: ModuleState::new(&exec_context.settings, None, ProgramMemory::new(), Default::default()),
exec_context: Some(exec_context.clone()),
};
}
@ -113,13 +112,13 @@ impl ExecState {
/// Convert to execution outcome when running in WebAssembly. We want to
/// reduce the amount of data that crosses the WASM boundary as much as
/// possible.
pub fn to_wasm_outcome(self, main_ref: EnvironmentRef) -> ExecOutcome {
pub async fn to_wasm_outcome(self, main_ref: EnvironmentRef) -> ExecOutcome {
// Fields are opt-in so that we don't accidentally leak private internal
// state when we add more to ExecState.
ExecOutcome {
variables: self
.stack()
.find_all_in_env(main_ref, |_| true)
.find_all_in_env(main_ref)
.map(|(k, v)| (k.clone(), v.clone()))
.collect(),
operations: self.global.operations,
@ -132,16 +131,21 @@ impl ExecState {
.iter()
.map(|(k, v)| ((*v), k.clone()))
.collect(),
default_planes: if let Some(ctx) = &self.exec_context {
ctx.engine.get_default_planes().read().await.clone()
} else {
None
},
}
}
pub fn to_mock_wasm_outcome(self, main_ref: EnvironmentRef) -> ExecOutcome {
pub async fn to_mock_wasm_outcome(self, main_ref: EnvironmentRef) -> ExecOutcome {
// Fields are opt-in so that we don't accidentally leak private internal
// state when we add more to ExecState.
ExecOutcome {
variables: self
.stack()
.find_all_in_env(main_ref, |_| true)
.find_all_in_env(main_ref)
.map(|(k, v)| (k.clone(), v.clone()))
.collect(),
operations: Default::default(),
@ -149,6 +153,11 @@ impl ExecState {
artifact_graph: Default::default(),
errors: self.global.errors,
filenames: Default::default(),
default_planes: if let Some(ctx) = &self.exec_context {
ctx.engine.get_default_planes().read().await.clone()
} else {
None
},
}
}
@ -160,8 +169,12 @@ impl ExecState {
&mut self.mod_local.stack
}
pub(crate) fn next_uuid(&mut self) -> Uuid {
self.global.id_generator.next_uuid()
pub fn next_uuid(&mut self) -> Uuid {
self.mod_local.id_generator.next_uuid()
}
pub fn id_generator(&mut self) -> &mut IdGenerator {
&mut self.mod_local.id_generator
}
pub(crate) fn add_artifact(&mut self, artifact: Artifact) {
@ -241,7 +254,6 @@ impl ExecState {
impl GlobalState {
fn new(settings: &ExecutorSettings) -> Self {
let mut global = GlobalState {
id_generator: Default::default(),
path_to_source_id: Default::default(),
module_infos: Default::default(),
artifacts: Default::default(),
@ -274,8 +286,14 @@ impl GlobalState {
}
impl ModuleState {
pub(super) fn new(exec_settings: &ExecutorSettings, std_path: Option<String>, memory: Arc<ProgramMemory>) -> Self {
pub(super) fn new(
exec_settings: &ExecutorSettings,
std_path: Option<String>,
memory: Arc<ProgramMemory>,
module_id: Option<ModuleId>,
) -> Self {
ModuleState {
id_generator: IdGenerator::new(module_id),
stack: memory.new_stack(),
pipe_value: Default::default(),
module_exports: Default::default(),
@ -332,29 +350,3 @@ impl MetaSettings {
Ok(())
}
}
/// A generator for ArtifactIds that can be stable across executions.
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct IdGenerator {
pub(super) next_id: usize,
ids: Vec<uuid::Uuid>,
}
impl IdGenerator {
pub fn new() -> Self {
Self::default()
}
pub fn next_uuid(&mut self) -> uuid::Uuid {
if let Some(id) = self.ids.get(self.next_id) {
self.next_id += 1;
*id
} else {
let id = uuid::Uuid::new_v4();
self.ids.push(id);
self.next_id += 1;
id
}
}
}

View File

@ -8,11 +8,11 @@
#[allow(unused_macros)]
macro_rules! println {
($($rest:tt)*) => {
#[cfg(feature = "disable-println")]
#[cfg(all(feature = "disable-println", not(test)))]
{
let _ = format!($($rest)*);
}
#[cfg(not(feature = "disable-println"))]
#[cfg(any(not(feature = "disable-println"), test))]
std::println!($($rest)*)
}
}
@ -20,11 +20,11 @@ macro_rules! println {
#[allow(unused_macros)]
macro_rules! eprintln {
($($rest:tt)*) => {
#[cfg(feature = "disable-println")]
#[cfg(all(feature = "disable-println", not(test)))]
{
let _ = format!($($rest)*);
}
#[cfg(not(feature = "disable-println"))]
#[cfg(any(not(feature = "disable-println"), test))]
std::eprintln!($($rest)*)
}
}
@ -32,11 +32,11 @@ macro_rules! eprintln {
#[allow(unused_macros)]
macro_rules! print {
($($rest:tt)*) => {
#[cfg(feature = "disable-println")]
#[cfg(all(feature = "disable-println", not(test)))]
{
let _ = format!($($rest)*);
}
#[cfg(not(feature = "disable-println"))]
#[cfg(any(not(feature = "disable-println"), test))]
std::print!($($rest)*)
}
}
@ -44,11 +44,11 @@ macro_rules! print {
#[allow(unused_macros)]
macro_rules! eprint {
($($rest:tt)*) => {
#[cfg(feature = "disable-println")]
#[cfg(all(feature = "disable-println", not(test)))]
{
let _ = format!($($rest)*);
}
#[cfg(not(feature = "disable-println"))]
#[cfg(any(not(feature = "disable-println"), test))]
std::eprint!($($rest)*)
}
}
@ -108,7 +108,7 @@ pub mod wasm_engine {
pub use crate::{
coredump::wasm::{CoreDumpManager, CoreDumper},
engine::conn_wasm::{EngineCommandManager, EngineConnection},
fs::wasm::FileSystemManager,
fs::wasm::{FileManager, FileSystemManager},
};
}

View File

@ -36,7 +36,7 @@ macro_rules! logln {
}
pub(crate) use logln;
#[cfg(all(not(feature = "disable-println"), not(target_arch = "wasm32")))]
#[cfg(any(test, all(not(feature = "disable-println"), not(target_arch = "wasm32"))))]
#[inline]
fn log_inner(msg: String) {
eprintln!("{msg}");
@ -48,7 +48,7 @@ fn log_inner(msg: String) {
web_sys::console::log_1(&msg.into());
}
#[cfg(feature = "disable-println")]
#[cfg(all(feature = "disable-println", not(test)))]
#[inline]
fn log_inner(_msg: String) {}

View File

@ -36,6 +36,6 @@ async fn main() {
)
.await
.unwrap();
let mut exec_state = ExecState::new(&ctx.settings);
let mut exec_state = ExecState::new(&ctx);
ctx.run(&program, &mut exec_state).await.unwrap();
}

View File

@ -33,6 +33,12 @@ impl ModuleId {
}
}
impl std::fmt::Display for ModuleId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
#[derive(Debug, Clone, Default)]
pub(crate) struct ModuleLoader {
/// The stack of import statements for detecting circular module imports.

View File

@ -2149,7 +2149,7 @@ impl From<&Node<TagDeclarator>> for TagIdentifier {
fn from(tag: &Node<TagDeclarator>) -> Self {
TagIdentifier {
value: tag.name.clone(),
info: None,
info: Vec::new(),
meta: vec![Metadata {
source_range: tag.into(),
}],

View File

@ -149,7 +149,7 @@ async fn execute_test(test: &Test, render_to_png: bool, export_step: bool) {
// due to SSI and GPU.
std::fs::write(test.output_dir.join(EXPORTED_STEP_NAME), step).unwrap();
}
let outcome = exec_state.to_wasm_outcome(env_ref);
let outcome = exec_state.to_wasm_outcome(env_ref).await;
assert_common_snapshots(
test,
outcome.operations,

View File

@ -286,13 +286,16 @@ impl Args {
exec_state: &'e mut ExecState,
tag: &'a TagIdentifier,
) -> Result<&'e crate::execution::TagEngineInfo, KclError> {
if let KclValue::TagIdentifier(t) = exec_state.stack().get_from_call_stack(&tag.value, self.source_range)? {
Ok(t.info.as_ref().ok_or_else(|| {
if let (epoch, KclValue::TagIdentifier(t)) =
exec_state.stack().get_from_call_stack(&tag.value, self.source_range)?
{
let info = t.get_info(epoch).ok_or_else(|| {
KclError::Type(KclErrorDetails {
message: format!("Tag `{}` does not have engine info", tag.value),
source_ranges: vec![self.source_range],
})
})?)
})?;
Ok(info)
} else {
Err(KclError::Type(KclErrorDetails {
message: format!("Tag `{}` does not exist", tag.value),
@ -309,7 +312,7 @@ impl Args {
where
'e: 'a,
{
if let Some(info) = &tag.info {
if let Some(info) = tag.get_cur_info() {
return Ok(info);
}
@ -324,7 +327,7 @@ impl Args {
where
'e: 'a,
{
if let Some(info) = &tag.info {
if let Some(info) = tag.get_cur_info() {
if info.surface.is_some() {
return Ok(info);
}

View File

@ -139,7 +139,7 @@ async fn inner_circle(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -251,7 +251,7 @@ async fn inner_circle_three_point(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -414,7 +414,7 @@ async fn inner_polygon(
};
if let Some(tag) = &tag {
sketch.add_tag(tag, &current_path);
sketch.add_tag(tag, &current_path, exec_state);
}
sketch.paths.push(current_path);
@ -450,7 +450,7 @@ async fn inner_polygon(
};
if let Some(tag) = &tag {
sketch.add_tag(tag, &current_path);
sketch.add_tag(tag, &current_path, exec_state);
}
sketch.paths.push(current_path);

View File

@ -253,7 +253,7 @@ async fn straight_line(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -489,7 +489,7 @@ async fn inner_angled_line(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -1098,6 +1098,8 @@ async fn make_sketch_plane_from_orientation(
let hide = Some(true);
match data {
PlaneData::XY | PlaneData::NegXY | PlaneData::XZ | PlaneData::NegXZ | PlaneData::YZ | PlaneData::NegYZ => {
// TODO: ignoring the default planes here since we already created them, breaks the
// front end for the feature tree which is stupid and we should fix it.
let x_axis = match data {
PlaneData::NegXY => Point3d::new(-1.0, 0.0, 0.0),
PlaneData::NegXZ => Point3d::new(-1.0, 0.0, 0.0),
@ -1278,14 +1280,17 @@ pub(crate) async fn inner_start_profile_at(
meta: vec![args.source_range.into()],
tags: if let Some(tag) = &tag {
let mut tag_identifier: TagIdentifier = tag.into();
tag_identifier.info = Some(TagEngineInfo {
id: current_path.geo_meta.id,
sketch: path_id,
path: Some(Path::Base {
base: current_path.clone(),
}),
surface: None,
});
tag_identifier.info = vec![(
exec_state.stack().current_epoch(),
TagEngineInfo {
id: current_path.geo_meta.id,
sketch: path_id,
path: Some(Path::Base {
base: current_path.clone(),
}),
surface: None,
},
)];
IndexMap::from([(tag.name.to_string(), tag_identifier)])
} else {
Default::default()
@ -1440,7 +1445,7 @@ pub(crate) async fn inner_close(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -1593,7 +1598,7 @@ pub(crate) async fn inner_arc(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -1695,7 +1700,7 @@ pub(crate) async fn inner_arc_to(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -1846,7 +1851,7 @@ async fn inner_tangential_arc(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -1943,7 +1948,7 @@ async fn inner_tangential_arc_to(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -2027,7 +2032,7 @@ async fn inner_tangential_arc_to_relative(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -2123,7 +2128,7 @@ async fn inner_bezier_curve(
let mut new_sketch = sketch.clone();
if let Some(tag) = &tag {
new_sketch.add_tag(tag, &current_path);
new_sketch.add_tag(tag, &current_path, exec_state);
}
new_sketch.paths.push(current_path);
@ -2252,7 +2257,7 @@ mod tests {
str_json = serde_json::to_string(&TagIdentifier {
value: "thing".to_string(),
info: None,
info: Vec::new(),
meta: Default::default(),
})
.unwrap();
@ -2261,7 +2266,7 @@ mod tests {
data,
crate::std::sketch::FaceTag::Tag(Box::new(TagIdentifier {
value: "thing".to_string(),
info: None,
info: Vec::new(),
meta: Default::default()
}))
);

View File

@ -81,7 +81,7 @@ async fn do_execute_and_snapshot(
ctx: &ExecutorContext,
program: Program,
) -> Result<(ExecState, EnvironmentRef, image::DynamicImage), ExecErrorWithState> {
let mut exec_state = ExecState::new(&ctx.settings);
let mut exec_state = ExecState::new(ctx);
let result = ctx
.run(&program, &mut exec_state)
.await
@ -156,7 +156,7 @@ pub async fn execute_and_export_step(
ExecErrorWithState,
> {
let ctx = new_context(units, true, current_file).await?;
let mut exec_state = ExecState::new(&ctx.settings);
let mut exec_state = ExecState::new(&ctx);
let program = Program::parse_no_errs(code)
.map_err(|err| ExecErrorWithState::new(KclErrorWithOutputs::no_outputs(err).into(), exec_state.clone()))?;
let result = ctx

View File

@ -284,56 +284,7 @@ description: Variables in memory after executing angled_line.kcl
"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.04
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
23.08,
5.19
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
142,
0
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -353,55 +304,6 @@ description: Variables in memory after executing angled_line.kcl
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
103,
142,
0
],
"tag": {
"end": 141,
"start": 135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
}

View File

@ -249,109 +249,11 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
95,
131,
0
]
},
"from": [
-5.0,
5.0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
5.55,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
95,
131,
0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
171,
0
]
},
"from": [
5.55,
5.0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
5.55,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
137,
171,
0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -779,109 +681,11 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
95,
131,
0
]
},
"from": [
-5.0,
5.0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
5.55,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
95,
131,
0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
171,
0
]
},
"from": [
5.55,
5.0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
5.55,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
137,
171,
0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -949,110 +753,12 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
95,
131,
0
]
},
"from": [
-5.0,
5.0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
5.55,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
95,
131,
0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
171,
0
]
},
"from": [
5.55,
5.0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
5.55,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
137,
171,
0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
},
"sketch001": {
"type": "Sketch",
@ -1240,109 +946,11 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
95,
131,
0
]
},
"from": [
-5.0,
5.0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
5.55,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
95,
131,
0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
171,
0
]
},
"from": [
5.55,
5.0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
5.55,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
137,
171,
0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -1715,109 +1323,11 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
95,
131,
0
]
},
"from": [
-5.0,
5.0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
5.55,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
95,
131,
0
],
"tag": {
"end": 130,
"start": 124,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
137,
171,
0
]
},
"from": [
5.55,
5.0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
5.55,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
137,
171,
0
],
"tag": {
"end": 170,
"start": 164,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart artifact_graph_example_code_no_3d.kcl
extension: md
snapshot_kind: binary

View File

@ -6,119 +6,17 @@ description: Variables in memory after executing artifact_graph_example_code_no_
"rectangleSegmentA001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentA001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
71,
121,
0
]
},
"from": [
5.82,
0.0
],
"tag": {
"end": 120,
"start": 99,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
-5.72,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentA001"
},
"rectangleSegmentB001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentB001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
127,
227,
0
]
},
"from": [
-5.72,
0.0
],
"tag": {
"end": 226,
"start": 205,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"to": [
-5.72,
8.21
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentB001"
},
"rectangleSegmentC001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentC001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
233,
353,
0
]
},
"from": [
-5.72,
8.21
],
"tag": {
"end": 352,
"start": 331,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
"to": [
5.82,
8.21
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentC001"
},
"sketch003": {
"type": "Sketch",
@ -311,117 +209,15 @@ description: Variables in memory after executing artifact_graph_example_code_no_
"tags": {
"rectangleSegmentA001": {
"type": "TagIdentifier",
"value": "rectangleSegmentA001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
71,
121,
0
]
},
"from": [
5.82,
0.0
],
"tag": {
"end": 120,
"start": 99,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
-5.72,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentA001"
},
"rectangleSegmentB001": {
"type": "TagIdentifier",
"value": "rectangleSegmentB001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
127,
227,
0
]
},
"from": [
-5.72,
0.0
],
"tag": {
"end": 226,
"start": 205,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"to": [
-5.72,
8.21
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentB001"
},
"rectangleSegmentC001": {
"type": "TagIdentifier",
"value": "rectangleSegmentC001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
233,
353,
0
]
},
"from": [
-5.72,
8.21
],
"tag": {
"end": 352,
"start": 331,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
"to": [
5.82,
8.21
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentC001"
}
},
"artifactId": "[uuid]",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart artifact_graph_example_code_offset_planes.kcl
extension: md
snapshot_kind: binary

View File

@ -205,56 +205,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -629,56 +580,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -1258,56 +1160,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -1391,56 +1244,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
577,
611,
0
]
},
"from": [
1.0,
1.5
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
1.5,
3.5
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
577,
611,
0
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -2137,56 +1941,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -2270,56 +2025,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
577,
611,
0
]
},
"from": [
1.0,
1.5
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
1.5,
3.5
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
577,
611,
0
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -2378,110 +2084,12 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
577,
611,
0
]
},
"from": [
1.0,
1.5
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
1.5,
3.5
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
577,
611,
0
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
},
"sketch001": {
"type": "Sketch",
@ -2641,56 +2249,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -3019,56 +2578,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -3597,56 +3107,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -3730,56 +3191,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
577,
611,
0
]
},
"from": [
1.0,
1.5
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
1.5,
3.5
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
577,
611,
0
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -4430,56 +3842,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
92,
125,
0
]
},
"from": [
4.0,
8.0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
9.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
92,
125,
0
],
"tag": {
"end": 124,
"start": 118,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -4563,56 +3926,7 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
577,
611,
0
]
},
"from": [
1.0,
1.5
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
1.5,
3.5
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
577,
611,
0
],
"tag": {
"end": 610,
"start": 604,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",

View File

@ -236,162 +236,15 @@ description: Variables in memory after executing basic_fillet_cube_close_opposit
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
},
"thing3": {
"type": "TagIdentifier",
"value": "thing3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
171,
191,
0
]
},
"from": [
10.0,
0.0
],
"tag": {
"end": 190,
"start": 183,
"type": "TagDeclarator",
"value": "thing3"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
171,
191,
0
],
"tag": {
"end": 190,
"start": 183,
"type": "TagDeclarator",
"value": "thing3"
},
"type": "extrudePlane"
}
}
"value": "thing3"
}
},
"artifactId": "[uuid]",
@ -427,163 +280,16 @@ description: Variables in memory after executing basic_fillet_cube_close_opposit
"thing": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
},
"thing3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
171,
191,
0
]
},
"from": [
10.0,
0.0
],
"tag": {
"end": 190,
"start": 183,
"type": "TagDeclarator",
"value": "thing3"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
171,
191,
0
],
"tag": {
"end": 190,
"start": 183,
"type": "TagDeclarator",
"value": "thing3"
},
"type": "extrudePlane"
}
}
"value": "thing3"
}
}

View File

@ -226,109 +226,11 @@ description: Variables in memory after executing basic_fillet_cube_end.kcl
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
}
},
"artifactId": "[uuid]",
@ -364,109 +266,11 @@ description: Variables in memory after executing basic_fillet_cube_end.kcl
"thing": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
}
}

View File

@ -246,215 +246,19 @@ description: Variables in memory after executing basic_fillet_cube_next_adjacent
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"thing1": {
"type": "TagIdentifier",
"value": "thing1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
139,
0
]
},
"from": [
0.0,
10.0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
105,
139,
0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"type": "extrudePlane"
}
}
"value": "thing1"
},
"thing2": {
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
145,
180,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
145,
180,
0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
},
"thing3": {
"type": "TagIdentifier",
"value": "thing3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
186,
206,
0
]
},
"from": [
10.0,
0.0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
186,
206,
0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"type": "extrudePlane"
}
}
"value": "thing3"
}
},
"artifactId": "[uuid]",
@ -483,217 +287,21 @@ description: Variables in memory after executing basic_fillet_cube_next_adjacent
"thing": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"thing1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
139,
0
]
},
"from": [
0.0,
10.0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
105,
139,
0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"type": "extrudePlane"
}
}
"value": "thing1"
},
"thing2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
145,
180,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
145,
180,
0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
},
"thing3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
186,
206,
0
]
},
"from": [
10.0,
0.0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
186,
206,
0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"type": "extrudePlane"
}
}
"value": "thing3"
}
}

View File

@ -246,215 +246,19 @@ description: Variables in memory after executing basic_fillet_cube_previous_adja
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"thing1": {
"type": "TagIdentifier",
"value": "thing1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
139,
0
]
},
"from": [
0.0,
10.0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
105,
139,
0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"type": "extrudePlane"
}
}
"value": "thing1"
},
"thing2": {
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
145,
180,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
145,
180,
0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
},
"thing3": {
"type": "TagIdentifier",
"value": "thing3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
186,
206,
0
]
},
"from": [
10.0,
0.0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
186,
206,
0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"type": "extrudePlane"
}
}
"value": "thing3"
}
},
"artifactId": "[uuid]",
@ -483,217 +287,21 @@ description: Variables in memory after executing basic_fillet_cube_previous_adja
"thing": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"thing1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
105,
139,
0
]
},
"from": [
0.0,
10.0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
105,
139,
0
],
"tag": {
"end": 138,
"start": 131,
"type": "TagDeclarator",
"value": "thing1"
},
"type": "extrudePlane"
}
}
"value": "thing1"
},
"thing2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
145,
180,
0
]
},
"from": [
10.0,
10.0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"to": [
10.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
145,
180,
0
],
"tag": {
"end": 179,
"start": 172,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
},
"thing3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "thing3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
186,
206,
0
]
},
"from": [
10.0,
0.0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
186,
206,
0
],
"tag": {
"end": 205,
"start": 198,
"type": "TagDeclarator",
"value": "thing3"
},
"type": "extrudePlane"
}
}
"value": "thing3"
}
}

View File

@ -226,109 +226,11 @@ description: Variables in memory after executing basic_fillet_cube_start.kcl
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
}
},
"artifactId": "[uuid]",
@ -364,109 +266,11 @@ description: Variables in memory after executing basic_fillet_cube_start.kcl
"thing": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
99,
0
],
"tag": {
"end": 98,
"start": 92,
"type": "TagDeclarator",
"value": "thing"
},
"type": "extrudePlane"
}
}
"value": "thing"
},
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
130,
165,
0
],
"tag": {
"end": 164,
"start": 157,
"type": "TagDeclarator",
"value": "thing2"
},
"type": "extrudePlane"
}
}
"value": "thing2"
}
}

View File

@ -182,56 +182,7 @@ description: Variables in memory after executing big_number_angle_to_match_lengt
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -251,55 +202,6 @@ description: Variables in memory after executing big_number_angle_to_match_lengt
"seg01": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
}

View File

@ -182,56 +182,7 @@ description: Variables in memory after executing big_number_angle_to_match_lengt
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -251,55 +202,6 @@ description: Variables in memory after executing big_number_angle_to_match_lengt
"seg01": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
66,
101,
0
],
"tag": {
"end": 100,
"start": 94,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
}

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart circle_three_point.kcl
extension: md
snapshot_kind: binary

File diff suppressed because it is too large Load Diff

View File

@ -259,215 +259,19 @@ description: Variables in memory after executing fillet-and-shell.kcl
"tags": {
"edge1": {
"type": "TagIdentifier",
"value": "edge1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
860,
908,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 907,
"start": 901,
"type": "TagDeclarator",
"value": "edge1"
},
"to": [
38.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
860,
908,
0
],
"tag": {
"end": 907,
"start": 901,
"type": "TagDeclarator",
"value": "edge1"
},
"type": "extrudePlane"
}
}
"value": "edge1"
},
"edge2": {
"type": "TagIdentifier",
"value": "edge2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
914,
971,
0
]
},
"from": [
38.0,
0.0
],
"tag": {
"end": 970,
"start": 964,
"type": "TagDeclarator",
"value": "edge2"
},
"to": [
38.0,
73.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
914,
971,
0
],
"tag": {
"end": 970,
"start": 964,
"type": "TagDeclarator",
"value": "edge2"
},
"type": "extrudePlane"
}
}
"value": "edge2"
},
"edge3": {
"type": "TagIdentifier",
"value": "edge3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
977,
1026,
0
]
},
"from": [
38.0,
73.0
],
"tag": {
"end": 1025,
"start": 1019,
"type": "TagDeclarator",
"value": "edge3"
},
"to": [
0.0,
73.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
977,
1026,
0
],
"tag": {
"end": 1025,
"start": 1019,
"type": "TagDeclarator",
"value": "edge3"
},
"type": "extrudePlane"
}
}
"value": "edge3"
},
"edge4": {
"type": "TagIdentifier",
"value": "edge4",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1032,
1051,
0
]
},
"from": [
0.0,
73.0
],
"tag": {
"end": 1050,
"start": 1044,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1032,
1051,
0
],
"tag": {
"end": 1050,
"start": 1044,
"type": "TagDeclarator",
"value": "edge4"
},
"type": "extrudePlane"
}
}
"value": "edge4"
}
},
"artifactId": "[uuid]",
@ -570,218 +374,22 @@ description: Variables in memory after executing fillet-and-shell.kcl
"edge1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
860,
908,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 907,
"start": 901,
"type": "TagDeclarator",
"value": "edge1"
},
"to": [
38.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
860,
908,
0
],
"tag": {
"end": 907,
"start": 901,
"type": "TagDeclarator",
"value": "edge1"
},
"type": "extrudePlane"
}
}
"value": "edge1"
},
"edge2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
914,
971,
0
]
},
"from": [
38.0,
0.0
],
"tag": {
"end": 970,
"start": 964,
"type": "TagDeclarator",
"value": "edge2"
},
"to": [
38.0,
73.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
914,
971,
0
],
"tag": {
"end": 970,
"start": 964,
"type": "TagDeclarator",
"value": "edge2"
},
"type": "extrudePlane"
}
}
"value": "edge2"
},
"edge3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
977,
1026,
0
]
},
"from": [
38.0,
73.0
],
"tag": {
"end": 1025,
"start": 1019,
"type": "TagDeclarator",
"value": "edge3"
},
"to": [
0.0,
73.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
977,
1026,
0
],
"tag": {
"end": 1025,
"start": 1019,
"type": "TagDeclarator",
"value": "edge3"
},
"type": "extrudePlane"
}
}
"value": "edge3"
},
"edge4": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge4",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1032,
1051,
0
]
},
"from": [
0.0,
73.0
],
"tag": {
"end": 1050,
"start": 1044,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1032,
1051,
0
],
"tag": {
"end": 1050,
"start": 1044,
"type": "TagDeclarator",
"value": "edge4"
},
"type": "extrudePlane"
}
}
"value": "edge4"
},
"lengthBetweenScrews": {
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart flush_batch_on_end.kcl
extension: md
snapshot_kind: binary

View File

@ -6,107 +6,12 @@ description: Variables in memory after executing flush_batch_on_end.kcl
"arc000": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc000",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
282,
374,
0
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
0.2734,
0.0
],
"radius": 0.2734375,
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"to": [
0.2734,
0.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
282,
374,
0
],
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"type": "extrudeArc"
}
}
"value": "arc000"
},
"arc001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "arc001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
437,
529,
0
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
0.182,
0.0
],
"radius": 0.182,
"tag": {
"end": 526,
"start": 519,
"type": "TagDeclarator",
"value": "arc001"
},
"to": [
0.182,
0.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
},
"surface": null
}
"value": "arc001"
},
"innerDiameter": {
"type": "Number",
@ -216,47 +121,7 @@ description: Variables in memory after executing flush_batch_on_end.kcl
"tags": {
"arc001": {
"type": "TagIdentifier",
"value": "arc001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
437,
529,
0
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
0.182,
0.0
],
"radius": 0.182,
"tag": {
"end": 526,
"start": 519,
"type": "TagDeclarator",
"value": "arc001"
},
"to": [
0.182,
0.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
},
"surface": null
}
"value": "arc001"
}
},
"artifactId": "[uuid]",
@ -375,62 +240,7 @@ description: Variables in memory after executing flush_batch_on_end.kcl
"tags": {
"arc000": {
"type": "TagIdentifier",
"value": "arc000",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
282,
374,
0
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
0.2734,
0.0
],
"radius": 0.2734375,
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"to": [
0.2734,
0.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
282,
374,
0
],
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"type": "extrudeArc"
}
}
"value": "arc000"
}
},
"artifactId": "[uuid]",
@ -557,62 +367,7 @@ description: Variables in memory after executing flush_batch_on_end.kcl
"tags": {
"arc000": {
"type": "TagIdentifier",
"value": "arc000",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
282,
374,
0
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
0.2734,
0.0
],
"radius": 0.2734375,
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"to": [
0.2734,
0.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
282,
374,
0
],
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"type": "extrudeArc"
}
}
"value": "arc000"
}
},
"artifactId": "[uuid]",
@ -724,62 +479,7 @@ description: Variables in memory after executing flush_batch_on_end.kcl
"tags": {
"arc000": {
"type": "TagIdentifier",
"value": "arc000",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
282,
374,
0
]
},
"ccw": true,
"center": [
0.0,
0.0
],
"from": [
0.2734,
0.0
],
"radius": 0.2734375,
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"to": [
0.2734,
0.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
282,
374,
0
],
"tag": {
"end": 371,
"start": 364,
"type": "TagDeclarator",
"value": "arc000"
},
"type": "extrudeArc"
}
}
"value": "arc000"
}
},
"artifactId": "[uuid]",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart helix_ccw.kcl
extension: md
snapshot_kind: binary

View File

@ -6,41 +6,7 @@ description: Variables in memory after executing helix_simple.kcl
"edge001": {
"type": "TagIdentifier",
"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",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "edge001"
},
"helixPath": {
"type": "Helix",
@ -144,41 +110,7 @@ description: Variables in memory after executing helix_simple.kcl
"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",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "edge001"
}
},
"artifactId": "[uuid]",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart import_whole.kcl
extension: md
snapshot_kind: binary

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart cycloidal-gear.kcl
extension: md
snapshot_kind: binary

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart dodecahedron.kcl
extension: md
snapshot_kind: binary

File diff suppressed because it is too large Load Diff

View File

@ -765,374 +765,31 @@ description: Variables in memory after executing exhaust-manifold.kcl
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1905,
1939,
0
]
},
"from": [
4.3,
-1.25
],
"tag": {
"end": 1938,
"start": 1932,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.7,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1905,
1939,
0
],
"tag": {
"end": 1938,
"start": 1932,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg03": {
"type": "TagIdentifier",
"value": "seg03",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2103,
2137,
0
]
},
"from": [
0.1573,
-1.25
],
"tag": {
"end": 2136,
"start": 2130,
"type": "TagDeclarator",
"value": "seg03"
},
"to": [
-1.2427,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2103,
2137,
0
],
"tag": {
"end": 2136,
"start": 2130,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "extrudePlane"
}
}
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"value": "seg04",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2143,
2186,
0
]
},
"from": [
-1.2427,
-1.25
],
"tag": {
"end": 2185,
"start": 2179,
"type": "TagDeclarator",
"value": "seg04"
},
"to": [
-1.2427,
1.35
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2143,
2186,
0
],
"tag": {
"end": 2185,
"start": 2179,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "extrudePlane"
}
}
"value": "seg04"
},
"seg05": {
"type": "TagIdentifier",
"value": "seg05",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2192,
2225,
0
]
},
"from": [
-1.2427,
1.35
],
"tag": {
"end": 2224,
"start": 2218,
"type": "TagDeclarator",
"value": "seg05"
},
"to": [
1.8573,
1.35
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2192,
2225,
0
],
"tag": {
"end": 2224,
"start": 2218,
"type": "TagDeclarator",
"value": "seg05"
},
"type": "extrudePlane"
}
}
"value": "seg05"
},
"seg07": {
"type": "TagIdentifier",
"value": "seg07",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2390,
2433,
0
]
},
"from": [
4.1713,
1.35
],
"tag": {
"end": 2432,
"start": 2426,
"type": "TagDeclarator",
"value": "seg07"
},
"to": [
7.2713,
1.35
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2390,
2433,
0
],
"tag": {
"end": 2432,
"start": 2426,
"type": "TagDeclarator",
"value": "seg07"
},
"type": "extrudePlane"
}
}
"value": "seg07"
},
"seg08": {
"type": "TagIdentifier",
"value": "seg08",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2439,
2490,
0
]
},
"from": [
7.2713,
1.35
],
"tag": {
"end": 2489,
"start": 2483,
"type": "TagDeclarator",
"value": "seg08"
},
"to": [
7.2713,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2439,
2490,
0
],
"tag": {
"end": 2489,
"start": 2483,
"type": "TagDeclarator",
"value": "seg08"
},
"type": "extrudePlane"
}
}
"value": "seg08"
},
"seg09": {
"type": "TagIdentifier",
"value": "seg09",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2496,
2540,
0
]
},
"from": [
7.2713,
-1.25
],
"tag": {
"end": 2539,
"start": 2533,
"type": "TagDeclarator",
"value": "seg09"
},
"to": [
5.8713,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2496,
2540,
0
],
"tag": {
"end": 2539,
"start": 2533,
"type": "TagDeclarator",
"value": "seg09"
},
"type": "extrudePlane"
}
}
"value": "seg09"
}
},
"artifactId": "[uuid]",
@ -1211,380 +868,37 @@ description: Variables in memory after executing exhaust-manifold.kcl
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1905,
1939,
0
]
},
"from": [
4.3,
-1.25
],
"tag": {
"end": 1938,
"start": 1932,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
1.7,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1905,
1939,
0
],
"tag": {
"end": 1938,
"start": 1932,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg03": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg03",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2103,
2137,
0
]
},
"from": [
0.1573,
-1.25
],
"tag": {
"end": 2136,
"start": 2130,
"type": "TagDeclarator",
"value": "seg03"
},
"to": [
-1.2427,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2103,
2137,
0
],
"tag": {
"end": 2136,
"start": 2130,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "extrudePlane"
}
}
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg04",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2143,
2186,
0
]
},
"from": [
-1.2427,
-1.25
],
"tag": {
"end": 2185,
"start": 2179,
"type": "TagDeclarator",
"value": "seg04"
},
"to": [
-1.2427,
1.35
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2143,
2186,
0
],
"tag": {
"end": 2185,
"start": 2179,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "extrudePlane"
}
}
"value": "seg04"
},
"seg05": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg05",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2192,
2225,
0
]
},
"from": [
-1.2427,
1.35
],
"tag": {
"end": 2224,
"start": 2218,
"type": "TagDeclarator",
"value": "seg05"
},
"to": [
1.8573,
1.35
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2192,
2225,
0
],
"tag": {
"end": 2224,
"start": 2218,
"type": "TagDeclarator",
"value": "seg05"
},
"type": "extrudePlane"
}
}
"value": "seg05"
},
"seg07": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg07",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2390,
2433,
0
]
},
"from": [
4.1713,
1.35
],
"tag": {
"end": 2432,
"start": 2426,
"type": "TagDeclarator",
"value": "seg07"
},
"to": [
7.2713,
1.35
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2390,
2433,
0
],
"tag": {
"end": 2432,
"start": 2426,
"type": "TagDeclarator",
"value": "seg07"
},
"type": "extrudePlane"
}
}
"value": "seg07"
},
"seg08": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg08",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2439,
2490,
0
]
},
"from": [
7.2713,
1.35
],
"tag": {
"end": 2489,
"start": 2483,
"type": "TagDeclarator",
"value": "seg08"
},
"to": [
7.2713,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2439,
2490,
0
],
"tag": {
"end": 2489,
"start": 2483,
"type": "TagDeclarator",
"value": "seg08"
},
"type": "extrudePlane"
}
}
"value": "seg08"
},
"seg09": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg09",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2496,
2540,
0
]
},
"from": [
7.2713,
-1.25
],
"tag": {
"end": 2539,
"start": 2533,
"type": "TagDeclarator",
"value": "seg09"
},
"to": [
5.8713,
-1.25
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2496,
2540,
0
],
"tag": {
"end": 2539,
"start": 2533,
"type": "TagDeclarator",
"value": "seg09"
},
"type": "extrudePlane"
}
}
"value": "seg09"
},
"wallThickness": {
"type": "Number",

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart hex-nut.kcl
extension: md
snapshot_kind: binary

File diff suppressed because it is too large Load Diff

View File

@ -19,218 +19,22 @@ description: Variables in memory after executing mounting-plate.kcl
"edge1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
630,
698,
0
]
},
"from": [
-3.0,
-5.0
],
"tag": {
"end": 697,
"start": 691,
"type": "TagDeclarator",
"value": "edge1"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
630,
698,
0
],
"tag": {
"end": 697,
"start": 691,
"type": "TagDeclarator",
"value": "edge1"
},
"type": "extrudePlane"
}
}
"value": "edge1"
},
"edge2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
706,
772,
0
]
},
"from": [
3.0,
-5.0
],
"tag": {
"end": 771,
"start": 765,
"type": "TagDeclarator",
"value": "edge2"
},
"to": [
3.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
706,
772,
0
],
"tag": {
"end": 771,
"start": 765,
"type": "TagDeclarator",
"value": "edge2"
},
"type": "extrudePlane"
}
}
"value": "edge2"
},
"edge3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
780,
848,
0
]
},
"from": [
3.0,
5.0
],
"tag": {
"end": 847,
"start": 841,
"type": "TagDeclarator",
"value": "edge3"
},
"to": [
-3.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
780,
848,
0
],
"tag": {
"end": 847,
"start": 841,
"type": "TagDeclarator",
"value": "edge3"
},
"type": "extrudePlane"
}
}
"value": "edge3"
},
"edge4": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge4",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
856,
875,
0
]
},
"from": [
-3.0,
5.0
],
"tag": {
"end": 874,
"start": 868,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [
-3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
856,
875,
0
],
"tag": {
"end": 874,
"start": 868,
"type": "TagDeclarator",
"value": "edge4"
},
"type": "extrudePlane"
}
}
"value": "edge4"
},
"filletRadius": {
"type": "Number",
@ -514,215 +318,19 @@ description: Variables in memory after executing mounting-plate.kcl
"tags": {
"edge1": {
"type": "TagIdentifier",
"value": "edge1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
630,
698,
0
]
},
"from": [
-3.0,
-5.0
],
"tag": {
"end": 697,
"start": 691,
"type": "TagDeclarator",
"value": "edge1"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
630,
698,
0
],
"tag": {
"end": 697,
"start": 691,
"type": "TagDeclarator",
"value": "edge1"
},
"type": "extrudePlane"
}
}
"value": "edge1"
},
"edge2": {
"type": "TagIdentifier",
"value": "edge2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
706,
772,
0
]
},
"from": [
3.0,
-5.0
],
"tag": {
"end": 771,
"start": 765,
"type": "TagDeclarator",
"value": "edge2"
},
"to": [
3.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
706,
772,
0
],
"tag": {
"end": 771,
"start": 765,
"type": "TagDeclarator",
"value": "edge2"
},
"type": "extrudePlane"
}
}
"value": "edge2"
},
"edge3": {
"type": "TagIdentifier",
"value": "edge3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
780,
848,
0
]
},
"from": [
3.0,
5.0
],
"tag": {
"end": 847,
"start": 841,
"type": "TagDeclarator",
"value": "edge3"
},
"to": [
-3.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
780,
848,
0
],
"tag": {
"end": 847,
"start": 841,
"type": "TagDeclarator",
"value": "edge3"
},
"type": "extrudePlane"
}
}
"value": "edge3"
},
"edge4": {
"type": "TagIdentifier",
"value": "edge4",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
856,
875,
0
]
},
"from": [
-3.0,
5.0
],
"tag": {
"end": 874,
"start": 868,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [
-3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
856,
875,
0
],
"tag": {
"end": 874,
"start": 868,
"type": "TagDeclarator",
"value": "edge4"
},
"type": "extrudePlane"
}
}
"value": "edge4"
}
},
"artifactId": "[uuid]",
@ -984,215 +592,19 @@ description: Variables in memory after executing mounting-plate.kcl
"tags": {
"edge1": {
"type": "TagIdentifier",
"value": "edge1",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
630,
698,
0
]
},
"from": [
-3.0,
-5.0
],
"tag": {
"end": 697,
"start": 691,
"type": "TagDeclarator",
"value": "edge1"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
630,
698,
0
],
"tag": {
"end": 697,
"start": 691,
"type": "TagDeclarator",
"value": "edge1"
},
"type": "extrudePlane"
}
}
"value": "edge1"
},
"edge2": {
"type": "TagIdentifier",
"value": "edge2",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
706,
772,
0
]
},
"from": [
3.0,
-5.0
],
"tag": {
"end": 771,
"start": 765,
"type": "TagDeclarator",
"value": "edge2"
},
"to": [
3.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
706,
772,
0
],
"tag": {
"end": 771,
"start": 765,
"type": "TagDeclarator",
"value": "edge2"
},
"type": "extrudePlane"
}
}
"value": "edge2"
},
"edge3": {
"type": "TagIdentifier",
"value": "edge3",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
780,
848,
0
]
},
"from": [
3.0,
5.0
],
"tag": {
"end": 847,
"start": 841,
"type": "TagDeclarator",
"value": "edge3"
},
"to": [
-3.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
780,
848,
0
],
"tag": {
"end": 847,
"start": 841,
"type": "TagDeclarator",
"value": "edge3"
},
"type": "extrudePlane"
}
}
"value": "edge3"
},
"edge4": {
"type": "TagIdentifier",
"value": "edge4",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
856,
875,
0
]
},
"from": [
-3.0,
5.0
],
"tag": {
"end": 874,
"start": 868,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [
-3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
856,
875,
0
],
"tag": {
"end": 874,
"start": 868,
"type": "TagDeclarator",
"value": "edge4"
},
"type": "extrudePlane"
}
}
"value": "edge4"
}
},
"artifactId": "[uuid]",

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart pipe-with-bend.kcl
extension: md
snapshot_kind: binary

View File

@ -1127,56 +1127,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
367,
424,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 423,
"start": 417,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
367,
424,
0
],
"tag": {
"end": 423,
"start": 417,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -1196,218 +1147,22 @@ description: Variables in memory after executing poopy-shoe.kcl
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
367,
424,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 423,
"start": 417,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
367,
424,
0
],
"tag": {
"end": 423,
"start": 417,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg03",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
3511,
3547,
0
]
},
"from": [
7.0,
1.0
],
"tag": {
"end": 3546,
"start": 3540,
"type": "TagDeclarator",
"value": "seg03"
},
"to": [
7.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
3511,
3547,
0
],
"tag": {
"end": 3546,
"start": 3540,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "extrudePlane"
}
}
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg04",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2882,
2901,
0
]
},
"from": [
7.0,
0.0
],
"tag": {
"end": 2900,
"start": 2894,
"type": "TagDeclarator",
"value": "seg04"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2882,
2901,
0
],
"tag": {
"end": 2900,
"start": 2894,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "extrudePlane"
}
}
"value": "seg04"
},
"sketch001": {
"type": "Sketch",
@ -1774,56 +1529,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
367,
424,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 423,
"start": 417,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
367,
424,
0
],
"tag": {
"end": 423,
"start": 417,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -2352,56 +2058,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -3581,56 +3238,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -3675,56 +3283,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg04": {
"type": "TagIdentifier",
"value": "seg04",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2882,
2901,
0
]
},
"from": [
7.0,
0.0
],
"tag": {
"end": 2900,
"start": 2894,
"type": "TagDeclarator",
"value": "seg04"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2882,
2901,
0
],
"tag": {
"end": 2900,
"start": 2894,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "extrudePlane"
}
}
"value": "seg04"
}
},
"artifactId": "[uuid]",
@ -4032,56 +3591,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg03": {
"type": "TagIdentifier",
"value": "seg03",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
3511,
3547,
0
]
},
"from": [
7.0,
1.0
],
"tag": {
"end": 3546,
"start": 3540,
"type": "TagDeclarator",
"value": "seg03"
},
"to": [
7.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
3511,
3547,
0
],
"tag": {
"end": 3546,
"start": 3540,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "extrudePlane"
}
}
"value": "seg03"
}
},
"artifactId": "[uuid]",
@ -4556,56 +4066,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg03": {
"type": "TagIdentifier",
"value": "seg03",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
3511,
3547,
0
]
},
"from": [
7.0,
1.0
],
"tag": {
"end": 3546,
"start": 3540,
"type": "TagDeclarator",
"value": "seg03"
},
"to": [
7.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
3511,
3547,
0
],
"tag": {
"end": 3546,
"start": 3540,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "extrudePlane"
}
}
"value": "seg03"
}
},
"artifactId": "[uuid]",
@ -5806,56 +5267,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
]
},
"from": [
1.5625,
0.0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
3.0,
2.4898
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1168,
1225,
0
],
"tag": {
"end": 1224,
"start": 1218,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",
@ -5900,56 +5312,7 @@ description: Variables in memory after executing poopy-shoe.kcl
"tags": {
"seg04": {
"type": "TagIdentifier",
"value": "seg04",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
2882,
2901,
0
]
},
"from": [
7.0,
0.0
],
"tag": {
"end": 2900,
"start": 2894,
"type": "TagDeclarator",
"value": "seg04"
},
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
2882,
2901,
0
],
"tag": {
"end": 2900,
"start": 2894,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "extrudePlane"
}
}
"value": "seg04"
}
},
"artifactId": "[uuid]",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart washer.kcl
extension: md
snapshot_kind: binary

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart pentagon_fillet_sugar.kcl
extension: md
snapshot_kind: binary

File diff suppressed because it is too large Load Diff

View File

@ -639,56 +639,7 @@ description: Variables in memory after executing poop_chute.kcl
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
298,
361,
0
]
},
"from": [
1.0625,
0.0
],
"tag": {
"end": 360,
"start": 354,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
2.0,
0.9375
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
298,
361,
0
],
"tag": {
"end": 360,
"start": 354,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -708,110 +659,12 @@ description: Variables in memory after executing poop_chute.kcl
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
298,
361,
0
]
},
"from": [
1.0625,
0.0
],
"tag": {
"end": 360,
"start": 354,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
2.0,
0.9375
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
298,
361,
0
],
"tag": {
"end": 360,
"start": 354,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1145,
1208,
0
]
},
"from": [
1.0625,
0.0
],
"tag": {
"end": 1207,
"start": 1201,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
2.0,
0.9375
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1145,
1208,
0
],
"tag": {
"end": 1207,
"start": 1201,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
},
"sketch001": {
"type": "Sketch",
@ -1178,56 +1031,7 @@ description: Variables in memory after executing poop_chute.kcl
"tags": {
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
298,
361,
0
]
},
"from": [
1.0625,
0.0
],
"tag": {
"end": 360,
"start": 354,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
2.0,
0.9375
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
298,
361,
0
],
"tag": {
"end": 360,
"start": 354,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -1756,56 +1560,7 @@ description: Variables in memory after executing poop_chute.kcl
"tags": {
"seg02": {
"type": "TagIdentifier",
"value": "seg02",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1145,
1208,
0
]
},
"from": [
1.0625,
0.0
],
"tag": {
"end": 1207,
"start": 1201,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
2.0,
0.9375
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1145,
1208,
0
],
"tag": {
"end": 1207,
"start": 1201,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
}
}
"value": "seg02"
}
},
"artifactId": "[uuid]",

View File

@ -6,41 +6,7 @@ description: Variables in memory after executing revolve_about_edge.kcl
"rectangleSegmentB001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentB001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
71,
119,
0
]
},
"from": [
-25.0,
25.0
],
"tag": {
"end": 118,
"start": 97,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"to": [
-25.0,
-25.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentB001"
},
"sketch001": {
"type": "Sketch",
@ -131,41 +97,7 @@ description: Variables in memory after executing revolve_about_edge.kcl
"tags": {
"rectangleSegmentB001": {
"type": "TagIdentifier",
"value": "rectangleSegmentB001",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
71,
119,
0
]
},
"from": [
-25.0,
25.0
],
"tag": {
"end": 118,
"start": 97,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"to": [
-25.0,
-25.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": null
}
"value": "rectangleSegmentB001"
}
},
"artifactId": "[uuid]",

View File

@ -6,56 +6,7 @@ description: Variables in memory after executing sketch_on_face.kcl
"here": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "here",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
74,
114,
0
]
},
"from": [
11.19,
28.35
],
"tag": {
"end": 113,
"start": 108,
"type": "TagDeclarator",
"value": "here"
},
"to": [
39.86,
15.1
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
74,
114,
0
],
"tag": {
"end": 113,
"start": 108,
"type": "TagDeclarator",
"value": "here"
},
"type": "extrudePlane"
}
}
"value": "here"
},
"part001": {
"type": "Solid",
@ -270,56 +221,7 @@ description: Variables in memory after executing sketch_on_face.kcl
"tags": {
"here": {
"type": "TagIdentifier",
"value": "here",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
74,
114,
0
]
},
"from": [
11.19,
28.35
],
"tag": {
"end": 113,
"start": 108,
"type": "TagDeclarator",
"value": "here"
},
"to": [
39.86,
15.1
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
74,
114,
0
],
"tag": {
"end": 113,
"start": 108,
"type": "TagDeclarator",
"value": "here"
},
"type": "extrudePlane"
}
}
"value": "here"
}
},
"artifactId": "[uuid]",
@ -716,56 +618,7 @@ description: Variables in memory after executing sketch_on_face.kcl
"tags": {
"here": {
"type": "TagIdentifier",
"value": "here",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
74,
114,
0
]
},
"from": [
11.19,
28.35
],
"tag": {
"end": 113,
"start": 108,
"type": "TagDeclarator",
"value": "here"
},
"to": [
39.86,
15.1
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
74,
114,
0
],
"tag": {
"end": 113,
"start": 108,
"type": "TagDeclarator",
"value": "here"
},
"type": "extrudePlane"
}
}
"value": "here"
}
},
"artifactId": "[uuid]",

View File

@ -337,162 +337,15 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"tags": {
"innerEdge": {
"type": "TagIdentifier",
"value": "innerEdge",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1181,
1239,
0
]
},
"from": [
-8.0,
5.6793
],
"tag": {
"end": 1238,
"start": 1228,
"type": "TagDeclarator",
"value": "innerEdge"
},
"to": [
-0.3207,
5.6793
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1181,
1239,
0
],
"tag": {
"end": 1238,
"start": 1228,
"type": "TagDeclarator",
"value": "innerEdge"
},
"type": "extrudePlane"
}
}
"value": "innerEdge"
},
"outerEdge": {
"type": "TagIdentifier",
"value": "outerEdge",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1048,
1093,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 1092,
"start": 1082,
"type": "TagDeclarator",
"value": "outerEdge"
},
"to": [
0.0,
6.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1048,
1093,
0
],
"tag": {
"end": 1092,
"start": 1082,
"type": "TagDeclarator",
"value": "outerEdge"
},
"type": "extrudePlane"
}
}
"value": "outerEdge"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1099,
1142,
0
]
},
"from": [
0.0,
6.0
],
"tag": {
"end": 1141,
"start": 1135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
-8.0,
6.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1099,
1142,
0
],
"tag": {
"end": 1141,
"start": 1135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",
@ -541,110 +394,12 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"innerEdge": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "innerEdge",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1181,
1239,
0
]
},
"from": [
-8.0,
5.6793
],
"tag": {
"end": 1238,
"start": 1228,
"type": "TagDeclarator",
"value": "innerEdge"
},
"to": [
-0.3207,
5.6793
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1181,
1239,
0
],
"tag": {
"end": 1238,
"start": 1228,
"type": "TagDeclarator",
"value": "innerEdge"
},
"type": "extrudePlane"
}
}
"value": "innerEdge"
},
"outerEdge": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "outerEdge",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1048,
1093,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 1092,
"start": 1082,
"type": "TagDeclarator",
"value": "outerEdge"
},
"to": [
0.0,
6.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1048,
1093,
0
],
"tag": {
"end": 1092,
"start": 1082,
"type": "TagDeclarator",
"value": "outerEdge"
},
"type": "extrudePlane"
}
}
"value": "outerEdge"
},
"p": {
"type": "Number",
@ -662,56 +417,7 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1099,
1142,
0
]
},
"from": [
0.0,
6.0
],
"tag": {
"end": 1141,
"start": 1135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
-8.0,
6.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1099,
1142,
0
],
"tag": {
"end": 1141,
"start": 1135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
},
"shelfMountL": {
"type": "Number",
@ -1230,162 +936,15 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"tags": {
"innerEdge": {
"type": "TagIdentifier",
"value": "innerEdge",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1181,
1239,
0
]
},
"from": [
-8.0,
5.6793
],
"tag": {
"end": 1238,
"start": 1228,
"type": "TagDeclarator",
"value": "innerEdge"
},
"to": [
-0.3207,
5.6793
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1181,
1239,
0
],
"tag": {
"end": 1238,
"start": 1228,
"type": "TagDeclarator",
"value": "innerEdge"
},
"type": "extrudePlane"
}
}
"value": "innerEdge"
},
"outerEdge": {
"type": "TagIdentifier",
"value": "outerEdge",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1048,
1093,
0
]
},
"from": [
0.0,
0.0
],
"tag": {
"end": 1092,
"start": 1082,
"type": "TagDeclarator",
"value": "outerEdge"
},
"to": [
0.0,
6.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1048,
1093,
0
],
"tag": {
"end": 1092,
"start": 1082,
"type": "TagDeclarator",
"value": "outerEdge"
},
"type": "extrudePlane"
}
}
"value": "outerEdge"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01",
"info": {
"type": "TagEngineInfo",
"id": "[uuid]",
"sketch": "[uuid]",
"path": {
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1099,
1142,
0
]
},
"from": [
0.0,
6.0
],
"tag": {
"end": 1141,
"start": 1135,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
-8.0,
6.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
"surface": {
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1099,
1142,
0
],
"tag": {
"end": 1141,
"start": 1135,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
}
}
"value": "seg01"
}
},
"artifactId": "[uuid]",

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