1
0
Fork 0
freesewing/packages/plugin-cutonfold/README.md

89 lines
2.1 KiB
Markdown
Raw Normal View History

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>&nbsp;<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>
# plugin-cutonfold
2018-07-21 15:34:46 +02:00
A freesewing plugin to add cut-on-fold indicators to your patterns.
2018-07-21 15:34:46 +02:00
## Install
For node.js, run:
2018-07-21 15:34:46 +02:00
```sh
npm install @freesewing/plugin-cutonfold
2018-07-21 15:34:46 +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
On node.js:
2018-07-21 15:34:46 +02:00
```js
import pattern from '@freesewing/pattern-brian'
import cutonfold from '@freesewing/plugin-cutonfold'
2018-07-21 15:34:46 +02:00
pattern.with(cutonfold);
2018-07-21 15:34:46 +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
> The macro method is available from the `shorthand()` method on an instantiated pattern part.
2018-07-21 15:34:46 +02:00
```js
macro('cutonfold', {
2018-07-21 15:34:46 +02:00
from: points.cbNeck
, to: points.cbHips
2018-07-21 15:34:46 +02:00
});
```
2018-07-21 15:34:46 +02:00
### Parameters
- `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
![Example of the output provided by this plugin](https://github.com/freesewing/plugin-cutonfold/raw/master/img/example.png)
## 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.