* Change tangentialArc, tangentialArcTo, and tangentialArcToRelative to keyword args * Change tangentialArc offset to angle and convert to kw arg calls * Fix lints * Fix sketch errors and all unit tests passing * Fix tangentialArcTo calls in KCL samples * Update tangentialArc in samples * Update sim test output * Fix formatting * Fix mistake in merge * Fix gear rack sample * Update output after more samples fixes * Update gear rack output * Add end label to docs snippet * Fix to not add endAbsolute for an arc with radius or angle arguments * Update docs outputs * Fix formatting * Fix executor tests * Fix formatting * Fix bench input files * Fix spelling * Improve error messages --------- Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
97 lines
302 KiB
Markdown
97 lines
302 KiB
Markdown
---
|
|
title: "tangentToEnd"
|
|
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.
|
|
|
|
|
|
|
|
```js
|
|
tangentToEnd(tag: TagIdentifier): number
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The line segment being queried by its tag | Yes |
|
|
|
|
### Returns
|
|
|
|
[`number`](/docs/kcl/types/number)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
// Horizontal pill.
|
|
pillSketch = startSketchOn(XZ)
|
|
|> startProfileAt([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)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// Vertical pill. Use absolute coordinate for arc.
|
|
pillSketch = startSketchOn(XZ)
|
|
|> startProfileAt([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)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
rectangleSketch = startSketchOn(XZ)
|
|
|> startProfileAt([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)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
bottom = startSketchOn(XY)
|
|
|> startProfileAt([0, 0], %)
|
|
|> arcTo({ end = [10, 10], interior = [5, 1] }, %, $arc1)
|
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
|
|> close()
|
|
```
|
|
|
|

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

|
|
|
|
|