more subtract regression tests (#7123)
* more regression tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * snaps Signed-off-by: Jess Frazelle <github@jessfraz.com> * iupdates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -3360,3 +3360,45 @@ mod nested_windows_main_kcl {
|
|||||||
super::execute(TEST_NAME, true).await
|
super::execute(TEST_NAME, true).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mod subtract_regression11 {
|
||||||
|
const TEST_NAME: &str = "subtract_regression11";
|
||||||
|
|
||||||
|
/// 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_regression12 {
|
||||||
|
const TEST_NAME: &str = "subtract_regression12";
|
||||||
|
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -185,21 +185,20 @@ flowchart LR
|
|||||||
%% face_code_ref=Missing NodePath
|
%% face_code_ref=Missing NodePath
|
||||||
86["Cap Start"]
|
86["Cap Start"]
|
||||||
%% face_code_ref=Missing NodePath
|
%% face_code_ref=Missing NodePath
|
||||||
87["Cap Start"]
|
87["Cap End"]
|
||||||
%% face_code_ref=Missing NodePath
|
%% face_code_ref=Missing NodePath
|
||||||
88["Cap End"]
|
88["Cap End"]
|
||||||
%% face_code_ref=Missing NodePath
|
%% face_code_ref=Missing NodePath
|
||||||
89["Cap End"]
|
89["Cap End"]
|
||||||
%% face_code_ref=Missing NodePath
|
%% face_code_ref=Missing NodePath
|
||||||
90["Cap End"]
|
90["SweepEdge Opposite"]
|
||||||
%% face_code_ref=Missing NodePath
|
|
||||||
91["SweepEdge Opposite"]
|
91["SweepEdge Opposite"]
|
||||||
92["SweepEdge Opposite"]
|
92["SweepEdge Opposite"]
|
||||||
93["SweepEdge Opposite"]
|
93["SweepEdge Opposite"]
|
||||||
94["SweepEdge Opposite"]
|
94["SweepEdge Opposite"]
|
||||||
95["SweepEdge Opposite"]
|
95["SweepEdge Opposite"]
|
||||||
96["SweepEdge Opposite"]
|
96["SweepEdge Opposite"]
|
||||||
97["SweepEdge Opposite"]
|
97["SweepEdge Adjacent"]
|
||||||
98["SweepEdge Adjacent"]
|
98["SweepEdge Adjacent"]
|
||||||
99["SweepEdge Adjacent"]
|
99["SweepEdge Adjacent"]
|
||||||
100["SweepEdge Adjacent"]
|
100["SweepEdge Adjacent"]
|
||||||
@ -214,15 +213,14 @@ flowchart LR
|
|||||||
109["SweepEdge Adjacent"]
|
109["SweepEdge Adjacent"]
|
||||||
110["SweepEdge Adjacent"]
|
110["SweepEdge Adjacent"]
|
||||||
111["SweepEdge Adjacent"]
|
111["SweepEdge Adjacent"]
|
||||||
112["SweepEdge Adjacent"]
|
112["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
113["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
113["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
||||||
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
114["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
114["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
||||||
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
115["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
115["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
||||||
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
116["EdgeCut Fillet<br>[2999, 3289, 0]"]
|
|
||||||
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
|
||||||
1 --- 8
|
1 --- 8
|
||||||
1 --- 9
|
1 --- 9
|
||||||
1 --- 13
|
1 --- 13
|
||||||
@ -283,84 +281,84 @@ flowchart LR
|
|||||||
20 ---- 64
|
20 ---- 64
|
||||||
82 --- 20
|
82 --- 20
|
||||||
27 --- 83
|
27 --- 83
|
||||||
27 x--> 87
|
27 x--> 86
|
||||||
27 --- 97
|
27 --- 96
|
||||||
27 --- 112
|
27 --- 111
|
||||||
28 --- 68
|
28 --- 68
|
||||||
28 x--> 85
|
28 x--> 85
|
||||||
28 --- 91
|
28 --- 90
|
||||||
28 --- 98
|
28 --- 97
|
||||||
31 --- 70
|
31 --- 70
|
||||||
31 x--> 84
|
31 x--> 84
|
||||||
31 --- 95
|
31 --- 94
|
||||||
31 --- 102
|
31 --- 101
|
||||||
32 --- 71
|
32 --- 71
|
||||||
32 x--> 84
|
32 x--> 84
|
||||||
32 --- 94
|
32 --- 93
|
||||||
32 --- 101
|
32 --- 100
|
||||||
33 --- 69
|
33 --- 69
|
||||||
33 x--> 84
|
33 x--> 84
|
||||||
33 --- 93
|
33 --- 92
|
||||||
33 --- 100
|
33 --- 99
|
||||||
34 --- 72
|
34 --- 72
|
||||||
34 x--> 84
|
34 x--> 84
|
||||||
34 --- 92
|
34 --- 91
|
||||||
34 --- 99
|
34 --- 98
|
||||||
62 <--x 36
|
62 <--x 36
|
||||||
36 --- 78
|
36 --- 78
|
||||||
36 x--> 104
|
36 x--> 103
|
||||||
62 <--x 37
|
62 <--x 37
|
||||||
37 --- 77
|
37 --- 77
|
||||||
37 --- 104
|
37 --- 103
|
||||||
62 <--x 38
|
62 <--x 38
|
||||||
38 --- 82
|
38 --- 82
|
||||||
38 --- 105
|
38 --- 104
|
||||||
62 <--x 39
|
62 <--x 39
|
||||||
39 --- 79
|
39 --- 79
|
||||||
39 --- 106
|
39 --- 105
|
||||||
62 <--x 40
|
62 <--x 40
|
||||||
40 --- 74
|
40 --- 74
|
||||||
40 --- 107
|
40 --- 106
|
||||||
62 <--x 41
|
62 <--x 41
|
||||||
41 --- 81
|
41 --- 81
|
||||||
41 --- 108
|
41 --- 107
|
||||||
62 <--x 42
|
62 <--x 42
|
||||||
42 --- 76
|
42 --- 76
|
||||||
42 --- 109
|
42 --- 108
|
||||||
62 <--x 43
|
62 <--x 43
|
||||||
43 --- 75
|
43 --- 75
|
||||||
43 --- 110
|
43 --- 109
|
||||||
62 <--x 44
|
62 <--x 44
|
||||||
44 --- 80
|
44 --- 80
|
||||||
44 --- 111
|
44 --- 110
|
||||||
45 --- 73
|
45 --- 73
|
||||||
45 x--> 82
|
45 x--> 82
|
||||||
45 --- 96
|
45 --- 95
|
||||||
45 --- 103
|
45 --- 102
|
||||||
59 --- 68
|
59 --- 68
|
||||||
59 --- 85
|
59 --- 85
|
||||||
59 --- 89
|
59 --- 88
|
||||||
59 --- 91
|
59 --- 90
|
||||||
59 --- 98
|
59 --- 97
|
||||||
60 --- 83
|
60 --- 83
|
||||||
60 --- 87
|
60 --- 86
|
||||||
60 --- 90
|
60 --- 89
|
||||||
60 --- 97
|
60 --- 96
|
||||||
60 --- 112
|
60 --- 111
|
||||||
61 --- 69
|
61 --- 69
|
||||||
61 --- 70
|
61 --- 70
|
||||||
61 --- 71
|
61 --- 71
|
||||||
61 --- 72
|
61 --- 72
|
||||||
61 --- 84
|
61 --- 84
|
||||||
61 --- 88
|
61 --- 87
|
||||||
|
61 --- 91
|
||||||
61 --- 92
|
61 --- 92
|
||||||
61 --- 93
|
61 --- 93
|
||||||
61 --- 94
|
61 --- 94
|
||||||
61 --- 95
|
61 --- 98
|
||||||
61 --- 99
|
61 --- 99
|
||||||
61 --- 100
|
61 --- 100
|
||||||
61 --- 101
|
61 --- 101
|
||||||
61 --- 102
|
|
||||||
62 --- 74
|
62 --- 74
|
||||||
62 --- 75
|
62 --- 75
|
||||||
62 --- 76
|
62 --- 76
|
||||||
@ -370,6 +368,7 @@ flowchart LR
|
|||||||
62 --- 80
|
62 --- 80
|
||||||
62 --- 81
|
62 --- 81
|
||||||
62 --- 82
|
62 --- 82
|
||||||
|
62 --- 103
|
||||||
62 --- 104
|
62 --- 104
|
||||||
62 --- 105
|
62 --- 105
|
||||||
62 --- 106
|
62 --- 106
|
||||||
@ -377,54 +376,52 @@ flowchart LR
|
|||||||
62 --- 108
|
62 --- 108
|
||||||
62 --- 109
|
62 --- 109
|
||||||
62 --- 110
|
62 --- 110
|
||||||
62 --- 111
|
|
||||||
64 --- 73
|
64 --- 73
|
||||||
64 --- 86
|
64 --- 95
|
||||||
64 --- 96
|
64 --- 102
|
||||||
64 --- 103
|
68 --- 90
|
||||||
68 --- 91
|
68 --- 97
|
||||||
68 --- 98
|
69 --- 92
|
||||||
69 --- 93
|
69 --- 99
|
||||||
69 --- 100
|
100 <--x 69
|
||||||
101 <--x 69
|
70 --- 94
|
||||||
70 --- 95
|
98 <--x 70
|
||||||
99 <--x 70
|
70 --- 101
|
||||||
70 --- 102
|
71 --- 93
|
||||||
71 --- 94
|
71 --- 100
|
||||||
71 --- 101
|
101 <--x 71
|
||||||
102 <--x 71
|
72 --- 91
|
||||||
72 --- 92
|
72 --- 98
|
||||||
72 --- 99
|
99 <--x 72
|
||||||
100 <--x 72
|
73 --- 95
|
||||||
73 --- 96
|
73 --- 102
|
||||||
73 --- 103
|
95 <--x 74
|
||||||
106 <--x 74
|
105 <--x 74
|
||||||
74 --- 107
|
74 --- 106
|
||||||
109 <--x 75
|
108 <--x 75
|
||||||
75 --- 110
|
75 --- 109
|
||||||
108 <--x 76
|
107 <--x 76
|
||||||
76 --- 109
|
76 --- 108
|
||||||
77 --- 104
|
77 --- 103
|
||||||
78 --- 104
|
78 --- 103
|
||||||
111 <--x 78
|
110 <--x 78
|
||||||
105 <--x 79
|
104 <--x 79
|
||||||
79 --- 106
|
79 --- 105
|
||||||
110 <--x 80
|
109 <--x 80
|
||||||
80 --- 111
|
80 --- 110
|
||||||
107 <--x 81
|
106 <--x 81
|
||||||
81 --- 108
|
81 --- 107
|
||||||
82 --- 105
|
82 --- 104
|
||||||
83 --- 97
|
83 --- 96
|
||||||
83 --- 112
|
83 --- 111
|
||||||
96 <--x 86
|
91 <--x 87
|
||||||
92 <--x 88
|
92 <--x 87
|
||||||
93 <--x 88
|
93 <--x 87
|
||||||
94 <--x 88
|
94 <--x 87
|
||||||
95 <--x 88
|
90 <--x 88
|
||||||
91 <--x 89
|
96 <--x 89
|
||||||
97 <--x 90
|
98 <--x 113
|
||||||
99 <--x 114
|
99 <--x 112
|
||||||
100 <--x 113
|
100 <--x 115
|
||||||
101 <--x 116
|
101 <--x 114
|
||||||
102 <--x 115
|
|
||||||
```
|
```
|
||||||
|
@ -1172,7 +1172,7 @@ description: Variables in memory after executing brake-rotor.kcl
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"height": -7.0,
|
"height": -7.0,
|
||||||
"startCapId": "[uuid]",
|
"startCapId": null,
|
||||||
"endCapId": null,
|
"endCapId": null,
|
||||||
"units": {
|
"units": {
|
||||||
"type": "Mm"
|
"type": "Mm"
|
||||||
@ -1606,7 +1606,7 @@ description: Variables in memory after executing brake-rotor.kcl
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"height": -7.0,
|
"height": -7.0,
|
||||||
"startCapId": "[uuid]",
|
"startCapId": null,
|
||||||
"endCapId": null,
|
"endCapId": null,
|
||||||
"units": {
|
"units": {
|
||||||
"type": "Mm"
|
"type": "Mm"
|
||||||
@ -2040,7 +2040,7 @@ description: Variables in memory after executing brake-rotor.kcl
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"height": -7.0,
|
"height": -7.0,
|
||||||
"startCapId": "[uuid]",
|
"startCapId": null,
|
||||||
"endCapId": null,
|
"endCapId": null,
|
||||||
"units": {
|
"units": {
|
||||||
"type": "Mm"
|
"type": "Mm"
|
||||||
@ -2474,7 +2474,7 @@ description: Variables in memory after executing brake-rotor.kcl
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"height": -7.0,
|
"height": -7.0,
|
||||||
"startCapId": "[uuid]",
|
"startCapId": null,
|
||||||
"endCapId": null,
|
"endCapId": null,
|
||||||
"units": {
|
"units": {
|
||||||
"type": "Mm"
|
"type": "Mm"
|
||||||
@ -2908,7 +2908,7 @@ description: Variables in memory after executing brake-rotor.kcl
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"height": -7.0,
|
"height": -7.0,
|
||||||
"startCapId": "[uuid]",
|
"startCapId": null,
|
||||||
"endCapId": null,
|
"endCapId": null,
|
||||||
"units": {
|
"units": {
|
||||||
"type": "Mm"
|
"type": "Mm"
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 81 KiB |
481
rust/kcl-lib/tests/subtract_regression11/artifact_commands.snap
Normal file
481
rust/kcl-lib/tests/subtract_regression11/artifact_commands.snap
Normal file
@ -0,0 +1,481 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Artifact commands subtract_regression11.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": 0.0,
|
||||||
|
"y": 1.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"y_axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 1.0
|
||||||
|
},
|
||||||
|
"size": 60.0,
|
||||||
|
"clobber": false,
|
||||||
|
"hide": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "enable_sketch_mode",
|
||||||
|
"entity_id": "[uuid]",
|
||||||
|
"ortho": false,
|
||||||
|
"animated": false,
|
||||||
|
"adjust_camera": false,
|
||||||
|
"planar_normal": {
|
||||||
|
"x": 1.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "move_path_pen",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"to": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 20.0,
|
||||||
|
"z": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "sketch_mode_disable"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "start_path"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 2.25,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 0.75,
|
||||||
|
"y": -0.75,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": -38.5,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": -0.75,
|
||||||
|
"y": -0.75,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": -2.25,
|
||||||
|
"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": 40.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "close_path",
|
||||||
|
"path_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "object_bring_to_front",
|
||||||
|
"object_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "revolve",
|
||||||
|
"target": "[uuid]",
|
||||||
|
"origin": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 1.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"axis_is_2d": true,
|
||||||
|
"angle": {
|
||||||
|
"unit": "degrees",
|
||||||
|
"value": 360.0
|
||||||
|
},
|
||||||
|
"tolerance": 0.0000001,
|
||||||
|
"opposite": "None"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_adjacency_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_extrusion_face_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "make_plane",
|
||||||
|
"origin": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"x_axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 1.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"y_axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 1.0
|
||||||
|
},
|
||||||
|
"size": 60.0,
|
||||||
|
"clobber": false,
|
||||||
|
"hide": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "enable_sketch_mode",
|
||||||
|
"entity_id": "[uuid]",
|
||||||
|
"ortho": false,
|
||||||
|
"animated": false,
|
||||||
|
"adjust_camera": false,
|
||||||
|
"planar_normal": {
|
||||||
|
"x": 1.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "move_path_pen",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"to": {
|
||||||
|
"x": 0.65,
|
||||||
|
"y": 20.1,
|
||||||
|
"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": -1.5,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": -1.1,
|
||||||
|
"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": 1.5,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 1.1,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "close_path",
|
||||||
|
"path_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "enable_sketch_mode",
|
||||||
|
"entity_id": "[uuid]",
|
||||||
|
"ortho": false,
|
||||||
|
"animated": false,
|
||||||
|
"adjust_camera": false,
|
||||||
|
"planar_normal": {
|
||||||
|
"x": 1.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extrude",
|
||||||
|
"target": "[uuid]",
|
||||||
|
"distance": 10.0,
|
||||||
|
"faces": null,
|
||||||
|
"opposite": {
|
||||||
|
"Other": 10.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_adjacency_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_extrusion_face_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "boolean_subtract",
|
||||||
|
"target_ids": [
|
||||||
|
"[uuid]"
|
||||||
|
],
|
||||||
|
"tool_ids": [
|
||||||
|
"[uuid]"
|
||||||
|
],
|
||||||
|
"tolerance": 0.0000001
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Artifact graph flowchart subtract_regression11.kcl
|
||||||
|
extension: md
|
||||||
|
snapshot_kind: binary
|
||||||
|
---
|
@ -0,0 +1,178 @@
|
|||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
subgraph path3 [Path]
|
||||||
|
3["Path<br>[88, 127, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||||
|
5["Segment<br>[133, 153, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
|
6["Segment<br>[159, 184, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||||
|
7["Segment<br>[190, 211, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||||
|
8["Segment<br>[217, 243, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||||
|
9["Segment<br>[249, 270, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||||
|
10["Segment<br>[276, 294, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||||
|
11["Segment<br>[300, 307, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
|
||||||
|
18[Solid2d]
|
||||||
|
end
|
||||||
|
subgraph path4 [Path]
|
||||||
|
4["Path<br>[428, 470, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||||
|
12["Segment<br>[476, 496, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
|
13["Segment<br>[502, 522, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||||
|
14["Segment<br>[528, 547, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||||
|
15["Segment<br>[553, 572, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||||
|
16["Segment<br>[578, 585, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||||
|
17[Solid2d]
|
||||||
|
end
|
||||||
|
1["Plane<br>[47, 64, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
2["Plane<br>[387, 404, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 3 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
19["Sweep Revolve<br>[322, 373, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
20["Sweep Extrusion<br>[603, 672, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
21["CompositeSolid Subtract<br>[683, 726, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
22[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
23[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
24[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
25[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
26[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
27[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
28[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
29[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
30[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
31["Cap Start"]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
32["Cap End"]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
33["SweepEdge Opposite"]
|
||||||
|
34["SweepEdge Opposite"]
|
||||||
|
35["SweepEdge Opposite"]
|
||||||
|
36["SweepEdge Opposite"]
|
||||||
|
37["SweepEdge Adjacent"]
|
||||||
|
38["SweepEdge Adjacent"]
|
||||||
|
39["SweepEdge Adjacent"]
|
||||||
|
40["SweepEdge Adjacent"]
|
||||||
|
41["SweepEdge Adjacent"]
|
||||||
|
42["SweepEdge Adjacent"]
|
||||||
|
43["SweepEdge Adjacent"]
|
||||||
|
44["SweepEdge Adjacent"]
|
||||||
|
1 --- 3
|
||||||
|
2 --- 4
|
||||||
|
3 --- 5
|
||||||
|
3 --- 6
|
||||||
|
3 --- 7
|
||||||
|
3 --- 8
|
||||||
|
3 --- 9
|
||||||
|
3 --- 10
|
||||||
|
3 --- 11
|
||||||
|
3 --- 18
|
||||||
|
3 ---- 19
|
||||||
|
3 --- 21
|
||||||
|
4 --- 12
|
||||||
|
4 --- 13
|
||||||
|
4 --- 14
|
||||||
|
4 --- 15
|
||||||
|
4 --- 16
|
||||||
|
4 --- 17
|
||||||
|
4 ---- 20
|
||||||
|
4 --- 21
|
||||||
|
19 <--x 5
|
||||||
|
5 --- 30
|
||||||
|
5 --- 41
|
||||||
|
19 <--x 6
|
||||||
|
6 --- 28
|
||||||
|
6 --- 42
|
||||||
|
19 <--x 7
|
||||||
|
7 --- 27
|
||||||
|
7 --- 43
|
||||||
|
19 <--x 8
|
||||||
|
8 --- 29
|
||||||
|
8 --- 44
|
||||||
|
19 <--x 9
|
||||||
|
9 --- 26
|
||||||
|
12 --- 23
|
||||||
|
12 x--> 31
|
||||||
|
12 --- 36
|
||||||
|
12 --- 40
|
||||||
|
13 --- 25
|
||||||
|
13 x--> 31
|
||||||
|
13 --- 35
|
||||||
|
13 --- 39
|
||||||
|
14 --- 22
|
||||||
|
14 x--> 31
|
||||||
|
14 --- 34
|
||||||
|
14 --- 38
|
||||||
|
15 --- 24
|
||||||
|
15 x--> 31
|
||||||
|
15 --- 33
|
||||||
|
15 --- 37
|
||||||
|
19 --- 26
|
||||||
|
19 --- 27
|
||||||
|
19 --- 28
|
||||||
|
19 --- 29
|
||||||
|
19 --- 30
|
||||||
|
19 --- 41
|
||||||
|
19 --- 42
|
||||||
|
19 --- 43
|
||||||
|
19 --- 44
|
||||||
|
20 --- 22
|
||||||
|
20 --- 23
|
||||||
|
20 --- 24
|
||||||
|
20 --- 25
|
||||||
|
20 --- 31
|
||||||
|
20 --- 32
|
||||||
|
20 --- 33
|
||||||
|
20 --- 34
|
||||||
|
20 --- 35
|
||||||
|
20 --- 36
|
||||||
|
20 --- 37
|
||||||
|
20 --- 38
|
||||||
|
20 --- 39
|
||||||
|
20 --- 40
|
||||||
|
22 --- 34
|
||||||
|
37 <--x 22
|
||||||
|
22 --- 38
|
||||||
|
23 --- 36
|
||||||
|
39 <--x 23
|
||||||
|
23 --- 40
|
||||||
|
24 --- 33
|
||||||
|
24 --- 37
|
||||||
|
40 <--x 24
|
||||||
|
25 --- 35
|
||||||
|
38 <--x 25
|
||||||
|
25 --- 39
|
||||||
|
44 <--x 26
|
||||||
|
42 <--x 27
|
||||||
|
27 --- 43
|
||||||
|
41 <--x 28
|
||||||
|
28 --- 42
|
||||||
|
43 <--x 29
|
||||||
|
29 --- 44
|
||||||
|
30 --- 41
|
||||||
|
33 <--x 32
|
||||||
|
34 <--x 32
|
||||||
|
35 <--x 32
|
||||||
|
36 <--x 32
|
||||||
|
```
|
1408
rust/kcl-lib/tests/subtract_regression11/ast.snap
Normal file
1408
rust/kcl-lib/tests/subtract_regression11/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
27
rust/kcl-lib/tests/subtract_regression11/input.kcl
Normal file
27
rust/kcl-lib/tests/subtract_regression11/input.kcl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@settings(defaultLengthUnit = mm)
|
||||||
|
|
||||||
|
sketch001 = startSketchOn(YZ)
|
||||||
|
|
||||||
|
sketch001Profile000 = startProfile(sketch001, at = [0.0, 20])
|
||||||
|
|> xLine(length = 2.25)
|
||||||
|
|> line(end = [0.75, -0.75])
|
||||||
|
|> yLine(length = -38.5)
|
||||||
|
|> line(end = [-0.75, -0.75])
|
||||||
|
|> xLine(length = -2.25)
|
||||||
|
|> yLine(length = 40)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
revolve000 = revolve(sketch001Profile000, axis = Y, angle = 360)
|
||||||
|
|
||||||
|
sketch003 = startSketchOn(YZ)
|
||||||
|
|
||||||
|
sketch003Profile000 = startProfile(sketch003, at = [0.65, 20.1])
|
||||||
|
|> yLine(length = -1.5)
|
||||||
|
|> xLine(length = -1.1)
|
||||||
|
|> yLine(length = 1.5)
|
||||||
|
|> xLine(length = 1.1)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
cut000Extrude = extrude([sketch003Profile000], length = 10, bidirectionalLength = 10)
|
||||||
|
|
||||||
|
cut000 = subtract(revolve000, tools = cut000Extrude)
|
217
rust/kcl-lib/tests/subtract_regression11/ops.snap
Normal file
217
rust/kcl-lib/tests/subtract_regression11/ops.snap
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Operations executed subtract_regression11.kcl
|
||||||
|
---
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "startSketchOn",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Plane",
|
||||||
|
"artifact_id": "[uuid]"
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "revolve",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Sketch",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {
|
||||||
|
"angle": {
|
||||||
|
"value": {
|
||||||
|
"type": "Number",
|
||||||
|
"value": 360.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"axis": {
|
||||||
|
"value": {
|
||||||
|
"type": "Object",
|
||||||
|
"value": {
|
||||||
|
"direction": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 1.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "startSketchOn",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Plane",
|
||||||
|
"artifact_id": "[uuid]"
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "extrude",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Sketch",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {
|
||||||
|
"bidirectionalLength": {
|
||||||
|
"value": {
|
||||||
|
"type": "Number",
|
||||||
|
"value": 10.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"length": {
|
||||||
|
"value": {
|
||||||
|
"type": "Number",
|
||||||
|
"value": 10.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "subtract",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Solid",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {
|
||||||
|
"tools": {
|
||||||
|
"value": {
|
||||||
|
"type": "Solid",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
]
|
1109
rust/kcl-lib/tests/subtract_regression11/program_memory.snap
Normal file
1109
rust/kcl-lib/tests/subtract_regression11/program_memory.snap
Normal file
File diff suppressed because it is too large
Load Diff
BIN
rust/kcl-lib/tests/subtract_regression11/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression11/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
31
rust/kcl-lib/tests/subtract_regression11/unparsed.snap
Normal file
31
rust/kcl-lib/tests/subtract_regression11/unparsed.snap
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Result of unparsing subtract_regression11.kcl
|
||||||
|
---
|
||||||
|
@settings(defaultLengthUnit = mm)
|
||||||
|
|
||||||
|
sketch001 = startSketchOn(YZ)
|
||||||
|
|
||||||
|
sketch001Profile000 = startProfile(sketch001, at = [0.0, 20])
|
||||||
|
|> xLine(length = 2.25)
|
||||||
|
|> line(end = [0.75, -0.75])
|
||||||
|
|> yLine(length = -38.5)
|
||||||
|
|> line(end = [-0.75, -0.75])
|
||||||
|
|> xLine(length = -2.25)
|
||||||
|
|> yLine(length = 40)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
revolve000 = revolve(sketch001Profile000, axis = Y, angle = 360)
|
||||||
|
|
||||||
|
sketch003 = startSketchOn(YZ)
|
||||||
|
|
||||||
|
sketch003Profile000 = startProfile(sketch003, at = [0.65, 20.1])
|
||||||
|
|> yLine(length = -1.5)
|
||||||
|
|> xLine(length = -1.1)
|
||||||
|
|> yLine(length = 1.5)
|
||||||
|
|> xLine(length = 1.1)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
cut000Extrude = extrude([sketch003Profile000], length = 10, bidirectionalLength = 10)
|
||||||
|
|
||||||
|
cut000 = subtract(revolve000, tools = cut000Extrude)
|
481
rust/kcl-lib/tests/subtract_regression12/artifact_commands.snap
Normal file
481
rust/kcl-lib/tests/subtract_regression12/artifact_commands.snap
Normal file
@ -0,0 +1,481 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Artifact commands subtract_regression12.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": 5.588,
|
||||||
|
"y": 12.7,
|
||||||
|
"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": -5.588,
|
||||||
|
"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": -25.4,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 2.54,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 0.635,
|
||||||
|
"y": 2.54,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 20.0406,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 2.413,
|
||||||
|
"y": 2.8194,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "close_path",
|
||||||
|
"path_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "object_bring_to_front",
|
||||||
|
"object_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "revolve",
|
||||||
|
"target": "[uuid]",
|
||||||
|
"origin": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 1.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"axis_is_2d": true,
|
||||||
|
"angle": {
|
||||||
|
"unit": "degrees",
|
||||||
|
"value": 360.0
|
||||||
|
},
|
||||||
|
"tolerance": 0.0000001,
|
||||||
|
"opposite": "None"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_adjacency_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_extrusion_face_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "make_plane",
|
||||||
|
"origin": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"x_axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 1.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"y_axis": {
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 1.0
|
||||||
|
},
|
||||||
|
"size": 60.0,
|
||||||
|
"clobber": false,
|
||||||
|
"hide": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "enable_sketch_mode",
|
||||||
|
"entity_id": "[uuid]",
|
||||||
|
"ortho": false,
|
||||||
|
"animated": false,
|
||||||
|
"adjust_camera": false,
|
||||||
|
"planar_normal": {
|
||||||
|
"x": 1.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "move_path_pen",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"to": {
|
||||||
|
"x": -15.24,
|
||||||
|
"y": 0.508,
|
||||||
|
"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": -1.016,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": 22.86,
|
||||||
|
"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": 1.016,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extend_path",
|
||||||
|
"path": "[uuid]",
|
||||||
|
"segment": {
|
||||||
|
"type": "line",
|
||||||
|
"end": {
|
||||||
|
"x": -22.86,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
},
|
||||||
|
"relative": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "close_path",
|
||||||
|
"path_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "enable_sketch_mode",
|
||||||
|
"entity_id": "[uuid]",
|
||||||
|
"ortho": false,
|
||||||
|
"animated": false,
|
||||||
|
"adjust_camera": false,
|
||||||
|
"planar_normal": {
|
||||||
|
"x": 1.0,
|
||||||
|
"y": 0.0,
|
||||||
|
"z": 0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "extrude",
|
||||||
|
"target": "[uuid]",
|
||||||
|
"distance": 5.08,
|
||||||
|
"faces": null,
|
||||||
|
"opposite": {
|
||||||
|
"Other": 5.08
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "object_bring_to_front",
|
||||||
|
"object_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "sketch_mode_disable"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_adjacency_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "solid3d_get_extrusion_face_info",
|
||||||
|
"object_id": "[uuid]",
|
||||||
|
"edge_id": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cmdId": "[uuid]",
|
||||||
|
"range": [],
|
||||||
|
"command": {
|
||||||
|
"type": "boolean_subtract",
|
||||||
|
"target_ids": [
|
||||||
|
"[uuid]"
|
||||||
|
],
|
||||||
|
"tool_ids": [
|
||||||
|
"[uuid]"
|
||||||
|
],
|
||||||
|
"tolerance": 0.0000001
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Artifact graph flowchart subtract_regression12.kcl
|
||||||
|
extension: md
|
||||||
|
snapshot_kind: binary
|
||||||
|
---
|
@ -0,0 +1,180 @@
|
|||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
subgraph path3 [Path]
|
||||||
|
3["Path<br>[88, 129, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||||
|
5["Segment<br>[135, 156, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
|
6["Segment<br>[162, 180, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||||
|
7["Segment<br>[186, 205, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||||
|
8["Segment<br>[211, 235, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||||
|
9["Segment<br>[241, 262, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||||
|
10["Segment<br>[268, 294, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||||
|
11["Segment<br>[300, 307, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
|
||||||
|
18[Solid2d]
|
||||||
|
end
|
||||||
|
subgraph path4 [Path]
|
||||||
|
4["Path<br>[428, 470, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||||
|
12["Segment<br>[476, 497, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||||
|
13["Segment<br>[503, 522, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||||
|
14["Segment<br>[528, 548, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||||
|
15["Segment<br>[554, 574, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||||
|
16["Segment<br>[580, 587, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||||
|
17[Solid2d]
|
||||||
|
end
|
||||||
|
1["Plane<br>[47, 64, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
2["Plane<br>[387, 404, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 3 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
19["Sweep Revolve<br>[322, 373, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
20["Sweep Extrusion<br>[605, 676, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
21["CompositeSolid Subtract<br>[687, 730, 0]"]
|
||||||
|
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||||
|
22[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
23[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
24[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
25[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
26[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
27[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
28[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
29[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
30[Wall]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
31["Cap Start"]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
32["Cap End"]
|
||||||
|
%% face_code_ref=Missing NodePath
|
||||||
|
33["SweepEdge Opposite"]
|
||||||
|
34["SweepEdge Opposite"]
|
||||||
|
35["SweepEdge Opposite"]
|
||||||
|
36["SweepEdge Opposite"]
|
||||||
|
37["SweepEdge Adjacent"]
|
||||||
|
38["SweepEdge Adjacent"]
|
||||||
|
39["SweepEdge Adjacent"]
|
||||||
|
40["SweepEdge Adjacent"]
|
||||||
|
41["SweepEdge Adjacent"]
|
||||||
|
42["SweepEdge Adjacent"]
|
||||||
|
43["SweepEdge Adjacent"]
|
||||||
|
44["SweepEdge Adjacent"]
|
||||||
|
1 --- 3
|
||||||
|
2 --- 4
|
||||||
|
3 --- 5
|
||||||
|
3 --- 6
|
||||||
|
3 --- 7
|
||||||
|
3 --- 8
|
||||||
|
3 --- 9
|
||||||
|
3 --- 10
|
||||||
|
3 --- 11
|
||||||
|
3 --- 18
|
||||||
|
3 ---- 19
|
||||||
|
3 --- 21
|
||||||
|
4 --- 12
|
||||||
|
4 --- 13
|
||||||
|
4 --- 14
|
||||||
|
4 --- 15
|
||||||
|
4 --- 16
|
||||||
|
4 --- 17
|
||||||
|
4 ---- 20
|
||||||
|
4 --- 21
|
||||||
|
19 <--x 5
|
||||||
|
5 --- 30
|
||||||
|
19 <--x 7
|
||||||
|
7 --- 28
|
||||||
|
7 --- 41
|
||||||
|
19 <--x 8
|
||||||
|
8 --- 29
|
||||||
|
8 --- 42
|
||||||
|
19 <--x 9
|
||||||
|
9 --- 27
|
||||||
|
9 --- 43
|
||||||
|
19 <--x 10
|
||||||
|
10 --- 26
|
||||||
|
10 --- 44
|
||||||
|
12 --- 23
|
||||||
|
12 x--> 31
|
||||||
|
12 --- 33
|
||||||
|
12 --- 37
|
||||||
|
13 --- 25
|
||||||
|
13 x--> 31
|
||||||
|
13 --- 34
|
||||||
|
13 --- 38
|
||||||
|
14 --- 22
|
||||||
|
14 x--> 31
|
||||||
|
14 --- 35
|
||||||
|
14 --- 39
|
||||||
|
15 --- 24
|
||||||
|
15 x--> 31
|
||||||
|
15 --- 36
|
||||||
|
15 --- 40
|
||||||
|
19 --- 26
|
||||||
|
19 --- 27
|
||||||
|
19 --- 28
|
||||||
|
19 --- 29
|
||||||
|
19 --- 30
|
||||||
|
19 --- 41
|
||||||
|
19 --- 42
|
||||||
|
19 --- 43
|
||||||
|
19 --- 44
|
||||||
|
20 --- 22
|
||||||
|
20 --- 23
|
||||||
|
20 --- 24
|
||||||
|
20 --- 25
|
||||||
|
20 --- 31
|
||||||
|
20 --- 32
|
||||||
|
20 --- 33
|
||||||
|
20 --- 34
|
||||||
|
20 --- 35
|
||||||
|
20 --- 36
|
||||||
|
20 --- 37
|
||||||
|
20 --- 38
|
||||||
|
20 --- 39
|
||||||
|
20 --- 40
|
||||||
|
22 --- 35
|
||||||
|
38 <--x 22
|
||||||
|
22 --- 39
|
||||||
|
23 --- 33
|
||||||
|
23 --- 37
|
||||||
|
40 <--x 23
|
||||||
|
24 --- 36
|
||||||
|
39 <--x 24
|
||||||
|
24 --- 40
|
||||||
|
25 --- 34
|
||||||
|
37 <--x 25
|
||||||
|
25 --- 38
|
||||||
|
42 <--x 26
|
||||||
|
43 <--x 26
|
||||||
|
26 x--> 44
|
||||||
|
41 <--x 27
|
||||||
|
42 <--x 27
|
||||||
|
27 x--> 43
|
||||||
|
28 x--> 41
|
||||||
|
41 <--x 29
|
||||||
|
29 x--> 42
|
||||||
|
43 <--x 30
|
||||||
|
33 <--x 32
|
||||||
|
34 <--x 32
|
||||||
|
35 <--x 32
|
||||||
|
36 <--x 32
|
||||||
|
```
|
1392
rust/kcl-lib/tests/subtract_regression12/ast.snap
Normal file
1392
rust/kcl-lib/tests/subtract_regression12/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
27
rust/kcl-lib/tests/subtract_regression12/input.kcl
Normal file
27
rust/kcl-lib/tests/subtract_regression12/input.kcl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@settings(defaultLengthUnit = in)
|
||||||
|
|
||||||
|
sketch000 = startSketchOn(XY)
|
||||||
|
|
||||||
|
sketch000Profile000 = startProfile(sketch000, at = [0.22, 0.5])
|
||||||
|
|> xLine(length = -0.22)
|
||||||
|
|> yLine(length = -1)
|
||||||
|
|> xLine(length = 0.1)
|
||||||
|
|> line(end = [0.025, 0.1])
|
||||||
|
|> yLine(length = 0.789)
|
||||||
|
|> line(end = [0.095, 0.111])
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
revolve000 = revolve(sketch000Profile000, axis = Y, angle = 360)
|
||||||
|
|
||||||
|
sketch002 = startSketchOn(YZ)
|
||||||
|
|
||||||
|
sketch002Profile000 = startProfile(sketch002, at = [-0.6, 0.02])
|
||||||
|
|> yLine(length = -0.04)
|
||||||
|
|> xLine(length = 0.9)
|
||||||
|
|> yLine(length = 0.04)
|
||||||
|
|> xLine(length = -0.9)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
cut000Extrude = extrude([sketch002Profile000], length = 0.2, bidirectionalLength = 0.2)
|
||||||
|
|
||||||
|
cut000 = subtract(revolve000, tools = cut000Extrude)
|
217
rust/kcl-lib/tests/subtract_regression12/ops.snap
Normal file
217
rust/kcl-lib/tests/subtract_regression12/ops.snap
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Operations executed subtract_regression12.kcl
|
||||||
|
---
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "startSketchOn",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Plane",
|
||||||
|
"artifact_id": "[uuid]"
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "revolve",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Sketch",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {
|
||||||
|
"angle": {
|
||||||
|
"value": {
|
||||||
|
"type": "Number",
|
||||||
|
"value": 360.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Inches"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"axis": {
|
||||||
|
"value": {
|
||||||
|
"type": "Object",
|
||||||
|
"value": {
|
||||||
|
"direction": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 1.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.0,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Mm"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "startSketchOn",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Plane",
|
||||||
|
"artifact_id": "[uuid]"
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "extrude",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Array",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "Sketch",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {
|
||||||
|
"bidirectionalLength": {
|
||||||
|
"value": {
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.2,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Inches"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"length": {
|
||||||
|
"value": {
|
||||||
|
"type": "Number",
|
||||||
|
"value": 0.2,
|
||||||
|
"ty": {
|
||||||
|
"type": "Default",
|
||||||
|
"len": {
|
||||||
|
"type": "Inches"
|
||||||
|
},
|
||||||
|
"angle": {
|
||||||
|
"type": "Degrees"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"name": "subtract",
|
||||||
|
"unlabeledArg": {
|
||||||
|
"value": {
|
||||||
|
"type": "Solid",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
},
|
||||||
|
"labeledArgs": {
|
||||||
|
"tools": {
|
||||||
|
"value": {
|
||||||
|
"type": "Solid",
|
||||||
|
"value": {
|
||||||
|
"artifactId": "[uuid]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceRange": []
|
||||||
|
}
|
||||||
|
]
|
1109
rust/kcl-lib/tests/subtract_regression12/program_memory.snap
Normal file
1109
rust/kcl-lib/tests/subtract_regression12/program_memory.snap
Normal file
File diff suppressed because it is too large
Load Diff
BIN
rust/kcl-lib/tests/subtract_regression12/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression12/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
31
rust/kcl-lib/tests/subtract_regression12/unparsed.snap
Normal file
31
rust/kcl-lib/tests/subtract_regression12/unparsed.snap
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
source: kcl-lib/src/simulation_tests.rs
|
||||||
|
description: Result of unparsing subtract_regression12.kcl
|
||||||
|
---
|
||||||
|
@settings(defaultLengthUnit = in)
|
||||||
|
|
||||||
|
sketch000 = startSketchOn(XY)
|
||||||
|
|
||||||
|
sketch000Profile000 = startProfile(sketch000, at = [0.22, 0.5])
|
||||||
|
|> xLine(length = -0.22)
|
||||||
|
|> yLine(length = -1)
|
||||||
|
|> xLine(length = 0.1)
|
||||||
|
|> line(end = [0.025, 0.1])
|
||||||
|
|> yLine(length = 0.789)
|
||||||
|
|> line(end = [0.095, 0.111])
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
revolve000 = revolve(sketch000Profile000, axis = Y, angle = 360)
|
||||||
|
|
||||||
|
sketch002 = startSketchOn(YZ)
|
||||||
|
|
||||||
|
sketch002Profile000 = startProfile(sketch002, at = [-0.6, 0.02])
|
||||||
|
|> yLine(length = -0.04)
|
||||||
|
|> xLine(length = 0.9)
|
||||||
|
|> yLine(length = 0.04)
|
||||||
|
|> xLine(length = -0.9)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
cut000Extrude = extrude([sketch002Profile000], length = 0.2, bidirectionalLength = 0.2)
|
||||||
|
|
||||||
|
cut000 = subtract(revolve000, tools = cut000Extrude)
|
Reference in New Issue
Block a user