kcl-stdfunctionsangledLine

angledLineFunction in std::sketch

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

angledLine(
  @sketch: Sketch,
  angle: number(Angle),
  length?: number(Length),
  lengthX?: number(Length),
  lengthY?: number(Length),
  endAbsoluteX?: number(Length),
  endAbsoluteY?: number(Length),
  tag?: TagDecl,
): Sketch

Arguments

NameTypeDescriptionRequired
sketchSketchWhich sketch should this path be added to?Yes
anglenumber(Angle)Which angle should the line be drawn at?Yes
lengthnumber(Length)Draw the line this distance along the given angle. Only one of length, lengthX, lengthY, endAbsoluteX, endAbsoluteY can be given.No
lengthXnumber(Length)Draw the line this distance along the X axis. Only one of length, lengthX, lengthY, endAbsoluteX, endAbsoluteY can be given.No
lengthYnumber(Length)Draw the line this distance along the Y axis. Only one of length, lengthX, lengthY, endAbsoluteX, endAbsoluteY can be given.No
endAbsoluteXnumber(Length)Draw the line along the given angle until it reaches this point along the X axis. Only one of length, lengthX, lengthY, endAbsoluteX, endAbsoluteY can be given.No
endAbsoluteYnumber(Length)Draw the line along the given angle until it reaches this point along the Y axis. Only one of length, lengthX, lengthY, endAbsoluteX, endAbsoluteY can be given.No
tagTagDeclCreate a new tag which refers to this line.No

Returns

Sketch - A sketch is a collection of paths.

Examples

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

example = extrude(exampleSketch, length = 10)

Rendered example of angledLine 0

Found a typo?