* Show a more reasonable name in function docs Signed-off-by: Nick Cameron <nrc@ncameron.org> * Fix buggy docs for union types Signed-off-by: Nick Cameron <nrc@ncameron.org> * Make types in the docs signatures into links Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
60 lines
88 KiB
Markdown
60 lines
88 KiB
Markdown
---
|
|
title: "angledLine"
|
|
excerpt: "Draw a line segment relative to the current origin using the polar measure of some angle and distance."
|
|
layout: manual
|
|
---
|
|
|
|
Draw a line segment relative to the current origin using the polar measure of some angle and distance.
|
|
|
|
|
|
|
|
```kcl
|
|
angledLine(
|
|
sketch: [Sketch](/docs/kcl/types/Sketch),
|
|
angle: [number](/docs/kcl/types/number),
|
|
length?: [number](/docs/kcl/types/number),
|
|
lengthX?: [number](/docs/kcl/types/number),
|
|
lengthY?: [number](/docs/kcl/types/number),
|
|
endAbsoluteX?: [number](/docs/kcl/types/number),
|
|
endAbsoluteY?: [number](/docs/kcl/types/number),
|
|
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration),
|
|
): [Sketch](/docs/kcl/types/Sketch)
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
|
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
|
|
| `length` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
|
| `lengthX` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
|
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
|
| `endAbsoluteX` | [`number`](/docs/kcl/types/number) | 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 |
|
|
| `endAbsoluteY` | [`number`](/docs/kcl/types/number) | 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 |
|
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
|
|
|
### Returns
|
|
|
|
[`Sketch`](/docs/kcl/types/Sketch)
|
|
|
|
|
|
### Examples
|
|
|
|
```kcl
|
|
exampleSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> yLine(endAbsolute = 15)
|
|
|> angledLine(angle = 30, length = 15)
|
|
|> line(end = [8, -10])
|
|
|> yLine(endAbsolute = 0)
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 10)
|
|
```
|
|
|
|

|
|
|
|
|