Merge pull request #2725 from BenJamesBen/v3-port-benjamin-2
Port Benjamin to v3.
This commit is contained in:
commit
24beaaf97f
7 changed files with 81 additions and 95 deletions
|
@ -1,69 +0,0 @@
|
||||||
import pkg from '../package.json' assert { type: 'json' }
|
|
||||||
|
|
||||||
const { version } = pkg
|
|
||||||
|
|
||||||
export default {
|
|
||||||
version,
|
|
||||||
name: 'benjamin',
|
|
||||||
design: 'Wouter Van Wageningen',
|
|
||||||
code: 'Wouter Van Wageningen',
|
|
||||||
department: 'accessories',
|
|
||||||
type: 'pattern',
|
|
||||||
difficulty: 3,
|
|
||||||
optionGroups: {
|
|
||||||
fit: ['collarEase', 'adjustmentRibbon'],
|
|
||||||
style: ['tipWidth', 'knotWidth', 'bowLength', 'bowStyle', 'endStyle', 'ribbonWidth'],
|
|
||||||
},
|
|
||||||
measurements: ['neck'],
|
|
||||||
dependencies: {
|
|
||||||
ribbon: 'base',
|
|
||||||
},
|
|
||||||
inject: {
|
|
||||||
bow1: 'base',
|
|
||||||
bow2: 'base',
|
|
||||||
bow3: 'base',
|
|
||||||
},
|
|
||||||
hide: ['base'],
|
|
||||||
parts: ['ribbon'],
|
|
||||||
options: {
|
|
||||||
transitionLength: 2, //Twice the knot
|
|
||||||
bandLength: 0.17,
|
|
||||||
ribbonWidth: {
|
|
||||||
pct: 6,
|
|
||||||
min: 5,
|
|
||||||
max: 8,
|
|
||||||
},
|
|
||||||
tipWidth: {
|
|
||||||
pct: 15,
|
|
||||||
min: 0,
|
|
||||||
max: 20,
|
|
||||||
},
|
|
||||||
knotWidth: {
|
|
||||||
pct: 7,
|
|
||||||
min: 5,
|
|
||||||
max: 10,
|
|
||||||
},
|
|
||||||
bowLength: {
|
|
||||||
pct: 28,
|
|
||||||
min: 23,
|
|
||||||
max: 33,
|
|
||||||
},
|
|
||||||
collarEase: {
|
|
||||||
pct: 3,
|
|
||||||
min: 0,
|
|
||||||
max: 6,
|
|
||||||
},
|
|
||||||
bowStyle: {
|
|
||||||
dflt: 'butterfly',
|
|
||||||
list: ['diamond', 'butterfly', 'square', 'widesquare'],
|
|
||||||
},
|
|
||||||
endStyle: {
|
|
||||||
dflt: 'straight',
|
|
||||||
list: ['straight', 'pointed', 'rounded'],
|
|
||||||
},
|
|
||||||
adjustmentRibbon: {
|
|
||||||
bool: false,
|
|
||||||
},
|
|
||||||
adjustmentRibbonWidth: 20,
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,4 +1,6 @@
|
||||||
export default function (part) {
|
import { pluginBundle } from '@freesewing/plugin-bundle'
|
||||||
|
|
||||||
|
function draftBenjaminBase (part) {
|
||||||
let {
|
let {
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
|
@ -200,3 +202,36 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const base = {
|
||||||
|
name: 'benjamin.base',
|
||||||
|
hide: true,
|
||||||
|
measurements: [
|
||||||
|
'neck',
|
||||||
|
],
|
||||||
|
options: {
|
||||||
|
// Static options
|
||||||
|
transitionLength: 2, //Twice the knot
|
||||||
|
bandLength: 0.17,
|
||||||
|
adjustmentRibbonWidth: 20,
|
||||||
|
// Fit options
|
||||||
|
collarEase: { pct: 3, min: 0, max: 6, menu: 'fit' },
|
||||||
|
adjustmentRibbon: { bool: false, menu: 'fit' },
|
||||||
|
// Style options
|
||||||
|
tipWidth: { pct: 15, min: 0, max: 20, menu: 'style' },
|
||||||
|
knotWidth: { pct: 7, min: 5, max: 10, menu: 'style' },
|
||||||
|
bowLength: { pct: 28, min: 23, max: 33, menu: 'style' },
|
||||||
|
bowStyle: { dflt: 'butterfly',
|
||||||
|
list: ['diamond', 'butterfly', 'square', 'widesquare'],
|
||||||
|
menu: 'style'
|
||||||
|
},
|
||||||
|
endStyle: {
|
||||||
|
dflt: 'straight',
|
||||||
|
list: ['straight', 'pointed', 'rounded'],
|
||||||
|
menu: 'style'
|
||||||
|
},
|
||||||
|
ribbonWidth: { pct: 6, min: 5, max: 8, menu: 'style' },
|
||||||
|
},
|
||||||
|
plugins: [ pluginBundle ],
|
||||||
|
draft: draftBenjaminBase,
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
export default function (part) {
|
import { base } from './base.mjs'
|
||||||
|
|
||||||
|
function draftBenjaminBow1 (part) {
|
||||||
let { Point, points, Path, paths, complete, macro, sa, store, paperless } = part.shorthand()
|
let { Point, points, Path, paths, complete, macro, sa, store, paperless } = part.shorthand()
|
||||||
|
|
||||||
points.bandBottomLeft = points.bandBottomLeft.shift(0, 0)
|
points.bandBottomLeft = points.bandBottomLeft.shift(0, 0)
|
||||||
|
@ -44,3 +46,9 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const bow1 = {
|
||||||
|
name: 'benjamin.bow1',
|
||||||
|
from: base,
|
||||||
|
draft: draftBenjaminBow1,
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
export default function (part) {
|
import { base } from './base.mjs'
|
||||||
|
|
||||||
|
function draftBenjaminBow2 (part) {
|
||||||
let { options, Point, points, Path, paths, complete, macro, sa, store, paperless } =
|
let { options, Point, points, Path, paths, complete, macro, sa, store, paperless } =
|
||||||
part.shorthand()
|
part.shorthand()
|
||||||
|
|
||||||
|
@ -48,3 +50,9 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const bow2 = {
|
||||||
|
name: 'benjamin.bow2',
|
||||||
|
from: base,
|
||||||
|
draft: draftBenjaminBow2,
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
export default function (part) {
|
import { base } from './base.mjs'
|
||||||
|
|
||||||
|
function draftBenjaminBow3 (part) {
|
||||||
let { options, Point, points, Path, paths, complete, macro, sa, store, paperless } =
|
let { options, Point, points, Path, paths, complete, macro, sa, store, paperless } =
|
||||||
part.shorthand()
|
part.shorthand()
|
||||||
|
|
||||||
|
@ -48,3 +50,9 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const bow3 = {
|
||||||
|
name: 'benjamin.bow3',
|
||||||
|
from: base,
|
||||||
|
draft: draftBenjaminBow3,
|
||||||
|
}
|
||||||
|
|
|
@ -1,25 +1,16 @@
|
||||||
import freesewing from '@freesewing/core'
|
import { Design } from '@freesewing/core'
|
||||||
import plugins from '@freesewing/plugin-bundle'
|
import { data } from '../data.mjs'
|
||||||
import config from '../config'
|
import { bow1 } from './bow1.mjs'
|
||||||
// Parts
|
import { bow2 } from './bow2.mjs'
|
||||||
import draftBase from './base'
|
import { bow3 } from './bow3.mjs'
|
||||||
import draftBow1 from './bow1'
|
import { ribbon } from './ribbon.mjs'
|
||||||
import draftBow2 from './bow2'
|
|
||||||
import draftBow3 from './bow3'
|
|
||||||
import draftRibbon from './ribbon'
|
|
||||||
|
|
||||||
// Create new design
|
// Setup our new design
|
||||||
const Benjamin = new freesewing.Design(config, plugins)
|
const Benjamin = new Design({
|
||||||
|
data,
|
||||||
// Attach draft methods to prototype
|
parts: [ bow1, bow2, bow3, ribbon ],
|
||||||
Benjamin.prototype.draftBase = draftBase
|
})
|
||||||
Benjamin.prototype.draftBow1 = draftBow1
|
|
||||||
Benjamin.prototype.draftBow2 = draftBow2
|
|
||||||
Benjamin.prototype.draftBow3 = draftBow3
|
|
||||||
Benjamin.prototype.draftRibbon = draftRibbon
|
|
||||||
|
|
||||||
// Named exports
|
// Named exports
|
||||||
export { config, Benjamin }
|
export { bow1, bow2, bow3, ribbon, Benjamin }
|
||||||
|
|
||||||
// Default export
|
|
||||||
export default Benjamin
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function (part) {
|
function draftBenjaminRibbon (part) {
|
||||||
let { Point, Path, measurements, store, options, complete, macro, points, paths, sa, paperless } =
|
let { Point, Path, measurements, store, options, complete, macro, points, paths, sa, paperless } =
|
||||||
part.shorthand()
|
part.shorthand()
|
||||||
|
|
||||||
|
@ -52,3 +52,8 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ribbon = {
|
||||||
|
name: 'benjamin.ribbon',
|
||||||
|
draft: draftBenjaminRibbon,
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue