Subtract tests (#6913)
* add subtract test and cleanup some other tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -1,53 +0,0 @@
|
||||
d_wrist_circumference = [22.8, 10.7, 16.4, 18.5]
|
||||
width = d_wrist_circumference[0] + d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3]
|
||||
length = 120.0
|
||||
hand_thickness = 24.0
|
||||
corner_radius = 5.0
|
||||
|
||||
// At first I thought this was going to be symmetric,
|
||||
// but I measured intentionally to not be symmetric,
|
||||
// because your wrist isn't a perfect cylindrical surface
|
||||
brace_base = startSketchOn(XY)
|
||||
|> startProfile(at = [corner_radius, 0])
|
||||
|> line(end = [width - corner_radius, 0.0])
|
||||
|> tangentialArc(end = [corner_radius, corner_radius])
|
||||
|> yLine(length = 25.0 - corner_radius)
|
||||
|> tangentialArc(end = [-corner_radius, corner_radius])
|
||||
|> xLine(length = -(d_wrist_circumference[0] - (corner_radius * 2)))
|
||||
|> tangentialArc(end = [-corner_radius, corner_radius])
|
||||
|> yLine(length = length - 25.0 - 23.0 - (corner_radius * 2))
|
||||
|> tangentialArc(end = [corner_radius, corner_radius])
|
||||
|> xLine(length = 15.0 - (corner_radius * 2))
|
||||
|> tangentialArc(end = [corner_radius, corner_radius])
|
||||
|> yLine(length = 23.0 - corner_radius)
|
||||
|> tangentialArc(end = [-corner_radius, corner_radius])
|
||||
|> xLine(length = -(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)))
|
||||
|> tangentialArc(end = [-corner_radius, -corner_radius])
|
||||
|> yLine(length = -(23.0 - corner_radius))
|
||||
|> tangentialArc(end = [corner_radius, -corner_radius])
|
||||
|> xLine(length = 15.0 - (corner_radius * 2))
|
||||
|> tangentialArc(end = [corner_radius, -corner_radius])
|
||||
|> yLine(length = -(length - 25.0 - 23.0 - (corner_radius * 2)))
|
||||
|> tangentialArc(end = [-corner_radius, -corner_radius])
|
||||
|> xLine(length = -(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius))
|
||||
|> tangentialArc(end = [-corner_radius, -corner_radius])
|
||||
|> yLine(length = -(25.0 - corner_radius))
|
||||
|> tangentialArc(end = [corner_radius, -corner_radius])
|
||||
|> close()
|
||||
|
||||
inner = startSketchOn(XY)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> xLine(length = 1.0)
|
||||
|> tangentialArc(end = [corner_radius, corner_radius])
|
||||
|> yLine(length = 25.0 - (corner_radius * 2))
|
||||
|> tangentialArc(end = [-corner_radius, corner_radius])
|
||||
|> xLine(length = -1.0)
|
||||
|> tangentialArc(end = [-corner_radius, -corner_radius])
|
||||
|> yLine(length = -(25.0 - (corner_radius * 2)))
|
||||
|> tangentialArc(end = [corner_radius, -corner_radius])
|
||||
|> close()
|
||||
|
||||
final = brace_base
|
||||
|> subtract2d(tool = inner)
|
||||
|> extrude(length = 3.0)
|
||||
|
@ -22,47 +22,6 @@ pub(crate) fn assert_out(test_name: &str, result: &image::DynamicImage) -> Strin
|
||||
path
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_fillet_duplicate_tags() {
|
||||
let code = kcl_input!("fillet_duplicate_tags");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let err = result.expect_err("Code should have failed due to the duplicate edges being filletted");
|
||||
|
||||
let err = err.as_kcl_error().unwrap();
|
||||
assert_eq!(
|
||||
err.message(),
|
||||
"The same edge ID is being referenced multiple times, which is not allowed. Please select a different edge"
|
||||
);
|
||||
assert_eq!(err.source_ranges().len(), 3);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute_engine_error_return() {
|
||||
let code = r#"part001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5.5229, 5.25217])
|
||||
|> line(end = [10.50433, -1.19122])
|
||||
|> line(end = [8.01362, -5.48731])
|
||||
|> line(end = [-1.02877, -6.76825])
|
||||
|> line(end = [-11.53311, 2.81559])
|
||||
|> extrude(length = 4)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let expected_msg = "engine: Modeling command failed: [ApiError { error_code: BadRequest, message: \"The path is not closed. Solid2D construction requires a closed path!\" }]";
|
||||
let err = result.unwrap_err().as_kcl_error().unwrap().get_message();
|
||||
assert_eq!(err, expected_msg);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute_i_shape() {
|
||||
// This is some code from lee that starts a pipe expression with a variable.
|
||||
let code = kcl_input!("i_shape");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
assert_out("i_shape", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
#[ignore] // No longer a stack overflow problem, instead it causes an engine internal error.
|
||||
async fn kcl_test_execute_pipes_on_pipes() {
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::execution::typed_path::TypedPath;
|
||||
use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
execution::typed_path::TypedPath,
|
||||
fs::FileSystem,
|
||||
SourceRange,
|
||||
};
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::execution::typed_path::TypedPath;
|
||||
use crate::SourceRange;
|
||||
use crate::{execution::typed_path::TypedPath, SourceRange};
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub mod local;
|
||||
|
@ -11,8 +11,7 @@ use tower_lsp::lsp_types::{
|
||||
TextDocumentItem, WorkspaceFolder,
|
||||
};
|
||||
|
||||
use crate::execution::typed_path::TypedPath;
|
||||
use crate::fs::FileSystem;
|
||||
use crate::{execution::typed_path::TypedPath, fs::FileSystem};
|
||||
|
||||
/// A trait for the backend of the language server.
|
||||
#[async_trait::async_trait]
|
||||
|
@ -2960,3 +2960,66 @@ mod subtract_regression05 {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod subtract_regression06 {
|
||||
const TEST_NAME: &str = "subtract_regression06";
|
||||
|
||||
/// 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 fillet_duplicate_tags {
|
||||
const TEST_NAME: &str = "fillet_duplicate_tags";
|
||||
|
||||
/// 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 execute_engine_error_return {
|
||||
const TEST_NAME: &str = "execute_engine_error_return";
|
||||
|
||||
/// 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
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,219 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact commands execute_engine_error_return.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "edge_lines_visible",
|
||||
"hidden": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "make_plane",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"x_axis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"y_axis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"size": 60.0,
|
||||
"clobber": false,
|
||||
"hide": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 5.5229,
|
||||
"y": 5.25217,
|
||||
"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": 10.5043,
|
||||
"y": -1.1912,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 8.0136,
|
||||
"y": -5.4873,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": -1.0288,
|
||||
"y": -6.7683,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": -11.5331,
|
||||
"y": 2.8156,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": 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": "extrude",
|
||||
"target": "[uuid]",
|
||||
"distance": 4.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_extrusion_face_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart execute_engine_error_return.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,16 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path2 [Path]
|
||||
2["Path<br>[33, 69, 0]"]
|
||||
3["Segment<br>[75, 107, 0]"]
|
||||
4["Segment<br>[113, 144, 0]"]
|
||||
5["Segment<br>[150, 182, 0]"]
|
||||
6["Segment<br>[188, 220, 0]"]
|
||||
end
|
||||
1["Plane<br>[10, 27, 0]"]
|
||||
1 --- 2
|
||||
2 --- 3
|
||||
2 --- 4
|
||||
2 --- 5
|
||||
2 --- 6
|
||||
```
|
508
rust/kcl-lib/tests/execute_engine_error_return/ast.snap
Normal file
508
rust/kcl-lib/tests/execute_engine_error_return/ast.snap
Normal file
@ -0,0 +1,508 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of parsing execute_engine_error_return.kcl
|
||||
---
|
||||
{
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"declaration": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"id": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "part001",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "startSketchOn",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "XY",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "at",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "5.5229",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 5.5229,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "5.25217",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 5.25217,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "startProfile",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "end",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "10.50433",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 10.50433,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"argument": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "1.19122",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.19122,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"operator": "-",
|
||||
"start": 0,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "end",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "8.01362",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 8.01362,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"argument": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "5.48731",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 5.48731,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"operator": "-",
|
||||
"start": 0,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "end",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"argument": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "1.02877",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.02877,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"operator": "-",
|
||||
"start": 0,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
},
|
||||
{
|
||||
"argument": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "6.76825",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 6.76825,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"operator": "-",
|
||||
"start": 0,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "end",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"argument": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "11.53311",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 11.53311,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"operator": "-",
|
||||
"start": 0,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
},
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "2.81559",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.81559,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "4",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 4.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "extrude",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
}
|
||||
],
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression"
|
||||
},
|
||||
"start": 0,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 0,
|
||||
"kind": "const",
|
||||
"start": 0,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
}
|
||||
],
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Error from executing execute_engine_error_return.kcl
|
||||
---
|
||||
KCL Engine error
|
||||
|
||||
× engine: Modeling command failed: [ApiError { error_code: BadRequest,
|
||||
│ message: "The path is not closed. Solid2D construction requires a closed
|
||||
│ path!" }]
|
||||
╭─[7:6]
|
||||
6 │ |> line(end = [-11.53311, 2.81559])
|
||||
7 │ |> extrude(length = 4)
|
||||
· ─────────┬─────────
|
||||
· ╰── tests/execute_engine_error_return/input.kcl
|
||||
╰────
|
7
rust/kcl-lib/tests/execute_engine_error_return/input.kcl
Normal file
7
rust/kcl-lib/tests/execute_engine_error_return/input.kcl
Normal file
@ -0,0 +1,7 @@
|
||||
part001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5.5229, 5.25217])
|
||||
|> line(end = [10.50433, -1.19122])
|
||||
|> line(end = [8.01362, -5.48731])
|
||||
|> line(end = [-1.02877, -6.76825])
|
||||
|> line(end = [-11.53311, 2.81559])
|
||||
|> extrude(length = 4)
|
52
rust/kcl-lib/tests/execute_engine_error_return/ops.snap
Normal file
52
rust/kcl-lib/tests/execute_engine_error_return/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed execute_engine_error_return.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"isError": true,
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
}
|
||||
]
|
11
rust/kcl-lib/tests/execute_engine_error_return/unparsed.snap
Normal file
11
rust/kcl-lib/tests/execute_engine_error_return/unparsed.snap
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing execute_engine_error_return.kcl
|
||||
---
|
||||
part001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5.5229, 5.25217])
|
||||
|> line(end = [10.50433, -1.19122])
|
||||
|> line(end = [8.01362, -5.48731])
|
||||
|> line(end = [-1.02877, -6.76825])
|
||||
|> line(end = [-11.53311, 2.81559])
|
||||
|> extrude(length = 4)
|
418
rust/kcl-lib/tests/fillet_duplicate_tags/artifact_commands.snap
Normal file
418
rust/kcl-lib/tests/fillet_duplicate_tags/artifact_commands.snap
Normal file
@ -0,0 +1,418 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact commands fillet_duplicate_tags.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": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "start_path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "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": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 10.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": 10.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 0.0,
|
||||
"y": 10.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "close_path",
|
||||
"path_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extrude",
|
||||
"target": "[uuid]",
|
||||
"distance": 10.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_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": "solid3d_get_next_adjacent_edge",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]",
|
||||
"face_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_prev_adjacent_edge",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]",
|
||||
"face_id": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart fillet_duplicate_tags.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,78 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path2 [Path]
|
||||
2["Path<br>[0, 44, 0]"]
|
||||
3["Segment<br>[50, 84, 0]"]
|
||||
4["Segment<br>[90, 124, 0]"]
|
||||
5["Segment<br>[130, 183, 0]"]
|
||||
6["Segment<br>[189, 210, 0]"]
|
||||
7[Solid2d]
|
||||
end
|
||||
1["Plane<br>[13, 30, 0]"]
|
||||
8["Sweep Extrusion<br>[216, 236, 0]"]
|
||||
9[Wall]
|
||||
10[Wall]
|
||||
11[Wall]
|
||||
12[Wall]
|
||||
13["Cap Start"]
|
||||
14["Cap End"]
|
||||
15["SweepEdge Opposite"]
|
||||
16["SweepEdge Opposite"]
|
||||
17["SweepEdge Opposite"]
|
||||
18["SweepEdge Opposite"]
|
||||
19["SweepEdge Adjacent"]
|
||||
20["SweepEdge Adjacent"]
|
||||
21["SweepEdge Adjacent"]
|
||||
22["SweepEdge Adjacent"]
|
||||
1 --- 2
|
||||
2 --- 3
|
||||
2 --- 4
|
||||
2 --- 5
|
||||
2 --- 6
|
||||
2 --- 7
|
||||
2 ---- 8
|
||||
3 --- 12
|
||||
3 x--> 13
|
||||
3 --- 16
|
||||
3 --- 21
|
||||
4 --- 10
|
||||
4 x--> 13
|
||||
4 --- 15
|
||||
4 --- 22
|
||||
5 --- 9
|
||||
5 x--> 13
|
||||
5 --- 18
|
||||
5 --- 20
|
||||
6 --- 11
|
||||
6 x--> 13
|
||||
6 --- 17
|
||||
6 --- 19
|
||||
8 --- 9
|
||||
8 --- 10
|
||||
8 --- 11
|
||||
8 --- 12
|
||||
8 --- 13
|
||||
8 --- 14
|
||||
8 --- 15
|
||||
8 --- 16
|
||||
8 --- 17
|
||||
8 --- 18
|
||||
8 --- 19
|
||||
8 --- 20
|
||||
8 --- 21
|
||||
8 --- 22
|
||||
18 <--x 9
|
||||
20 <--x 9
|
||||
22 <--x 9
|
||||
15 <--x 10
|
||||
22 <--x 10
|
||||
17 <--x 11
|
||||
19 <--x 11
|
||||
20 <--x 11
|
||||
16 <--x 12
|
||||
19 <--x 12
|
||||
15 <--x 14
|
||||
16 <--x 14
|
||||
17 <--x 14
|
||||
18 <--x 14
|
||||
```
|
610
rust/kcl-lib/tests/fillet_duplicate_tags/ast.snap
Normal file
610
rust/kcl-lib/tests/fillet_duplicate_tags/ast.snap
Normal file
@ -0,0 +1,610 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of parsing fillet_duplicate_tags.kcl
|
||||
---
|
||||
{
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"expression": {
|
||||
"body": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "at",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "0",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "0",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "startProfile",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "startSketchOn",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "XY",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "10",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 10.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "tag",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "TagDeclarator",
|
||||
"type": "TagDeclarator",
|
||||
"value": "line000"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "xLine",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "10",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 10.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "tag",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "TagDeclarator",
|
||||
"type": "TagDeclarator",
|
||||
"value": "line001"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "yLine",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "endAbsolute",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "profileStartX",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "tag",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "TagDeclarator",
|
||||
"type": "TagDeclarator",
|
||||
"value": "line002"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "xLine",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "tag",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "TagDeclarator",
|
||||
"type": "TagDeclarator",
|
||||
"value": "line003"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "close",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "10",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 10.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "extrude",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "radius",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "1",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "tags",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line003",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
},
|
||||
{
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "getNextAdjacentEdge",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line000",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "getPreviousAdjacentEdge",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "line001",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "fillet",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
}
|
||||
],
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression"
|
||||
},
|
||||
"start": 0,
|
||||
"type": "ExpressionStatement",
|
||||
"type": "ExpressionStatement"
|
||||
}
|
||||
],
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {
|
||||
"0": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "newLine"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"startNodes": []
|
||||
},
|
||||
"start": 0
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Error from executing fillet_duplicate_tags.kcl
|
||||
---
|
||||
KCL Type error
|
||||
|
||||
× type: The same edge ID is being referenced multiple times, which is not
|
||||
│ allowed. Please select a different edge
|
||||
╭─[7:6]
|
||||
6 │ |> extrude(length = 10)
|
||||
7 │ ╭─▶ |> fillet(
|
||||
8 │ │ radius = 1,
|
||||
9 │ │ tags = [
|
||||
10 │ │ line003,
|
||||
11 │ │ getNextAdjacentEdge(line000),
|
||||
· │ ──────────────┬─────────────
|
||||
· │ ╰── tests/fillet_duplicate_tags/input.kcl
|
||||
12 │ │ getPreviousAdjacentEdge(line001)
|
||||
· │ ────────────────┬───────────────
|
||||
· │ ╰── tests/fillet_duplicate_tags/input.kcl
|
||||
13 │ │ ],
|
||||
14 │ ├─▶ )
|
||||
· ╰──── tests/fillet_duplicate_tags/input.kcl
|
||||
15 │
|
||||
╰────
|
||||
├─▶ KCL Type error
|
||||
│
|
||||
│ × type: The same edge ID is being referenced multiple times, which is
|
||||
│ │ not allowed. Please select a different edge
|
||||
│ ╭─[11:10]
|
||||
│ 10 │ line003,
|
||||
│ 11 │ getNextAdjacentEdge(line000),
|
||||
│ · ──────────────┬─────────────
|
||||
│ · ╰── tests/fillet_duplicate_tags/input.kcl
|
||||
│ 12 │ getPreviousAdjacentEdge(line001)
|
||||
│ ╰────
|
||||
╰─▶ KCL Type error
|
||||
|
||||
× type: The same edge ID is being referenced multiple times, which is
|
||||
│ not allowed. Please select a different edge
|
||||
╭─[12:10]
|
||||
11 │ getNextAdjacentEdge(line000),
|
||||
12 │ getPreviousAdjacentEdge(line001)
|
||||
· ────────────────┬───────────────
|
||||
· ╰── tests/fillet_duplicate_tags/input.kcl
|
||||
13 │ ],
|
||||
╰────
|
105
rust/kcl-lib/tests/fillet_duplicate_tags/ops.snap
Normal file
105
rust/kcl-lib/tests/fillet_duplicate_tags/ops.snap
Normal file
@ -0,0 +1,105 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed fillet_duplicate_tags.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 10.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "KclStdLibCall",
|
||||
"name": "fillet",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"labeledArgs": {
|
||||
"radius": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"tags": {
|
||||
"value": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "TagIdentifier",
|
||||
"value": "line003",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
{
|
||||
"type": "Uuid",
|
||||
"value": "[uuid]"
|
||||
},
|
||||
{
|
||||
"type": "Uuid",
|
||||
"value": "[uuid]"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"sourceRange": [],
|
||||
"isError": true
|
||||
}
|
||||
]
|
18
rust/kcl-lib/tests/fillet_duplicate_tags/unparsed.snap
Normal file
18
rust/kcl-lib/tests/fillet_duplicate_tags/unparsed.snap
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing fillet_duplicate_tags.kcl
|
||||
---
|
||||
startProfile(startSketchOn(XY), at = [0, 0])
|
||||
|> xLine(length = 10, tag = $line000)
|
||||
|> yLine(length = 10, tag = $line001)
|
||||
|> xLine(endAbsolute = profileStartX(%), tag = $line002)
|
||||
|> close(tag = $line003)
|
||||
|> extrude(length = 10)
|
||||
|> fillet(
|
||||
radius = 1,
|
||||
tags = [
|
||||
line003,
|
||||
getNextAdjacentEdge(line000),
|
||||
getPreviousAdjacentEdge(line001)
|
||||
],
|
||||
)
|
1455
rust/kcl-lib/tests/subtract_regression06/artifact_commands.snap
Normal file
1455
rust/kcl-lib/tests/subtract_regression06/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_regression06.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -0,0 +1,305 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path3 [Path]
|
||||
3["Path<br>[88, 135, 0]"]
|
||||
5["Segment<br>[141, 163, 0]"]
|
||||
6["Segment<br>[169, 253, 0]"]
|
||||
7["Segment<br>[259, 292, 0]"]
|
||||
8["Segment<br>[298, 393, 0]"]
|
||||
9["Segment<br>[399, 430, 0]"]
|
||||
10["Segment<br>[436, 522, 0]"]
|
||||
11["Segment<br>[528, 550, 0]"]
|
||||
12["Segment<br>[556, 578, 0]"]
|
||||
13["Segment<br>[584, 607, 0]"]
|
||||
14["Segment<br>[613, 700, 0]"]
|
||||
15["Segment<br>[706, 739, 0]"]
|
||||
16["Segment<br>[745, 840, 0]"]
|
||||
17["Segment<br>[846, 879, 0]"]
|
||||
18["Segment<br>[885, 970, 0]"]
|
||||
19["Segment<br>[976, 999, 0]"]
|
||||
20["Segment<br>[1005, 1026, 0]"]
|
||||
21["Segment<br>[1032, 1039, 0]"]
|
||||
23[Solid2d]
|
||||
end
|
||||
subgraph path4 [Path]
|
||||
4["Path<br>[1286, 1346, 0]"]
|
||||
22["Segment<br>[1286, 1346, 0]"]
|
||||
24[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 64, 0]"]
|
||||
2["Plane<br>[1239, 1262, 0]"]
|
||||
25["Sweep Extrusion<br>[1054, 1123, 0]"]
|
||||
26["Sweep Extrusion<br>[1364, 1406, 0]"]
|
||||
27["CompositeSolid Subtract<br>[1417, 1460, 0]"]
|
||||
28[Wall]
|
||||
29[Wall]
|
||||
30[Wall]
|
||||
31[Wall]
|
||||
32[Wall]
|
||||
33[Wall]
|
||||
34[Wall]
|
||||
35[Wall]
|
||||
36[Wall]
|
||||
37[Wall]
|
||||
38[Wall]
|
||||
39[Wall]
|
||||
40[Wall]
|
||||
41[Wall]
|
||||
42[Wall]
|
||||
43[Wall]
|
||||
44[Wall]
|
||||
45["Cap Start"]
|
||||
46["Cap Start"]
|
||||
47["Cap End"]
|
||||
48["Cap End"]
|
||||
49["SweepEdge Opposite"]
|
||||
50["SweepEdge Opposite"]
|
||||
51["SweepEdge Opposite"]
|
||||
52["SweepEdge Opposite"]
|
||||
53["SweepEdge Opposite"]
|
||||
54["SweepEdge Opposite"]
|
||||
55["SweepEdge Opposite"]
|
||||
56["SweepEdge Opposite"]
|
||||
57["SweepEdge Opposite"]
|
||||
58["SweepEdge Opposite"]
|
||||
59["SweepEdge Opposite"]
|
||||
60["SweepEdge Opposite"]
|
||||
61["SweepEdge Opposite"]
|
||||
62["SweepEdge Opposite"]
|
||||
63["SweepEdge Opposite"]
|
||||
64["SweepEdge Opposite"]
|
||||
65["SweepEdge Opposite"]
|
||||
66["SweepEdge Adjacent"]
|
||||
67["SweepEdge Adjacent"]
|
||||
68["SweepEdge Adjacent"]
|
||||
69["SweepEdge Adjacent"]
|
||||
70["SweepEdge Adjacent"]
|
||||
71["SweepEdge Adjacent"]
|
||||
72["SweepEdge Adjacent"]
|
||||
73["SweepEdge Adjacent"]
|
||||
74["SweepEdge Adjacent"]
|
||||
75["SweepEdge Adjacent"]
|
||||
76["SweepEdge Adjacent"]
|
||||
77["SweepEdge Adjacent"]
|
||||
78["SweepEdge Adjacent"]
|
||||
79["SweepEdge Adjacent"]
|
||||
80["SweepEdge Adjacent"]
|
||||
81["SweepEdge Adjacent"]
|
||||
82["SweepEdge Adjacent"]
|
||||
1 --- 3
|
||||
2 --- 4
|
||||
3 --- 5
|
||||
3 --- 6
|
||||
3 --- 7
|
||||
3 --- 8
|
||||
3 --- 9
|
||||
3 --- 10
|
||||
3 --- 11
|
||||
3 --- 12
|
||||
3 --- 13
|
||||
3 --- 14
|
||||
3 --- 15
|
||||
3 --- 16
|
||||
3 --- 17
|
||||
3 --- 18
|
||||
3 --- 19
|
||||
3 --- 20
|
||||
3 --- 21
|
||||
3 --- 23
|
||||
3 ---- 25
|
||||
3 --- 27
|
||||
4 --- 22
|
||||
4 --- 24
|
||||
4 ---- 26
|
||||
4 --- 27
|
||||
5 --- 41
|
||||
5 x--> 46
|
||||
5 --- 57
|
||||
5 --- 69
|
||||
6 --- 36
|
||||
6 x--> 46
|
||||
6 --- 52
|
||||
6 --- 81
|
||||
7 --- 35
|
||||
7 x--> 46
|
||||
7 --- 54
|
||||
7 --- 74
|
||||
8 --- 37
|
||||
8 x--> 46
|
||||
8 --- 56
|
||||
8 --- 78
|
||||
9 --- 33
|
||||
9 x--> 46
|
||||
9 --- 53
|
||||
9 --- 72
|
||||
10 --- 32
|
||||
10 x--> 46
|
||||
10 --- 65
|
||||
10 --- 68
|
||||
11 --- 40
|
||||
11 x--> 46
|
||||
11 --- 50
|
||||
11 --- 76
|
||||
12 --- 43
|
||||
12 x--> 46
|
||||
12 --- 61
|
||||
12 --- 67
|
||||
13 --- 42
|
||||
13 x--> 46
|
||||
13 --- 60
|
||||
13 --- 80
|
||||
14 --- 30
|
||||
14 x--> 46
|
||||
14 --- 62
|
||||
14 --- 82
|
||||
15 --- 31
|
||||
15 x--> 46
|
||||
15 --- 51
|
||||
15 --- 73
|
||||
16 --- 44
|
||||
16 x--> 46
|
||||
16 --- 63
|
||||
16 --- 77
|
||||
17 --- 38
|
||||
17 x--> 46
|
||||
17 --- 55
|
||||
17 --- 79
|
||||
18 --- 34
|
||||
18 x--> 46
|
||||
18 --- 59
|
||||
18 --- 71
|
||||
19 --- 29
|
||||
19 x--> 46
|
||||
19 --- 64
|
||||
19 --- 70
|
||||
20 --- 39
|
||||
20 x--> 46
|
||||
20 --- 58
|
||||
20 --- 75
|
||||
22 --- 28
|
||||
22 x--> 45
|
||||
22 --- 49
|
||||
22 --- 66
|
||||
25 --- 29
|
||||
25 --- 30
|
||||
25 --- 31
|
||||
25 --- 32
|
||||
25 --- 33
|
||||
25 --- 34
|
||||
25 --- 35
|
||||
25 --- 36
|
||||
25 --- 37
|
||||
25 --- 38
|
||||
25 --- 39
|
||||
25 --- 40
|
||||
25 --- 41
|
||||
25 --- 42
|
||||
25 --- 43
|
||||
25 --- 44
|
||||
25 --- 46
|
||||
25 --- 48
|
||||
25 --- 50
|
||||
25 --- 51
|
||||
25 --- 52
|
||||
25 --- 53
|
||||
25 --- 54
|
||||
25 --- 55
|
||||
25 --- 56
|
||||
25 --- 57
|
||||
25 --- 58
|
||||
25 --- 59
|
||||
25 --- 60
|
||||
25 --- 61
|
||||
25 --- 62
|
||||
25 --- 63
|
||||
25 --- 64
|
||||
25 --- 65
|
||||
25 --- 67
|
||||
25 --- 68
|
||||
25 --- 69
|
||||
25 --- 70
|
||||
25 --- 71
|
||||
25 --- 72
|
||||
25 --- 73
|
||||
25 --- 74
|
||||
25 --- 75
|
||||
25 --- 76
|
||||
25 --- 77
|
||||
25 --- 78
|
||||
25 --- 79
|
||||
25 --- 80
|
||||
25 --- 81
|
||||
25 --- 82
|
||||
26 --- 28
|
||||
26 --- 45
|
||||
26 --- 47
|
||||
26 --- 49
|
||||
26 --- 66
|
||||
49 <--x 28
|
||||
66 <--x 28
|
||||
64 <--x 29
|
||||
70 <--x 29
|
||||
71 <--x 29
|
||||
62 <--x 30
|
||||
80 <--x 30
|
||||
82 <--x 30
|
||||
51 <--x 31
|
||||
73 <--x 31
|
||||
82 <--x 31
|
||||
65 <--x 32
|
||||
68 <--x 32
|
||||
72 <--x 32
|
||||
53 <--x 33
|
||||
72 <--x 33
|
||||
78 <--x 33
|
||||
59 <--x 34
|
||||
71 <--x 34
|
||||
79 <--x 34
|
||||
54 <--x 35
|
||||
74 <--x 35
|
||||
81 <--x 35
|
||||
52 <--x 36
|
||||
69 <--x 36
|
||||
81 <--x 36
|
||||
56 <--x 37
|
||||
74 <--x 37
|
||||
78 <--x 37
|
||||
55 <--x 38
|
||||
77 <--x 38
|
||||
79 <--x 38
|
||||
58 <--x 39
|
||||
70 <--x 39
|
||||
75 <--x 39
|
||||
50 <--x 40
|
||||
68 <--x 40
|
||||
76 <--x 40
|
||||
57 <--x 41
|
||||
69 <--x 41
|
||||
75 <--x 41
|
||||
60 <--x 42
|
||||
67 <--x 42
|
||||
80 <--x 42
|
||||
61 <--x 43
|
||||
67 <--x 43
|
||||
76 <--x 43
|
||||
63 <--x 44
|
||||
73 <--x 44
|
||||
77 <--x 44
|
||||
49 <--x 47
|
||||
50 <--x 48
|
||||
51 <--x 48
|
||||
52 <--x 48
|
||||
53 <--x 48
|
||||
54 <--x 48
|
||||
55 <--x 48
|
||||
56 <--x 48
|
||||
57 <--x 48
|
||||
58 <--x 48
|
||||
59 <--x 48
|
||||
60 <--x 48
|
||||
61 <--x 48
|
||||
62 <--x 48
|
||||
63 <--x 48
|
||||
64 <--x 48
|
||||
65 <--x 48
|
||||
```
|
2273
rust/kcl-lib/tests/subtract_regression06/ast.snap
Normal file
2273
rust/kcl-lib/tests/subtract_regression06/ast.snap
Normal file
File diff suppressed because it is too large
Load Diff
67
rust/kcl-lib/tests/subtract_regression06/input.kcl
Normal file
67
rust/kcl-lib/tests/subtract_regression06/input.kcl
Normal file
@ -0,0 +1,67 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
sketch002 = startSketchOn(XY)
|
||||
|
||||
sketch002Profile000 = startProfile(sketch002, at = [-0.48125, 3.125])
|
||||
|> xLine(length = 0.9625)
|
||||
|> arc(
|
||||
angleStart = 90,
|
||||
angleEnd = 11.87373,
|
||||
radius = 0.25
|
||||
)
|
||||
|> line(end = [0.558516, -2.656385])
|
||||
|> arc(
|
||||
angleStart = 11.87373,
|
||||
angleEnd = -192.443844,
|
||||
radius = 1.3125
|
||||
)
|
||||
|> line(end = [0.556289, 2.52095])
|
||||
|> arc(
|
||||
angleStart = 167.556156,
|
||||
angleEnd = 90,
|
||||
radius = 0.25
|
||||
)
|
||||
|> xLine(length = 0.9625)
|
||||
|> yLine(length = -0.125)
|
||||
|> xLine(length = -0.9625)
|
||||
|> arc(
|
||||
angleStart = 90,
|
||||
angleEnd = 167.556156,
|
||||
radius = 0.125
|
||||
)
|
||||
|> line(end = [-0.556289, -2.52095])
|
||||
|> arc(
|
||||
angleStart = -192.443844,
|
||||
angleEnd = 11.87373,
|
||||
radius = 1.1875
|
||||
)
|
||||
|> line(end = [-0.558516, 2.656385])
|
||||
|> arc(
|
||||
angleStart = 11.87373,
|
||||
angleEnd = 90,
|
||||
radius = 0.125
|
||||
)
|
||||
|> xLine(length = -0.9625)
|
||||
|> yLine(length = 0.125)
|
||||
|> close()
|
||||
|
||||
extrude000 = extrude(sketch002Profile000, length = 0.5, bidirectionalLength = 0.5)
|
||||
|
||||
plane009 = {
|
||||
origin = [0, 0, 0],
|
||||
xAxis = [1, 0, 0],
|
||||
yAxis = [0, 0, -1],
|
||||
zAxis = [-0, 1, 0]
|
||||
}
|
||||
|
||||
sketch003 = startSketchOn(plane009)
|
||||
|
||||
sketch003Profile000 = circle(
|
||||
sketch003,
|
||||
center = [0, 0],
|
||||
radius = 0.21875
|
||||
)
|
||||
|
||||
cut000Extrude = extrude([sketch003Profile000], length = 4)
|
||||
|
||||
cut000 = subtract(extrude000, tools = cut000Extrude)
|
319
rust/kcl-lib/tests/subtract_regression06/ops.snap
Normal file
319
rust/kcl-lib/tests/subtract_regression06/ops.snap
Normal file
@ -0,0 +1,319 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed subtract_regression06.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"bidirectionalLength": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.5,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"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": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Object",
|
||||
"value": {
|
||||
"origin": {
|
||||
"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": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"xAxis": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.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": 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.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"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": 4.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": []
|
||||
}
|
||||
}
|
||||
]
|
1961
rust/kcl-lib/tests/subtract_regression06/program_memory.snap
Normal file
1961
rust/kcl-lib/tests/subtract_regression06/program_memory.snap
Normal file
File diff suppressed because it is too large
Load Diff
BIN
rust/kcl-lib/tests/subtract_regression06/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/subtract_regression06/rendered_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
43
rust/kcl-lib/tests/subtract_regression06/unparsed.snap
Normal file
43
rust/kcl-lib/tests/subtract_regression06/unparsed.snap
Normal file
@ -0,0 +1,43 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing subtract_regression06.kcl
|
||||
---
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
sketch002 = startSketchOn(XY)
|
||||
|
||||
sketch002Profile000 = startProfile(sketch002, at = [-0.48125, 3.125])
|
||||
|> xLine(length = 0.9625)
|
||||
|> arc(angleStart = 90, angleEnd = 11.87373, radius = 0.25)
|
||||
|> line(end = [0.558516, -2.656385])
|
||||
|> arc(angleStart = 11.87373, angleEnd = -192.443844, radius = 1.3125)
|
||||
|> line(end = [0.556289, 2.52095])
|
||||
|> arc(angleStart = 167.556156, angleEnd = 90, radius = 0.25)
|
||||
|> xLine(length = 0.9625)
|
||||
|> yLine(length = -0.125)
|
||||
|> xLine(length = -0.9625)
|
||||
|> arc(angleStart = 90, angleEnd = 167.556156, radius = 0.125)
|
||||
|> line(end = [-0.556289, -2.52095])
|
||||
|> arc(angleStart = -192.443844, angleEnd = 11.87373, radius = 1.1875)
|
||||
|> line(end = [-0.558516, 2.656385])
|
||||
|> arc(angleStart = 11.87373, angleEnd = 90, radius = 0.125)
|
||||
|> xLine(length = -0.9625)
|
||||
|> yLine(length = 0.125)
|
||||
|> close()
|
||||
|
||||
extrude000 = extrude(sketch002Profile000, length = 0.5, bidirectionalLength = 0.5)
|
||||
|
||||
plane009 = {
|
||||
origin = [0, 0, 0],
|
||||
xAxis = [1, 0, 0],
|
||||
yAxis = [0, 0, -1],
|
||||
zAxis = [-0, 1, 0]
|
||||
}
|
||||
|
||||
sketch003 = startSketchOn(plane009)
|
||||
|
||||
sketch003Profile000 = circle(sketch003, center = [0, 0], radius = 0.21875)
|
||||
|
||||
cut000Extrude = extrude([sketch003Profile000], length = 4)
|
||||
|
||||
cut000 = subtract(extrude000, tools = cut000Extrude)
|
Reference in New Issue
Block a user