1
0
Fork 0
freesewing/sites/dev/docs/reference/macros/crossbox/readme.mdx

58 lines
1.7 KiB
Text
Raw Normal View History

2023-05-05 20:10:19 +00:00
---
title: crossBox
2023-05-05 20:10:19 +00:00
---
The `crossbox` macro is used to mark a feature on a sewing pattern
to attach and reinforce an attachment between two pieces.
This is regularly done by sewing along the outside of the pieces
that needs to be joined, and then sewing along the diagonals too.
It is provided by [plugin-annotations](/reference/plugins/annotations), which is
part of [core-plugins](/reference/plugins/core) (so it is available by default).
2023-05-05 20:10:19 +00:00
## Signature
```js
macro('crossbox', {
String id='crossbox',
Point topLeft,
Point bottomRight,
2023-05-05 20:10:19 +00:00
String text,
Boolean force = false,
2023-05-05 20:10:19 +00:00
})
```
## Example
<Example caption="An example of the crossbox macro">
```js
({ Point, points, Path, paths, macro, part }) => {
points.tl = new Point(5,5)
points.br = new Point(45,25)
macro('crossbox', {
topLeft: new Point(5, 5),
bottomRight: new Point(45, 25),
text: 'Attach here',
2023-05-05 20:10:19 +00:00
})
return part
}
```
</Example>
## Configuration
| Property | Default | Type | Description |
|----------------:|----------|---------------------|-------------|
| `bottomRight` | | [Point](/reference/api/point) | The bottom right point of the crossbox |
| `topLeft` | | [Point](/reference/api/point) | The top left point of the crossbox |
| `id` | `crossbox` | `string` | The ID of this macro instance |
| `text` | | String | Optional text to go in the center of the crossbox |
| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` |
## Notes
2023-05-05 20:10:19 +00:00
This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`.
2023-05-05 20:10:19 +00:00