feat(plugintest): Added plugin-gore
This commit is contained in:
parent
4d358dfc52
commit
e599287e5d
3 changed files with 32 additions and 6 deletions
|
@ -37,6 +37,7 @@ export default {
|
||||||
'dimensionStartMarker',
|
'dimensionStartMarker',
|
||||||
],
|
],
|
||||||
flip: [ 'flipAxis' ],
|
flip: [ 'flipAxis' ],
|
||||||
|
gore: [ 'goreRadius', 'goreGoreNumber', 'goreExtraLength' ],
|
||||||
},
|
},
|
||||||
measurements: [],
|
measurements: [],
|
||||||
parts: [
|
parts: [
|
||||||
|
@ -46,7 +47,7 @@ export default {
|
||||||
'cutonfold',
|
'cutonfold',
|
||||||
'dimension',
|
'dimension',
|
||||||
'flip',
|
'flip',
|
||||||
//'gore',
|
'gore',
|
||||||
//'grainline',
|
//'grainline',
|
||||||
//'i18n',
|
//'i18n',
|
||||||
//'logo',
|
//'logo',
|
||||||
|
@ -64,7 +65,7 @@ export default {
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
plugin: {
|
plugin: {
|
||||||
dflt: 'flip',
|
dflt: 'gore',
|
||||||
list: [
|
list: [
|
||||||
'all',
|
'all',
|
||||||
'banner',
|
'banner',
|
||||||
|
@ -112,5 +113,10 @@ export default {
|
||||||
dimensionStartMarker: { bool: true },
|
dimensionStartMarker: { bool: true },
|
||||||
// Flip options
|
// Flip options
|
||||||
flipAxis: { dflt: 'x', list: ['x', 'y'] },
|
flipAxis: { dflt: 'x', list: ['x', 'y'] },
|
||||||
|
// Gore options
|
||||||
|
goreRadius: { count: 20, min: 10, max: 30 },
|
||||||
|
goreGoreNumber: { count: 6, min: 4, max: 8 },
|
||||||
|
goreExtraLength: { count: 10, min: 0, max: 20 },
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import buttons from '@freesewing/plugin-buttons'
|
||||||
import cutonfold from '@freesewing/plugin-cutonfold'
|
import cutonfold from '@freesewing/plugin-cutonfold'
|
||||||
import dimension from '@freesewing/plugin-dimension'
|
import dimension from '@freesewing/plugin-dimension'
|
||||||
import flip from '@freesewing/plugin-flip'
|
import flip from '@freesewing/plugin-flip'
|
||||||
//import gore from '@freesewing/plugin-gore'
|
import gore from '@freesewing/plugin-gore'
|
||||||
//import grainline from '@freesewing/plugin-grainline'
|
//import grainline from '@freesewing/plugin-grainline'
|
||||||
//import i18n from '@freesewing/plugin-i18n'
|
//import i18n from '@freesewing/plugin-i18n'
|
||||||
//import logo from '@freesewing/plugin-logo'
|
//import logo from '@freesewing/plugin-logo'
|
||||||
|
@ -29,7 +29,7 @@ import draftButtons from './plugin-buttons'
|
||||||
import draftCutonfold from './plugin-cutonfold'
|
import draftCutonfold from './plugin-cutonfold'
|
||||||
import draftDimension from './plugin-dimension'
|
import draftDimension from './plugin-dimension'
|
||||||
import draftFlip from './plugin-flip'
|
import draftFlip from './plugin-flip'
|
||||||
//import draftGore from './plugin-gore'
|
import draftGore from './plugin-gore'
|
||||||
//import draftGrainline from './plugin-grainline'
|
//import draftGrainline from './plugin-grainline'
|
||||||
//import draftI18n from './plugin-i18n'
|
//import draftI18n from './plugin-i18n'
|
||||||
//import draftLogo from './plugin-logo'
|
//import draftLogo from './plugin-logo'
|
||||||
|
@ -56,7 +56,7 @@ const plugins = [
|
||||||
cutonfold,
|
cutonfold,
|
||||||
dimension,
|
dimension,
|
||||||
flip,
|
flip,
|
||||||
// gore,
|
gore,
|
||||||
// grainline,
|
// grainline,
|
||||||
// i18n,
|
// i18n,
|
||||||
// logo,
|
// logo,
|
||||||
|
@ -80,7 +80,7 @@ const methods = {
|
||||||
draftCutonfold,
|
draftCutonfold,
|
||||||
draftDimension,
|
draftDimension,
|
||||||
draftFlip,
|
draftFlip,
|
||||||
// draftGore,
|
draftGore,
|
||||||
// draftGrainline,
|
// draftGrainline,
|
||||||
// draftI18n,
|
// draftI18n,
|
||||||
// draftLogo,
|
// draftLogo,
|
||||||
|
|
20
packages/plugintest/src/plugin-gore.js
Normal file
20
packages/plugintest/src/plugin-gore.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
const draftDimension = part => {
|
||||||
|
|
||||||
|
const { points, Point, paths, Path, snippets, Snippet, options, macro } = part.shorthand()
|
||||||
|
|
||||||
|
if (['gore', 'all'].indexOf(options.plugin) !== -1) {
|
||||||
|
|
||||||
|
points.start = new Point(10,10)
|
||||||
|
macro('gore', {
|
||||||
|
from: points.start,
|
||||||
|
radius: options.goreRadius,
|
||||||
|
goreNumber: options.goreGoreNumber,
|
||||||
|
extraLength: options.goreExtraLength,
|
||||||
|
render: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
return part
|
||||||
|
}
|
||||||
|
|
||||||
|
export default draftDimension
|
Loading…
Add table
Add a link
Reference in a new issue