2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: round
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
The `round` macro rounds a corner. It is provided by the [round
|
|
|
|
plugin](/reference/plugins/round/).
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
## Signature
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
2022-09-30 04:39:30 +02:00
|
|
|
macro('round', {
|
|
|
|
String class,
|
|
|
|
Point from,
|
|
|
|
Boolean hide,
|
|
|
|
String prefix,
|
|
|
|
Number radius,
|
|
|
|
Point to,
|
|
|
|
Point via,
|
2021-08-25 16:09:31 +02:00
|
|
|
})
|
|
|
|
```
|
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
## Example
|
|
|
|
|
|
|
|
<Example caption="An example of the round macro">
|
|
|
|
```js
|
|
|
|
({ Point, points, macro, part }) => {
|
|
|
|
|
|
|
|
macro('round', {
|
|
|
|
from: new Point(0, 0),
|
|
|
|
to: new Point(100, 40),
|
|
|
|
via: new Point(100, 0),
|
|
|
|
radius: 30,
|
|
|
|
hide: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
return part
|
|
|
|
}
|
|
|
|
```
|
|
|
|
</Example>
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2022-02-19 08:04:25 +01:00
|
|
|
| Property | Default | Type | Description |
|
2021-08-25 16:09:31 +02:00
|
|
|
|------------:|---------|---------------------|-------------|
|
|
|
|
| `from` | | [Point](/reference/api/point) | The startpoint towards the corner to round |
|
|
|
|
| `to` | | [Point](/reference/api/point) | The endpoint away from the corner to round |
|
|
|
|
| `via` | | [Point](/reference/api/point) | The corner to round |
|
|
|
|
| `radius` | Maximum | Number | The radius in mm in not the maximum |
|
|
|
|
| `prefix` | | String | A prefix to give to the points and paths created by this macro |
|
2022-09-30 04:39:30 +02:00
|
|
|
| `hide` | `true` | Boolean | Whether to hide the path created by this macro |
|
2021-08-25 16:09:31 +02:00
|
|
|
| `class` | | String | Class(es) to assign to the path created by this macro |
|
2022-09-30 04:39:30 +02:00
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
This macro is only intended for 90 degree corners.
|