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',
|
||||
],
|
||||
flip: [ 'flipAxis' ],
|
||||
gore: [ 'goreRadius', 'goreGoreNumber', 'goreExtraLength' ],
|
||||
},
|
||||
measurements: [],
|
||||
parts: [
|
||||
|
@ -46,7 +47,7 @@ export default {
|
|||
'cutonfold',
|
||||
'dimension',
|
||||
'flip',
|
||||
//'gore',
|
||||
'gore',
|
||||
//'grainline',
|
||||
//'i18n',
|
||||
//'logo',
|
||||
|
@ -64,7 +65,7 @@ export default {
|
|||
],
|
||||
options: {
|
||||
plugin: {
|
||||
dflt: 'flip',
|
||||
dflt: 'gore',
|
||||
list: [
|
||||
'all',
|
||||
'banner',
|
||||
|
@ -112,5 +113,10 @@ export default {
|
|||
dimensionStartMarker: { bool: true },
|
||||
// Flip options
|
||||
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 dimension from '@freesewing/plugin-dimension'
|
||||
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 i18n from '@freesewing/plugin-i18n'
|
||||
//import logo from '@freesewing/plugin-logo'
|
||||
|
@ -29,7 +29,7 @@ import draftButtons from './plugin-buttons'
|
|||
import draftCutonfold from './plugin-cutonfold'
|
||||
import draftDimension from './plugin-dimension'
|
||||
import draftFlip from './plugin-flip'
|
||||
//import draftGore from './plugin-gore'
|
||||
import draftGore from './plugin-gore'
|
||||
//import draftGrainline from './plugin-grainline'
|
||||
//import draftI18n from './plugin-i18n'
|
||||
//import draftLogo from './plugin-logo'
|
||||
|
@ -56,7 +56,7 @@ const plugins = [
|
|||
cutonfold,
|
||||
dimension,
|
||||
flip,
|
||||
// gore,
|
||||
gore,
|
||||
// grainline,
|
||||
// i18n,
|
||||
// logo,
|
||||
|
@ -80,7 +80,7 @@ const methods = {
|
|||
draftCutonfold,
|
||||
draftDimension,
|
||||
draftFlip,
|
||||
// draftGore,
|
||||
draftGore,
|
||||
// draftGrainline,
|
||||
// draftI18n,
|
||||
// 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