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
|
2023-05-07 13:12:14 -07:00
|
|
|
determine what is the inside or outside of the part.
|
2023-05-05 20:10:19 +00:00
|
|
|
|
2023-10-29 17:20:35 +01:00
|
|
|
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('pleat', {
|
2023-10-29 17:20:35 +01:00
|
|
|
String id = 'pleat',
|
2023-05-05 20:10:19 +00:00
|
|
|
Point from,
|
|
|
|
Point to,
|
|
|
|
Number margin = 35,
|
|
|
|
Boolean reverse = false,
|
2023-10-29 17:20:35 +01:00
|
|
|
Boolean force = false,
|
|
|
|
Object calsses = {
|
|
|
|
arrow: 'note',
|
|
|
|
from: 'note',
|
|
|
|
to: 'note dashed',
|
|
|
|
},
|
|
|
|
|
2023-05-05 20:10:19 +00:00
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
## 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)
|
2023-10-29 17:20:35 +01:00
|
|
|
points.to = new Point(10,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 |
|
|
|
|
|----------------:|----------|---------------------|-------------|
|
2023-05-07 13:12:30 -07:00
|
|
|
| `from` | | [Point](/reference/api/point) | The start point of the pleat |
|
2023-10-29 17:20:35 +01:00
|
|
|
| `id` | `pleat` | `string` | The ID of this macro instance |
|
2023-05-07 13:12:39 -07:00
|
|
|
| `to` | | [Point](/reference/api/point) | The end point of the pleat |
|
2023-05-05 23:29:54 +00:00
|
|
|
| `margin` | 35 | Number | The size (in mm) of the pleat lines |
|
|
|
|
| `reverse` | `false` | Boolean | Reverses the two pleat lines and the arrow |
|
2023-10-29 17:20:35 +01:00
|
|
|
| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` |
|
|
|
|
| `classes.arrow` | `note` | `string` | CSS classes to apply to the arrow |
|
|
|
|
| `classes.from` | `note` | `string` | CSS classes to apply to the line at the `from` point |
|
|
|
|
| `classes.to` | `note dashed` | `string` | CSS classes to apply to the line at the `to` point |
|
2023-05-05 23:29:54 +00:00
|
|
|
|
2023-10-29 17:20:35 +01:00
|
|
|
## Notes
|
|
|
|
|
|
|
|
This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`.
|
2023-05-05 23:29:54 +00:00
|
|
|
|