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

92 lines
2.7 KiB
Markdown
Raw Normal View History

---
title: cutonfold
---
The `cutonfold` macro adds a _cut on fold_ indicator to your pattern.
It is provided by the [annotations plugin](/reference/plugins/annotations).
## Signature
```js
macro('cutonfold', {
Point from,
Boolean grainline=false,
Number margin=5,
Number offset=15,
String prefix='',
Point to,
2022-01-18 10:13:16 +01:00
})
```
## Example
<Example caption="Example of the cut on fold indicator added by this macro">
```js
({ Point, macro, Path, paths, part }) => {
macro('cutonfold', {
from: new Point(0,0),
to: new Point(100,0),
grainline: true
})
// Prevent clipping
paths.diag = new Path()
.move(new Point(-10,-20))
.move(new Point(110,0))
return part
}
```
</Example>
## Configuration
2022-02-19 08:04:25 +01:00
| Property | Default | Type | Description |
|------------:|---------|---------------------|-------------|
2022-02-20 14:35:50 +01:00
| `from` | | [Point](/reference/api/point) | The startpoint of the _cut on fold_ indicator |
| `to` | | [Point](/reference/api/point) | The endpoint of the _cut on fold_ indicator |
| `margin` | 5 | [Point](/reference/api/point) | The distance in % to keep from the start/end edge |
| `offset` | 15 | Number | The distance in mm to offset from the line from start to end |
| `prefix` | 'cutonfold' | String | A prefix to apply to the names of the generated path and points |
| `grainline` | `false` | Boolean | Whether this cutonfold indicator is also the grainline |
## Result
| Generated Element | Description |
|------|-------------|
| `paths.${prefix}Cutonfold` | The Path for the _cut on fold_ indicator |
| `points.${prefix}From` | Point used to create the path |
| `points.${prefix}Via1` | Point used to create the path |
| `points.${prefix}Via2` | Point used to create the path |
| `points.${prefix}To}` | Point used to create the path |
## Notes
### Place outside `complete`
The `cutonfold` macro should be placed outside of `complete` blocks
in the part's draft method.
This is because it provides information about the part's foldline and
possible grainline,
information that is always needed by the cutting layout regardless of
whether `complete` details and graphics are shown on the pattern.
The `cutonfold` macro will automatically show or hide the cut on fold
indicator based on the `complete` setting.
### It's safe to use a corner of your pattern part for this
2022-02-19 08:04:25 +01:00
Since this is typically used on corners, the generated cut-on-fold indicator
will not go all the way to the `to` and `from` points.
### Removing the cut on fold indicator
If you inherit a part with a cut on fold indicator and you'd like to remove it,
you can do so by passing `false` to the macro:
```js
macro('cutonfold', false)
```