* Replace tag type with tagIdent and tagDecl Signed-off-by: Nick Cameron <nrc@ncameron.org> * Replace tagIdent with TaggedEdge and TaggedFace Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
44 lines
86 KiB
Markdown
44 lines
86 KiB
Markdown
---
|
|
title: "segLen"
|
|
subtitle: "Function in std::sketch"
|
|
excerpt: "Compute the length of the provided line segment."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the length of the provided line segment.
|
|
|
|
```kcl
|
|
segLen(@tag: TaggedEdge): number(Length)
|
|
```
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
|
|
|
|
|
|
### Examples
|
|
|
|
```kcl
|
|
exampleSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> angledLine(angle = 60, length = 10, tag = $thing)
|
|
|> tangentialArc(angle = -120deg, radius = 5)
|
|
|> angledLine(angle = -60deg, length = segLen(thing))
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
|
|
```
|
|
|
|

|
|
|
|
|