Files
modeling-app/docs/kcl/angledLine.md
Adam Chalmers d275995dfe 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)`
2025-04-09 14:55:15 -05:00

88 KiB

title, excerpt, layout
title excerpt layout
angledLine Draw a line segment relative to the current origin using the polar measure of some angle and distance. manual

Draw a line segment relative to the current origin using the polar measure of some angle and distance.

angledLine(
  sketch: Sketch,
  angle: number,
  length?: number,
  lengthX?: number,
  lengthY?: number,
  endAbsoluteX?: number,
  endAbsoluteY?: number,
  tag?: TagDeclarator,
): Sketch

Arguments

Name Type Description Required
sketch Sketch Which sketch should this path be added to? Yes
angle number Which angle should the line be drawn at? Yes
length number Draw the line this distance along the given angle. Only one of length, lengthX, lengthY, lengthAbsoluteEndX, lengthAbsoluteEndY can be given. No
lengthX number Draw the line this distance along the X axis. Only one of length, lengthX, lengthY, lengthAbsoluteEndX, lengthAbsoluteEndY can be given. No
lengthY number Draw the line this distance along the Y axis. Only one of length, lengthX, lengthY, lengthAbsoluteEndX, lengthAbsoluteEndY can be given. No
endAbsoluteX number Draw the line along the given angle until it reaches this point along the X axis. Only one of length, lengthX, lengthY, lengthAbsoluteEndX, lengthAbsoluteEndY can be given. No
endAbsoluteY number Draw the line along the given angle until it reaches this point along the Y axis. Only one of length, lengthX, lengthY, lengthAbsoluteEndX, lengthAbsoluteEndY can be given. No
tag TagDeclarator Create a new tag which refers to this line No

Returns

Sketch

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfileAt([0, 0], %)
  |> yLine(endAbsolute = 15)
  |> angledLine(angle = 30, length = 15)
  |> line(end = [8, -10])
  |> yLine(endAbsolute = 0)
  |> close()

example = extrude(exampleSketch, length = 10)

Rendered example of angledLine 0