KCL: Add diameter arg to circle (#7116)

Paul's been requesting this for a long time. Now that we're fully using keyword args, this is easy to do.

We should probably add a similar `diameter` arg to `arc`, `tangentialArc`, `polygon` etc. And _maybe_ to `fillet`, but that might not be as helpful.
This commit is contained in:
Adam Chalmers
2025-05-20 14:44:35 -05:00
committed by GitHub
parent 5dc77ceed5
commit 36c8ad439d
5 changed files with 37 additions and 10 deletions

View File

@ -631,6 +631,8 @@ impl FnData {
return "clone(${0:part001})".to_owned();
} else if self.name == "hole" {
return "hole(${0:holeSketch}, ${1:%})".to_owned();
} else if self.name == "circle" {
return "circle(center = [${0:3.14}, ${1:3.14}], diameter = ${2:3.14})".to_owned();
}
let mut args = Vec::new();
let mut index = 0;

View File

@ -1018,7 +1018,7 @@ mod tests {
let snippet = circle_fn.to_autocomplete_snippet();
assert_eq!(
snippet,
r#"circle(center = [${0:3.14}, ${1:3.14}], radius = ${2:3.14})"#
r#"circle(center = [${0:3.14}, ${1:3.14}], diameter = ${2:3.14})"#
);
}