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

71 lines
2.1 KiB
Markdown
Raw Normal View History

2023-05-05 20:10:19 +00:00
---
title: pleat
---
2023-05-05 23:29:54 +00:00
The `pleat` macro is used to mark a pleat on a pattern. It draws the appropriate
lines perpendicular to the line going from `from` to `to`.
The `pleat` macro follows the convention of paths being counter-clockwise to
determine what is the inside or outside of the part.
2023-05-05 20:10:19 +00:00
It is provided by [plugin-annotations](/reference/plugins/annotations/).
## Signature
```js
macro('pleat', {
Point from,
Point to,
2023-05-05 23:29:54 +00:00
String prefix = 'pleat',
2023-05-05 20:10:19 +00:00
Number margin = 35,
Boolean reverse = false,
})
```
## Example
<Example caption="An example of the pleat macro">
```js
({ Point, points, Path, paths, macro, part }) => {
points.seamTL = new Point(0,0)
points.seamTR = new Point(70,0)
paths.seam = new Path()
.move(points.seamTL)
.line(points.seamTR)
2023-05-05 23:29:54 +00:00
.attr('class', 'fabric')
points.from = new Point(40,0)
points.to = new Point(30,0)
2023-05-05 20:10:19 +00:00
macro('pleat', {
from: points.from,
to: points.to,
})
return part
}
```
</Example>
2023-05-05 23:29:54 +00:00
## Configuration
| Property | Default | Type | Description |
|----------------:|----------|---------------------|-------------|
| `from` | | [Point](/reference/api/point) | The start point of the pleat |
2023-05-05 23:29:54 +00:00
| `to` | | [Point](/reference/api/point) | The bottom right point of the crossbox |
| `prefix` | 'pleat' | String | The prefix to be used for creating all the points and paths |
| `margin` | 35 | Number | The size (in mm) of the pleat lines |
| `reverse` | `false` | Boolean | Reverses the two pleat lines and the arrow |
## Result
| Generated Element | Description |
|-------------------|-------------|
| `points.${prefix}From` | Copy of the `from` Point |
| `points.${prefix}To` | Copy of the `to` Point |
| `points.${prefix}FromIn` | Point for the inside of the `from` path |
| `points.${prefix}ToIn` | Point for the inside of the `to` path |
| `paths.${prefix}PleatFrom` | Path forming the from line |
| `paths.${prefix}PleatTo` | Path forming the to line |
| `paths.${prefix}PleatArrow` | Path forming the arrow |