Files
modeling-app/docs/kcl/segEnd.md
Jonathan Tran b816df21d2 Deprecate startSketchAt() stdlib function (#4819)
* Deprecate startSketchAt() stdlib function

* Remove uses of startSketchAt() from the doc tests

* Update docs
2024-12-17 11:28:22 -05:00

88 KiB

title, excerpt, layout
title excerpt layout
segEnd Compute the ending point of the provided line segment. manual

Compute the ending point of the provided line segment.

segEnd(tag: TagIdentifier) -> [number]

Arguments

Name Type Description Required
tag TagIdentifier Yes

Returns

[number]

Examples

w = 15
cube = startSketchOn('XY')
  |> startProfileAt([0, 0], %)
  |> line([w, 0], %, $line1)
  |> line([0, w], %, $line2)
  |> line([-w, 0], %, $line3)
  |> line([0, -w], %, $line4)
  |> close(%)
  |> extrude(5, %)

fn cylinder(radius, tag) {
  return startSketchOn('XY')
    |> startProfileAt([0, 0], %)
    |> circle({
         radius = radius,
         center = segEnd(tag)
       }, %)
    |> extrude(radius, %)
}

cylinder(1, line1)
cylinder(2, line2)
cylinder(3, line3)
cylinder(4, line4)

Rendered example of segEnd 0