1
0
Fork 0

memo: Updated README

This commit is contained in:
Joost De Cock 2018-08-01 14:48:11 +02:00
parent 6dacc3d581
commit 3ff58cdd78
5 changed files with 84 additions and 116 deletions

View file

@ -5,47 +5,113 @@
<br><sup>a library for made-to-measure sewing patterns</sup>
</h4>
# freesewing / plugins / macro-cutonfold
# plugin-dimension
This is a macro for [freesewing](https://github.com/freesewing/freesewing)
to add cut-on-fold indicators on your patterns.
A [freesewing](https://github.com/freesewing/freesewing)
plugin to add dimensions to your (paperless) patterns.
## Install
Install this plugin from NPM:
```sh
npm install @freesewing-plugins/macro-cutonfold --save
npm install @freesewing/plugins-dimension --save
```
## Loading the plugin
Plugins are loaded by the `withPlugin` method of an instantiated freesewing pattern:
To load this plugin, add it to your instantiated pattern:
```js
import F from 'freesewing';
import cutonfold from '@freesewing-plugins/macro-cutonfold';
import pattern from '@freesewing/pattern-brian'
import theme from '@freesewing/plugin-theme'
import dimension from '@freesewing/plugin-dimension'
var pattern = new F.pattern()
.withPlugin(cutonfold);
pattern.with(theme).with(dimension);
```
## Using the plugin
You now have the following macros available:
This plugin provides the `cutonfold` macro which you can call with the `macro` method on an instantiated pattern part:
Name | Description
----------|-----------------------------------------------------
`hd` | Adds a horizontal dimension
`vd` | Adds a vertical dimension
`ld` | Adds a linear dimension
`pd` | Adds a dimension that follows a path
You can use them as such:
```sh
macro('<name>', {<options>});
```
## Parameters
As all freesewing plugins, all options needs to be passed as a single object.
### hd
```js
part.macro('cutonfold', {
part.macro('hd', {
from: points.cbNeck
, to: points.cbHips
, to: points.cbHips,
y: points.cbHips + 15
});
```
- `from` : A point object
- `to` : A point object
- `y` : The y-value at which to place the dimension
### Parameters
### vd
```js
part.macro('vd', {
from: points.cbNeck
, to: points.cbHips,
x: points.cbHips + 15
});
```
- `from` : A point object
- `to` : A point object
- `x` : The x-value at which to place the dimension
As all freesewing macros, bundle these parameters into a single object.
### ld
```js
part.macro('ld', {
from: points.cbNeck
, to: points.cbHips,
d: 15
});
```
- `from` : A point object
- `to` : A point object
- `d` : The distance by which to offset the dimension from the line between from and to
As all freesewing macros, bundle these parameters into a single object.
### pd
```js
part.macro('pd', {
path: new path().move(points.cbNeck).curve(points.cbNeckCp1, points.cbNeckCp2, points.cbHips),
d: 15
});
```
- `path` : A path object
- `d` : The distance by which to offset the dimension from the path
- `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
As all freesewing macros, bundle these parameters into a single object.
## Example
FIXME: include example
Below is an example of different dimensions.
![Example of the dimension plugin](https://github.com/freesewing/plugin-dimension/raw/master/img/example.png)
## Where to get help
Questions? Stuck? The [freesewing chat room on Gitter](https://gitter.im/freesewing/freesewing)
is the best place to ask for help.

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View file

@ -1,33 +0,0 @@
import { terser } from "rollup-plugin-terser";
import filesize from "rollup-plugin-filesize";
import babel from "rollup-plugin-babel";
import json from "rollup-plugin-json";
import resolve from "rollup-plugin-node-resolve";
import meta from "../package.json";
export default {
input: "src/index.js",
output: {
file: "dist/node.js",
format: "cjs"
},
plugins: [
resolve({
browser: false
}),
json(),
babel({
exclude: "node_modules/**"
}),
filesize()
//terser({
// output: {
// preamble: `/**\n * ${meta.name} | v${meta.version}\n * ${
// meta.description
// }\n * (c) ${new Date().getFullYear()} ${meta.author}\n * @license ${
// meta.license
// }\n */`
// }
//})
]
};

View file

@ -1,33 +0,0 @@
import { terser } from "rollup-plugin-terser";
import filesize from "rollup-plugin-filesize";
import babel from "rollup-plugin-babel";
import json from "rollup-plugin-json";
import resolve from "rollup-plugin-node-resolve";
import meta from "../package.json";
export default {
input: "src/index.js",
output: {
file: "dist/es.mjs",
format: "es"
},
plugins: [
resolve({
browser: false
}),
json(),
babel({
exclude: "node_modules/**"
}),
filesize()
//terser({
// output: {
// preamble: `/**\n * ${meta.name} | v${meta.version}\n * ${
// meta.description
// }\n * (c) ${new Date().getFullYear()} ${meta.author}\n * @license ${
// meta.license
// }\n */`
// }
//})
]
};

View file

@ -1,32 +0,0 @@
import { terser } from "rollup-plugin-terser";
import babel from "rollup-plugin-babel";
import resolve from "rollup-plugin-node-resolve";
import json from "rollup-plugin-json";
import meta from "../package.json";
export default {
input: "src/index.js",
output: {
file: "dist/browser.js",
format: "iife",
name: "freesewing.plugins.cutonfold"
},
plugins: [
resolve({
browser: true
}),
json(),
babel({
exclude: "node_modules/**"
})
//terser({
// output: {
// preamble: `/**\n * ${meta.name} | v${meta.version}\n * ${
// meta.description
// }\n * (c) ${new Date().getFullYear()} ${meta.author}\n * @license ${
// meta.license
// }\n */`
// }
//})
]
};