1
0
Fork 0
freesewing/markdown/dev/reference/macros/scalebox/en.md

77 lines
2.2 KiB
Markdown
Raw Normal View History

---
title: scalebox
---
The `scalebox` macro adds a _scale box_ to your pattern. This box allows users
to verify their pattern is printed to scale.
The white inside of the box provides a metric scale, and the black outside
of the box provides an imperial scale.
The `scalebox` macro is is provided by the [annotations
plugin](/reference/plugins/annotations).
## Signature
```js
macro('scalebox', {
Point at,
String lead,
Number rotate,
String text,
String title,
})
```
## Example
<Example caption="An example of the scalebox macro">
```js
({ Point, macro, part }) => {
macro('scalebox', {
at: new Point(0,0),
title: 'This is the title',
number: 666,
})
return part
}
```
</Example>
## Configuration
2022-02-19 08:04:25 +01:00
| Property | Default | Type | Description |
|------------:|---------|---------------------|-------------|
2022-02-20 14:35:50 +01:00
| `at` | | [Point](/reference/api/point) | The point to anchor the _scale box_ on |
| `lead` | FreeSewing | String | The lead text above the title |
2022-02-20 14:35:50 +01:00
| `title` | _pattern name + version_ | String | The title text |
| `text` | (\*) | String | The text below the title |
| `rotate` | 0 | Number | Rotation in degrees |
(\*) `freesewingIsMadeByJoostDeCockAndContributors \n withTheFinancialSupportOfOurPatrons`
## Result
| Generated Element | Description |
|-------------------|-------------|
| `paths.__scaleboxImperial` | Path of the imperial, outer box |
| `paths.__scaleboxMetric` | Path of the metric, inner box |
| `points.__scaleboxLead` | Point anchoring the lead text above the title |
| `points.__scaleboxTitle` | Point anchoring the title text |
| `points.__scaleboxTitle` | Point anchoring the text below the title |
| `points.__scaleboxImperial` | Point anchoring the imperial text |
| `points.__scaleboxMetric` | Point anchoring the metric text |
| `points.__scalebox[Metric/Imperial][Top/Bottom][Left/Right]` | Points for the corners of the boxes |
## Notes
### Removing the scalebox
2022-07-31 16:11:50 +02:00
If you inherit a part with a scalebox on it and you'd like to remove all points and paths
generated by the scalebox macro, you can do so by passing `false` to the macro:
```js
macro('scalebox', false)
```