memo: Updated README
This commit is contained in:
parent
6dacc3d581
commit
3ff58cdd78
5 changed files with 84 additions and 116 deletions
|
@ -5,47 +5,113 @@
|
||||||
<br><sup>a library for made-to-measure sewing patterns</sup>
|
<br><sup>a library for made-to-measure sewing patterns</sup>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
# freesewing / plugins / macro-cutonfold
|
# plugin-dimension
|
||||||
|
|
||||||
This is a macro for [freesewing](https://github.com/freesewing/freesewing)
|
A [freesewing](https://github.com/freesewing/freesewing)
|
||||||
to add cut-on-fold indicators on your patterns.
|
plugin to add dimensions to your (paperless) patterns.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
Install this plugin from NPM:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install @freesewing-plugins/macro-cutonfold --save
|
npm install @freesewing/plugins-dimension --save
|
||||||
```
|
```
|
||||||
|
|
||||||
## Loading the plugin
|
## 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
|
```js
|
||||||
import F from 'freesewing';
|
import pattern from '@freesewing/pattern-brian'
|
||||||
import cutonfold from '@freesewing-plugins/macro-cutonfold';
|
import theme from '@freesewing/plugin-theme'
|
||||||
|
import dimension from '@freesewing/plugin-dimension'
|
||||||
|
|
||||||
var pattern = new F.pattern()
|
pattern.with(theme).with(dimension);
|
||||||
.withPlugin(cutonfold);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 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
|
```js
|
||||||
part.macro('cutonfold', {
|
part.macro('hd', {
|
||||||
from: points.cbNeck
|
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
|
||||||
|
|
||||||
- `to`: A point object at the start of the cut-on-fold indicator
|
```js
|
||||||
- `from`: A point object at the end of the cut-on-fold indicator
|
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
|
||||||
|
|
||||||
As all freesewing macros, bundle these parameters into a single object.
|
As all freesewing macros, bundle these parameters into a single object.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
FIXME: include example
|
Below is an example of different dimensions.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
BIN
packages/plugin-dimension/img/example.png
Normal file
BIN
packages/plugin-dimension/img/example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
|
@ -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 */`
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
]
|
|
||||||
};
|
|
|
@ -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 */`
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
]
|
|
||||||
};
|
|
|
@ -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 */`
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
]
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue