1
0
Fork 0

feat(wahid): Add support for high-bust draft. See #2386

This commit is contained in:
Joost De Cock 2022-07-09 17:57:07 +02:00
parent f7fbf8b446
commit ed5639cd04
3 changed files with 21 additions and 5 deletions

View file

@ -258,7 +258,7 @@ utils:
wahid: wahid:
peer: peer:
'@freesewing/brian': *freesewing '@freesewing/brian': *freesewing
'@freesewing/plugin-round': *freesewing '@freesewing/plugin-bust': *freesewing
yuri: yuri:
peer: peer:
'@freesewing/brian': *freesewing '@freesewing/brian': *freesewing

View file

@ -18,6 +18,7 @@ export default {
'backScyeDart', 'backScyeDart',
'frontScyeDart', 'frontScyeDart',
'centerBackDart', 'centerBackDart',
'draftForHighBust',
], ],
style: [ style: [
'pocketLocation', 'pocketLocation',
@ -42,6 +43,7 @@ export default {
'shoulderToShoulder', 'shoulderToShoulder',
'waist', 'waist',
], ],
optionalMeasurements: [ 'highBust' ],
dependencies: { dependencies: {
backBlock: 'base', backBlock: 'base',
frontBlock: 'backBlock', frontBlock: 'backBlock',
@ -106,5 +108,8 @@ export default {
shoulderInset: { pct: 10, min: 0, max: 20 }, shoulderInset: { pct: 10, min: 0, max: 20 },
neckInset: { pct: 5, min: 0, max: 10 }, neckInset: { pct: 5, min: 0, max: 10 },
pocketAngle: { deg: 5, min: 0, max: 5 }, pocketAngle: { deg: 5, min: 0, max: 5 },
// draft for high bust
draftForHighBust: { bool: false },
}, },
} }

View file

@ -1,8 +1,7 @@
import freesewing from '@freesewing/core' import freesewing from '@freesewing/core'
import Brian from '@freesewing/brian' import Brian from '@freesewing/brian'
import plugins from '@freesewing/plugin-bundle' import plugins from '@freesewing/plugin-bundle'
import round from '@freesewing/plugin-round' import plugin from '@freesewing/plugin-bust' // Note: conditional plugin
import buttons from '@freesewing/plugin-buttons'
import config from '../config' import config from '../config'
// Parts // Parts
import draftFront from './front' import draftFront from './front'
@ -27,8 +26,20 @@ const wristPlugin = {
}, },
} }
// Create pattern /* Check to see whether we should load the bust plugin
const Wahid = new freesewing.Design(config, [plugins, round, buttons, wristPlugin]) * Only of the `draftForHighBust` options is set
* AND the highBust measurement is available
*/
const condition = (settings = false) =>
settings &&
settings.options &&
settings.options.draftForHighBust &&
settings.measurements.highBust
? true
: false
// Create design
const Wahid = new freesewing.Design(config, [plugins, wristPlugin], { plugin, condition })
// Parts we're getting from Brian // Parts we're getting from Brian
Wahid.prototype.draftBase = function (part) { Wahid.prototype.draftBase = function (part) {