From 416de9a9fb00975fca6b7f18da9c1d50edf46a20 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 16 May 2025 16:22:50 -0700 Subject: [PATCH] allow more than one tool (#6945) * allow more than one tool Signed-off-by: Jess Frazelle * updates Signed-off-by: Jess Frazelle * updates Signed-off-by: Jess Frazelle * updates Signed-off-by: Jess Frazelle * update tests Signed-off-by: Jess Frazelle * fmt Signed-off-by: Jess Frazelle * bump kcl Signed-off-by: Jess Frazelle --------- Signed-off-by: Jess Frazelle --- rust/Cargo.lock | 20 +- rust/kcl-bumper/Cargo.toml | 2 +- rust/kcl-derive-docs/Cargo.toml | 2 +- rust/kcl-directory-test-macro/Cargo.toml | 2 +- rust/kcl-language-server-release/Cargo.toml | 2 +- rust/kcl-language-server/Cargo.toml | 2 +- rust/kcl-lib/Cargo.toml | 2 +- rust/kcl-lib/src/simulation_tests.rs | 63 + rust/kcl-lib/src/std/csg.rs | 14 - .../multi_target_csg/artifact_commands.snap | 1050 +++++ .../artifact_graph_flowchart.snap | 6 + .../artifact_graph_flowchart.snap.md | 466 +++ rust/kcl-lib/tests/multi_target_csg/ast.snap | 3507 +++++++++++++++++ .../multi_target_csg/execution_error.snap | 14 + rust/kcl-lib/tests/multi_target_csg/input.kcl | 89 + rust/kcl-lib/tests/multi_target_csg/ops.snap | 265 ++ .../tests/multi_target_csg/unparsed.snap | 71 + .../artifact_commands.snap | 717 ++++ .../artifact_graph_flowchart.snap | 6 + .../artifact_graph_flowchart.snap.md | 135 + .../tests/subtract_with_pattern/ast.snap | 1258 ++++++ .../tests/subtract_with_pattern/input.kcl | 22 + .../tests/subtract_with_pattern/ops.snap | 285 ++ .../subtract_with_pattern/program_memory.snap | 1706 ++++++++ .../subtract_with_pattern/rendered_model.png | Bin 0 -> 39656 bytes .../tests/subtract_with_pattern/unparsed.snap | 27 + .../artifact_commands.snap | 591 +++ .../artifact_graph_flowchart.snap | 6 + .../artifact_graph_flowchart.snap.md | 135 + .../subtract_with_pattern_cut_thru/ast.snap | 1328 +++++++ .../subtract_with_pattern_cut_thru/input.kcl | 23 + .../subtract_with_pattern_cut_thru/ops.snap | 255 ++ .../program_memory.snap | 1365 +++++++ .../rendered_model.png | Bin 0 -> 31413 bytes .../unparsed.snap | 29 + rust/kcl-python-bindings/Cargo.toml | 2 +- rust/kcl-test-server/Cargo.toml | 2 +- rust/kcl-to-core/Cargo.toml | 2 +- rust/kcl-wasm-lib/Cargo.toml | 2 +- 39 files changed, 13439 insertions(+), 34 deletions(-) create mode 100644 rust/kcl-lib/tests/multi_target_csg/artifact_commands.snap create mode 100644 rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap create mode 100644 rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap.md create mode 100644 rust/kcl-lib/tests/multi_target_csg/ast.snap create mode 100644 rust/kcl-lib/tests/multi_target_csg/execution_error.snap create mode 100644 rust/kcl-lib/tests/multi_target_csg/input.kcl create mode 100644 rust/kcl-lib/tests/multi_target_csg/ops.snap create mode 100644 rust/kcl-lib/tests/multi_target_csg/unparsed.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/artifact_commands.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap.md create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/ast.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/input.kcl create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/ops.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/program_memory.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/rendered_model.png create mode 100644 rust/kcl-lib/tests/subtract_with_pattern/unparsed.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_commands.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap.md create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ast.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/input.kcl create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ops.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/program_memory.snap create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/rendered_model.png create mode 100644 rust/kcl-lib/tests/subtract_with_pattern_cut_thru/unparsed.snap diff --git a/rust/Cargo.lock b/rust/Cargo.lock index cdb6deaf5..881a75059 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1815,7 +1815,7 @@ dependencies = [ [[package]] name = "kcl-bumper" -version = "0.1.73" +version = "0.1.74" dependencies = [ "anyhow", "clap", @@ -1826,7 +1826,7 @@ dependencies = [ [[package]] name = "kcl-derive-docs" -version = "0.1.73" +version = "0.1.74" dependencies = [ "Inflector", "anyhow", @@ -1845,7 +1845,7 @@ dependencies = [ [[package]] name = "kcl-directory-test-macro" -version = "0.1.73" +version = "0.1.74" dependencies = [ "convert_case", "proc-macro2", @@ -1855,7 +1855,7 @@ dependencies = [ [[package]] name = "kcl-language-server" -version = "0.2.73" +version = "0.2.74" dependencies = [ "anyhow", "clap", @@ -1876,7 +1876,7 @@ dependencies = [ [[package]] name = "kcl-language-server-release" -version = "0.1.73" +version = "0.1.74" dependencies = [ "anyhow", "clap", @@ -1896,7 +1896,7 @@ dependencies = [ [[package]] name = "kcl-lib" -version = "0.2.73" +version = "0.2.74" dependencies = [ "anyhow", "approx 0.5.1", @@ -1973,7 +1973,7 @@ dependencies = [ [[package]] name = "kcl-python-bindings" -version = "0.3.73" +version = "0.3.74" dependencies = [ "anyhow", "kcl-lib", @@ -1988,7 +1988,7 @@ dependencies = [ [[package]] name = "kcl-test-server" -version = "0.1.73" +version = "0.1.74" dependencies = [ "anyhow", "hyper 0.14.32", @@ -2001,7 +2001,7 @@ dependencies = [ [[package]] name = "kcl-to-core" -version = "0.1.73" +version = "0.1.74" dependencies = [ "anyhow", "async-trait", @@ -2015,7 +2015,7 @@ dependencies = [ [[package]] name = "kcl-wasm-lib" -version = "0.1.73" +version = "0.1.74" dependencies = [ "anyhow", "bson", diff --git a/rust/kcl-bumper/Cargo.toml b/rust/kcl-bumper/Cargo.toml index 8026c4f6c..d518b79ac 100644 --- a/rust/kcl-bumper/Cargo.toml +++ b/rust/kcl-bumper/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-bumper" -version = "0.1.73" +version = "0.1.74" edition = "2021" repository = "https://github.com/KittyCAD/modeling-api" rust-version = "1.76" diff --git a/rust/kcl-derive-docs/Cargo.toml b/rust/kcl-derive-docs/Cargo.toml index 2f25a23f0..016cc8f54 100644 --- a/rust/kcl-derive-docs/Cargo.toml +++ b/rust/kcl-derive-docs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-derive-docs" description = "A tool for generating documentation from Rust derive macros" -version = "0.1.73" +version = "0.1.74" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" diff --git a/rust/kcl-directory-test-macro/Cargo.toml b/rust/kcl-directory-test-macro/Cargo.toml index 7a4907ace..e6a9b1d05 100644 --- a/rust/kcl-directory-test-macro/Cargo.toml +++ b/rust/kcl-directory-test-macro/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-directory-test-macro" description = "A tool for generating tests from a directory of kcl files" -version = "0.1.73" +version = "0.1.74" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" diff --git a/rust/kcl-language-server-release/Cargo.toml b/rust/kcl-language-server-release/Cargo.toml index b1a7b8568..93e6b6050 100644 --- a/rust/kcl-language-server-release/Cargo.toml +++ b/rust/kcl-language-server-release/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kcl-language-server-release" -version = "0.1.73" +version = "0.1.74" edition = "2021" authors = ["KittyCAD Inc "] publish = false diff --git a/rust/kcl-language-server/Cargo.toml b/rust/kcl-language-server/Cargo.toml index e63950338..731ec595d 100644 --- a/rust/kcl-language-server/Cargo.toml +++ b/rust/kcl-language-server/Cargo.toml @@ -2,7 +2,7 @@ name = "kcl-language-server" description = "A language server for KCL." authors = ["KittyCAD Inc "] -version = "0.2.73" +version = "0.2.74" edition = "2021" license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/kcl-lib/Cargo.toml b/rust/kcl-lib/Cargo.toml index 310aef0c9..87796b213 100644 --- a/rust/kcl-lib/Cargo.toml +++ b/rust/kcl-lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-lib" description = "KittyCAD Language implementation and tools" -version = "0.2.73" +version = "0.2.74" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" diff --git a/rust/kcl-lib/src/simulation_tests.rs b/rust/kcl-lib/src/simulation_tests.rs index 36bb77a64..3cf10b5a3 100644 --- a/rust/kcl-lib/src/simulation_tests.rs +++ b/rust/kcl-lib/src/simulation_tests.rs @@ -3086,6 +3086,48 @@ mod error_revolve_on_edge_get_edge { super::execute(TEST_NAME, true).await } } +mod subtract_with_pattern { + const TEST_NAME: &str = "subtract_with_pattern"; + + /// Test parsing KCL. + #[test] + fn parse() { + super::parse(TEST_NAME) + } + + /// Test that parsing and unparsing KCL produces the original KCL input. + #[tokio::test(flavor = "multi_thread")] + async fn unparse() { + super::unparse(TEST_NAME).await + } + + /// Test that KCL is executed correctly. + #[tokio::test(flavor = "multi_thread")] + async fn kcl_test_execute() { + super::execute(TEST_NAME, true).await + } +} +mod subtract_with_pattern_cut_thru { + const TEST_NAME: &str = "subtract_with_pattern_cut_thru"; + + /// Test parsing KCL. + #[test] + fn parse() { + super::parse(TEST_NAME) + } + + /// Test that parsing and unparsing KCL produces the original KCL input. + #[tokio::test(flavor = "multi_thread")] + async fn unparse() { + super::unparse(TEST_NAME).await + } + + /// Test that KCL is executed correctly. + #[tokio::test(flavor = "multi_thread")] + async fn kcl_test_execute() { + super::execute(TEST_NAME, true).await + } +} mod sketch_on_face_union { const TEST_NAME: &str = "sketch_on_face_union"; @@ -3107,6 +3149,27 @@ mod sketch_on_face_union { super::execute(TEST_NAME, true).await } } +mod multi_target_csg { + const TEST_NAME: &str = "multi_target_csg"; + + /// Test parsing KCL. + #[test] + fn parse() { + super::parse(TEST_NAME) + } + + /// Test that parsing and unparsing KCL produces the original KCL input. + #[tokio::test(flavor = "multi_thread")] + async fn unparse() { + super::unparse(TEST_NAME).await + } + + /// Test that KCL is executed correctly. + #[tokio::test(flavor = "multi_thread")] + async fn kcl_test_execute() { + super::execute(TEST_NAME, true).await + } +} mod revolve_colinear { const TEST_NAME: &str = "revolve-colinear"; diff --git a/rust/kcl-lib/src/std/csg.rs b/rust/kcl-lib/src/std/csg.rs index a55ba7170..b56b547a5 100644 --- a/rust/kcl-lib/src/std/csg.rs +++ b/rust/kcl-lib/src/std/csg.rs @@ -293,20 +293,6 @@ pub async fn subtract(exec_state: &mut ExecState, args: Args) -> Result = args.get_unlabeled_kw_arg_typed("solids", &RuntimeType::solids(), exec_state)?; let tools: Vec = args.get_kw_arg_typed("tools", &RuntimeType::solids(), exec_state)?; - if solids.len() > 1 { - return Err(KclError::UndefinedValue(KclErrorDetails { - message: "Only one solid is allowed for a subtract operation, currently.".to_string(), - source_ranges: vec![args.source_range], - })); - } - - if tools.len() > 1 { - return Err(KclError::UndefinedValue(KclErrorDetails { - message: "Only one tool is allowed for a subtract operation, currently.".to_string(), - source_ranges: vec![args.source_range], - })); - } - let tolerance: Option = args.get_kw_arg_opt_typed("tolerance", &RuntimeType::length(), exec_state)?; let solids = inner_subtract(solids, tools, tolerance, exec_state, args).await?; diff --git a/rust/kcl-lib/tests/multi_target_csg/artifact_commands.snap b/rust/kcl-lib/tests/multi_target_csg/artifact_commands.snap new file mode 100644 index 000000000..fbe82a6cb --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/artifact_commands.snap @@ -0,0 +1,1050 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands multi_target_csg.kcl +--- +[ + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "edge_lines_visible", + "hidden": false + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": -1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 1.0, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": -4.1275, + "y": 4.7625, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 8.255, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 4.1275, + "y": 4.1275 + }, + "radius": 0.635, + "start": { + "unit": "degrees", + "value": 90.0 + }, + "end": { + "unit": "degrees", + "value": 0.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": -8.255, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 4.1275, + "y": -4.1275 + }, + "radius": 0.635, + "start": { + "unit": "degrees", + "value": 360.0 + }, + "end": { + "unit": "degrees", + "value": 270.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -8.255, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -4.1275, + "y": -4.1275 + }, + "radius": 0.635, + "start": { + "unit": "degrees", + "value": 270.0 + }, + "end": { + "unit": "degrees", + "value": 180.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": 8.255, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -4.1275, + "y": 4.1275 + }, + "radius": 0.635, + "start": { + "unit": "degrees", + "value": 180.0 + }, + "end": { + "unit": "degrees", + "value": 90.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid2d_add_hole", + "object_id": "[uuid]", + "hole_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 1.0, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -0.0, + "y": -0.0 + }, + "radius": 0.9921747999999999, + "start": { + "unit": "degrees", + "value": 0.0 + }, + "end": { + "unit": "degrees", + "value": 360.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 0.9922, + "y": -0.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 1.0, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 1.5875, + "faces": null, + "opposite": "None" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 1.0, + "z": 0.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": -1.4178, + "y": -5.5562, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 1.2318, + "y": 5.5562, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -2.2299, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -0.6775, + "y": -3.056, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 1.4896, + "y": -2.5003, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.186, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 0.186, + "y": 0.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 2.2299, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.6775, + "y": -3.056, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -1.4896, + "y": -2.5003, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -0.186, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -1.2318, + "y": 5.5562, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 2.54, + "faces": null, + "opposite": { + "Other": 2.54 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 2.54, + "faces": null, + "opposite": { + "Other": 2.54 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 2.54, + "z": 0.0 + }, + "x_axis": { + "x": -1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "size": 100.0, + "clobber": false, + "hide": false + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "plane_set_color", + "plane_id": "[uuid]", + "color": { + "r": 0.6, + "g": 0.6, + "b": 0.6, + "a": 0.3 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 1.0, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -0.0, + "y": -0.0 + }, + "radius": 0.9921747999999999, + "start": { + "unit": "degrees", + "value": 0.0 + }, + "end": { + "unit": "degrees", + "value": 360.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 0.9922, + "y": -0.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 1.0, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": -25.4, + "faces": null, + "opposite": "None" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]", + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + } +] diff --git a/rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap new file mode 100644 index 000000000..8ea14d1a8 --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart multi_target_csg.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..81d71e469 --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/artifact_graph_flowchart.snap.md @@ -0,0 +1,466 @@ +```mermaid +flowchart LR + subgraph path5 [Path] + 5["Path
[89, 136, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 10["Segment
[142, 163, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] + 11["Segment
[169, 247, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] + 12["Segment
[253, 275, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] + 13["Segment
[281, 362, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] + 14["Segment
[368, 390, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] + 15["Segment
[396, 477, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }] + 16["Segment
[483, 504, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }] + 17["Segment
[510, 590, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }] + 18["Segment
[596, 603, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }] + 34[Solid2d] + end + subgraph path6 [Path] + 6["Path
[627, 695, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }, CallKwArg { index: 0 }] + 19["Segment
[627, 695, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }, CallKwArg { index: 0 }] + 37[Solid2d] + end + subgraph path7 [Path] + 7["Path
[811, 861, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 20["Segment
[867, 898, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] + 21["Segment
[904, 929, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] + 22["Segment
[935, 969, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] + 23["Segment
[975, 1008, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] + 24["Segment
[1014, 1038, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] + 25["Segment
[1044, 1051, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }] + 33[Solid2d] + end + subgraph path8 [Path] + 8["Path
[1075, 1118, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 26["Segment
[1124, 1148, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] + 27["Segment
[1154, 1187, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] + 28["Segment
[1193, 1227, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] + 29["Segment
[1233, 1258, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] + 30["Segment
[1264, 1296, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] + 31["Segment
[1302, 1309, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }] + 36[Solid2d] + end + subgraph path9 [Path] + 9["Path
[1499, 1562, 0]"] + %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 32["Segment
[1499, 1562, 0]"] + %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 35[Solid2d] + end + 1["Plane
[47, 65, 0]"] + %% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 2["Plane
[770, 787, 0]"] + %% [ProgramBodyItem { index: 3 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 3["Plane
[1444, 1474, 0]"] + %% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, CallKwUnlabeledArg] + 4["StartSketchOnPlane
[1430, 1475, 0]"] + %% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 38["Sweep Extrusion
[711, 756, 0]"] + %% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 39["Sweep Extrusion
[1324, 1416, 0]"] + %% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 40["Sweep Extrusion
[1324, 1416, 0]"] + %% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 41["Sweep Extrusion
[1580, 1623, 0]"] + %% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 42[Wall] + %% face_code_ref=Missing NodePath + 43[Wall] + %% face_code_ref=Missing NodePath + 44[Wall] + %% face_code_ref=Missing NodePath + 45[Wall] + %% face_code_ref=Missing NodePath + 46[Wall] + %% face_code_ref=Missing NodePath + 47[Wall] + %% face_code_ref=Missing NodePath + 48[Wall] + %% face_code_ref=Missing NodePath + 49[Wall] + %% face_code_ref=Missing NodePath + 50[Wall] + %% face_code_ref=Missing NodePath + 51[Wall] + %% face_code_ref=Missing NodePath + 52[Wall] + %% face_code_ref=Missing NodePath + 53[Wall] + %% face_code_ref=Missing NodePath + 54[Wall] + %% face_code_ref=Missing NodePath + 55[Wall] + %% face_code_ref=Missing NodePath + 56[Wall] + %% face_code_ref=Missing NodePath + 57[Wall] + %% face_code_ref=Missing NodePath + 58[Wall] + %% face_code_ref=Missing NodePath + 59[Wall] + %% face_code_ref=Missing NodePath + 60[Wall] + %% face_code_ref=Missing NodePath + 61[Wall] + %% face_code_ref=Missing NodePath + 62[Wall] + %% face_code_ref=Missing NodePath + 63["Cap Start"] + %% face_code_ref=Missing NodePath + 64["Cap Start"] + %% face_code_ref=Missing NodePath + 65["Cap Start"] + %% face_code_ref=Missing NodePath + 66["Cap Start"] + %% face_code_ref=Missing NodePath + 67["Cap End"] + %% face_code_ref=Missing NodePath + 68["Cap End"] + %% face_code_ref=Missing NodePath + 69["Cap End"] + %% face_code_ref=Missing NodePath + 70["Cap End"] + %% face_code_ref=Missing NodePath + 71["SweepEdge Opposite"] + 72["SweepEdge Opposite"] + 73["SweepEdge Opposite"] + 74["SweepEdge Opposite"] + 75["SweepEdge Opposite"] + 76["SweepEdge Opposite"] + 77["SweepEdge Opposite"] + 78["SweepEdge Opposite"] + 79["SweepEdge Opposite"] + 80["SweepEdge Opposite"] + 81["SweepEdge Opposite"] + 82["SweepEdge Opposite"] + 83["SweepEdge Opposite"] + 84["SweepEdge Opposite"] + 85["SweepEdge Opposite"] + 86["SweepEdge Opposite"] + 87["SweepEdge Opposite"] + 88["SweepEdge Opposite"] + 89["SweepEdge Opposite"] + 90["SweepEdge Opposite"] + 91["SweepEdge Opposite"] + 92["SweepEdge Adjacent"] + 93["SweepEdge Adjacent"] + 94["SweepEdge Adjacent"] + 95["SweepEdge Adjacent"] + 96["SweepEdge Adjacent"] + 97["SweepEdge Adjacent"] + 98["SweepEdge Adjacent"] + 99["SweepEdge Adjacent"] + 100["SweepEdge Adjacent"] + 101["SweepEdge Adjacent"] + 102["SweepEdge Adjacent"] + 103["SweepEdge Adjacent"] + 104["SweepEdge Adjacent"] + 105["SweepEdge Adjacent"] + 106["SweepEdge Adjacent"] + 107["SweepEdge Adjacent"] + 108["SweepEdge Adjacent"] + 109["SweepEdge Adjacent"] + 110["SweepEdge Adjacent"] + 111["SweepEdge Adjacent"] + 112["SweepEdge Adjacent"] + 1 --- 5 + 1 --- 6 + 2 --- 7 + 2 --- 8 + 3 <--x 4 + 3 --- 9 + 5 --- 10 + 5 --- 11 + 5 --- 12 + 5 --- 13 + 5 --- 14 + 5 --- 15 + 5 --- 16 + 5 --- 17 + 5 --- 18 + 5 --- 34 + 5 ---- 38 + 6 --- 19 + 6 --- 37 + 7 --- 20 + 7 --- 21 + 7 --- 22 + 7 --- 23 + 7 --- 24 + 7 --- 25 + 7 --- 33 + 7 ---- 40 + 8 --- 26 + 8 --- 27 + 8 --- 28 + 8 --- 29 + 8 --- 30 + 8 --- 31 + 8 --- 36 + 8 ---- 39 + 9 --- 32 + 9 --- 35 + 9 ---- 41 + 10 --- 58 + 10 x--> 65 + 10 --- 91 + 10 --- 112 + 11 --- 57 + 11 x--> 65 + 11 --- 90 + 11 --- 111 + 12 --- 59 + 12 x--> 65 + 12 --- 89 + 12 --- 110 + 13 --- 56 + 13 x--> 65 + 13 --- 88 + 13 --- 109 + 14 --- 55 + 14 x--> 65 + 14 --- 87 + 14 --- 108 + 15 --- 60 + 15 x--> 65 + 15 --- 86 + 15 --- 107 + 16 --- 62 + 16 x--> 65 + 16 --- 85 + 16 --- 106 + 17 --- 61 + 17 x--> 65 + 17 --- 84 + 17 --- 105 + 20 --- 49 + 20 x--> 63 + 20 --- 78 + 20 --- 99 + 21 --- 54 + 21 x--> 63 + 21 --- 79 + 21 --- 100 + 22 --- 52 + 22 x--> 63 + 22 --- 80 + 22 --- 101 + 23 --- 51 + 23 x--> 63 + 23 --- 81 + 23 --- 102 + 24 --- 53 + 24 x--> 63 + 24 --- 82 + 24 --- 103 + 25 --- 50 + 25 x--> 63 + 25 --- 83 + 25 --- 104 + 26 --- 44 + 26 x--> 64 + 26 --- 76 + 26 --- 97 + 27 --- 45 + 27 x--> 64 + 27 --- 75 + 27 --- 96 + 28 --- 47 + 28 x--> 64 + 28 --- 74 + 28 --- 95 + 29 --- 42 + 29 x--> 64 + 29 --- 73 + 29 --- 94 + 30 --- 46 + 30 x--> 64 + 30 --- 72 + 30 --- 93 + 31 --- 43 + 31 x--> 64 + 31 --- 71 + 31 --- 92 + 32 --- 48 + 32 x--> 70 + 32 --- 77 + 32 --- 98 + 38 --- 55 + 38 --- 56 + 38 --- 57 + 38 --- 58 + 38 --- 59 + 38 --- 60 + 38 --- 61 + 38 --- 62 + 38 --- 65 + 38 --- 69 + 38 --- 84 + 38 --- 85 + 38 --- 86 + 38 --- 87 + 38 --- 88 + 38 --- 89 + 38 --- 90 + 38 --- 91 + 38 --- 105 + 38 --- 106 + 38 --- 107 + 38 --- 108 + 38 --- 109 + 38 --- 110 + 38 --- 111 + 38 --- 112 + 39 --- 42 + 39 --- 43 + 39 --- 44 + 39 --- 45 + 39 --- 46 + 39 --- 47 + 39 --- 64 + 39 --- 68 + 39 --- 71 + 39 --- 72 + 39 --- 73 + 39 --- 74 + 39 --- 75 + 39 --- 76 + 39 --- 92 + 39 --- 93 + 39 --- 94 + 39 --- 95 + 39 --- 96 + 39 --- 97 + 40 --- 49 + 40 --- 50 + 40 --- 51 + 40 --- 52 + 40 --- 53 + 40 --- 54 + 40 --- 63 + 40 --- 67 + 40 --- 78 + 40 --- 79 + 40 --- 80 + 40 --- 81 + 40 --- 82 + 40 --- 83 + 40 --- 99 + 40 --- 100 + 40 --- 101 + 40 --- 102 + 40 --- 103 + 40 --- 104 + 41 --- 48 + 41 --- 66 + 41 --- 70 + 41 --- 77 + 41 --- 98 + 42 --- 73 + 42 --- 94 + 95 <--x 42 + 43 --- 71 + 43 --- 92 + 93 <--x 43 + 44 --- 76 + 92 <--x 44 + 44 --- 97 + 45 --- 75 + 45 --- 96 + 97 <--x 45 + 46 --- 72 + 46 --- 93 + 94 <--x 46 + 47 --- 74 + 47 --- 95 + 96 <--x 47 + 48 --- 77 + 48 --- 98 + 49 --- 78 + 49 --- 99 + 104 <--x 49 + 50 --- 83 + 103 <--x 50 + 50 --- 104 + 51 --- 81 + 101 <--x 51 + 51 --- 102 + 52 --- 80 + 100 <--x 52 + 52 --- 101 + 53 --- 82 + 102 <--x 53 + 53 --- 103 + 54 --- 79 + 99 <--x 54 + 54 --- 100 + 55 --- 87 + 55 --- 108 + 109 <--x 55 + 56 --- 88 + 56 --- 109 + 110 <--x 56 + 57 --- 90 + 57 --- 111 + 112 <--x 57 + 58 --- 91 + 105 <--x 58 + 58 --- 112 + 59 --- 89 + 59 --- 110 + 111 <--x 59 + 60 --- 86 + 60 --- 107 + 108 <--x 60 + 61 --- 84 + 61 --- 105 + 106 <--x 61 + 62 --- 85 + 62 --- 106 + 107 <--x 62 + 77 <--x 66 + 78 <--x 67 + 79 <--x 67 + 80 <--x 67 + 81 <--x 67 + 82 <--x 67 + 83 <--x 67 + 71 <--x 68 + 72 <--x 68 + 73 <--x 68 + 74 <--x 68 + 75 <--x 68 + 76 <--x 68 + 84 <--x 69 + 85 <--x 69 + 86 <--x 69 + 87 <--x 69 + 88 <--x 69 + 89 <--x 69 + 90 <--x 69 + 91 <--x 69 +``` diff --git a/rust/kcl-lib/tests/multi_target_csg/ast.snap b/rust/kcl-lib/tests/multi_target_csg/ast.snap new file mode 100644 index 000000000..231d8e825 --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/ast.snap @@ -0,0 +1,3507 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing multi_target_csg.kcl +--- +{ + "Ok": { + "body": [ + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch002Profile000", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.1625", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1625, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.1875", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1875, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.325", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.325, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "90", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 90.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.025", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.025, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "arc", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.325", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.325, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "yLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "360", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 360.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "270", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 270.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.025", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.025, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "arc", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.325", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.325, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "270", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 270.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "180", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 180.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.025", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.025, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "arc", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.325", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.325, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "yLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "180", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 180.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "90", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 90.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.025", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.025, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "arc", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tool", + "start": 0, + "type": "Identifier" + }, + "arg": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "center", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.039062", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.039062, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tag", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "TagDeclarator", + "type": "TagDeclarator", + "value": "hole001" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "circle", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "subtract2d", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "extrude000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.0625", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0625, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch002Profile000", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch003", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XY", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch003Profile000", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.05582", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.05582, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.21875", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.21875, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch003", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.048496", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.048496, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.21875", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.21875, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.087793", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.087793, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.026673", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.026673, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.120313", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.120313, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.058646", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.058646, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.098438", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.098438, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.007324", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.007324, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch003Profile001", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.007324", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.007324, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch003", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.087793", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.087793, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.026673", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.026673, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.120313", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.120313, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.058646", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.058646, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.098438", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.098438, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.007324", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.007324, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.048496", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.048496, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.21875", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.21875, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "extrude001", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "bidirectionalLength", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch003Profile000", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch003Profile001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch004", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "offset", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "offsetPlane", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch004Profile000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "center", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.039062", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.039062, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "circle", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch004", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "cut000Extrude", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch004Profile000", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "cut000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tools", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "cut000Extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "subtract", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch005", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "offset", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.07", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.07, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "offsetPlane", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch005Profile000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "center", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.052734", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.052734, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "circle", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch005", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch006", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "offset", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.0325", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0325, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "offsetPlane", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch006Profile000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "center", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.03", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.03, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "circle", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch006", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "draftCut000Extrude", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "loft", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch005Profile000", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch006Profile000", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "draftCut000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tools", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "draftCut000Extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "subtract", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude000", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + } + ], + "commentStart": 0, + "end": 0, + "innerAttrs": [ + { + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "settings", + "start": 0, + "type": "Identifier" + }, + "properties": [ + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "defaultLengthUnit", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "in", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + ], + "start": 0, + "type": "Annotation" + } + ], + "nonCodeMeta": { + "nonCodeNodes": { + "0": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "1": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "2": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "3": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "4": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "5": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "6": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "7": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "8": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "9": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "10": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "11": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "12": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "13": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "14": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "15": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/multi_target_csg/execution_error.snap b/rust/kcl-lib/tests/multi_target_csg/execution_error.snap new file mode 100644 index 000000000..206fdd29c --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/execution_error.snap @@ -0,0 +1,14 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Error from executing multi_target_csg.kcl +--- +KCL Engine error + + × engine: Currently the engine does not support multiple targets on subtract + ╭─[69:10] + 68 │ + 69 │ cut000 = subtract(extrude001, tools = cut000Extrude) + · ─────────────────────┬───────────────────── + · ╰── tests/multi_target_csg/input.kcl + 70 │ + ╰──── diff --git a/rust/kcl-lib/tests/multi_target_csg/input.kcl b/rust/kcl-lib/tests/multi_target_csg/input.kcl new file mode 100644 index 000000000..6e86ab884 --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/input.kcl @@ -0,0 +1,89 @@ +@settings(defaultLengthUnit = in) + +sketch002 = startSketchOn(-XZ) + +sketch002Profile000 = startProfile(sketch002, at = [-0.1625, 0.1875]) + |> xLine(length = 0.325) + |> arc( + angleStart = 90, + angleEnd = 0, + radius = 0.025, + ) + |> yLine(length = -0.325) + |> arc( + angleStart = 360, + angleEnd = 270, + radius = 0.025, + ) + |> xLine(length = -0.325) + |> arc( + angleStart = 270, + angleEnd = 180, + radius = 0.025, + ) + |> yLine(length = 0.325) + |> arc( + angleStart = 180, + angleEnd = 90, + radius = 0.025, + ) + |> close() + |> subtract2d(tool = circle( + center = [-0, -0], + radius = 0.039062, + tag = $hole001 +)) + +extrude000 = extrude(sketch002Profile000, length = 0.0625) + +sketch003 = startSketchOn(XY) + +sketch003Profile000 = startProfile(sketch003, at = [-0.05582, -0.21875]) + |> line(end = [0.048496, 0.21875]) + |> xLine(length = -0.087793) + |> line(end = [-0.026673, -0.120313]) + |> line(end = [0.058646, -0.098438]) + |> xLine(length = 0.007324) + |> close() + +sketch003Profile001 = startProfile(sketch003, at = [0.007324, 0]) + |> xLine(length = 0.087793) + |> line(end = [0.026673, -0.120313]) + |> line(end = [-0.058646, -0.098438]) + |> xLine(length = -0.007324) + |> line(end = [-0.048496, 0.21875]) + |> close() + +extrude001 = extrude([sketch003Profile000, sketch003Profile001], length = 0.1, bidirectionalLength = 0.1) + +sketch004 = startSketchOn(offsetPlane(-XZ, offset = 0.1)) + +sketch004Profile000 = circle( + sketch004, + center = [-0, -0], + radius = 0.039062 +) + +cut000Extrude = extrude([sketch004Profile000], length = -1) + +cut000 = subtract(extrude001, tools = cut000Extrude) + +sketch005 = startSketchOn(offsetPlane(-XZ, offset = 0.07)) + +sketch005Profile000 = circle( + sketch005, + center = [0, 0], + radius = 0.052734 +) + +sketch006 = startSketchOn(offsetPlane(-XZ, offset = 0.0325)) + +sketch006Profile000 = circle( + sketch006, + center = [0, 0], + radius = 0.03 +) + +draftCut000Extrude = loft([sketch005Profile000, sketch006Profile000]) + +draftCut000 = subtract(extrude000, tools = draftCut000Extrude) diff --git a/rust/kcl-lib/tests/multi_target_csg/ops.snap b/rust/kcl-lib/tests/multi_target_csg/ops.snap new file mode 100644 index 000000000..d2a2d841a --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/ops.snap @@ -0,0 +1,265 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed multi_target_csg.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "tool": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract2d", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": 0.0625, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "bidirectionalLength": { + "value": { + "type": "Number", + "value": 0.1, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "length": { + "value": { + "type": "Number", + "value": 0.1, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Array", + "value": [ + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + } + ] + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "type": "KclStdLibCall", + "name": "offsetPlane", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + }, + "labeledArgs": { + "offset": { + "value": { + "type": "Number", + "value": 0.1, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "sourceRange": [] + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": -1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Array", + "value": [ + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + } + ] + }, + "sourceRange": [] + } + }, + { + "isError": true, + "labeledArgs": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Array", + "value": [ + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + } + ] + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/multi_target_csg/unparsed.snap b/rust/kcl-lib/tests/multi_target_csg/unparsed.snap new file mode 100644 index 000000000..a0853ebf6 --- /dev/null +++ b/rust/kcl-lib/tests/multi_target_csg/unparsed.snap @@ -0,0 +1,71 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing multi_target_csg.kcl +--- +@settings(defaultLengthUnit = in) + +sketch002 = startSketchOn(-XZ) + +sketch002Profile000 = startProfile(sketch002, at = [-0.1625, 0.1875]) + |> xLine(length = 0.325) + |> arc(angleStart = 90, angleEnd = 0, radius = 0.025) + |> yLine(length = -0.325) + |> arc(angleStart = 360, angleEnd = 270, radius = 0.025) + |> xLine(length = -0.325) + |> arc(angleStart = 270, angleEnd = 180, radius = 0.025) + |> yLine(length = 0.325) + |> arc(angleStart = 180, angleEnd = 90, radius = 0.025) + |> close() + |> subtract2d(tool = circle(center = [-0, -0], radius = 0.039062, tag = $hole001)) + +extrude000 = extrude(sketch002Profile000, length = 0.0625) + +sketch003 = startSketchOn(XY) + +sketch003Profile000 = startProfile(sketch003, at = [-0.05582, -0.21875]) + |> line(end = [0.048496, 0.21875]) + |> xLine(length = -0.087793) + |> line(end = [-0.026673, -0.120313]) + |> line(end = [0.058646, -0.098438]) + |> xLine(length = 0.007324) + |> close() + +sketch003Profile001 = startProfile(sketch003, at = [0.007324, 0]) + |> xLine(length = 0.087793) + |> line(end = [0.026673, -0.120313]) + |> line(end = [-0.058646, -0.098438]) + |> xLine(length = -0.007324) + |> line(end = [-0.048496, 0.21875]) + |> close() + +extrude001 = extrude( + [ + sketch003Profile000, + sketch003Profile001 + ], + length = 0.1, + bidirectionalLength = 0.1, +) + +sketch004 = startSketchOn(offsetPlane(-XZ, offset = 0.1)) + +sketch004Profile000 = circle(sketch004, center = [-0, -0], radius = 0.039062) + +cut000Extrude = extrude([sketch004Profile000], length = -1) + +cut000 = subtract(extrude001, tools = cut000Extrude) + +sketch005 = startSketchOn(offsetPlane(-XZ, offset = 0.07)) + +sketch005Profile000 = circle(sketch005, center = [0, 0], radius = 0.052734) + +sketch006 = startSketchOn(offsetPlane(-XZ, offset = 0.0325)) + +sketch006Profile000 = circle(sketch006, center = [0, 0], radius = 0.03) + +draftCut000Extrude = loft([ + sketch005Profile000, + sketch006Profile000 +]) + +draftCut000 = subtract(extrude000, tools = draftCut000Extrude) diff --git a/rust/kcl-lib/tests/subtract_with_pattern/artifact_commands.snap b/rust/kcl-lib/tests/subtract_with_pattern/artifact_commands.snap new file mode 100644 index 000000000..e35d2c34d --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/artifact_commands.snap @@ -0,0 +1,717 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands subtract_with_pattern.kcl +--- +[ + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "edge_lines_visible", + "hidden": false + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 1.0, + "z": 0.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 2.65, + "y": 12.2, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 23.49, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": -22.68, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -24.2, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 2.65, + "y": 12.2, + "z": 0.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 500.0, + "faces": null, + "opposite": "None" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": -1.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 17.5, + "y": 22.02 + }, + "radius": 10.16, + "start": { + "unit": "degrees", + "value": 0.0 + }, + "end": { + "unit": "degrees", + "value": 360.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 27.66, + "y": 22.02, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": -1.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 50.0, + "faces": null, + "opposite": "None" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "entity_linear_pattern_transform", + "entity_id": "[uuid]", + "transform": [], + "transforms": [ + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 30.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 60.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 90.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 120.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 150.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 180.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 210.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 240.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 270.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ] + ] + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]" + ], + "tolerance": 0.0000001 + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "set_object_transform", + "object_id": "[uuid]", + "transforms": [ + { + "translate": null, + "rotate_rpy": null, + "rotate_angle_axis": { + "property": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 90.0 + }, + "set": false, + "is_local": true + }, + "scale": null + } + ] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap new file mode 100644 index 000000000..2a145ce13 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart subtract_with_pattern.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..8b401d7ed --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/artifact_graph_flowchart.snap.md @@ -0,0 +1,135 @@ +```mermaid +flowchart LR + subgraph path3 [Path] + 3["Path
[43, 85, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 5["Segment
[93, 114, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] + 6["Segment
[122, 144, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] + 7["Segment
[152, 173, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] + 8["Segment
[181, 237, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] + 9["Segment
[245, 252, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] + 12[Solid2d] + end + subgraph path4 [Path] + 4["Path
[349, 406, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 10["Segment
[349, 406, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 11[Solid2d] + end + 1["Plane
[12, 29, 0]"] + %% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 2["Plane
[317, 334, 0]"] + %% [ProgramBodyItem { index: 3 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 13["Sweep Extrusion
[268, 301, 0]"] + %% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 14["Sweep Extrusion
[422, 454, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 15["CompositeSolid Subtract
[641, 685, 0]"] + %% [ProgramBodyItem { index: 7 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }] + 16[Wall] + %% face_code_ref=Missing NodePath + 17[Wall] + %% face_code_ref=Missing NodePath + 18[Wall] + %% face_code_ref=Missing NodePath + 19[Wall] + %% face_code_ref=Missing NodePath + 20[Wall] + %% face_code_ref=Missing NodePath + 21["Cap Start"] + %% face_code_ref=Missing NodePath + 22["Cap Start"] + %% face_code_ref=Missing NodePath + 23["Cap End"] + %% face_code_ref=Missing NodePath + 24["Cap End"] + %% face_code_ref=Missing NodePath + 25["SweepEdge Opposite"] + 26["SweepEdge Opposite"] + 27["SweepEdge Opposite"] + 28["SweepEdge Opposite"] + 29["SweepEdge Opposite"] + 30["SweepEdge Adjacent"] + 31["SweepEdge Adjacent"] + 32["SweepEdge Adjacent"] + 33["SweepEdge Adjacent"] + 34["SweepEdge Adjacent"] + 1 --- 3 + 2 --- 4 + 3 --- 5 + 3 --- 6 + 3 --- 7 + 3 --- 8 + 3 --- 9 + 3 --- 12 + 3 ---- 13 + 3 --- 15 + 4 --- 10 + 4 --- 11 + 4 ---- 14 + 4 --- 15 + 5 --- 19 + 5 x--> 21 + 5 --- 28 + 5 --- 33 + 6 --- 17 + 6 x--> 21 + 6 --- 27 + 6 --- 32 + 7 --- 16 + 7 x--> 21 + 7 --- 26 + 7 --- 31 + 8 --- 18 + 8 x--> 21 + 8 --- 25 + 8 --- 30 + 10 --- 20 + 10 x--> 22 + 10 --- 29 + 10 --- 34 + 13 --- 16 + 13 --- 17 + 13 --- 18 + 13 --- 19 + 13 --- 21 + 13 --- 23 + 13 --- 25 + 13 --- 26 + 13 --- 27 + 13 --- 28 + 13 --- 30 + 13 --- 31 + 13 --- 32 + 13 --- 33 + 14 --- 20 + 14 --- 22 + 14 --- 24 + 14 --- 29 + 14 --- 34 + 16 --- 26 + 16 --- 31 + 32 <--x 16 + 17 --- 27 + 17 --- 32 + 33 <--x 17 + 18 --- 25 + 18 --- 30 + 31 <--x 18 + 19 --- 28 + 30 <--x 19 + 19 --- 33 + 20 --- 29 + 20 --- 34 + 25 <--x 23 + 26 <--x 23 + 27 <--x 23 + 28 <--x 23 + 29 <--x 24 +``` diff --git a/rust/kcl-lib/tests/subtract_with_pattern/ast.snap b/rust/kcl-lib/tests/subtract_with_pattern/ast.snap new file mode 100644 index 000000000..b09fa8340 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/ast.snap @@ -0,0 +1,1258 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing subtract_with_pattern.kcl +--- +{ + "Ok": { + "body": [ + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XY", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "2.65", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.65, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "12.2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 12.2, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "23.49", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 23.49, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "22.68", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 22.68, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "yLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "24.2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 24.2, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsolute", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profileStartX", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profileStartY", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "extrude001", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "500", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 500.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile002", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "center", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "17.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 17.5, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "22.02", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 22.02, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "10.16", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 10.16, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "circle", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "extrude002", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "50", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 50.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "myPatterns", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "instances", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "10", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 10.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "distance", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "30", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 30.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "axis", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "patternLinear3d", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tools", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "myPatterns", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "subtract", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "90", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 90.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "axis", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "rotate", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "1": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "inlineComment", + "value": "we do this to ensure the id is okay after the subtract", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "1": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "2": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "4": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "6": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "7": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "startNodes": [] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/subtract_with_pattern/input.kcl b/rust/kcl-lib/tests/subtract_with_pattern/input.kcl new file mode 100644 index 000000000..1a5dbd392 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/input.kcl @@ -0,0 +1,22 @@ +sketch001 = startSketchOn(XY) +profile001 = startProfile(sketch001, at = [2.65, 12.2]) + |> xLine(length = 23.49) + |> yLine(length = -22.68) + |> xLine(length = -24.2) + |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) + |> close() + +extrude001 = extrude(profile001, length = 500) + +sketch002 = startSketchOn(XZ) +profile002 = circle(sketch002, center = [17.5, 22.02], radius = 10.16) + +extrude002 = extrude(profile002, length = 50) +myPatterns = patternLinear3d(extrude002, + instances = 10, + distance = 30, + axis = [0,0,1]) + +subtract([extrude001], tools = [myPatterns]) + |> rotate(angle = 90, axis = [0,1,0]) // we do this to ensure the id is okay after the subtract + diff --git a/rust/kcl-lib/tests/subtract_with_pattern/ops.snap b/rust/kcl-lib/tests/subtract_with_pattern/ops.snap new file mode 100644 index 000000000..3c35e852f --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/ops.snap @@ -0,0 +1,285 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed subtract_with_pattern.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": 500.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": 50.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "axis": { + "value": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 1.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "sourceRange": [] + }, + "distance": { + "value": { + "type": "Number", + "value": 30.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "instances": { + "value": { + "type": "Number", + "value": 10.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "patternLinear3d", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + } + ] + } + ] + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Array", + "value": [ + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + } + ] + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_with_pattern/program_memory.snap b/rust/kcl-lib/tests/subtract_with_pattern/program_memory.snap new file mode 100644 index 000000000..a1a7a717d --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/program_memory.snap @@ -0,0 +1,1706 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing subtract_with_pattern.kcl +--- +{ + "extrude001": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + -10.48 + ], + "tag": null, + "to": [ + 1.94, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.94, + -10.48 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 2.65, + 12.2 + ], + "to": [ + 2.65, + 12.2 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 500.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + "extrude002": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + "myPatterns": { + "type": "HomArray", + "value": [ + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + } + ] + }, + "profile001": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + -10.48 + ], + "tag": null, + "to": [ + 1.94, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.94, + -10.48 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 2.65, + 12.2 + ], + "to": [ + 2.65, + 12.2 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + } + }, + "profile002": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 22.02 + ], + "from": [ + 27.66, + 22.02 + ], + "radius": 10.16, + "tag": null, + "to": [ + 27.66, + 22.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 27.66, + 22.02 + ], + "to": [ + 27.66, + 22.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + } + }, + "sketch001": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch002": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + } +} diff --git a/rust/kcl-lib/tests/subtract_with_pattern/rendered_model.png b/rust/kcl-lib/tests/subtract_with_pattern/rendered_model.png new file mode 100644 index 0000000000000000000000000000000000000000..68d442107f2ebd0c7541bcb89eb96dec77eddcb3 GIT binary patch literal 39656 zcmeHwd0bUx*Y*ZfN>frROcYE>Gg3?p2N1L@z%m}IM++649;pBk(Et$+Y7Rt-qD6{A zuch|ni)hBAz(GNALNbdXki(#$p^PHa;q3QX_r3QS%J=zw-}l$|$MGkeVV|>y`(Eo> z*SglaH_`ui*KJ_`;r#_c80g_X=RHB_i>Ic)JkbviMG?0a2*QCBk2$kH2sL?-Yxb?} zM_*rT5knexUb=Q{?b|C(1eB*q|3CRM@$0!MiIW{hH+FrN{^^FJ+nxM=PjR_B+oI;j z<0sDi`S)MluF+Tixp2w)-~axrUGeN!kN?t{KgE|{e*Bl#|1SRXgU22TM;DL(u=sID z!h7Pv`I(P7JvwDg%Hg$-IX&7@ug{xz{(epDI=hu$7%xn3M2$0MVE#r^)Uyqvj~Up; z@e@YyFa&-hco-On5j>3GVPqcq1klJ8^+&@HPvN@YMWjo|VBIe3T`i-QYavxq!p8Gfq7CAjX|mJB^QBxWl*w<|gi zvEKo#Uq{pQ9c!~`S5&-Kvbe3PsOw-+*MzEbC5wXx8eD5rcE{*@#YNr!U9{m)PvhC9 z1=81Fx7hFtKS;Ooez0ptu%h9D_x%grJ@-5nGgK`jRp-#K<94d>pJJweo46@JGxc<# z*e|Us>5`+kx3o@STCVn7njlV0>uOq_Aby(GmGbanp!#A~i>I5cdEWwxbecm+c~(j z_BUK^zhQlz8NN7gUu{8bFkwQw;zoUBW4)$0Cc88y`_auL&AOagr<^V58&JJIByRWT zwze-k>EUkpv{Q69+>|dm>VLE|X|8U2jlxv>{T7vnv>{p?B!5G_a4$cKIz&30df^`F zorUr{zVc_>KAIR`5mtYwBD8jA#m2V60w47SANBgkhV;mWv#jl^Te*F$x-*E6ZAw=~ zQE!E612dh-?wd*1LpBzKtU;5Ojfdey$w%@TXK=mhz|nfIqs3_Lc;t(H0>AH@l*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z7>=}N@b)}MwQAS?LN`1{Nl=AoJ4+U p%*PDf#aJIR$Uy#MeXPdDq_Eg}<{;P0MFReLy!q~&6R$7b{68EtMr;58 literal 0 HcmV?d00001 diff --git a/rust/kcl-lib/tests/subtract_with_pattern/unparsed.snap b/rust/kcl-lib/tests/subtract_with_pattern/unparsed.snap new file mode 100644 index 000000000..335a5fea0 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern/unparsed.snap @@ -0,0 +1,27 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing subtract_with_pattern.kcl +--- +sketch001 = startSketchOn(XY) +profile001 = startProfile(sketch001, at = [2.65, 12.2]) + |> xLine(length = 23.49) + |> yLine(length = -22.68) + |> xLine(length = -24.2) + |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) + |> close() + +extrude001 = extrude(profile001, length = 500) + +sketch002 = startSketchOn(XZ) +profile002 = circle(sketch002, center = [17.5, 22.02], radius = 10.16) + +extrude002 = extrude(profile002, length = 50) +myPatterns = patternLinear3d( + extrude002, + instances = 10, + distance = 30, + axis = [0, 0, 1], +) + +subtract([extrude001], tools = [myPatterns]) + |> rotate(angle = 90, axis = [0, 1, 0]) // we do this to ensure the id is okay after the subtract diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_commands.snap b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_commands.snap new file mode 100644 index 000000000..64bc48c22 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_commands.snap @@ -0,0 +1,591 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands subtract_with_pattern_cut_thru.kcl +--- +[ + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "edge_lines_visible", + "hidden": false + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 1.0, + "z": 0.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 2.65, + "y": 12.2, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 23.49, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": -22.68, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -24.2, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 2.65, + "y": 12.2, + "z": 0.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 500.0, + "faces": null, + "opposite": "None" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": -1.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 17.5, + "y": 42.02 + }, + "radius": 30.16, + "start": { + "unit": "degrees", + "value": 0.0 + }, + "end": { + "unit": "degrees", + "value": 360.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 47.66, + "y": 42.02, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": -1.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 50.0, + "faces": null, + "opposite": "None" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_adjacency_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_extrusion_face_info", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "set_object_transform", + "object_id": "[uuid]", + "transforms": [ + { + "translate": { + "property": { + "x": 0.0, + "y": 30.0, + "z": 0.0 + }, + "set": false, + "is_local": true + }, + "rotate_rpy": null, + "rotate_angle_axis": null, + "scale": null + } + ] + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "entity_linear_pattern_transform", + "entity_id": "[uuid]", + "transform": [], + "transforms": [ + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 80.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 160.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 240.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ], + [ + { + "translate": { + "x": 0.0, + "y": 0.0, + "z": 320.0 + }, + "scale": { + "x": 1.0, + "y": 1.0, + "z": 1.0 + }, + "rotation": { + "axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "angle": { + "unit": "degrees", + "value": 0.0 + }, + "origin": { + "type": "local" + } + }, + "replicate": true + } + ] + ] + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]", + "[uuid]" + ], + "tolerance": 0.0000001 + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "set_object_transform", + "object_id": "[uuid]", + "transforms": [ + { + "translate": null, + "rotate_rpy": null, + "rotate_angle_axis": { + "property": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 90.0 + }, + "set": false, + "is_local": true + }, + "scale": null + } + ] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap new file mode 100644 index 000000000..9c236e6bb --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart subtract_with_pattern_cut_thru.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..a16c30ffc --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/artifact_graph_flowchart.snap.md @@ -0,0 +1,135 @@ +```mermaid +flowchart LR + subgraph path3 [Path] + 3["Path
[43, 85, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 5["Segment
[93, 114, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] + 6["Segment
[122, 144, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] + 7["Segment
[152, 173, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] + 8["Segment
[181, 237, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] + 9["Segment
[245, 252, 0]"] + %% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] + 12[Solid2d] + end + subgraph path4 [Path] + 4["Path
[349, 406, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 10["Segment
[349, 406, 0]"] + %% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 11[Solid2d] + end + 1["Plane
[12, 29, 0]"] + %% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 2["Plane
[317, 334, 0]"] + %% [ProgramBodyItem { index: 3 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 13["Sweep Extrusion
[268, 301, 0]"] + %% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit] + 14["Sweep Extrusion
[422, 454, 0]"] + %% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 15["CompositeSolid Subtract
[686, 730, 0]"] + %% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] + 16[Wall] + %% face_code_ref=Missing NodePath + 17[Wall] + %% face_code_ref=Missing NodePath + 18[Wall] + %% face_code_ref=Missing NodePath + 19[Wall] + %% face_code_ref=Missing NodePath + 20[Wall] + %% face_code_ref=Missing NodePath + 21["Cap Start"] + %% face_code_ref=Missing NodePath + 22["Cap Start"] + %% face_code_ref=Missing NodePath + 23["Cap End"] + %% face_code_ref=Missing NodePath + 24["Cap End"] + %% face_code_ref=Missing NodePath + 25["SweepEdge Opposite"] + 26["SweepEdge Opposite"] + 27["SweepEdge Opposite"] + 28["SweepEdge Opposite"] + 29["SweepEdge Opposite"] + 30["SweepEdge Adjacent"] + 31["SweepEdge Adjacent"] + 32["SweepEdge Adjacent"] + 33["SweepEdge Adjacent"] + 34["SweepEdge Adjacent"] + 1 --- 3 + 2 --- 4 + 3 --- 5 + 3 --- 6 + 3 --- 7 + 3 --- 8 + 3 --- 9 + 3 --- 12 + 3 ---- 13 + 3 --- 15 + 4 --- 10 + 4 --- 11 + 4 ---- 14 + 4 --- 15 + 5 --- 19 + 5 x--> 21 + 5 --- 28 + 5 --- 33 + 6 --- 17 + 6 x--> 21 + 6 --- 27 + 6 --- 32 + 7 --- 16 + 7 x--> 21 + 7 --- 26 + 7 --- 31 + 8 --- 18 + 8 x--> 21 + 8 --- 25 + 8 --- 30 + 10 --- 20 + 10 x--> 22 + 10 --- 29 + 10 --- 34 + 13 --- 16 + 13 --- 17 + 13 --- 18 + 13 --- 19 + 13 --- 21 + 13 --- 23 + 13 --- 25 + 13 --- 26 + 13 --- 27 + 13 --- 28 + 13 --- 30 + 13 --- 31 + 13 --- 32 + 13 --- 33 + 14 --- 20 + 14 --- 22 + 14 --- 24 + 14 --- 29 + 14 --- 34 + 16 --- 26 + 16 --- 31 + 32 <--x 16 + 17 --- 27 + 17 --- 32 + 33 <--x 17 + 18 --- 25 + 18 --- 30 + 31 <--x 18 + 19 --- 28 + 30 <--x 19 + 19 --- 33 + 20 --- 29 + 20 --- 34 + 25 <--x 23 + 26 <--x 23 + 27 <--x 23 + 28 <--x 23 + 29 <--x 24 +``` diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ast.snap b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ast.snap new file mode 100644 index 000000000..acf0cd726 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ast.snap @@ -0,0 +1,1328 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing subtract_with_pattern_cut_thru.kcl +--- +{ + "Ok": { + "body": [ + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XY", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "2.65", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.65, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "12.2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 12.2, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "23.49", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 23.49, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "22.68", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 22.68, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "yLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "24.2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 24.2, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsolute", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profileStartX", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profileStartY", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "line", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "extrude001", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "500", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 500.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile002", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "center", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "17.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 17.5, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "42.02", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 42.02, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "30.16", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 30.16, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "circle", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "extrude002", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "50", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 50.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "y", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "30", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 30.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "translate", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "myPatterns", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "instances", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "distance", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "80", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 80.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "axis", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "patternLinear3d", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "results", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tools", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "myPatterns", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "subtract", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "90", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 90.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "axis", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "rotate", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "1": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "inlineComment", + "value": "we do this to ensure the id is okay after the subtract", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "1": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "2": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "4": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "5": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "6": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "startNodes": [] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/input.kcl b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/input.kcl new file mode 100644 index 000000000..7dc0acb39 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/input.kcl @@ -0,0 +1,23 @@ +sketch001 = startSketchOn(XY) +profile001 = startProfile(sketch001, at = [2.65, 12.2]) + |> xLine(length = 23.49) + |> yLine(length = -22.68) + |> xLine(length = -24.2) + |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) + |> close() + +extrude001 = extrude(profile001, length = 500) + +sketch002 = startSketchOn(XZ) +profile002 = circle(sketch002, center = [17.5, 42.02], radius = 30.16) + +extrude002 = extrude(profile002, length = 50) + |> translate(y=30) + +myPatterns = patternLinear3d(extrude002, + instances = 5, + distance = 80, + axis = [0,0,1]) + +results = subtract([extrude001], tools = [myPatterns]) + |> rotate(angle = 90, axis = [0,1,0]) // we do this to ensure the id is okay after the subtract diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ops.snap b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ops.snap new file mode 100644 index 000000000..081181ae1 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/ops.snap @@ -0,0 +1,255 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed subtract_with_pattern_cut_thru.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": 500.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": 50.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "axis": { + "value": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 1.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "sourceRange": [] + }, + "distance": { + "value": { + "type": "Number", + "value": 80.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "instances": { + "value": { + "type": "Number", + "value": 5.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "name": "patternLinear3d", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Array", + "value": [ + { + "type": "Array", + "value": [ + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + } + ] + } + ] + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Array", + "value": [ + { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + } + ] + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/program_memory.snap b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/program_memory.snap new file mode 100644 index 000000000..2abc5182a --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/program_memory.snap @@ -0,0 +1,1365 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing subtract_with_pattern_cut_thru.kcl +--- +{ + "extrude001": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + -10.48 + ], + "tag": null, + "to": [ + 1.94, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.94, + -10.48 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 2.65, + 12.2 + ], + "to": [ + 2.65, + 12.2 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 500.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + "extrude002": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + "myPatterns": { + "type": "HomArray", + "value": [ + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 50.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + } + ] + }, + "profile001": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + -10.48 + ], + "tag": null, + "to": [ + 1.94, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.94, + -10.48 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 2.65, + 12.2 + ], + "to": [ + 2.65, + 12.2 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + } + }, + "profile002": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 17.5, + 42.02 + ], + "from": [ + 47.66, + 42.02 + ], + "radius": 30.16, + "tag": null, + "to": [ + 47.66, + 42.02 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 47.66, + 42.02 + ], + "to": [ + 47.66, + 42.02 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + } + }, + "results": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "artifactId": "[uuid]", + "value": [ + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + 12.2 + ], + "tag": null, + "to": [ + 26.14, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 26.14, + -10.48 + ], + "tag": null, + "to": [ + 1.94, + -10.48 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.94, + -10.48 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.65, + 12.2 + ], + "tag": null, + "to": [ + 2.65, + 12.2 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 2.65, + 12.2 + ], + "to": [ + 2.65, + 12.2 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": 500.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + "sketch001": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "XY", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch002": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "XZ", + "xAxis": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + } +} diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/rendered_model.png b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/rendered_model.png new file mode 100644 index 0000000000000000000000000000000000000000..1c472402363d2d7a5c1a425cb1519fa09f240cfe GIT binary patch literal 31413 zcmeHQYgkifw%!qiRuo!Wr6UTpQf;+Lr=Eh!C06TLYAe&}SlWugTg&MY1f|GLNTyE9 zD77e#ZEY0V`b_P}2%;kw1%e{t4Wr{AAZP$Fs0aZ9gpkWVYpri@2GTJQU=cYTI!zhAaw?C6Q3IgT3}^wyhy;J8t6cf^$^9N{l@^34x8E^$lHn{WIv zUeaFX@T1p9-=6K_<2rVnyL52V(zQ8}_4&frXJ2Q2`*v>TYja-cFm5jRuf$(c{nl6K z2Ht(cwfRtX&WZbv-V8{$U05EnGPe5Bn_l_&J&%9ViTnJF8IONbY&F09kB@yPcy~Vg z*U-nk6a0)1d9Ua(mxq^Z&HZ`PV=fP0$P%{r&ZBFhbq=Vu+ZSdNQTvV!OMiPR+T@14 z#)joac8(o9h6BGHJccER9X#ydVOJiu0?@7%ZKGiq!Na3rSNFra9(&s|tlPAM$MABo zchJMi#cmA@b3g3hVFwR;KW6X8?1rf=4%kuAHX1AKlFBZr>@JnvrLwzJwm4u%McZiD zU8>>Hu)9>l+HU)BeOTLVmsG<9rX4)~pMwYQ8X8mex@$_FTT)&PyKRRhhdv{l1akw|bTNPnT%t zJ^89SNRjXhyhN_tGbiy|cnMd2cILZ^gk>Wx#f*FW!~f6!)PrxMvaC?`uFzCb-tx)p zRFXCQr1ppP9_Dv7J?{pqbfu<3__jZNlP1}4b6|e1e!fn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y}V{+QF4ZyU719g7Cl2<^U)u@K0*MgVoSNIvi1{(j%>Ya4Zx& zx5tz%8v$2}9ppSffH}As6Cv9dWIz|`kDitUoY66u=d@(-036DMqtuo(WFnfRAdn6E z|4^`Iqn;d<;(yI788@y#Aq6(uDBAXb_2%9`yb%YY>K<)ZU}BJgVlw?ekLC{A{q zNJITKr%tPZi7Xo@f`2A=sz-=Zot;(CFhZ0x_;H(j-0xZ2BW;0JwxIhR%r45eonD#s z;G|V<^)#=dM1+}kO3Sg~V~{ZbEAzmOLms8UC?uf(*v%<03RwMIZCxGAj@dB>>tfPS zlDA(jejY;|zZ#v9-;EQ6b?*!AmAk+Qg~0|pEx@7W#NoG2N8v<4&OnVHQltMhs0BEN zJBB3ZpQzO^Ba;fJxU7qrmrloiZuq0Crp9!dN$CV90tDk5&H_j?(9J=8D%~3S&165v zGIS5&EX(lNpe4{tEr@V11`l$1UQ(5l*N6@i8=0du*ABzewkltZx$(O#=f7)FU7%MK z2RtRerx>s>vXd*V`g!~waykl#oB`2k#$;y4Y3S5XGVmdcOT?~bF(o72(96Lg_VV?r zzV&dB|zyL*A@1F z8Vfv?0;daPUbqJ9N?MuGyN6_=c;Lx915ZGk|G@@{U>1elqkeqYQJNK3wtDnDPxIWz z-0-{YpZ`jH!*1*!Y)cd(-q=5M(@Zu#JWtJcdQX4jy*! zu>Y2#VIQ_<{|zdlt0j0Cb~DFr=GY~bEp6H*m2EWal4@8q?2^hZsqB) literal 0 HcmV?d00001 diff --git a/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/unparsed.snap b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/unparsed.snap new file mode 100644 index 000000000..f14fef584 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_with_pattern_cut_thru/unparsed.snap @@ -0,0 +1,29 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing subtract_with_pattern_cut_thru.kcl +--- +sketch001 = startSketchOn(XY) +profile001 = startProfile(sketch001, at = [2.65, 12.2]) + |> xLine(length = 23.49) + |> yLine(length = -22.68) + |> xLine(length = -24.2) + |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) + |> close() + +extrude001 = extrude(profile001, length = 500) + +sketch002 = startSketchOn(XZ) +profile002 = circle(sketch002, center = [17.5, 42.02], radius = 30.16) + +extrude002 = extrude(profile002, length = 50) + |> translate(y = 30) + +myPatterns = patternLinear3d( + extrude002, + instances = 5, + distance = 80, + axis = [0, 0, 1], +) + +results = subtract([extrude001], tools = [myPatterns]) + |> rotate(angle = 90, axis = [0, 1, 0]) // we do this to ensure the id is okay after the subtract diff --git a/rust/kcl-python-bindings/Cargo.toml b/rust/kcl-python-bindings/Cargo.toml index c423c4987..1ee30281c 100644 --- a/rust/kcl-python-bindings/Cargo.toml +++ b/rust/kcl-python-bindings/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kcl-python-bindings" -version = "0.3.73" +version = "0.3.74" edition = "2021" repository = "https://github.com/kittycad/modeling-app" exclude = ["tests/*", "files/*", "venv/*"] diff --git a/rust/kcl-test-server/Cargo.toml b/rust/kcl-test-server/Cargo.toml index a0aec3330..09294be15 100644 --- a/rust/kcl-test-server/Cargo.toml +++ b/rust/kcl-test-server/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-test-server" description = "A test server for KCL" -version = "0.1.73" +version = "0.1.74" edition = "2021" license = "MIT" diff --git a/rust/kcl-to-core/Cargo.toml b/rust/kcl-to-core/Cargo.toml index bc7a44461..eaa0f5bf1 100644 --- a/rust/kcl-to-core/Cargo.toml +++ b/rust/kcl-to-core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-to-core" description = "Utility methods to convert kcl to engine core executable tests" -version = "0.1.73" +version = "0.1.74" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" diff --git a/rust/kcl-wasm-lib/Cargo.toml b/rust/kcl-wasm-lib/Cargo.toml index 5b40f3d07..685ec23f1 100644 --- a/rust/kcl-wasm-lib/Cargo.toml +++ b/rust/kcl-wasm-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kcl-wasm-lib" -version = "0.1.73" +version = "0.1.74" edition = "2021" repository = "https://github.com/KittyCAD/modeling-app" rust-version = "1.83"