* fix docs paths for website Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix docs paths for website Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
43 lines
83 KiB
Markdown
43 lines
83 KiB
Markdown
---
|
|
title: "segLen"
|
|
excerpt: "Compute the length of the provided line segment."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the length of the provided line segment.
|
|
|
|
|
|
|
|
```js
|
|
segLen(tag: TagIdentifier) -> number
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
|
|
|
### Returns
|
|
|
|
`number`
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
const exampleSketch = startSketchOn("XZ")
|
|
|> startProfileAt([0, 0], %)
|
|
|> angledLine({ angle: 60, length: 10 }, %, $thing)
|
|
|> tangentialArc({ offset: -120, radius: 5 }, %)
|
|
|> angledLine({ angle: -60, length: segLen(thing) }, %)
|
|
|> close(%)
|
|
|
|
const example = extrude(5, exampleSketch)
|
|
```
|
|
|
|

|
|
|
|
|