Files
modeling-app/docs/kcl-std/functions/std-sketch-lastSegY.md
Nick Cameron 4d1524f03b Format examples in docs (#7378)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-06-05 18:01:45 -04:00

65 KiB

title, subtitle, excerpt, layout
title subtitle excerpt layout
lastSegY Function in std::sketch Extract the 'y' axis value of the last line segment in the provided 2-d sketch. manual

Extract the 'y' axis value of the last line segment in the provided 2-d sketch.

lastSegY(@sketch: Sketch): number(Length)

Arguments

Name Type Description Required
sketch Sketch The sketch whose line segment is being queried. Yes

Returns

number(Length) - A number.

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> line(end = [5, 0])
  |> line(end = [20, 5])
  |> line(end = [0, lastSegY(%)])
  |> line(end = [-15, 0])
  |> close()

example = extrude(exampleSketch, length = 5)

Rendered example of lastSegY 0