Adds new stdlib functions segStart, segStartX, segStartY, segEnd Part of <https://github.com/KittyCAD/modeling-app/issues/4382>
44 lines
67 KiB
Markdown
44 lines
67 KiB
Markdown
---
|
|
title: "segStartX"
|
|
excerpt: "Compute the starting point of the provided line segment along the 'x' axis."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the starting point of the provided line segment along the 'x' axis.
|
|
|
|
|
|
|
|
```js
|
|
segStartX(tag: TagIdentifier) -> number
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
|
|
|
### Returns
|
|
|
|
`number`
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
exampleSketch = startSketchOn('XZ')
|
|
|> startProfileAt([0, 0], %)
|
|
|> line([20, 0], %, $thing)
|
|
|> line([0, 5], %)
|
|
|> line([20 - segStartX(thing), 0], %)
|
|
|> line([-20, 10], %)
|
|
|> close(%)
|
|
|
|
example = extrude(5, exampleSketch)
|
|
```
|
|
|
|

|
|
|
|
|