KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up). Before vs. after: `angledLine({angle = 90, length = 3}, %, $edge)` => `angledLine(angle = 90, length = 3, tag = $edge)` `angledLineOfXLength({angle = 90, length = 3}, %, $edge)` => `angledLine(angle = 90, lengthX = 3, tag = $edge)` `angledLineOfYLength({angle = 90, length = 3}, %, $edge)` => `angledLine(angle = 90, lengthY = 3, tag = $edge)` `angledLineToX({angle = 90, length = 3}, %, $edge)` => `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)` `angledLineToY({angle = 90, length = 3}, %, $edge)` => `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
This commit is contained in:
@ -1203,7 +1203,7 @@ fn o(c_x, c_y) {
|
||||
angle_start = 45 + a,
|
||||
angle_end = 225 - a
|
||||
}, %)
|
||||
|> angledLine([45, o_r - i_r], %)
|
||||
|> angledLine(angle = 45, length = o_r - i_r)
|
||||
|> arc({
|
||||
radius = i_r,
|
||||
angle_start = 225 - a,
|
||||
@ -1219,7 +1219,7 @@ fn o(c_x, c_y) {
|
||||
angle_start = 225 + a,
|
||||
angle_end = 360 + 45 - a
|
||||
}, %)
|
||||
|> angledLine([225, o_r - i_r], %)
|
||||
|> angledLine(angle = 225, length = o_r - i_r)
|
||||
|> arc({
|
||||
radius = i_r,
|
||||
angle_start = 45 - a,
|
||||
@ -2234,14 +2234,8 @@ myAng2 = 134
|
||||
part001 = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([1, 3.82], %, $seg01) // ln-should-get-tag
|
||||
|> angledLineToX([
|
||||
-angleToMatchLengthX(seg01, myVar, %),
|
||||
myVar
|
||||
], %) // ln-lineTo-xAbsolute should use angleToMatchLengthX helper
|
||||
|> angledLineToY([
|
||||
-angleToMatchLengthY(seg01, myVar, %),
|
||||
myVar
|
||||
], %) // ln-lineTo-yAbsolute should use angleToMatchLengthY helper"#;
|
||||
|> angledLine(angle = -angleToMatchLengthX(seg01, myVar, %), length = myVar) // ln-lineTo-xAbsolute should use angleToMatchLengthX helper
|
||||
|> angledLine(angle = -angleToMatchLengthY(seg01, myVar, %), length = myVar) // ln-lineTo-yAbsolute should use angleToMatchLengthY helper"#;
|
||||
let program = crate::parsing::top_level_parse(some_program_string).unwrap();
|
||||
|
||||
let recasted = program.recast(&Default::default(), 0);
|
||||
@ -2258,14 +2252,8 @@ myAng2 = 134
|
||||
part001 = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([1, 3.82], %, $seg01) // ln-should-get-tag
|
||||
|> angledLineToX([
|
||||
-angleToMatchLengthX(seg01, myVar, %),
|
||||
myVar
|
||||
], %) // ln-lineTo-xAbsolute should use angleToMatchLengthX helper
|
||||
|> angledLineToY([
|
||||
-angleToMatchLengthY(seg01, myVar, %),
|
||||
myVar
|
||||
], %) // ln-lineTo-yAbsolute should use angleToMatchLengthY helper
|
||||
|> angledLine(angle = -angleToMatchLengthX(seg01, myVar, %), length = myVar) // ln-lineTo-xAbsolute should use angleToMatchLengthX helper
|
||||
|> angledLine(angle = -angleToMatchLengthY(seg01, myVar, %), length = myVar) // ln-lineTo-yAbsolute should use angleToMatchLengthY helper
|
||||
"#;
|
||||
let program = crate::parsing::top_level_parse(some_program_string).unwrap();
|
||||
|
||||
|
Reference in New Issue
Block a user