diff --git a/rust/kcl-lib/src/simulation_tests.rs b/rust/kcl-lib/src/simulation_tests.rs index 2d16dfe18..ff0facbc9 100644 --- a/rust/kcl-lib/src/simulation_tests.rs +++ b/rust/kcl-lib/src/simulation_tests.rs @@ -3092,3 +3092,24 @@ mod error_revolve_on_edge_get_edge { super::execute(TEST_NAME, true).await } } +mod mirror_sketch_extrude_2_artifacts { + const TEST_NAME: &str = "mirror_sketch_extrude_2_artifacts"; + + /// Test parsing KCL. + #[test] + fn parse() { + super::parse(TEST_NAME) + } + + /// Test that parsing and unparsing KCL produces the original KCL input. + #[tokio::test(flavor = "multi_thread")] + async fn unparse() { + super::unparse(TEST_NAME).await + } + + /// Test that KCL is executed correctly. + #[tokio::test(flavor = "multi_thread")] + async fn kcl_test_execute() { + super::execute(TEST_NAME, true).await + } +} diff --git a/rust/kcl-lib/src/std/mirror.rs b/rust/kcl-lib/src/std/mirror.rs index da8890e29..6cb75a787 100644 --- a/rust/kcl-lib/src/std/mirror.rs +++ b/rust/kcl-lib/src/std/mirror.rs @@ -3,8 +3,12 @@ use anyhow::Result; use kcmc::{each_cmd as mcmd, ModelingCmd}; use kittycad_modeling_cmds::{ - self as kcmc, length_unit::LengthUnit, ok_response::OkModelingCmdResponse, output::EntityGetAllChildUuids, - shared::Point3d, websocket::OkWebSocketResponseData, + self as kcmc, + length_unit::LengthUnit, + ok_response::OkModelingCmdResponse, + output::{EntityMirror, EntityMirrorAcrossEdge}, + shared::Point3d, + websocket::OkWebSocketResponseData, }; use crate::{ @@ -54,72 +58,83 @@ async fn inner_mirror_2d( return Ok(starting_sketches); } - match axis { - Axis2dOrEdgeReference::Axis { direction, origin } => { - args.batch_modeling_cmd( - exec_state.next_uuid(), - ModelingCmd::from(mcmd::EntityMirror { - ids: starting_sketches.iter().map(|sketch| sketch.id).collect(), - axis: Point3d { - x: direction[0].to_mm(), - y: direction[1].to_mm(), - z: 0.0, - }, - point: Point3d { - x: LengthUnit(origin[0].to_mm()), - y: LengthUnit(origin[1].to_mm()), - z: LengthUnit(0.0), - }, - }), - ) - .await?; - } - Axis2dOrEdgeReference::Edge(edge) => { - let edge_id = edge.get_engine_id(exec_state, &args)?; + for sketch in &starting_sketches.clone() { + let results = match &axis { + Axis2dOrEdgeReference::Axis { direction, origin } => { + let response = args + .send_modeling_cmd( + sketch.mirror.unwrap(), // This is safe we just made it above. + ModelingCmd::from(mcmd::EntityMirror { + ids: vec![sketch.id], + axis: Point3d { + x: direction[0].to_mm(), + y: direction[1].to_mm(), + z: 0.0, + }, + point: Point3d { + x: LengthUnit(origin[0].to_mm()), + y: LengthUnit(origin[1].to_mm()), + z: LengthUnit(0.0), + }, + }), + ) + .await?; - args.batch_modeling_cmd( - exec_state.next_uuid(), - ModelingCmd::from(mcmd::EntityMirrorAcrossEdge { - ids: starting_sketches.iter().map(|sketch| sketch.id).collect(), - edge_id, - }), - ) - .await?; - } - }; + let OkWebSocketResponseData::Modeling { + modeling_response: + OkModelingCmdResponse::EntityMirror(EntityMirror { + entity_face_edge_ids, .. + }), + } = response + else { + return Err(KclError::Internal(KclErrorDetails { + message: "Expected a successful response from EntityMirror".to_string(), + source_ranges: vec![args.source_range], + })); + }; - // After the mirror, get the first child uuid for the path. - // The "get extrusion face info" API call requires *any* edge on the sketch being extruded. - // But if you mirror2d a sketch these IDs might change so we need to get the children versus - // using the IDs we already have. - // We only do this with mirrors because otherwise it is a waste of a websocket call. - for sketch in &mut starting_sketches { - let response = args - .send_modeling_cmd( - exec_state.next_uuid(), - ModelingCmd::from(mcmd::EntityGetAllChildUuids { entity_id: sketch.id }), - ) - .await?; - let OkWebSocketResponseData::Modeling { - modeling_response: - OkModelingCmdResponse::EntityGetAllChildUuids(EntityGetAllChildUuids { entity_ids: child_ids }), - } = response - else { - return Err(KclError::Internal(KclErrorDetails { - message: "Expected a successful response from EntityGetAllChildUuids".to_string(), - source_ranges: vec![args.source_range], - })); + entity_face_edge_ids + } + Axis2dOrEdgeReference::Edge(edge) => { + let edge_id = edge.get_engine_id(exec_state, &args)?; + + let response = args + .send_modeling_cmd( + sketch.mirror.unwrap(), // This is safe we just made it above. + ModelingCmd::from(mcmd::EntityMirrorAcrossEdge { + ids: vec![sketch.id], + edge_id, + }), + ) + .await?; + + let OkWebSocketResponseData::Modeling { + modeling_response: + OkModelingCmdResponse::EntityMirrorAcrossEdge(EntityMirrorAcrossEdge { + entity_face_edge_ids, .. + }), + } = response + else { + return Err(KclError::Internal(KclErrorDetails { + message: "Expected a successful response from EntityMirrorAcrossEdge".to_string(), + source_ranges: vec![args.source_range], + })); + }; + + entity_face_edge_ids + } }; - if child_ids.len() >= 2 { - // The first child is the original sketch, the second is the mirrored sketch. - let child_id = child_ids[1]; - sketch.mirror = Some(child_id); - } else { - return Err(KclError::Type(KclErrorDetails { - message: "Expected child uuids to be >= 2".to_string(), - source_ranges: vec![args.source_range], - })); + println!("Mirror response: {:?}", results); + for result in results { + if result.object_id != sketch.id { + // Add a new sketch to the list. + let mut new_sketch = sketch.clone(); + new_sketch.id = result.object_id; + new_sketch.original_id = sketch.id; + + starting_sketches.push(new_sketch); + } } } diff --git a/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/ast.snap b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/ast.snap new file mode 100644 index 000000000..73c8d0b78 --- /dev/null +++ b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/ast.snap @@ -0,0 +1,2591 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of parsing mirror_sketch_extrude_2_artifacts.kcl +--- +{ + "Ok": { + "body": [ + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "trussSupportAngle", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "raw": "15", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 15.0, + "suffix": "None" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "preComments": [ + "// Define parameters" + ], + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "height", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "raw": "120", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 120.0, + "suffix": "None" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "raw": "4", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 4.0, + "suffix": "None" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "YZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "60", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 60.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": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "120", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 120.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "12", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 12.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "yLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsoluteX", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tag", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "TagDeclarator", + "type": "TagDeclarator", + "value": "tag001" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "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": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsoluteX", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "60", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 60.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile002", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "left": { + "commentStart": 0, + "end": 0, + "raw": "60", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 60.0, + "suffix": "None" + } + }, + "operator": "-", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "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": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsolute", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "/", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsolute", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "segEndY", + "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": "tag001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "operator": "-", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + } + } + ], + "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": "endAbsoluteX", + "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": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "2": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "inlineComment", + "value": "update", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile003", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "left": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "60", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 60.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + "operator": "+", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "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": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsolute", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + "operator": "/", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "xLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsolute", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "segEndY", + "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": "tag001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "operator": "-", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + } + } + ], + "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": "endAbsoluteX", + "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": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "205", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 205.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "2": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "inlineComment", + "value": "update", + "style": "line" + } + } + ], + "4": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLineBlockComment", + "value": "profile003 = mirror2d(profile002, axis = Y)", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile004", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tool", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "subtract2d", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tool", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile003", + "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": "subtract2d", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "body001", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile001", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "init": { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "offset", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": ".1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.1, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "offsetPlane", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "YZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile006", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "at", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "left": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "thickness", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "/", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + "operator": "-", + "right": { + "commentStart": 0, + "end": 0, + "raw": "1", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "14", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 14.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfile", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "sketch002", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "30", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 30.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "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": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "argument": { + "commentStart": 0, + "end": 0, + "raw": "25", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 25.0, + "suffix": "None" + } + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.0, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "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": "angle", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "210", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 210.0, + "suffix": "None" + } + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "endAbsoluteX", + "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" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "angledLine", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null + }, + { + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + } + ], + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "profile007", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "axis", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "Y", + "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": "mirror2d", + "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": "profile006", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "beams", + "start": 0, + "type": "Identifier" + }, + "init": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "raw": "1.8", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.8, + "suffix": "None" + } + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "elements": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "profile007", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + } + ], + "commentStart": 0, + "end": 0, + "innerAttrs": [ + { + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "settings", + "start": 0, + "type": "Identifier" + }, + "properties": [ + { + "commentStart": 0, + "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "defaultLengthUnit", + "start": 0, + "type": "Identifier" + }, + "start": 0, + "type": "ObjectProperty", + "value": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "in", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + ], + "start": 0, + "type": "Annotation" + } + ], + "nonCodeMeta": { + "nonCodeNodes": { + "2": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "4": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "5": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "6": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "8": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "9": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "11": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ], + "12": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] + }, + "start": 0 + } +} diff --git a/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/input.kcl b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/input.kcl new file mode 100644 index 000000000..0f97d3cb5 --- /dev/null +++ b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/input.kcl @@ -0,0 +1,44 @@ +@settings(defaultLengthUnit = in) + +// Define parameters +trussSupportAngle = 15 +height = 120 +thickness = 4 + +sketch001 = startSketchOn(YZ) +profile001 = startProfile(sketch001, at = [60, 0]) + |> xLine(length = -120) + |> yLine(length = 12) + |> angledLine(angle = 25, endAbsoluteX = 0, tag = $tag001) + |> angledLine(angle = -25, endAbsoluteX = 60) + |> close() + +profile002 = startProfile(sketch001, at = [60-thickness, thickness]) + |> xLine(endAbsolute = thickness/2) + |> yLine(endAbsolute = segEndY(tag001)-thickness) // update + |> angledLine(endAbsoluteX = profileStartX(%), angle = -25) + |> close(%) + +profile003 = startProfile(sketch001, at = [-60+thickness, thickness]) + |> xLine(endAbsolute = -thickness/2) + |> yLine(endAbsolute = segEndY(tag001)-thickness) // update + |> angledLine(endAbsoluteX = profileStartX(%), angle = 205) + |> close(%) + +// profile003 = mirror2d(profile002, axis = Y) + +profile004 = subtract2d(profile001, tool = profile002) +subtract2d(profile001, tool = profile003) + +body001 = extrude(profile001, length = 2) + +sketch002 = startSketchOn(offsetPlane(YZ, offset = .1)) +profile006 = startProfile(sketch002, at = [thickness/2-1, 14]) + |> angledLine(angle = 30, length = 25) + |> angledLine(angle = -25, length = 5) + |> angledLine(angle = 210, endAbsoluteX = profileStartX(%)) + |> close(%) + +profile007 = mirror2d(profile006, axis = Y) + +beams = extrude([ profile007], length = 1.8) diff --git a/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/program_memory.snap b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/program_memory.snap new file mode 100644 index 000000000..8cec2a187 --- /dev/null +++ b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/program_memory.snap @@ -0,0 +1,1359 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Variables in memory after executing mirror_sketch_extrude_2_artifacts.kcl +--- +{ + "beams": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[uuid]", + "value": [], + "sketch": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.0, + 14.0 + ], + "tag": null, + "to": [ + 22.6506, + 26.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 22.6506, + 26.5 + ], + "tag": null, + "to": [ + 27.1822, + 24.3869 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 27.1822, + 24.3869 + ], + "tag": null, + "to": [ + 1.0, + 9.2706 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.0, + 9.2706 + ], + "tag": null, + "to": [ + 1.0, + 14.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 2.54, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 1.0, + 14.0 + ], + "to": [ + 1.0, + 14.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 1.8, + "startCapId": null, + "endCapId": null, + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "body001": { + "type": "Solid", + "value": { + "type": "Solid", + "id": "[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": { + "commentStart": 290, + "end": 297, + "start": 290, + "type": "TagDeclarator", + "value": "tag001" + }, + "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": [ + 60.0, + 0.0 + ], + "tag": null, + "to": [ + -60.0, + 0.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -60.0, + 0.0 + ], + "tag": null, + "to": [ + -60.0, + 12.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -60.0, + 12.0 + ], + "tag": { + "commentStart": 290, + "end": 297, + "start": 290, + "type": "TagDeclarator", + "value": "tag001" + }, + "to": [ + 0.0, + 39.9785 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 39.9785 + ], + "tag": null, + "to": [ + 60.0, + 12.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 60.0, + 12.0 + ], + "tag": null, + "to": [ + 60.0, + 0.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 60.0, + 0.0 + ], + "to": [ + 60.0, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "tags": { + "tag001": { + "type": "TagIdentifier", + "value": "tag001" + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + }, + "height": 2.0, + "startCapId": "[uuid]", + "endCapId": "[uuid]", + "units": { + "type": "Inches" + }, + "sectional": false + } + }, + "height": { + "type": "Number", + "value": 120.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "profile001": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 60.0, + 0.0 + ], + "tag": null, + "to": [ + -60.0, + 0.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -60.0, + 0.0 + ], + "tag": null, + "to": [ + -60.0, + 12.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -60.0, + 12.0 + ], + "tag": { + "commentStart": 290, + "end": 297, + "start": 290, + "type": "TagDeclarator", + "value": "tag001" + }, + "to": [ + 0.0, + 39.9785 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 39.9785 + ], + "tag": null, + "to": [ + 60.0, + 12.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 60.0, + 12.0 + ], + "tag": null, + "to": [ + 60.0, + 0.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 60.0, + 0.0 + ], + "to": [ + 60.0, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "tags": { + "tag001": { + "type": "TagIdentifier", + "value": "tag001" + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "profile002": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 56.0, + 4.0 + ], + "tag": null, + "to": [ + 2.0, + 4.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.0, + 4.0 + ], + "tag": null, + "to": [ + 2.0, + 35.9785 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 2.0, + 35.9785 + ], + "tag": null, + "to": [ + 56.0, + 10.7978 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 56.0, + 10.7978 + ], + "tag": null, + "to": [ + 56.0, + 4.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 56.0, + 4.0 + ], + "to": [ + 56.0, + 4.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "profile003": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -56.0, + 4.0 + ], + "tag": null, + "to": [ + -2.0, + 4.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -2.0, + 4.0 + ], + "tag": null, + "to": [ + -2.0, + 35.9785 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -2.0, + 35.9785 + ], + "tag": null, + "to": [ + -56.0, + 10.7978 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -56.0, + 10.7978 + ], + "tag": null, + "to": [ + -56.0, + 4.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + -56.0, + 4.0 + ], + "to": [ + -56.0, + 4.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "profile004": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 60.0, + 0.0 + ], + "tag": null, + "to": [ + -60.0, + 0.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -60.0, + 0.0 + ], + "tag": null, + "to": [ + -60.0, + 12.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + -60.0, + 12.0 + ], + "tag": { + "commentStart": 290, + "end": 297, + "start": 290, + "type": "TagDeclarator", + "value": "tag001" + }, + "to": [ + 0.0, + 39.9785 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 0.0, + 39.9785 + ], + "tag": null, + "to": [ + 60.0, + 12.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 60.0, + 12.0 + ], + "tag": null, + "to": [ + 60.0, + 0.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 60.0, + 0.0 + ], + "to": [ + 60.0, + 0.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "tags": { + "tag001": { + "type": "TagIdentifier", + "value": "tag001" + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "profile006": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.0, + 14.0 + ], + "tag": null, + "to": [ + 22.6506, + 26.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 22.6506, + 26.5 + ], + "tag": null, + "to": [ + 27.1822, + 24.3869 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 27.1822, + 24.3869 + ], + "tag": null, + "to": [ + 1.0, + 9.2706 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.0, + 9.2706 + ], + "tag": null, + "to": [ + 1.0, + 14.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 2.54, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 1.0, + 14.0 + ], + "to": [ + 1.0, + 14.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "profile007": { + "type": "Sketch", + "value": { + "type": "Sketch", + "id": "[uuid]", + "paths": [ + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.0, + 14.0 + ], + "tag": null, + "to": [ + 22.6506, + 26.5 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 22.6506, + 26.5 + ], + "tag": null, + "to": [ + 27.1822, + 24.3869 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 27.1822, + 24.3869 + ], + "tag": null, + "to": [ + 1.0, + 9.2706 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + }, + { + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + }, + "from": [ + 1.0, + 9.2706 + ], + "tag": null, + "to": [ + 1.0, + 14.0 + ], + "type": "ToPoint", + "units": { + "type": "Inches" + } + } + ], + "on": { + "id": "[uuid]", + "origin": { + "x": 2.54, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "type": "plane", + "value": "Custom", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + }, + "start": { + "from": [ + 1.0, + 14.0 + ], + "to": [ + 1.0, + 14.0 + ], + "units": { + "type": "Inches" + }, + "tag": null, + "__geoMeta": { + "id": "[uuid]", + "sourceRange": [] + } + }, + "originalId": "[uuid]", + "units": { + "type": "Inches" + } + } + }, + "sketch001": { + "type": "Plane", + "value": { + "id": "[uuid]", + "origin": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "YZ", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + }, + "sketch002": { + "type": "Plane", + "value": { + "id": "[uuid]", + "origin": { + "x": 2.54, + "y": 0.0, + "z": 0.0, + "units": { + "type": "Mm" + } + }, + "value": "Custom", + "xAxis": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "units": { + "type": "Unknown" + } + }, + "yAxis": { + "x": 0.0, + "y": 0.0, + "z": 1.0, + "units": { + "type": "Unknown" + } + } + } + }, + "tag001": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "tag001" + }, + "thickness": { + "type": "Number", + "value": 4.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "trussSupportAngle": { + "type": "Number", + "value": 15.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + } +} diff --git a/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/rendered_model.png b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/rendered_model.png new file mode 100644 index 000000000..bbd5368cf Binary files /dev/null and b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/rendered_model.png differ diff --git a/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/unparsed.snap b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/unparsed.snap new file mode 100644 index 000000000..c1cabb260 --- /dev/null +++ b/rust/kcl-lib/tests/mirror_sketch_extrude_2_artifacts/unparsed.snap @@ -0,0 +1,48 @@ +--- +source: kcl-lib/src/simulation_tests.rs +description: Result of unparsing mirror_sketch_extrude_2_artifacts.kcl +--- +@settings(defaultLengthUnit = in) + +// Define parameters +trussSupportAngle = 15 +height = 120 +thickness = 4 + +sketch001 = startSketchOn(YZ) +profile001 = startProfile(sketch001, at = [60, 0]) + |> xLine(length = -120) + |> yLine(length = 12) + |> angledLine(angle = 25, endAbsoluteX = 0, tag = $tag001) + |> angledLine(angle = -25, endAbsoluteX = 60) + |> close() + +profile002 = startProfile(sketch001, at = [60 - thickness, thickness]) + |> xLine(endAbsolute = thickness / 2) + |> yLine(endAbsolute = segEndY(tag001) - thickness) // update + |> angledLine(endAbsoluteX = profileStartX(%), angle = -25) + |> close(%) + +profile003 = startProfile(sketch001, at = [-60 + thickness, thickness]) + |> xLine(endAbsolute = -thickness / 2) + |> yLine(endAbsolute = segEndY(tag001) - thickness) // update + |> angledLine(endAbsoluteX = profileStartX(%), angle = 205) + |> close(%) + +// profile003 = mirror2d(profile002, axis = Y) + +profile004 = subtract2d(profile001, tool = profile002) +subtract2d(profile001, tool = profile003) + +body001 = extrude(profile001, length = 2) + +sketch002 = startSketchOn(offsetPlane(YZ, offset = .1)) +profile006 = startProfile(sketch002, at = [thickness / 2 - 1, 14]) + |> angledLine(angle = 30, length = 25) + |> angledLine(angle = -25, length = 5) + |> angledLine(angle = 210, endAbsoluteX = profileStartX(%)) + |> close(%) + +profile007 = mirror2d(profile006, axis = Y) + +beams = extrude([profile007], length = 1.8)