1
0
Fork 0
freesewing/packages/plugin-dimension
2019-04-19 17:31:44 +02:00
..
img memo: Updated README 2019-04-19 08:22:00 +02:00
src sparkles: Added check to avoid double-loading plugin 2019-04-19 08:22:01 +02:00
tests Merge branch 'master' of github.com:freesewing/plugin-dimension 2019-04-19 08:22:01 +02:00
.babelrc Merge branch 'master' of github.com:freesewing/plugin-dimension 2019-04-19 08:22:01 +02:00
.editorconfig tada: First commit 2019-04-19 08:22:00 +02:00
.gitignore tada: First commit 2019-04-19 08:22:00 +02:00
.npmignore tada: First commit 2019-04-19 08:22:00 +02:00
.travis.yml Merge branch 'master' of github.com:freesewing/plugin-dimension 2019-04-19 08:22:01 +02:00
LICENSE tada: First commit 2019-04-19 08:22:00 +02:00
package.json 🔧 Centrally confifured package and rollup files 2019-04-19 17:31:44 +02:00
README.md Merge branch 'master' of github.com:freesewing/plugin-dimension 2019-04-19 08:22:01 +02:00
rollup.config.js 🔧 Centrally confifured package and rollup files 2019-04-19 17:31:44 +02:00

Freesewing logo

 freesewing
a library for made-to-measure sewing patterns

Travis build Version License Code coverage DeepScan grade Chat on Gitter Become a Patron

plugin-dimension

A freesewing plugin to add dimensions to your (paperless) patterns.

Install

Install this plugin from NPM:

npm install @freesewing/plugins-dimension --save

Loading the plugin

To load this plugin, add it to your instantiated pattern:

import pattern from '@freesewing/pattern-brian'
import theme from '@freesewing/plugin-theme'
import dimension from '@freesewing/plugin-dimension'

pattern.with(theme).with(dimension);

You now have the following macros available:

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:

macro('<name>', {<options>});

Parameters

As all freesewing plugins, all options needs to be passed as a single object.

hd

part.macro('hd', {
  from: points.cbNeck
, 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

vd

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

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

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.

Example

Below is an example of different dimensions.

Example of the dimension plugin

Where to get help

Questions? Stuck? The freesewing chat room on Gitter is the best place to ask for help.