diff --git a/rust/kcl-lib/src/simulation_tests.rs b/rust/kcl-lib/src/simulation_tests.rs index 0cdcd7fe8..a07425a9b 100644 --- a/rust/kcl-lib/src/simulation_tests.rs +++ b/rust/kcl-lib/src/simulation_tests.rs @@ -2750,3 +2750,87 @@ mod panic_repro_cube { super::execute(TEST_NAME, true).await } } +mod subtract_regression00 { + const TEST_NAME: &str = "subtract_regression00"; + + /// 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_regression01 { + const TEST_NAME: &str = "subtract_regression01"; + + /// 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_regression02 { + const TEST_NAME: &str = "subtract_regression02"; + + /// 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_regression03 { + const TEST_NAME: &str = "subtract_regression03"; + + /// 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 + } +} diff --git a/rust/kcl-lib/tests/subtract_regression00/artifact_commands.snap b/rust/kcl-lib/tests/subtract_regression00/artifact_commands.snap new file mode 100644 index 000000000..36cda239d --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/artifact_commands.snap @@ -0,0 +1,653 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands subtract_regression00.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": -25.0, + "y": -25.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": 50.0, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": 50.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -50.0, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": -50.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 50.0, + "faces": null, + "opposite": { + "Other": 0.0 + } + } + }, + { + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 55.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 1.0, + "z": 0.0 + }, + "size": 100.0, + "clobber": false, + "hide": false + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "plane_set_color", + "plane_id": "[uuid]", + "color": { + "r": 0.6, + "g": 0.6, + "b": 0.6, + "a": 0.3 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 0.0, + "y": 0.0 + }, + "radius": 12.5, + "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": 12.5, + "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": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": -60.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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression00/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/subtract_regression00/artifact_graph_flowchart.snap new file mode 100644 index 000000000..ade882444 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart subtract_regression00.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/subtract_regression00/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/subtract_regression00/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..537facc3d --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/artifact_graph_flowchart.snap.md @@ -0,0 +1,115 @@ +```mermaid +flowchart LR + subgraph path4 [Path] + 4["Path
[88, 128, 0]"] + 6["Segment
[134, 152, 0]"] + 7["Segment
[158, 176, 0]"] + 8["Segment
[182, 201, 0]"] + 9["Segment
[207, 226, 0]"] + 10["Segment
[232, 239, 0]"] + 12[Solid2d] + end + subgraph path5 [Path] + 5["Path
[401, 458, 0]"] + 11["Segment
[401, 458, 0]"] + 13[Solid2d] + end + 1["Plane
[47, 64, 0]"] + 2["Plane
[348, 376, 0]"] + 3["StartSketchOnPlane
[334, 377, 0]"] + 14["Sweep Extrusion
[254, 320, 0]"] + 15["Sweep Extrusion
[476, 518, 0]"] + 16["CompositeSolid Subtract
[529, 572, 0]"] + 17[Wall] + 18[Wall] + 19[Wall] + 20[Wall] + 21[Wall] + 22["Cap Start"] + 23["Cap Start"] + 24["Cap End"] + 25["Cap End"] + 26["SweepEdge Opposite"] + 27["SweepEdge Opposite"] + 28["SweepEdge Opposite"] + 29["SweepEdge Opposite"] + 30["SweepEdge Opposite"] + 31["SweepEdge Adjacent"] + 32["SweepEdge Adjacent"] + 33["SweepEdge Adjacent"] + 34["SweepEdge Adjacent"] + 35["SweepEdge Adjacent"] + 1 --- 4 + 2 <--x 3 + 2 --- 5 + 4 --- 6 + 4 --- 7 + 4 --- 8 + 4 --- 9 + 4 --- 10 + 4 --- 12 + 4 ---- 14 + 4 --- 16 + 5 --- 11 + 5 --- 13 + 5 ---- 15 + 5 --- 16 + 6 --- 20 + 6 x--> 22 + 6 --- 26 + 6 --- 34 + 7 --- 18 + 7 x--> 22 + 7 --- 29 + 7 --- 32 + 8 --- 17 + 8 x--> 22 + 8 --- 28 + 8 --- 33 + 9 --- 19 + 9 x--> 22 + 9 --- 27 + 9 --- 31 + 11 --- 21 + 11 x--> 25 + 11 --- 30 + 11 --- 35 + 14 --- 17 + 14 --- 18 + 14 --- 19 + 14 --- 20 + 14 --- 22 + 14 --- 24 + 14 --- 26 + 14 --- 27 + 14 --- 28 + 14 --- 29 + 14 --- 31 + 14 --- 32 + 14 --- 33 + 14 --- 34 + 15 --- 21 + 15 --- 23 + 15 --- 25 + 15 --- 30 + 15 --- 35 + 28 <--x 17 + 32 <--x 17 + 33 <--x 17 + 29 <--x 18 + 32 <--x 18 + 34 <--x 18 + 27 <--x 19 + 31 <--x 19 + 33 <--x 19 + 26 <--x 20 + 31 <--x 20 + 34 <--x 20 + 30 <--x 21 + 35 <--x 21 + 30 <--x 23 + 26 <--x 24 + 27 <--x 24 + 28 <--x 24 + 29 <--x 24 +``` diff --git a/rust/kcl-lib/tests/subtract_regression00/ast.snap b/rust/kcl-lib/tests/subtract_regression00/ast.snap new file mode 100644 index 000000000..5de9e8bd2 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/ast.snap @@ -0,0 +1,1069 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing subtract_regression00.kcl +--- +{ + "Ok": { + "body": [ + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch000", + "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": "sketch000Profile000", + "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": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "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": "sketch000", + "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": "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": "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": { + "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": "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": "50", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 50.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": "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": "50", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 50.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": "yLine", + "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": "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": "50", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 50.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "bidirectionalLength", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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": "sketch000Profile000", + "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": "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": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "offset", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "55", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 55.0, + "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": { + "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": "sketch001Profile000", + "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": "12.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 12.5, + "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": "sketch001", + "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": "60", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 60.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": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch001Profile000", + "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": "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": "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": "mm", + "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" + } + } + ] + }, + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/subtract_regression00/input.kcl b/rust/kcl-lib/tests/subtract_regression00/input.kcl new file mode 100644 index 000000000..7cc0e4552 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/input.kcl @@ -0,0 +1,24 @@ +@settings(defaultLengthUnit = mm) + +sketch000 = startSketchOn(XY) + +sketch000Profile000 = startProfile(sketch000, at = [-25, -25]) + |> xLine(length = 50) + |> yLine(length = 50) + |> xLine(length = -50) + |> yLine(length = -50) + |> close() + +extrude000 = extrude(sketch000Profile000, length = 50, bidirectionalLength = 0) + +sketch001 = startSketchOn(offsetPlane(XY, offset = 55)) + +sketch001Profile000 = circle( + sketch001, + center = [0, 0], + radius = 12.5 +) + +cut000Extrude = extrude(sketch001Profile000, length = -60) + +cut000 = subtract(extrude000, tools = cut000Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression00/ops.snap b/rust/kcl-lib/tests/subtract_regression00/ops.snap new file mode 100644 index 000000000..260e6114c --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/ops.snap @@ -0,0 +1,167 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed subtract_regression00.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "bidirectionalLength": { + "value": { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "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": {}, + "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": 55.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "sourceRange": [] + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": -60.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": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression00/program_memory.snap b/rust/kcl-lib/tests/subtract_regression00/program_memory.snap new file mode 100644 index 000000000..a35e2c88c --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/program_memory.snap @@ -0,0 +1,820 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing subtract_regression00.kcl +--- +{ + "cut000": { + "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": [ + -25.0, + -25.0 + ], + "tag": null, + "to": [ + 25.0, + -25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 25.0, + -25.0 + ], + "tag": null, + "to": [ + 25.0, + 25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 25.0, + 25.0 + ], + "tag": null, + "to": [ + -25.0, + 25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + 25.0 + ], + "tag": null, + "to": [ + -25.0, + -25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + -25.0 + ], + "tag": null, + "to": [ + -25.0, + -25.0 + ], + "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": [ + -25.0, + -25.0 + ], + "to": [ + -25.0, + -25.0 + ], + "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 + } + }, + "cut000Extrude": { + "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": [ + 0.0, + 0.0 + ], + "from": [ + 12.5, + 0.0 + ], + "radius": 12.5, + "tag": null, + "to": [ + 12.5, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 55.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "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": [ + 12.5, + 0.0 + ], + "to": [ + 12.5, + 0.0 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + }, + "height": -60.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Mm" + }, + "sectional": false + } + }, + "extrude000": { + "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": [ + -25.0, + -25.0 + ], + "tag": null, + "to": [ + 25.0, + -25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 25.0, + -25.0 + ], + "tag": null, + "to": [ + 25.0, + 25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 25.0, + 25.0 + ], + "tag": null, + "to": [ + -25.0, + 25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + 25.0 + ], + "tag": null, + "to": [ + -25.0, + -25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + -25.0 + ], + "tag": null, + "to": [ + -25.0, + -25.0 + ], + "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": [ + -25.0, + -25.0 + ], + "to": [ + -25.0, + -25.0 + ], + "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 + } + }, + "sketch000": { + "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" + } + } + } + }, + "sketch000Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + -25.0 + ], + "tag": null, + "to": [ + 25.0, + -25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 25.0, + -25.0 + ], + "tag": null, + "to": [ + 25.0, + 25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 25.0, + 25.0 + ], + "tag": null, + "to": [ + -25.0, + 25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + 25.0 + ], + "tag": null, + "to": [ + -25.0, + -25.0 + ], + "type": "ToPoint", + "units": { + "type": "Mm" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -25.0, + -25.0 + ], + "tag": null, + "to": [ + -25.0, + -25.0 + ], + "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": [ + -25.0, + -25.0 + ], + "to": [ + -25.0, + -25.0 + ], + "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": 55.0, + "units": { + "type": "Mm" + } + }, + "value": "Custom", + "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" + } + } + } + }, + "sketch001Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.0, + 0.0 + ], + "from": [ + 12.5, + 0.0 + ], + "radius": 12.5, + "tag": null, + "to": [ + 12.5, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Mm" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 55.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "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": [ + 12.5, + 0.0 + ], + "to": [ + 12.5, + 0.0 + ], + "units": { + "type": "Mm" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Mm" + } + } + } +} diff --git a/rust/kcl-lib/tests/subtract_regression00/rendered_model.png b/rust/kcl-lib/tests/subtract_regression00/rendered_model.png new file mode 100644 index 000000000..9d946187c Binary files /dev/null and b/rust/kcl-lib/tests/subtract_regression00/rendered_model.png differ diff --git a/rust/kcl-lib/tests/subtract_regression00/unparsed.snap b/rust/kcl-lib/tests/subtract_regression00/unparsed.snap new file mode 100644 index 000000000..c55177a77 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression00/unparsed.snap @@ -0,0 +1,24 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing subtract_regression00.kcl +--- +@settings(defaultLengthUnit = mm) + +sketch000 = startSketchOn(XY) + +sketch000Profile000 = startProfile(sketch000, at = [-25, -25]) + |> xLine(length = 50) + |> yLine(length = 50) + |> xLine(length = -50) + |> yLine(length = -50) + |> close() + +extrude000 = extrude(sketch000Profile000, length = 50, bidirectionalLength = 0) + +sketch001 = startSketchOn(offsetPlane(XY, offset = 55)) + +sketch001Profile000 = circle(sketch001, center = [0, 0], radius = 12.5) + +cut000Extrude = extrude(sketch001Profile000, length = -60) + +cut000 = subtract(extrude000, tools = cut000Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression01/artifact_commands.snap b/rust/kcl-lib/tests/subtract_regression01/artifact_commands.snap new file mode 100644 index 000000000..0f40847dd --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/artifact_commands.snap @@ -0,0 +1,844 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands subtract_regression01.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": -23.1902, + "y": -14.909799999999999, + "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.1902, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -0.0, + "y": -0.0 + }, + "radius": 14.909799999999999, + "start": { + "unit": "degrees", + "value": -90.0 + }, + "end": { + "unit": "degrees", + "value": 227.157002 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 1.5026, + "y": 1.6203, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -0.0, + "y": -0.0 + }, + "radius": 12.7, + "start": { + "unit": "degrees", + "value": 227.157002 + }, + "end": { + "unit": "degrees", + "value": -90.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -23.1902, + "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": -2.2098, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 6.35, + "faces": null, + "opposite": { + "Other": 6.35 + } + } + }, + { + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": -6.35, + "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": -17.9832, + "y": 0.0 + }, + "radius": 2.6034999999999995, + "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": -15.379699999999998, + "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": 12.7, + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression01/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/subtract_regression01/artifact_graph_flowchart.snap new file mode 100644 index 000000000..3e5bf48e6 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart subtract_regression01.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/subtract_regression01/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/subtract_regression01/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..f0d61f967 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/artifact_graph_flowchart.snap.md @@ -0,0 +1,161 @@ +```mermaid +flowchart LR + subgraph path4 [Path] + 4["Path
[88, 134, 0]"] + 6["Segment
[140, 161, 0]"] + 7["Segment
[167, 255, 0]"] + 8["Segment
[261, 292, 0]"] + 9["Segment
[298, 384, 0]"] + 10["Segment
[390, 412, 0]"] + 11["Segment
[418, 440, 0]"] + 12["Segment
[446, 453, 0]"] + 14[Solid2d] + end + subgraph path5 [Path] + 5["Path
[622, 686, 0]"] + 13["Segment
[622, 686, 0]"] + 15[Solid2d] + end + 1["Plane
[47, 64, 0]"] + 2["Plane
[567, 597, 0]"] + 3["StartSketchOnPlane
[553, 598, 0]"] + 16["Sweep Extrusion
[468, 539, 0]"] + 17["Sweep Extrusion
[704, 748, 0]"] + 18["CompositeSolid Subtract
[759, 802, 0]"] + 19[Wall] + 20[Wall] + 21[Wall] + 22[Wall] + 23[Wall] + 24[Wall] + 25[Wall] + 26[Wall] + 27["Cap Start"] + 28["Cap Start"] + 29["Cap End"] + 30["Cap End"] + 31["SweepEdge Opposite"] + 32["SweepEdge Opposite"] + 33["SweepEdge Opposite"] + 34["SweepEdge Opposite"] + 35["SweepEdge Opposite"] + 36["SweepEdge Opposite"] + 37["SweepEdge Opposite"] + 38["SweepEdge Opposite"] + 39["SweepEdge Adjacent"] + 40["SweepEdge Adjacent"] + 41["SweepEdge Adjacent"] + 42["SweepEdge Adjacent"] + 43["SweepEdge Adjacent"] + 44["SweepEdge Adjacent"] + 45["SweepEdge Adjacent"] + 46["SweepEdge Adjacent"] + 1 --- 4 + 2 <--x 3 + 2 --- 5 + 4 --- 6 + 4 --- 7 + 4 --- 8 + 4 --- 9 + 4 --- 10 + 4 --- 11 + 4 --- 12 + 4 --- 14 + 4 ---- 16 + 4 --- 18 + 5 --- 13 + 5 --- 15 + 5 ---- 17 + 5 --- 18 + 6 --- 26 + 6 x--> 28 + 6 --- 35 + 6 --- 44 + 7 --- 23 + 7 x--> 28 + 7 --- 38 + 7 --- 41 + 8 --- 22 + 8 x--> 28 + 8 --- 33 + 8 --- 43 + 9 --- 24 + 9 x--> 28 + 9 --- 37 + 9 --- 40 + 10 --- 21 + 10 x--> 28 + 10 --- 34 + 10 --- 42 + 11 --- 20 + 11 x--> 28 + 11 --- 32 + 11 --- 46 + 12 --- 25 + 12 x--> 28 + 12 --- 36 + 12 --- 45 + 13 --- 19 + 13 x--> 27 + 13 --- 31 + 13 --- 39 + 16 --- 20 + 16 --- 21 + 16 --- 22 + 16 --- 23 + 16 --- 24 + 16 --- 25 + 16 --- 26 + 16 --- 28 + 16 --- 30 + 16 --- 32 + 16 --- 33 + 16 --- 34 + 16 --- 35 + 16 --- 36 + 16 --- 37 + 16 --- 38 + 16 --- 40 + 16 --- 41 + 16 --- 42 + 16 --- 43 + 16 --- 44 + 16 --- 45 + 16 --- 46 + 17 --- 19 + 17 --- 27 + 17 --- 29 + 17 --- 31 + 17 --- 39 + 31 <--x 19 + 39 <--x 19 + 32 <--x 20 + 42 <--x 20 + 46 <--x 20 + 34 <--x 21 + 40 <--x 21 + 42 <--x 21 + 33 <--x 22 + 41 <--x 22 + 43 <--x 22 + 38 <--x 23 + 41 <--x 23 + 44 <--x 23 + 37 <--x 24 + 40 <--x 24 + 43 <--x 24 + 36 <--x 25 + 45 <--x 25 + 46 <--x 25 + 35 <--x 26 + 44 <--x 26 + 45 <--x 26 + 31 <--x 29 + 32 <--x 30 + 33 <--x 30 + 34 <--x 30 + 35 <--x 30 + 36 <--x 30 + 37 <--x 30 + 38 <--x 30 +``` diff --git a/rust/kcl-lib/tests/subtract_regression01/ast.snap b/rust/kcl-lib/tests/subtract_regression01/ast.snap new file mode 100644 index 000000000..1e57c2649 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/ast.snap @@ -0,0 +1,1297 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing subtract_regression01.kcl +--- +{ + "Ok": { + "body": [ + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch000", + "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": "sketch000Profile000", + "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.913", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.913, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.587", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.587, + "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": "sketch000", + "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.913", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.913, + "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": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "90", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 90.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "227.157002", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 227.157002, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.587", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.587, + "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": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.059159", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.059159, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.06379", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.06379, + "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": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "227.157002", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 227.157002, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "90", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 90.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.5, + "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.913", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.913, + "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": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.087", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.087, + "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 + }, + { + "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": "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.25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.25, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "bidirectionalLength", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.25, + "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": "sketch000Profile000", + "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": "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": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "offset", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.25, + "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": { + "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": "sketch001Profile000", + "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.708", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.708, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "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.1025", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1025, + "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": "sketch001", + "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": { + "commentStart": 0, + "end": 0, + "raw": "0.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.5, + "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": "sketch001Profile000", + "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": "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" + } + } + ] + }, + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/subtract_regression01/input.kcl b/rust/kcl-lib/tests/subtract_regression01/input.kcl new file mode 100644 index 000000000..b2c30aa5c --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/input.kcl @@ -0,0 +1,34 @@ +@settings(defaultLengthUnit = in) + +sketch000 = startSketchOn(XY) + +sketch000Profile000 = startProfile(sketch000, at = [-0.913, -0.587]) + |> xLine(length = 0.913) + |> arc( + angleStart = -90, + angleEnd = 227.157002, + radius = 0.587 + ) + |> line(end = [0.059159, 0.06379]) + |> arc( + angleStart = 227.157002, + angleEnd = -90, + radius = 0.5 + ) + |> xLine(length = -0.913) + |> yLine(length = -0.087) + |> close() + +extrude000 = extrude(sketch000Profile000, length = 0.25, bidirectionalLength = 0.25) + +sketch001 = startSketchOn(offsetPlane(XZ, offset = 0.25)) + +sketch001Profile000 = circle( + sketch001, + center = [-0.708, 0], + radius = 0.1025 +) + +cut000Extrude = extrude([sketch001Profile000], length = 0.5) + +cut000 = subtract(extrude000, tools = cut000Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression01/ops.snap b/rust/kcl-lib/tests/subtract_regression01/ops.snap new file mode 100644 index 000000000..fc9169adf --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/ops.snap @@ -0,0 +1,172 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed subtract_regression01.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "bidirectionalLength": { + "value": { + "type": "Number", + "value": 0.25, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "length": { + "value": { + "type": "Number", + "value": 0.25, + "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": [] + } + }, + { + "type": "KclStdLibCall", + "name": "offsetPlane", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + }, + "labeledArgs": { + "offset": { + "value": { + "type": "Number", + "value": 0.25, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + } + }, + "sourceRange": [] + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": 0.5, + "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": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression01/program_memory.snap b/rust/kcl-lib/tests/subtract_regression01/program_memory.snap new file mode 100644 index 000000000..f259021da --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/program_memory.snap @@ -0,0 +1,1012 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing subtract_regression01.kcl +--- +{ + "cut000": { + "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": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + }, + { + "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": [ + -0.913, + -0.587 + ], + "tag": null, + "to": [ + 0.0, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.0, + -0.0 + ], + "from": [ + 0.0, + -0.587 + ], + "radius": 0.587, + "tag": null, + "to": [ + -0.3992, + -0.4304 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.3992, + -0.4304 + ], + "tag": null, + "to": [ + -0.34, + -0.3666 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.0, + -0.0 + ], + "from": [ + -0.34, + -0.3666 + ], + "radius": 0.5, + "tag": null, + "to": [ + -0.0, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.0, + -0.5 + ], + "tag": null, + "to": [ + -0.913, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.5 + ], + "tag": null, + "to": [ + -0.913, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.587 + ], + "tag": null, + "to": [ + -0.913, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.913, + -0.587 + ], + "to": [ + -0.913, + -0.587 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.25, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut000Extrude": { + "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": [ + -0.708, + 0.0 + ], + "from": [ + -0.6055, + 0.0 + ], + "radius": 0.1025, + "tag": null, + "to": [ + -0.6055, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": -6.35, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "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": [ + -0.6055, + 0.0 + ], + "to": [ + -0.6055, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.5, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "extrude000": { + "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": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + }, + { + "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": [ + -0.913, + -0.587 + ], + "tag": null, + "to": [ + 0.0, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.0, + -0.0 + ], + "from": [ + 0.0, + -0.587 + ], + "radius": 0.587, + "tag": null, + "to": [ + -0.3992, + -0.4304 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.3992, + -0.4304 + ], + "tag": null, + "to": [ + -0.34, + -0.3666 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.0, + -0.0 + ], + "from": [ + -0.34, + -0.3666 + ], + "radius": 0.5, + "tag": null, + "to": [ + -0.0, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.0, + -0.5 + ], + "tag": null, + "to": [ + -0.913, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.5 + ], + "tag": null, + "to": [ + -0.913, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.587 + ], + "tag": null, + "to": [ + -0.913, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.913, + -0.587 + ], + "to": [ + -0.913, + -0.587 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.25, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "sketch000": { + "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" + } + } + } + }, + "sketch000Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.587 + ], + "tag": null, + "to": [ + 0.0, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.0, + -0.0 + ], + "from": [ + 0.0, + -0.587 + ], + "radius": 0.587, + "tag": null, + "to": [ + -0.3992, + -0.4304 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.3992, + -0.4304 + ], + "tag": null, + "to": [ + -0.34, + -0.3666 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.0, + -0.0 + ], + "from": [ + -0.34, + -0.3666 + ], + "radius": 0.5, + "tag": null, + "to": [ + -0.0, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.0, + -0.5 + ], + "tag": null, + "to": [ + -0.913, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.5 + ], + "tag": null, + "to": [ + -0.913, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.913, + -0.587 + ], + "tag": null, + "to": [ + -0.913, + -0.587 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.913, + -0.587 + ], + "to": [ + -0.913, + -0.587 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch001": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": -6.35, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "Custom", + "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" + } + } + } + }, + "sketch001Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.708, + 0.0 + ], + "from": [ + -0.6055, + 0.0 + ], + "radius": 0.1025, + "tag": null, + "to": [ + -0.6055, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": -6.35, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "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": [ + -0.6055, + 0.0 + ], + "to": [ + -0.6055, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + } +} diff --git a/rust/kcl-lib/tests/subtract_regression01/rendered_model.png b/rust/kcl-lib/tests/subtract_regression01/rendered_model.png new file mode 100644 index 000000000..a4d96af7c Binary files /dev/null and b/rust/kcl-lib/tests/subtract_regression01/rendered_model.png differ diff --git a/rust/kcl-lib/tests/subtract_regression01/unparsed.snap b/rust/kcl-lib/tests/subtract_regression01/unparsed.snap new file mode 100644 index 000000000..4a25f97e9 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression01/unparsed.snap @@ -0,0 +1,26 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing subtract_regression01.kcl +--- +@settings(defaultLengthUnit = in) + +sketch000 = startSketchOn(XY) + +sketch000Profile000 = startProfile(sketch000, at = [-0.913, -0.587]) + |> xLine(length = 0.913) + |> arc(angleStart = -90, angleEnd = 227.157002, radius = 0.587) + |> line(end = [0.059159, 0.06379]) + |> arc(angleStart = 227.157002, angleEnd = -90, radius = 0.5) + |> xLine(length = -0.913) + |> yLine(length = -0.087) + |> close() + +extrude000 = extrude(sketch000Profile000, length = 0.25, bidirectionalLength = 0.25) + +sketch001 = startSketchOn(offsetPlane(XZ, offset = 0.25)) + +sketch001Profile000 = circle(sketch001, center = [-0.708, 0], radius = 0.1025) + +cut000Extrude = extrude([sketch001Profile000], length = 0.5) + +cut000 = subtract(extrude000, tools = cut000Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression02/artifact_commands.snap b/rust/kcl-lib/tests/subtract_regression02/artifact_commands.snap new file mode 100644 index 000000000..402bb8d9f --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/artifact_commands.snap @@ -0,0 +1,1063 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands subtract_regression02.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": -19.049999999999997, + "y": 19.049999999999997, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": -38.1, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 38.1, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 12.7, + "y": -19.05 + }, + "radius": 6.35, + "start": { + "unit": "degrees", + "value": 0.0 + }, + "end": { + "unit": "degrees", + "value": 90.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -17.4752, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -4.7752, + "y": -4.7752 + }, + "radius": 7.924799999999999, + "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": 17.4752, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -19.05, + "y": 12.7 + }, + "radius": 6.35, + "start": { + "unit": "degrees", + "value": 0.0 + }, + "end": { + "unit": "degrees", + "value": 90.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": 16.637, + "faces": null, + "opposite": { + "Other": 16.637 + } + } + }, + { + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 1.0, + "y": 0.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "close_path", + "path_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "enable_sketch_mode", + "entity_id": "[uuid]", + "ortho": false, + "animated": false, + "adjust_camera": false, + "planar_normal": { + "x": 0.0, + "y": -1.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 0.0, + "y": 0.0 + }, + "radius": 4.1655999999999995, + "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": 4.1655999999999995, + "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": 25.4, + "faces": null, + "opposite": { + "Other": 0.0 + } + } + }, + { + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "x_axis": { + "x": 0.0, + "y": -1.0, + "z": 0.0 + }, + "y_axis": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "size": 60.0, + "clobber": false, + "hide": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "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": -1.0, + "y": 0.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 0.0, + "y": 0.0 + }, + "radius": 4.1655999999999995, + "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": 4.1655999999999995, + "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": -1.0, + "y": 0.0, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": 25.4, + "faces": null, + "opposite": { + "Other": 0.0 + } + } + }, + { + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression02/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/subtract_regression02/artifact_graph_flowchart.snap new file mode 100644 index 000000000..2fd72573e --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart subtract_regression02.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/subtract_regression02/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/subtract_regression02/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..df738b757 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/artifact_graph_flowchart.snap.md @@ -0,0 +1,192 @@ +```mermaid +flowchart LR + subgraph path4 [Path] + 4["Path
[88, 131, 0]"] + 7["Segment
[137, 157, 0]"] + 8["Segment
[163, 182, 0]"] + 9["Segment
[188, 265, 0]"] + 10["Segment
[271, 293, 0]"] + 11["Segment
[299, 380, 0]"] + 12["Segment
[386, 407, 0]"] + 13["Segment
[413, 490, 0]"] + 14["Segment
[496, 503, 0]"] + 19[Solid2d] + end + subgraph path5 [Path] + 5["Path
[646, 704, 0]"] + 15["Segment
[646, 704, 0]"] + 17[Solid2d] + end + subgraph path6 [Path] + 6["Path
[901, 959, 0]"] + 16["Segment
[901, 959, 0]"] + 18[Solid2d] + end + 1["Plane
[47, 64, 0]"] + 2["Plane
[605, 622, 0]"] + 3["Plane
[859, 877, 0]"] + 20["Sweep Extrusion
[518, 591, 0]"] + 21["Sweep Extrusion
[722, 791, 0]"] + 22["Sweep Extrusion
[977, 1046, 0]"] + 23["CompositeSolid Subtract
[802, 845, 0]"] + 24["CompositeSolid Subtract
[1057, 1096, 0]"] + 25[Wall] + 26[Wall] + 27[Wall] + 28[Wall] + 29[Wall] + 30[Wall] + 31[Wall] + 32[Wall] + 33[Wall] + 34["Cap Start"] + 35["Cap Start"] + 36["Cap Start"] + 37["Cap End"] + 38["Cap End"] + 39["Cap End"] + 40["SweepEdge Opposite"] + 41["SweepEdge Opposite"] + 42["SweepEdge Opposite"] + 43["SweepEdge Opposite"] + 44["SweepEdge Opposite"] + 45["SweepEdge Opposite"] + 46["SweepEdge Opposite"] + 47["SweepEdge Opposite"] + 48["SweepEdge Opposite"] + 49["SweepEdge Adjacent"] + 50["SweepEdge Adjacent"] + 51["SweepEdge Adjacent"] + 52["SweepEdge Adjacent"] + 53["SweepEdge Adjacent"] + 54["SweepEdge Adjacent"] + 55["SweepEdge Adjacent"] + 56["SweepEdge Adjacent"] + 57["SweepEdge Adjacent"] + 1 --- 4 + 2 --- 5 + 3 --- 6 + 4 --- 7 + 4 --- 8 + 4 --- 9 + 4 --- 10 + 4 --- 11 + 4 --- 12 + 4 --- 13 + 4 --- 14 + 4 --- 19 + 4 ---- 20 + 4 --- 23 + 5 --- 15 + 5 --- 17 + 5 ---- 21 + 5 --- 23 + 6 --- 16 + 6 --- 18 + 6 ---- 22 + 6 --- 24 + 7 --- 32 + 7 x--> 36 + 7 --- 45 + 7 --- 50 + 8 --- 29 + 8 x--> 36 + 8 --- 42 + 8 --- 53 + 9 --- 28 + 9 x--> 36 + 9 --- 44 + 9 --- 51 + 10 --- 30 + 10 x--> 36 + 10 --- 41 + 10 --- 54 + 11 --- 27 + 11 x--> 36 + 11 --- 43 + 11 --- 55 + 12 --- 26 + 12 x--> 36 + 12 --- 47 + 12 --- 56 + 13 --- 31 + 13 x--> 36 + 13 --- 46 + 13 --- 52 + 15 --- 25 + 15 x--> 35 + 15 --- 40 + 15 --- 49 + 16 --- 33 + 16 x--> 34 + 16 --- 48 + 16 --- 57 + 20 --- 26 + 20 --- 27 + 20 --- 28 + 20 --- 29 + 20 --- 30 + 20 --- 31 + 20 --- 32 + 20 --- 36 + 20 --- 39 + 20 --- 41 + 20 --- 42 + 20 --- 43 + 20 --- 44 + 20 --- 45 + 20 --- 46 + 20 --- 47 + 20 --- 50 + 20 --- 51 + 20 --- 52 + 20 --- 53 + 20 --- 54 + 20 --- 55 + 20 --- 56 + 21 --- 25 + 21 --- 35 + 21 --- 38 + 21 --- 40 + 21 --- 49 + 22 --- 33 + 22 --- 34 + 22 --- 37 + 22 --- 48 + 22 --- 57 + 23 --- 24 + 40 <--x 25 + 49 <--x 25 + 47 <--x 26 + 55 <--x 26 + 56 <--x 26 + 43 <--x 27 + 54 <--x 27 + 55 <--x 27 + 44 <--x 28 + 51 <--x 28 + 53 <--x 28 + 42 <--x 29 + 50 <--x 29 + 53 <--x 29 + 41 <--x 30 + 51 <--x 30 + 54 <--x 30 + 46 <--x 31 + 52 <--x 31 + 56 <--x 31 + 45 <--x 32 + 50 <--x 32 + 52 <--x 32 + 48 <--x 33 + 57 <--x 33 + 48 <--x 37 + 40 <--x 38 + 41 <--x 39 + 42 <--x 39 + 43 <--x 39 + 44 <--x 39 + 45 <--x 39 + 46 <--x 39 + 47 <--x 39 +``` diff --git a/rust/kcl-lib/tests/subtract_regression02/ast.snap b/rust/kcl-lib/tests/subtract_regression02/ast.snap new file mode 100644 index 000000000..af2ff1aae --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/ast.snap @@ -0,0 +1,1749 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing subtract_regression02.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": { + "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": "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.75", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.75, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.75", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.75, + "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": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "1.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.5, + "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": { + "commentStart": 0, + "end": 0, + "raw": "1.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.5, + "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": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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.25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.25, + "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.688", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.688, + "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.312", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.312, + "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.688", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.688, + "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": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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.25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.25, + "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 + } + ], + "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.655", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.655, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "bidirectionalLength", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.655", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.655, + "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": "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": "sketch003Profile000", + "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.164", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.164, + "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": "sketch003", + "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": { + "commentStart": 0, + "end": 0, + "raw": "1.0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "bidirectionalLength", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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": { + "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" + } + ], + "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": "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, + "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": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "YZ", + "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": [ + { + "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.164", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.164, + "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": "cut001Extrude", + "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": "1.0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "bidirectionalLength", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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": { + "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": "cut001", + "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": "cut001Extrude", + "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": "cut000", + "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" + } + } + ] + }, + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/subtract_regression02/input.kcl b/rust/kcl-lib/tests/subtract_regression02/input.kcl new file mode 100644 index 000000000..67813ccfe --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/input.kcl @@ -0,0 +1,51 @@ +@settings(defaultLengthUnit = in) + +sketch002 = startSketchOn(XY) + +sketch002Profile000 = startProfile(sketch002, at = [-0.75, 0.75]) + |> yLine(length = -1.5) + |> xLine(length = 1.5) + |> arc( + angleStart = 0, + angleEnd = 90, + radius = 0.25 + ) + |> xLine(length = -0.688) + |> arc( + angleStart = 270, + angleEnd = 180, + radius = 0.312 + ) + |> yLine(length = 0.688) + |> arc( + angleStart = 0, + angleEnd = 90, + radius = 0.25 + ) + |> close() + +extrude000 = extrude(sketch002Profile000, length = 0.655, bidirectionalLength = 0.655) + +sketch003 = startSketchOn(XZ) + +sketch003Profile000 = circle( + sketch003, + center = [0, 0], + radius = 0.164 +) + +cut000Extrude = extrude([sketch003Profile000], length = 1.0, bidirectionalLength = 0) + +cut000 = subtract(extrude000, tools = cut000Extrude) + +sketch004 = startSketchOn(-YZ) + +sketch004Profile000 = circle( + sketch004, + center = [0, 0], + radius = 0.164 +) + +cut001Extrude = extrude([sketch004Profile000], length = 1.0, bidirectionalLength = 0) + +cut001 = subtract(cut000, tools = cut001Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression02/ops.snap b/rust/kcl-lib/tests/subtract_regression02/ops.snap new file mode 100644 index 000000000..91b346f28 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/ops.snap @@ -0,0 +1,249 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed subtract_regression02.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "bidirectionalLength": { + "value": { + "type": "Number", + "value": 0.655, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "length": { + "value": { + "type": "Number", + "value": 0.655, + "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.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "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": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "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.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "sourceRange": [] + }, + "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": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression02/program_memory.snap b/rust/kcl-lib/tests/subtract_regression02/program_memory.snap new file mode 100644 index 000000000..650f4dccc --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/program_memory.snap @@ -0,0 +1,1609 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing subtract_regression02.kcl +--- +{ + "cut000": { + "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": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + -0.75 + ], + "tag": null, + "to": [ + 0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.5, + -0.75 + ], + "from": [ + 0.75, + -0.75 + ], + "radius": 0.25, + "tag": null, + "to": [ + 0.5, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.5, + -0.5 + ], + "tag": null, + "to": [ + -0.188, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.188, + -0.188 + ], + "from": [ + -0.188, + -0.5 + ], + "radius": 0.312, + "tag": null, + "to": [ + -0.5, + -0.188 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.5, + -0.188 + ], + "tag": null, + "to": [ + -0.5, + 0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.75, + 0.5 + ], + "from": [ + -0.5, + 0.5 + ], + "radius": 0.25, + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.75, + 0.75 + ], + "to": [ + -0.75, + 0.75 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.655, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut000Extrude": { + "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": [ + 0.0, + 0.0 + ], + "from": [ + 0.164, + 0.0 + ], + "radius": 0.164, + "tag": null, + "to": [ + 0.164, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "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": [ + 0.164, + 0.0 + ], + "to": [ + 0.164, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 1.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut001": { + "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": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + -0.75 + ], + "tag": null, + "to": [ + 0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.5, + -0.75 + ], + "from": [ + 0.75, + -0.75 + ], + "radius": 0.25, + "tag": null, + "to": [ + 0.5, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.5, + -0.5 + ], + "tag": null, + "to": [ + -0.188, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.188, + -0.188 + ], + "from": [ + -0.188, + -0.5 + ], + "radius": 0.312, + "tag": null, + "to": [ + -0.5, + -0.188 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.5, + -0.188 + ], + "tag": null, + "to": [ + -0.5, + 0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.75, + 0.5 + ], + "from": [ + -0.5, + 0.5 + ], + "radius": 0.25, + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.75, + 0.75 + ], + "to": [ + -0.75, + 0.75 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.655, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut001Extrude": { + "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": [ + 0.0, + 0.0 + ], + "from": [ + 0.164, + 0.0 + ], + "radius": 0.164, + "tag": null, + "to": [ + 0.164, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": -1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.164, + 0.0 + ], + "to": [ + 0.164, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 1.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "extrude000": { + "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": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudePlane" + }, + { + "faceId": "[uuid]", + "id": "[uuid]", + "sourceRange": [], + "tag": null, + "type": "extrudeArc" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + -0.75 + ], + "tag": null, + "to": [ + 0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.5, + -0.75 + ], + "from": [ + 0.75, + -0.75 + ], + "radius": 0.25, + "tag": null, + "to": [ + 0.5, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.5, + -0.5 + ], + "tag": null, + "to": [ + -0.188, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.188, + -0.188 + ], + "from": [ + -0.188, + -0.5 + ], + "radius": 0.312, + "tag": null, + "to": [ + -0.5, + -0.188 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.5, + -0.188 + ], + "tag": null, + "to": [ + -0.5, + 0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.75, + 0.5 + ], + "from": [ + -0.5, + 0.5 + ], + "radius": 0.25, + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.75, + 0.75 + ], + "to": [ + -0.75, + 0.75 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.655, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "sketch002": { + "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" + } + } + } + }, + "sketch002Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + -0.75 + ], + "tag": null, + "to": [ + 0.75, + -0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.5, + -0.75 + ], + "from": [ + 0.75, + -0.75 + ], + "radius": 0.25, + "tag": null, + "to": [ + 0.5, + -0.5 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.5, + -0.5 + ], + "tag": null, + "to": [ + -0.188, + -0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.188, + -0.188 + ], + "from": [ + -0.188, + -0.5 + ], + "radius": 0.312, + "tag": null, + "to": [ + -0.5, + -0.188 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.5, + -0.188 + ], + "tag": null, + "to": [ + -0.5, + 0.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + -0.75, + 0.5 + ], + "from": [ + -0.5, + 0.5 + ], + "radius": 0.25, + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.75, + 0.75 + ], + "tag": null, + "to": [ + -0.75, + 0.75 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.75, + 0.75 + ], + "to": [ + -0.75, + 0.75 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch003": { + "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" + } + } + } + }, + "sketch003Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.0, + 0.0 + ], + "from": [ + 0.164, + 0.0 + ], + "radius": 0.164, + "tag": null, + "to": [ + 0.164, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "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": [ + 0.164, + 0.0 + ], + "to": [ + 0.164, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch004": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": -1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch004Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.0, + 0.0 + ], + "from": [ + 0.164, + 0.0 + ], + "radius": 0.164, + "tag": null, + "to": [ + 0.164, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": -1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.164, + 0.0 + ], + "to": [ + 0.164, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + } +} diff --git a/rust/kcl-lib/tests/subtract_regression02/rendered_model.png b/rust/kcl-lib/tests/subtract_regression02/rendered_model.png new file mode 100644 index 000000000..cb01df189 Binary files /dev/null and b/rust/kcl-lib/tests/subtract_regression02/rendered_model.png differ diff --git a/rust/kcl-lib/tests/subtract_regression02/unparsed.snap b/rust/kcl-lib/tests/subtract_regression02/unparsed.snap new file mode 100644 index 000000000..bc4da37fe --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression02/unparsed.snap @@ -0,0 +1,35 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing subtract_regression02.kcl +--- +@settings(defaultLengthUnit = in) + +sketch002 = startSketchOn(XY) + +sketch002Profile000 = startProfile(sketch002, at = [-0.75, 0.75]) + |> yLine(length = -1.5) + |> xLine(length = 1.5) + |> arc(angleStart = 0, angleEnd = 90, radius = 0.25) + |> xLine(length = -0.688) + |> arc(angleStart = 270, angleEnd = 180, radius = 0.312) + |> yLine(length = 0.688) + |> arc(angleStart = 0, angleEnd = 90, radius = 0.25) + |> close() + +extrude000 = extrude(sketch002Profile000, length = 0.655, bidirectionalLength = 0.655) + +sketch003 = startSketchOn(XZ) + +sketch003Profile000 = circle(sketch003, center = [0, 0], radius = 0.164) + +cut000Extrude = extrude([sketch003Profile000], length = 1.0, bidirectionalLength = 0) + +cut000 = subtract(extrude000, tools = cut000Extrude) + +sketch004 = startSketchOn(-YZ) + +sketch004Profile000 = circle(sketch004, center = [0, 0], radius = 0.164) + +cut001Extrude = extrude([sketch004Profile000], length = 1.0, bidirectionalLength = 0) + +cut001 = subtract(cut000, tools = cut001Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression03/artifact_commands.snap b/rust/kcl-lib/tests/subtract_regression03/artifact_commands.snap new file mode 100644 index 000000000..af9972d3c --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/artifact_commands.snap @@ -0,0 +1,1145 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact commands subtract_regression03.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": -12.7940816, + "y": -6.7290696, + "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": -4.8739, + "y": 4.3836, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": -14.878, + "y": 0.7564 + }, + "radius": 4.17195, + "start": { + "unit": "degrees", + "value": 228.031232 + }, + "end": { + "unit": "degrees", + "value": 105.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 11.8064, + "y": 3.1635, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 0.0, + "y": -7.5438 + }, + "radius": 16.0401, + "start": { + "unit": "degrees", + "value": 105.0 + }, + "end": { + "unit": "degrees", + "value": 75.0 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 11.8064, + "y": -3.1635, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 14.8781, + "y": 0.7564 + }, + "radius": 4.17195, + "start": { + "unit": "degrees", + "value": 75.0 + }, + "end": { + "unit": "degrees", + "value": -37.055012 + }, + "relative": false + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -5.0882, + "y": -6.7388, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "set_object_transform", + "object_id": "[uuid]", + "transforms": [ + { + "translate": null, + "rotate_rpy": null, + "rotate_angle_axis": null, + "scale": { + "property": { + "x": 0.958, + "y": 0.958, + "z": 1.0 + }, + "set": false, + "is_local": true + } + } + ] + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": -12.7940816, + "y": -6.7290696, + "z": 0.0 + }, + "x_axis": { + "x": 0.7435091262737867, + "y": 0.6687257877094245, + "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.6687257877094245, + "y": -0.7435091262737867, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "arc", + "center": { + "x": 0.0, + "y": 0.0 + }, + "radius": 1.2573, + "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": 1.2573, + "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": "object_bring_to_front", + "object_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sweep", + "target": "[uuid]", + "trajectory": "[uuid]", + "sectional": false, + "tolerance": 0.0000001 + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": -12.7940816, + "y": -7.112, + "z": 0.0 + }, + "x_axis": { + "x": -0.7435091262737867, + "y": 0.6687257877094245, + "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.6687257877094245, + "y": -0.7435091262737867, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 0.0, + "y": -1.5239999999999998, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 3.2771, + "y": 3.048, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -3.2771, + "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": -3.048, + "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.6687257877094245, + "y": -0.7435091262737867, + "z": -0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": -5.08, + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "make_plane", + "origin": { + "x": 10.668, + "y": -7.112, + "z": 0.0 + }, + "x_axis": { + "x": -0.6025804201392091, + "y": -0.7980581665924197, + "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.7980581665924197, + "y": 0.6025804201392091, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "move_path_pen", + "path": "[uuid]", + "to": { + "x": 0.0, + "y": -1.5239999999999998, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "object_visible", + "object_id": "[uuid]", + "hidden": true + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "sketch_mode_disable" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "start_path" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 0.0, + "y": 3.048, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": -3.2771, + "y": 0.0, + "z": 0.0 + }, + "relative": true + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extend_path", + "path": "[uuid]", + "segment": { + "type": "line", + "end": { + "x": 3.2771, + "y": -3.048, + "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.7980581665924197, + "y": 0.6025804201392091, + "z": 0.0 + } + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "extrude", + "target": "[uuid]", + "distance": -5.08, + "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_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "object_id": "[uuid]", + "edge_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_all_edge_faces", + "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_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "boolean_subtract", + "target_ids": [ + "[uuid]" + ], + "tool_ids": [ + "[uuid]" + ], + "tolerance": 0.0000001 + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression03/artifact_graph_flowchart.snap b/rust/kcl-lib/tests/subtract_regression03/artifact_graph_flowchart.snap new file mode 100644 index 000000000..f8c80f310 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/artifact_graph_flowchart.snap @@ -0,0 +1,6 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Artifact graph flowchart subtract_regression03.kcl +extension: md +snapshot_kind: binary +--- diff --git a/rust/kcl-lib/tests/subtract_regression03/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/subtract_regression03/artifact_graph_flowchart.snap.md new file mode 100644 index 000000000..a6883417c --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/artifact_graph_flowchart.snap.md @@ -0,0 +1,182 @@ +```mermaid +flowchart LR + subgraph path5 [Path] + 5["Path
[88, 140, 0]"] + 9["Segment
[146, 179, 0]"] + 10["Segment
[185, 275, 0]"] + 11["Segment
[281, 313, 0]"] + 12["Segment
[319, 400, 0]"] + 13["Segment
[406, 439, 0]"] + 14["Segment
[445, 534, 0]"] + 15["Segment
[540, 574, 0]"] + end + subgraph path6 [Path] + 6["Path
[813, 872, 0]"] + 16["Segment
[813, 872, 0]"] + 27[Solid2d] + end + subgraph path7 [Path] + 7["Path
[1156, 1196, 0]"] + 17["Segment
[1202, 1230, 0]"] + 18["Segment
[1236, 1261, 0]"] + 19["Segment
[1267, 1288, 0]"] + 20["Segment
[1294, 1301, 0]"] + 26[Solid2d] + end + subgraph path8 [Path] + 8["Path
[1621, 1661, 0]"] + 21["Segment
[1667, 1687, 0]"] + 22["Segment
[1693, 1718, 0]"] + 23["Segment
[1724, 1753, 0]"] + 24["Segment
[1759, 1766, 0]"] + 25[Solid2d] + end + 1["Plane
[47, 64, 0]"] + 2["Plane
[766, 789, 0]"] + 3["Plane
[1109, 1132, 0]"] + 4["Plane
[1574, 1597, 0]"] + 28["Sweep Sweep
[892, 952, 0]"] + 29["Sweep Extrusion
[1319, 1364, 0]"] + 30["Sweep Extrusion
[1784, 1829, 0]"] + 31["CompositeSolid Subtract
[1375, 1423, 0]"] + 32["CompositeSolid Subtract
[1840, 1879, 0]"] + 33[Wall] + 34[Wall] + 35[Wall] + 36[Wall] + 37[Wall] + 38[Wall] + 39[Wall] + 40["Cap Start"] + 41["Cap Start"] + 42["Cap Start"] + 43["Cap End"] + 44["Cap End"] + 45["Cap End"] + 46["SweepEdge Opposite"] + 47["SweepEdge Opposite"] + 48["SweepEdge Opposite"] + 49["SweepEdge Opposite"] + 50["SweepEdge Opposite"] + 51["SweepEdge Opposite"] + 52["SweepEdge Opposite"] + 53["SweepEdge Adjacent"] + 54["SweepEdge Adjacent"] + 55["SweepEdge Adjacent"] + 56["SweepEdge Adjacent"] + 57["SweepEdge Adjacent"] + 58["SweepEdge Adjacent"] + 59["SweepEdge Adjacent"] + 1 --- 5 + 2 --- 6 + 3 --- 7 + 4 --- 8 + 5 --- 9 + 5 --- 10 + 5 --- 11 + 5 --- 12 + 5 --- 13 + 5 --- 14 + 5 --- 15 + 6 --- 16 + 6 --- 27 + 6 ---- 28 + 6 --- 31 + 7 --- 17 + 7 --- 18 + 7 --- 19 + 7 --- 20 + 7 --- 26 + 7 ---- 29 + 7 --- 31 + 8 --- 21 + 8 --- 22 + 8 --- 23 + 8 --- 24 + 8 --- 25 + 8 ---- 30 + 8 --- 32 + 16 --- 33 + 16 x--> 43 + 16 --- 46 + 16 --- 53 + 17 --- 38 + 17 x--> 44 + 17 --- 50 + 17 --- 59 + 18 --- 37 + 18 x--> 44 + 18 --- 52 + 18 --- 57 + 19 --- 39 + 19 x--> 44 + 19 --- 51 + 19 --- 58 + 21 --- 35 + 21 x--> 45 + 21 --- 47 + 21 --- 54 + 22 --- 36 + 22 x--> 45 + 22 --- 48 + 22 --- 56 + 23 --- 34 + 23 x--> 45 + 23 --- 49 + 23 --- 55 + 28 --- 33 + 28 --- 40 + 28 --- 43 + 28 --- 46 + 28 --- 53 + 29 --- 37 + 29 --- 38 + 29 --- 39 + 29 --- 41 + 29 --- 44 + 29 --- 50 + 29 --- 51 + 29 --- 52 + 29 --- 57 + 29 --- 58 + 29 --- 59 + 30 --- 34 + 30 --- 35 + 30 --- 36 + 30 --- 42 + 30 --- 45 + 30 --- 47 + 30 --- 48 + 30 --- 49 + 30 --- 54 + 30 --- 55 + 30 --- 56 + 31 --- 32 + 46 <--x 33 + 53 <--x 33 + 49 <--x 34 + 55 <--x 34 + 56 <--x 34 + 47 <--x 35 + 54 <--x 35 + 55 <--x 35 + 48 <--x 36 + 54 <--x 36 + 56 <--x 36 + 52 <--x 37 + 57 <--x 37 + 59 <--x 37 + 50 <--x 38 + 58 <--x 38 + 59 <--x 38 + 51 <--x 39 + 57 <--x 39 + 58 <--x 39 + 46 <--x 40 + 50 <--x 41 + 51 <--x 41 + 52 <--x 41 + 47 <--x 42 + 48 <--x 42 + 49 <--x 42 +``` diff --git a/rust/kcl-lib/tests/subtract_regression03/ast.snap b/rust/kcl-lib/tests/subtract_regression03/ast.snap new file mode 100644 index 000000000..f1b016470 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/ast.snap @@ -0,0 +1,3363 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing subtract_regression03.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": { + "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": "sketch002Profile001", + "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.503704", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.503704, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.264924", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.264924, + "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": "sketch002", + "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": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.191884", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.191884, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.172584", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.172584, + "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": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "228.031232", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 228.031232, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "105", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 105.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.16425", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.16425, + "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": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.464817", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.464817, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.124547", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.124547, + "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": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "105", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 105.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "75", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 75.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.6315", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.6315, + "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": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.464817", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.464817, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.124547", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.124547, + "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": "angleStart", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "75", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 75.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angleEnd", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "37.055012", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 37.055012, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.16425", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.16425, + "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": "end", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.200323", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.200323, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.265308", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.265308, + "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": "x", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.958", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.958, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "y", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0.958", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.958, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "scale", + "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": "plane000", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "properties": [ + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "origin", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.503704", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.503704, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.264924", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.264924, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "xAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.191884", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.191884, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.172584", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.172584, + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "yAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "zAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.191884", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.191884, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.172584", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.172584, + "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" + } + } + ], + "start": 0, + "type": "ObjectExpression", + "type": "ObjectExpression" + }, + "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": "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": "plane000", + "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": "sketch001Profile000", + "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.0495", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0495, + "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": "sketch001", + "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": "sweepExtrude000", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "path", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch002Profile001", + "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": "sweep", + "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": "sketch001Profile000", + "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": "plane001", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "properties": [ + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "origin", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.503704", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.503704, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.28", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.28, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "xAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.191884", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.191884, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.172584", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.172584, + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "yAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "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" + } + }, + { + "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" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "zAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.191884", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.191884, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.172584", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.172584, + "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" + } + } + ], + "start": 0, + "type": "ObjectExpression", + "type": "ObjectExpression" + }, + "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": "plane001", + "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": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.06", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.06, + "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.129019", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.129019, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.12", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.12, + "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.129019", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.129019, + "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": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.12", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.12, + "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 + }, + { + "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": "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": "0.2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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": "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" + } + ], + "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": "sweepExtrude000", + "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": "plane002", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "properties": [ + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "origin", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.42", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.42, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.28", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.28, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "xAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.200323", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.200323, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.265308", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.265308, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "yAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "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" + } + }, + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "zAxis", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.200323", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.200323, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0.265308", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.265308, + "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" + } + } + ], + "start": 0, + "type": "ObjectExpression", + "type": "ObjectExpression" + }, + "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": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "plane002", + "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": "sketch004Profile000", + "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", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.06", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.06, + "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": "sketch004", + "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.12", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.12, + "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": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.129019", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.129019, + "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": [ + { + "commentStart": 0, + "end": 0, + "raw": "0.129019", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.129019, + "suffix": "None" + } + }, + { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "0.12", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.12, + "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 + }, + { + "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": "cut001Extrude", + "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": "0.2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.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": "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": "cut001", + "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": "cut001Extrude", + "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": "cut000", + "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" + } + } + ] + }, + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/subtract_regression03/input.kcl b/rust/kcl-lib/tests/subtract_regression03/input.kcl new file mode 100644 index 000000000..d5c8f9ba7 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/input.kcl @@ -0,0 +1,83 @@ +@settings(defaultLengthUnit = in) + +sketch002 = startSketchOn(XY) + +sketch002Profile001 = startProfile(sketch002, at = [-0.503704, -0.264924]) + |> line(end = [-0.191884, 0.172584]) + |> arc( + angleStart = 228.031232, + angleEnd = 105, + radius = 0.16425 + ) + |> line(end = [0.464817, 0.124547]) + |> arc( + angleStart = 105, + angleEnd = 75, + radius = 0.6315 + ) + |> line(end = [0.464817, -0.124547]) + |> arc( + angleStart = 75, + angleEnd = -37.055012, + radius = 0.16425 + ) + |> line(end = [-0.200323, -0.265308]) + |> scale(x = 0.958, y = 0.958) + +plane000 = { + origin = [-0.503704, -0.264924, 0], + xAxis = [0.191884, 0.172584, 0], + yAxis = [0, 0, 1], + zAxis = [-0.191884, 0.172584, 0] +} + +sketch001 = startSketchOn(plane000) + +sketch001Profile000 = circle( + sketch001, + center = [0, 0], + radius = 0.0495 +) + +sweepExtrude000 = sweep( + sketch001Profile000, + path = sketch002Profile001 +) + +plane001 = { + origin = [-0.503704, -0.28, 0], + xAxis = [-0.191884, 0.172584, 0], + yAxis = [0, 0, -1], + zAxis = [-0.191884, 0.172584, 0] +} + +sketch003 = startSketchOn(plane001) + +sketch003Profile000 = startProfile(sketch003, at = [0, -0.06]) + |> line(end = [0.129019, 0.12]) + |> xLine(length = -0.129019) + |> yLine(length = -0.12) + |> close() + +cut000Extrude = extrude([sketch003Profile000], length = -0.2) + +cut000 = subtract(sweepExtrude000, tools = cut000Extrude) + +plane002 = { + origin = [0.42, -0.28, 0], + xAxis = [-0.200323, -0.265308, 0], + yAxis = [0, 0, 1], + zAxis = [0.200323, 0.265308, 0] +} + +sketch004 = startSketchOn(plane002) + +sketch004Profile000 = startProfile(sketch004, at = [0, -0.06]) + |> yLine(length = 0.12) + |> xLine(length = -0.129019) + |> line(end = [0.129019, -0.12]) + |> close() + +cut001Extrude = extrude([sketch004Profile000], length = -0.2) + +cut001 = subtract(cut000, tools = cut001Extrude) diff --git a/rust/kcl-lib/tests/subtract_regression03/ops.snap b/rust/kcl-lib/tests/subtract_regression03/ops.snap new file mode 100644 index 000000000..9b344ed9f --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/ops.snap @@ -0,0 +1,738 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Operations executed subtract_regression03.kcl +--- +[ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Plane", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Object", + "value": { + "origin": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": -0.503704, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.264924, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "xAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.191884, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.172584, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "yAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "zAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": -0.191884, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.172584, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + } + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "path": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "sweep", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Object", + "value": { + "origin": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": -0.503704, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.28, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "xAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": -0.191884, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.172584, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "yAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "zAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": -0.191884, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.172584, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + } + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": -0.2, + "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": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Object", + "value": { + "origin": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.42, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.28, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "xAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": -0.200323, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.265308, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "yAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "zAxis": { + "type": "Array", + "value": [ + { + "type": "Number", + "value": 0.200323, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.265308, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + } + } + }, + "sourceRange": [] + } + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": -0.2, + "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": [] + } + }, + { + "labeledArgs": { + "tools": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + }, + "name": "subtract", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + } + } +] diff --git a/rust/kcl-lib/tests/subtract_regression03/program_memory.snap b/rust/kcl-lib/tests/subtract_regression03/program_memory.snap new file mode 100644 index 000000000..ff8f0b4cb --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/program_memory.snap @@ -0,0 +1,1923 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing subtract_regression03.kcl +--- +{ + "cut000": { + "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": [ + 0.0, + 0.0 + ], + "from": [ + 0.0495, + 0.0 + ], + "radius": 0.0495, + "tag": null, + "to": [ + 0.0495, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.264924, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0495, + 0.0 + ], + "to": [ + 0.0495, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut000Extrude": { + "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" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.129, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.129, + 0.06 + ], + "tag": null, + "to": [ + 0.0, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.28, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": -0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": -1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0, + -0.06 + ], + "to": [ + 0.0, + -0.06 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": -0.2, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut001": { + "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": [ + 0.0, + 0.0 + ], + "from": [ + 0.0495, + 0.0 + ], + "radius": 0.0495, + "tag": null, + "to": [ + 0.0495, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.264924, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0495, + 0.0 + ], + "to": [ + 0.0495, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "cut001Extrude": { + "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" + } + ], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.0, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 0.06 + ], + "tag": null, + "to": [ + -0.129, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.129, + 0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.42, + "y": -0.28, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": -0.6025804201392091, + "y": -0.7980581665924197, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0, + -0.06 + ], + "to": [ + 0.0, + -0.06 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": -0.2, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "plane000": { + "type": "Object", + "value": { + "origin": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": -0.5037, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.2649, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "xAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": 0.1919, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.1726, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "yAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "zAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": -0.1919, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.1726, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + } + } + }, + "plane001": { + "type": "Object", + "value": { + "origin": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": -0.5037, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.28, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "xAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": -0.1919, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.1726, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "yAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "zAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": -0.1919, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.1726, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + } + } + }, + "plane002": { + "type": "Object", + "value": { + "origin": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": 0.42, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.28, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "xAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": -0.2003, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": -0.2653, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "yAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 1.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + }, + "zAxis": { + "type": "MixedArray", + "value": [ + { + "type": "Number", + "value": 0.2003, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.2653, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + { + "type": "Number", + "value": 0.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } + ] + } + } + }, + "sketch001": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.264924, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "value": "Custom", + "xAxis": { + "x": 0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch001Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": true, + "center": [ + 0.0, + 0.0 + ], + "from": [ + 0.0495, + 0.0 + ], + "radius": 0.0495, + "tag": null, + "to": [ + 0.0495, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.264924, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0495, + 0.0 + ], + "to": [ + 0.0495, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch002": { + "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" + } + } + } + }, + "sketch002Profile001": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.5037, + -0.2649 + ], + "tag": null, + "to": [ + -0.6956, + -0.0923 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + -0.5857, + 0.0298 + ], + "from": [ + -0.6956, + -0.0923 + ], + "radius": 0.16425, + "tag": null, + "to": [ + -0.6283, + 0.1884 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.6283, + 0.1884 + ], + "tag": null, + "to": [ + -0.1634, + 0.313 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + 0.0, + -0.297 + ], + "from": [ + -0.1634, + 0.313 + ], + "radius": 0.6315, + "tag": null, + "to": [ + 0.1634, + 0.313 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.1634, + 0.313 + ], + "tag": null, + "to": [ + 0.6283, + 0.1884 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "ccw": false, + "center": [ + 0.5858, + 0.0298 + ], + "from": [ + 0.6283, + 0.1884 + ], + "radius": 0.16425, + "tag": null, + "to": [ + 0.7168, + -0.0692 + ], + "type": "Arc", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.7168, + -0.0692 + ], + "tag": null, + "to": [ + 0.5165, + -0.3345 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "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": [ + -0.5037, + -0.2649 + ], + "to": [ + -0.5037, + -0.2649 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch003": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.28, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "value": "Custom", + "xAxis": { + "x": -0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": -1.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch003Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.129, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.129, + 0.06 + ], + "tag": null, + "to": [ + 0.0, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.28, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": -0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": -1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0, + -0.06 + ], + "to": [ + 0.0, + -0.06 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch004": { + "type": "Plane", + "value": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.42, + "y": -0.28, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "value": "Custom", + "xAxis": { + "x": -0.6025804201392091, + "y": -0.7980581665924197, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch004Profile000": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.0, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 0.06 + ], + "tag": null, + "to": [ + -0.129, + 0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -0.129, + 0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + -0.06 + ], + "tag": null, + "to": [ + 0.0, + -0.06 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": 0.42, + "y": -0.28, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": -0.6025804201392091, + "y": -0.7980581665924197, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0, + -0.06 + ], + "to": [ + 0.0, + -0.06 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sweepExtrude000": { + "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": [ + 0.0, + 0.0 + ], + "from": [ + 0.0495, + 0.0 + ], + "radius": 0.0495, + "tag": null, + "to": [ + 0.0495, + 0.0 + ], + "type": "Circle", + "units": { + "type": "Inches" + } + } + ], + "on": { + "artifactId": "[uuid]", + "id": "[uuid]", + "origin": { + "x": -0.503704, + "y": -0.264924, + "z": 0.0, + "units": { + "type": "Inches" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.7435091262737867, + "y": 0.6687257877094245, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 0.0495, + 0.0 + ], + "to": [ + 0.0495, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "artifactId": "[uuid]", + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 0.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + } +} diff --git a/rust/kcl-lib/tests/subtract_regression03/rendered_model.png b/rust/kcl-lib/tests/subtract_regression03/rendered_model.png new file mode 100644 index 000000000..584ab9e35 Binary files /dev/null and b/rust/kcl-lib/tests/subtract_regression03/rendered_model.png differ diff --git a/rust/kcl-lib/tests/subtract_regression03/unparsed.snap b/rust/kcl-lib/tests/subtract_regression03/unparsed.snap new file mode 100644 index 000000000..bd0834835 --- /dev/null +++ b/rust/kcl-lib/tests/subtract_regression03/unparsed.snap @@ -0,0 +1,68 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing subtract_regression03.kcl +--- +@settings(defaultLengthUnit = in) + +sketch002 = startSketchOn(XY) + +sketch002Profile001 = startProfile(sketch002, at = [-0.503704, -0.264924]) + |> line(end = [-0.191884, 0.172584]) + |> arc(angleStart = 228.031232, angleEnd = 105, radius = 0.16425) + |> line(end = [0.464817, 0.124547]) + |> arc(angleStart = 105, angleEnd = 75, radius = 0.6315) + |> line(end = [0.464817, -0.124547]) + |> arc(angleStart = 75, angleEnd = -37.055012, radius = 0.16425) + |> line(end = [-0.200323, -0.265308]) + |> scale(x = 0.958, y = 0.958) + +plane000 = { + origin = [-0.503704, -0.264924, 0], + xAxis = [0.191884, 0.172584, 0], + yAxis = [0, 0, 1], + zAxis = [-0.191884, 0.172584, 0] +} + +sketch001 = startSketchOn(plane000) + +sketch001Profile000 = circle(sketch001, center = [0, 0], radius = 0.0495) + +sweepExtrude000 = sweep(sketch001Profile000, path = sketch002Profile001) + +plane001 = { + origin = [-0.503704, -0.28, 0], + xAxis = [-0.191884, 0.172584, 0], + yAxis = [0, 0, -1], + zAxis = [-0.191884, 0.172584, 0] +} + +sketch003 = startSketchOn(plane001) + +sketch003Profile000 = startProfile(sketch003, at = [0, -0.06]) + |> line(end = [0.129019, 0.12]) + |> xLine(length = -0.129019) + |> yLine(length = -0.12) + |> close() + +cut000Extrude = extrude([sketch003Profile000], length = -0.2) + +cut000 = subtract(sweepExtrude000, tools = cut000Extrude) + +plane002 = { + origin = [0.42, -0.28, 0], + xAxis = [-0.200323, -0.265308, 0], + yAxis = [0, 0, 1], + zAxis = [0.200323, 0.265308, 0] +} + +sketch004 = startSketchOn(plane002) + +sketch004Profile000 = startProfile(sketch004, at = [0, -0.06]) + |> yLine(length = 0.12) + |> xLine(length = -0.129019) + |> line(end = [0.129019, -0.12]) + |> close() + +cut001Extrude = extrude([sketch004Profile000], length = -0.2) + +cut001 = subtract(cut000, tools = cut001Extrude)