Kwargs: leg helpers (#6459)

legLen, legAngX, legAngY moved to keyword arguments
This commit is contained in:
Adam Chalmers
2025-04-24 09:53:19 -05:00
committed by GitHub
parent 668f6671a9
commit b02dbd4fe6
11 changed files with 95 additions and 65 deletions

View File

@ -1277,7 +1277,7 @@ const part001 = startSketchOn(XY)
|> line(end = [3, 4], tag = $seg01)
|> line(end = [
min(segLen(seg01), myVar),
-legLen(segLen(seg01), myVar)
-legLen(hypotenuse = segLen(seg01), leg = myVar)
])
"#;
@ -1292,7 +1292,7 @@ const part001 = startSketchOn(XY)
|> line(end = [3, 4], tag = $seg01)
|> line(end = [
min(segLen(seg01), myVar),
legLen(segLen(seg01), myVar)
legLen(hypotenuse = segLen(seg01), leg = myVar)
])
"#;
@ -1684,7 +1684,7 @@ let shape = layer() |> patternTransform(instances = 10, transform = transform)
#[tokio::test(flavor = "multi_thread")]
async fn test_math_execute_with_functions() {
let ast = r#"const myVar = 2 + min(100, -1 + legLen(5, 3))"#;
let ast = r#"const myVar = 2 + min(100, -1 + legLen(hypotenuse = 5, leg = 3))"#;
let result = parse_execute(ast).await.unwrap();
assert_eq!(
5.0,