Files
modeling-app/docs/kcl-std/tangentToEnd.md
Nick Cameron 1841e63021 Misc docs polishing (#6712)
* Fake modules for Rust std lib functions

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

* Include the missing @ in Rust std lib fns

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

* Move revolve and mirror2d to better modules

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

* Use docs from KCL mods for type summaries

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

* Use type docs to describe types from KCL std lib

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 16:09:59 +12:00

302 KiB

title, excerpt, layout
title excerpt layout
std::sketch::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 - A number

Examples

// 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)

Rendered example of std::sketch::tangentToEnd 0

// 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)

Rendered example of std::sketch::tangentToEnd 1

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)

Rendered example of std::sketch::tangentToEnd 2

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

Rendered example of std::sketch::tangentToEnd 3

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()

Rendered example of std::sketch::tangentToEnd 4