* 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>
102 lines
302 KiB
Markdown
102 lines
302 KiB
Markdown
---
|
|
title: "tangentToEnd"
|
|
subtitle: "Function in std::sketch"
|
|
excerpt: "Returns the angle coming out of the end of the segment in degrees."
|
|
layout: manual
|
|
---
|
|
|
|
Returns the angle coming out of the end of the segment in degrees.
|
|
|
|
```kcl
|
|
tangentToEnd(@tag: TaggedEdge): number(Angle)
|
|
```
|
|
|
|
|
|
|
|
### 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(Angle)`](/docs/kcl-std/types/std-types-number) - A number.
|
|
|
|
|
|
### Examples
|
|
|
|
```kcl
|
|
// Horizontal pill.
|
|
pillSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(end = [20, 0])
|
|
|> tangentialArc(end = [0, 10], tag = $arc1)
|
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
|
|> tangentialArc(end = [0, -10])
|
|
|> close()
|
|
|
|
pillExtrude = extrude(pillSketch, length = 10)
|
|
|
|
```
|
|
|
|

|
|
|
|
```kcl
|
|
// Vertical pill. Use absolute coordinate for arc.
|
|
pillSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(end = [0, 20])
|
|
|> tangentialArc(endAbsolute = [10, 20], tag = $arc1)
|
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
|
|> tangentialArc(end = [-10, 0])
|
|
|> close()
|
|
|
|
pillExtrude = extrude(pillSketch, length = 10)
|
|
|
|
```
|
|
|
|

|
|
|
|
```kcl
|
|
rectangleSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(end = [10, 0], tag = $seg1)
|
|
|> angledLine(angle = tangentToEnd(seg1), length = 10)
|
|
|> line(end = [0, 10])
|
|
|> line(end = [-20, 0])
|
|
|> close()
|
|
|
|
rectangleExtrude = extrude(rectangleSketch, length = 10)
|
|
|
|
```
|
|
|
|

|
|
|
|
```kcl
|
|
bottom = startSketchOn(XY)
|
|
|> startProfile(at = [0, 0])
|
|
|> arc(endAbsolute = [10, 10], interiorAbsolute = [5, 1], tag = $arc1)
|
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
|
|> close()
|
|
|
|
```
|
|
|
|

|
|
|
|
```kcl
|
|
circSketch = startSketchOn(XY)
|
|
|> circle(center = [0, 0], radius = 3, tag = $circ)
|
|
|
|
triangleSketch = startSketchOn(XY)
|
|
|> startProfile(at = [-5, 0])
|
|
|> angledLine(angle = tangentToEnd(circ), length = 10)
|
|
|> line(end = [-15, 0])
|
|
|> close()
|
|
|
|
```
|
|
|
|

|
|
|
|
|