Files
modeling-app/docs/kcl/tangentToEnd.md
Nick Cameron e8feb0309b Automatic fixing of deprecations and use non-quoted default planes by default (#5902)
* Automatic fixing of deprecations and use non-quoted default planes by default

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-21 09:39:12 +00:00

302 KiB

title, excerpt, layout
title excerpt layout
tangentToEnd Returns the angle coming out of the end of the segment in degrees. manual

Returns the angle coming out of the end of the segment in degrees.

tangentToEnd(tag: TagIdentifier): number

Arguments

Name Type Description Required
tag TagIdentifier The line segment being queried by its tag Yes

Returns

number

Examples

// Horizontal pill.
pillSketch = startSketchOn(XZ)
  |> startProfileAt([0, 0], %)
  |> line(end = [20, 0])
  |> tangentialArcToRelative([0, 10], %, $arc1)
  |> angledLine({
       angle = tangentToEnd(arc1),
       length = 20
     }, %)
  |> tangentialArcToRelative([0, -10], %)
  |> close()

pillExtrude = extrude(pillSketch, length = 10)

Rendered example of tangentToEnd 0

// Vertical pill.  Use absolute coordinate for arc.
pillSketch = startSketchOn(XZ)
  |> startProfileAt([0, 0], %)
  |> line(end = [0, 20])
  |> tangentialArcTo([10, 20], %, $arc1)
  |> angledLine({
       angle = tangentToEnd(arc1),
       length = 20
     }, %)
  |> tangentialArcToRelative([-10, 0], %)
  |> close()

pillExtrude = extrude(pillSketch, length = 10)

Rendered example of tangentToEnd 1

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)

Rendered example of tangentToEnd 2

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

Rendered example of tangentToEnd 3

circSketch = startSketchOn(XY)
  |> circle(center = [0, 0], radius = 3, tag = $circ)

triangleSketch = startSketchOn(XY)
  |> startProfileAt([-5, 0], %)
  |> angledLine([tangentToEnd(circ), 10], %)
  |> line(end = [-15, 0])
  |> close()

Rendered example of tangentToEnd 4