* wip * sketch a bit more; going to pull this out of tests next * wip * lock start things * this was a bad idea * Revert "this was a bad idea" This reverts commita2092e7ed6
. * prepare prelude before spawning * error * poop * yike * :( * ok * Reapply "this was a bad idea" This reverts commitfafdf41093
. * chip away more * man this is bad * fix rebase add feature flag Signed-off-by: Jess Frazelle <github@jessfraz.com> * get rid of execution kind Signed-off-by: Jess Frazelle <github@jessfraz.com> * clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * logs Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * no extra executes Signed-off-by: Jess Frazelle <github@jessfraz.com> * race w batch Signed-off-by: Jess Frazelle <github@jessfraz.com> * cluppy Signed-off-by: Jess Frazelle <github@jessfraz.com> * no printlns Signed-off-by: Jess Frazelle <github@jessfraz.com> * no printlns Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix source ranges Signed-off-by: Jess Frazelle <github@jessfraz.com> * batch shit Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some bugs Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix error Signed-off-by: Jess Frazelle <github@jessfraz.com> * cut 1 * preserve mem * re-ad deep_clone the helper we were calling was pushing a new call, which was hanging out. we can skip the middleman since we already have something properly prepared, just without a stdlib in some cases. * skip non-kcl * clean up source range bug * error message changed the uuids also changed because the error is hit before execute even starts. * typo * rensnapshot a few * order things * MAYBE REVERT LATER: attempt at an ordering * snapsnap * Revert "snapsnap" This reverts commit7350b32c7d
. * Revert "MAYBE REVERT LATER:" This reverts commitab49f3e85f
. * ugh * poop * poop2 * lint * tranche 1 * more * more snaps * snap * more * update * MAYBE REVERT THIS * cache multi-file Signed-off-by: Jess Frazelle <github@jessfraz.com> * addd tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * set to false Signed-off-by: Jess Frazelle <github@jessfraz.com> * add test outputs Signed-off-by: Jess Frazelle <github@jessfraz.com> * clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * kcl-py-bindings uses carwheel Signed-off-by: Jess Frazelle <github@jessfraz.com> * update snapshots 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> Co-authored-by: Paul R. Tagliamonte <paul@zoo.dev> Co-authored-by: Paul Tagliamonte <paultag@gmail.com>
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()
|
|
```
|
|
|
|

|
|
|
|
|