add subtract regression tests (#6829)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
653
rust/kcl-lib/tests/subtract_regression00/artifact_commands.snap
Normal file
653
rust/kcl-lib/tests/subtract_regression00/artifact_commands.snap
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart subtract_regression00.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,115 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path4 [Path]
|
||||
4["Path<br>[88, 128, 0]"]
|
||||
6["Segment<br>[134, 152, 0]"]
|
||||
7["Segment<br>[158, 176, 0]"]
|
||||
8["Segment<br>[182, 201, 0]"]
|
||||
9["Segment<br>[207, 226, 0]"]
|
||||
10["Segment<br>[232, 239, 0]"]
|
||||
12[Solid2d]
|
||||
end
|
||||
subgraph path5 [Path]
|
||||
5["Path<br>[401, 458, 0]"]
|
||||
11["Segment<br>[401, 458, 0]"]
|
||||
13[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 64, 0]"]
|
||||
2["Plane<br>[348, 376, 0]"]
|
||||
3["StartSketchOnPlane<br>[334, 377, 0]"]
|
||||
14["Sweep Extrusion<br>[254, 320, 0]"]
|
||||
15["Sweep Extrusion<br>[476, 518, 0]"]
|
||||
16["CompositeSolid Subtract<br>[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
|
||||
```
|
1069
rust/kcl-lib/tests/subtract_regression00/ast.snap
Normal file
1069
rust/kcl-lib/tests/subtract_regression00/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
24
rust/kcl-lib/tests/subtract_regression00/input.kcl
Normal file
24
rust/kcl-lib/tests/subtract_regression00/input.kcl
Normal file
@ -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)
|
167
rust/kcl-lib/tests/subtract_regression00/ops.snap
Normal file
167
rust/kcl-lib/tests/subtract_regression00/ops.snap
Normal file
@ -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": []
|
||||
}
|
||||
}
|
||||
]
|
820
rust/kcl-lib/tests/subtract_regression00/program_memory.snap
Normal file
820
rust/kcl-lib/tests/subtract_regression00/program_memory.snap
Normal file
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
rust/kcl-lib/tests/subtract_regression00/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression00/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
24
rust/kcl-lib/tests/subtract_regression00/unparsed.snap
Normal file
24
rust/kcl-lib/tests/subtract_regression00/unparsed.snap
Normal file
@ -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)
|
844
rust/kcl-lib/tests/subtract_regression01/artifact_commands.snap
Normal file
844
rust/kcl-lib/tests/subtract_regression01/artifact_commands.snap
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart subtract_regression01.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,161 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path4 [Path]
|
||||
4["Path<br>[88, 134, 0]"]
|
||||
6["Segment<br>[140, 161, 0]"]
|
||||
7["Segment<br>[167, 255, 0]"]
|
||||
8["Segment<br>[261, 292, 0]"]
|
||||
9["Segment<br>[298, 384, 0]"]
|
||||
10["Segment<br>[390, 412, 0]"]
|
||||
11["Segment<br>[418, 440, 0]"]
|
||||
12["Segment<br>[446, 453, 0]"]
|
||||
14[Solid2d]
|
||||
end
|
||||
subgraph path5 [Path]
|
||||
5["Path<br>[622, 686, 0]"]
|
||||
13["Segment<br>[622, 686, 0]"]
|
||||
15[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 64, 0]"]
|
||||
2["Plane<br>[567, 597, 0]"]
|
||||
3["StartSketchOnPlane<br>[553, 598, 0]"]
|
||||
16["Sweep Extrusion<br>[468, 539, 0]"]
|
||||
17["Sweep Extrusion<br>[704, 748, 0]"]
|
||||
18["CompositeSolid Subtract<br>[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
|
||||
```
|
1297
rust/kcl-lib/tests/subtract_regression01/ast.snap
Normal file
1297
rust/kcl-lib/tests/subtract_regression01/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
34
rust/kcl-lib/tests/subtract_regression01/input.kcl
Normal file
34
rust/kcl-lib/tests/subtract_regression01/input.kcl
Normal file
@ -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)
|
172
rust/kcl-lib/tests/subtract_regression01/ops.snap
Normal file
172
rust/kcl-lib/tests/subtract_regression01/ops.snap
Normal file
@ -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": []
|
||||
}
|
||||
}
|
||||
]
|
1012
rust/kcl-lib/tests/subtract_regression01/program_memory.snap
Normal file
1012
rust/kcl-lib/tests/subtract_regression01/program_memory.snap
Normal file
File diff suppressed because it is too large
Load Diff
BIN
rust/kcl-lib/tests/subtract_regression01/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression01/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
26
rust/kcl-lib/tests/subtract_regression01/unparsed.snap
Normal file
26
rust/kcl-lib/tests/subtract_regression01/unparsed.snap
Normal file
@ -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)
|
1063
rust/kcl-lib/tests/subtract_regression02/artifact_commands.snap
Normal file
1063
rust/kcl-lib/tests/subtract_regression02/artifact_commands.snap
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart subtract_regression02.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,192 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path4 [Path]
|
||||
4["Path<br>[88, 131, 0]"]
|
||||
7["Segment<br>[137, 157, 0]"]
|
||||
8["Segment<br>[163, 182, 0]"]
|
||||
9["Segment<br>[188, 265, 0]"]
|
||||
10["Segment<br>[271, 293, 0]"]
|
||||
11["Segment<br>[299, 380, 0]"]
|
||||
12["Segment<br>[386, 407, 0]"]
|
||||
13["Segment<br>[413, 490, 0]"]
|
||||
14["Segment<br>[496, 503, 0]"]
|
||||
19[Solid2d]
|
||||
end
|
||||
subgraph path5 [Path]
|
||||
5["Path<br>[646, 704, 0]"]
|
||||
15["Segment<br>[646, 704, 0]"]
|
||||
17[Solid2d]
|
||||
end
|
||||
subgraph path6 [Path]
|
||||
6["Path<br>[901, 959, 0]"]
|
||||
16["Segment<br>[901, 959, 0]"]
|
||||
18[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 64, 0]"]
|
||||
2["Plane<br>[605, 622, 0]"]
|
||||
3["Plane<br>[859, 877, 0]"]
|
||||
20["Sweep Extrusion<br>[518, 591, 0]"]
|
||||
21["Sweep Extrusion<br>[722, 791, 0]"]
|
||||
22["Sweep Extrusion<br>[977, 1046, 0]"]
|
||||
23["CompositeSolid Subtract<br>[802, 845, 0]"]
|
||||
24["CompositeSolid Subtract<br>[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
|
||||
```
|
1749
rust/kcl-lib/tests/subtract_regression02/ast.snap
Normal file
1749
rust/kcl-lib/tests/subtract_regression02/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
51
rust/kcl-lib/tests/subtract_regression02/input.kcl
Normal file
51
rust/kcl-lib/tests/subtract_regression02/input.kcl
Normal file
@ -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)
|
249
rust/kcl-lib/tests/subtract_regression02/ops.snap
Normal file
249
rust/kcl-lib/tests/subtract_regression02/ops.snap
Normal file
@ -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": []
|
||||
}
|
||||
}
|
||||
]
|
1609
rust/kcl-lib/tests/subtract_regression02/program_memory.snap
Normal file
1609
rust/kcl-lib/tests/subtract_regression02/program_memory.snap
Normal file
File diff suppressed because it is too large
Load Diff
BIN
rust/kcl-lib/tests/subtract_regression02/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression02/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
35
rust/kcl-lib/tests/subtract_regression02/unparsed.snap
Normal file
35
rust/kcl-lib/tests/subtract_regression02/unparsed.snap
Normal file
@ -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)
|
1145
rust/kcl-lib/tests/subtract_regression03/artifact_commands.snap
Normal file
1145
rust/kcl-lib/tests/subtract_regression03/artifact_commands.snap
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart subtract_regression03.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,182 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path5 [Path]
|
||||
5["Path<br>[88, 140, 0]"]
|
||||
9["Segment<br>[146, 179, 0]"]
|
||||
10["Segment<br>[185, 275, 0]"]
|
||||
11["Segment<br>[281, 313, 0]"]
|
||||
12["Segment<br>[319, 400, 0]"]
|
||||
13["Segment<br>[406, 439, 0]"]
|
||||
14["Segment<br>[445, 534, 0]"]
|
||||
15["Segment<br>[540, 574, 0]"]
|
||||
end
|
||||
subgraph path6 [Path]
|
||||
6["Path<br>[813, 872, 0]"]
|
||||
16["Segment<br>[813, 872, 0]"]
|
||||
27[Solid2d]
|
||||
end
|
||||
subgraph path7 [Path]
|
||||
7["Path<br>[1156, 1196, 0]"]
|
||||
17["Segment<br>[1202, 1230, 0]"]
|
||||
18["Segment<br>[1236, 1261, 0]"]
|
||||
19["Segment<br>[1267, 1288, 0]"]
|
||||
20["Segment<br>[1294, 1301, 0]"]
|
||||
26[Solid2d]
|
||||
end
|
||||
subgraph path8 [Path]
|
||||
8["Path<br>[1621, 1661, 0]"]
|
||||
21["Segment<br>[1667, 1687, 0]"]
|
||||
22["Segment<br>[1693, 1718, 0]"]
|
||||
23["Segment<br>[1724, 1753, 0]"]
|
||||
24["Segment<br>[1759, 1766, 0]"]
|
||||
25[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 64, 0]"]
|
||||
2["Plane<br>[766, 789, 0]"]
|
||||
3["Plane<br>[1109, 1132, 0]"]
|
||||
4["Plane<br>[1574, 1597, 0]"]
|
||||
28["Sweep Sweep<br>[892, 952, 0]"]
|
||||
29["Sweep Extrusion<br>[1319, 1364, 0]"]
|
||||
30["Sweep Extrusion<br>[1784, 1829, 0]"]
|
||||
31["CompositeSolid Subtract<br>[1375, 1423, 0]"]
|
||||
32["CompositeSolid Subtract<br>[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
|
||||
```
|
3363
rust/kcl-lib/tests/subtract_regression03/ast.snap
Normal file
3363
rust/kcl-lib/tests/subtract_regression03/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
83
rust/kcl-lib/tests/subtract_regression03/input.kcl
Normal file
83
rust/kcl-lib/tests/subtract_regression03/input.kcl
Normal file
@ -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)
|
738
rust/kcl-lib/tests/subtract_regression03/ops.snap
Normal file
738
rust/kcl-lib/tests/subtract_regression03/ops.snap
Normal file
@ -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": []
|
||||
}
|
||||
}
|
||||
]
|
1923
rust/kcl-lib/tests/subtract_regression03/program_memory.snap
Normal file
1923
rust/kcl-lib/tests/subtract_regression03/program_memory.snap
Normal file
File diff suppressed because it is too large
Load Diff
BIN
rust/kcl-lib/tests/subtract_regression03/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression03/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
68
rust/kcl-lib/tests/subtract_regression03/unparsed.snap
Normal file
68
rust/kcl-lib/tests/subtract_regression03/unparsed.snap
Normal file
@ -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)
|
Reference in New Issue
Block a user