updates updates updates updates updates updates better updates array of updates updates updates updates Signed-off-by: Jess Frazelle <github@jessfraz.com>
45 lines
78 KiB
Markdown
45 lines
78 KiB
Markdown
---
|
|
title: "lineTo"
|
|
excerpt: "Draw a line from the current origin to some absolute (x, y) point."
|
|
layout: manual
|
|
---
|
|
|
|
Draw a line from the current origin to some absolute (x, y) point.
|
|
|
|
|
|
|
|
```js
|
|
lineTo(to: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `to` | `[number]` | | Yes |
|
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
|
|
|
### Returns
|
|
|
|
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
const exampleSketch = startSketchOn("XZ")
|
|
|> startProfileAt([0, 0], %)
|
|
|> lineTo([10, 0], %)
|
|
|> lineTo([0, 10], %)
|
|
|> lineTo([-10, 0], %)
|
|
|> close(%)
|
|
|
|
const example = extrude(5, exampleSketch)
|
|
```
|
|
|
|

|
|
|
|
|