44 lines
76 KiB
Markdown
44 lines
76 KiB
Markdown
---
|
|
title: "angleToMatchLengthX"
|
|
excerpt: "Compute the angle (in degrees) in o"
|
|
layout: manual
|
|
---
|
|
|
|
Compute the angle (in degrees) in o
|
|
|
|
|
|
|
|
```js
|
|
angleToMatchLengthX(tag: TagIdentifier, to: number, sketch: Sketch) -> number
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
|
| `to` | `number` | | Yes |
|
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
|
|
|
### Returns
|
|
|
|
`number`
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
sketch001 = startSketchOn('XZ')
|
|
|> startProfileAt([0, 0], %)
|
|
|> line([2, 5], %, $seg01)
|
|
|> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)
|
|
|> close(%)
|
|
|
|
extrusion = extrude(5, sketch001)
|
|
```
|
|
|
|

|
|
|
|
|