Compare commits

...

3 Commits

Author SHA1 Message Date
df167c0382 WIP 2025-05-14 14:18:57 -05:00
15857e9191 Change sweep relativeTo flag defaults
Default to trajectoryCurve, as Ryan wants
2025-05-14 14:18:11 -05:00
1a32f664d0 Change sweep relativeTo flag defaults
Default to trajectoryCurve, as Ryan wants
2025-05-14 13:57:12 -05:00
9 changed files with 21 additions and 22 deletions

View File

@ -167,7 +167,7 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
path = { docs = "The path to sweep the sketch along" }, path = { docs = "The path to sweep the sketch along" },
sectional = { docs = "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components." }, sectional = { docs = "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components." },
tolerance = { docs = "Tolerance for this operation" }, tolerance = { docs = "Tolerance for this operation" },
relative_to = { docs = "What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. Defaults to sketchPlane."}, relative_to = { docs = "What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. Defaults to trajectoryCurve."},
tag_start = { docs = "A named tag for the face at the start of the sweep, i.e. the original sketch" }, tag_start = { docs = "A named tag for the face at the start of the sweep, i.e. the original sketch" },
tag_end = { docs = "A named tag for the face at the end of the sweep" }, tag_end = { docs = "A named tag for the face at the end of the sweep" },
}, },
@ -191,14 +191,13 @@ async fn inner_sweep(
}; };
let relative_to = match relative_to.as_deref() { let relative_to = match relative_to.as_deref() {
Some("sketchPlane") => RelativeTo::SketchPlane, Some("sketchPlane") => RelativeTo::SketchPlane,
Some("trajectoryCurve") => RelativeTo::TrajectoryCurve, Some("trajectoryCurve") | None => RelativeTo::TrajectoryCurve,
Some(_) => { Some(_) => {
return Err(KclError::Syntax(crate::errors::KclErrorDetails { return Err(KclError::Syntax(crate::errors::KclErrorDetails {
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
message: "If you provide relativeTo, it must either be 'sketchPlane' or 'trajectoryCurve'".to_owned(), message: "If you provide relativeTo, it must either be 'sketchPlane' or 'trajectoryCurve'".to_owned(),
})) }))
} }
None => RelativeTo::default(),
}; };
let mut solids = Vec::new(); let mut solids = Vec::new();

View File

@ -5122,7 +5122,7 @@ description: Artifact commands bench.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -5134,7 +5134,7 @@ description: Artifact commands bench.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
} }
] ]

View File

@ -906,7 +906,7 @@ description: Artifact commands cold-plate.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {

View File

@ -162,7 +162,7 @@ description: Variables in memory after executing countersunk-plate.kcl
], ],
"tag": null, "tag": null,
"to": [ "to": [
2.7737, 2.7738,
-0.6983 -0.6983
], ],
"type": "TangentialArc", "type": "TangentialArc",
@ -176,7 +176,7 @@ description: Variables in memory after executing countersunk-plate.kcl
"sourceRange": [] "sourceRange": []
}, },
"from": [ "from": [
2.7737, 2.7738,
-0.6983 -0.6983
], ],
"tag": null, "tag": null,
@ -196,7 +196,7 @@ description: Variables in memory after executing countersunk-plate.kcl
}, },
"ccw": false, "ccw": false,
"center": [ "center": [
-0.0, 0.0,
-0.0 -0.0
], ],
"from": [ "from": [

View File

@ -5576,7 +5576,7 @@ description: Artifact commands cpu-cooler.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -6111,7 +6111,7 @@ description: Artifact commands cpu-cooler.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -9469,7 +9469,7 @@ description: Artifact commands cpu-cooler.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -9601,7 +9601,7 @@ description: Artifact commands cpu-cooler.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -10120,7 +10120,7 @@ description: Artifact commands cpu-cooler.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -10252,7 +10252,7 @@ description: Artifact commands cpu-cooler.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {

View File

@ -1598,7 +1598,7 @@ description: Artifact commands exhaust-manifold.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -1610,7 +1610,7 @@ description: Artifact commands exhaust-manifold.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -1622,7 +1622,7 @@ description: Artifact commands exhaust-manifold.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {
@ -1634,7 +1634,7 @@ description: Artifact commands exhaust-manifold.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {

View File

@ -4491,7 +4491,7 @@ description: Artifact commands utility-sink.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {

View File

@ -418,7 +418,7 @@ description: Artifact commands subtract_regression03.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {

View File

@ -395,7 +395,7 @@ description: Artifact commands subtract_regression05.kcl
"trajectory": "[uuid]", "trajectory": "[uuid]",
"sectional": false, "sectional": false,
"tolerance": 0.0000001, "tolerance": 0.0000001,
"relative_to": "sketch_plane" "relative_to": "trajectory_curve"
} }
}, },
{ {