2018-07-21 15:34:46 +02:00
< p align = "center" >
< a title = "Go to freesewing.org" href = "https://freesewing.org/" > < img src = "https://freesewing.org/img/logo/black.svg" align = "center" width = "150px" alt = "Freesewing logo" / > < / a >
< / p >
< h4 align = "center" > < em > < a title = "Go to freesewing.org" href = "https://freesewing.org/" > freesewing< / a > < / em >
< br > < sup > a library for made-to-measure sewing patterns< / sup >
< / h4 >
2018-08-09 11:20:54 +02:00
# plugin-cutonfold
2018-07-21 15:34:46 +02:00
2018-08-09 11:20:54 +02:00
A freesewing plugin to add cut-on-fold indicators to your patterns.
2018-07-21 15:34:46 +02:00
## Install
2018-08-09 11:20:54 +02:00
For node.js, run:
2018-07-21 15:34:46 +02:00
```sh
2018-08-09 11:24:53 +02:00
npm install @freesewing/plugin -cutonfold
2018-07-21 15:34:46 +02:00
```
2018-08-09 11:20:54 +02:00
in the browser, simply include this script:
```html
< script type = "text/javascript" src = "https://unpkg.com/ @freesewing/plugin -cutonfold" ></ script >
```
## Loading this plugin
To load this plugin, add it to your instantiated pattern.
2018-07-21 15:34:46 +02:00
2018-08-09 11:20:54 +02:00
On node.js:
2018-07-21 15:34:46 +02:00
```js
2018-08-09 11:20:54 +02:00
import pattern from '@freesewing/pattern -brian'
import cutonfold from '@freesewing/plugin -cutonfold'
2018-07-21 15:34:46 +02:00
2018-08-09 11:20:54 +02:00
pattern.with(cutonfold);
2018-07-21 15:34:46 +02:00
```
2018-08-09 11:20:54 +02:00
In the browser, this plugin will register as `freesewing.plugins.cutonfold` .
Since it's a build-time plugin, it will be loaded by the pattern.
```html
< script type = "text/javascript" src = "https://unpkg.com/freesewing" > < / script >
< script type = "text/javascript" src = "https://unpkg.com/ @freesewing/plugin -cutonfold" ></ script >
< script type = "text/javascript" src = "https://unpkg.com/ @freesewing/pattern -brian" ></ script >
< script >
var pattern = freesewing.patterns.brian;
< / script >
```
## Usage
This plugin provides the `cutonfold` macro.
2018-07-21 15:34:46 +02:00
2018-08-09 11:20:54 +02:00
> The macro method is available from the `shorthand()` method on an instantiated pattern part.
2018-07-21 15:34:46 +02:00
```js
2018-08-09 11:20:54 +02:00
macro('cutonfold', {
2018-07-21 15:34:46 +02:00
from: points.cbNeck
2018-08-09 11:20:54 +02:00
, to: points.cbHips
2018-07-21 15:34:46 +02:00
});
2018-08-09 11:20:54 +02:00
```
2018-07-21 15:34:46 +02:00
### Parameters
2018-08-09 11:20:54 +02:00
- `to` : A point object at the start of the cut-on-fold indicator
- `from` : A point object at the end of the cut-on-fold indicator
2018-07-21 15:34:46 +02:00
As all freesewing macros, bundle these parameters into a single object.
## Example
2018-08-09 11:24:53 +02:00

2018-08-09 11:20:54 +02:00
## Build
To build this plugin, run:
```sh
npm run build
```
## License: MIT
See [the license file ](https://github.com/freesewing/plugin-theme/blob/master/LICENSE )
for details.