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:
Adam Chalmers
2025-04-09 14:55:15 -05:00
committed by GitHub
parent b03ca30379
commit d275995dfe
288 changed files with 36142 additions and 40081 deletions

View File

@ -117,10 +117,10 @@ pub async fn sqrt(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 50,
/// length = sqrt(2500),
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -150,15 +150,15 @@ pub async fn abs(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line(end = [8, 0])
/// |> angledLine({
/// |> angledLine(
/// angle = abs(myAngle),
/// length = 5,
/// }, %)
/// )
/// |> line(end = [-5, 0])
/// |> angledLine({
/// |> angledLine(
/// angle = myAngle,
/// length = 5,
/// }, %)
/// )
/// |> close()
///
/// baseExtrusion = extrude(sketch001, length = 5)
@ -276,10 +276,10 @@ pub async fn min(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kcl
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 70,
/// length = min(15, 31, 4, 13, 22)
/// }, %)
/// )
/// |> line(end = [20, 0])
/// |> close()
///
@ -321,10 +321,10 @@ pub async fn max(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kcl
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 70,
/// length = max(15, 31, 4, 13, 22)
/// }, %)
/// )
/// |> line(end = [20, 0])
/// |> close()
///
@ -372,10 +372,10 @@ pub async fn pow(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 50,
/// length = pow(5, 2),
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -402,10 +402,10 @@ pub async fn acos(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// ```no_run
/// sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = toDegrees(acos(0.5)),
/// length = 10,
/// }, %)
/// )
/// |> line(end = [5, 0])
/// |> line(endAbsolute = [12, 0])
/// |> close()
@ -433,10 +433,10 @@ pub async fn asin(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// ```no_run
/// sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = toDegrees(asin(0.5)),
/// length = 20,
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -463,10 +463,10 @@ pub async fn atan(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// ```no_run
/// sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = toDegrees(atan(1.25)),
/// length = 20,
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -493,10 +493,10 @@ pub async fn atan2(_exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```no_run
/// sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = toDegrees(atan2(1.25, 2)),
/// length = 20,
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -657,10 +657,10 @@ pub async fn e(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclE
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 30,
/// length = 2 * e() ^ 2,
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -689,10 +689,10 @@ pub async fn tau(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 50,
/// length = 10 * tau(),
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -720,10 +720,10 @@ pub async fn to_radians(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 50,
/// length = 70 * cos(toRadians(45)),
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///
@ -750,10 +750,10 @@ pub async fn to_degrees(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// |> angledLine(
/// angle = 50,
/// length = 70 * cos(toDegrees(pi()/4)),
/// }, %)
/// )
/// |> yLine(endAbsolute = 0)
/// |> close()
///