1
0
Fork 0

refactor(hugo): Removed deprecated measurements from Hugo

This commit is contained in:
Joost De Cock 2020-02-01 16:10:00 +01:00
parent 161b6c1c79
commit 8d4c97204a
4 changed files with 48 additions and 60 deletions

View file

@ -1,57 +1,57 @@
import { version } from "../package.json";
import { version } from '../package.json'
export default {
name: "hugo",
name: 'hugo',
version,
design: "Joost De Cock",
code: "Joost De Cock",
department: "menswear",
type: "pattern",
design: 'Joost De Cock',
code: 'Joost De Cock',
department: 'menswear',
type: 'pattern',
difficulty: 3,
tags: ["top", "basics"],
tags: ['top', 'basics'],
optionGroups: {
fit: ["bicepsEase", "chestEase", "cuffEase", "ribbingStretch"],
style: ["lengthBonus", "sleeveLengthBonus", "ribbingHeight"],
advanced: ["acrossBackFactor", "backNeckCutout"]
fit: ['bicepsEase', 'chestEase', 'cuffEase', 'ribbingStretch'],
style: ['lengthBonus', 'sleeveLengthBonus', 'ribbingHeight'],
advanced: ['acrossBackFactor', 'backNeckCutout']
},
measurements: [
"bicepsCircumference",
"centerBackNeckToWaist",
"chestCircumference",
"naturalWaistToHip",
"neckCircumference",
"shoulderSlope",
"shoulderToShoulder",
"hipsCircumference",
"shoulderToWrist",
"wristCircumference",
"headCircumference"
'bicepsCircumference',
'chestCircumference',
'headCircumference',
'hipsCircumference',
'hpsToHipsBack',
'naturalWaistToHip',
'neckCircumference',
'shoulderSlope',
'shoulderToShoulder',
'shoulderToWrist',
'wristCircumference'
],
parts: ["waistband", "cuff"],
parts: ['waistband', 'cuff'],
dependencies: {
frontBase: "base",
front: "frontBase",
backBase: "base",
back: "backBase",
sleevecap: "front",
sleeveBase: "sleevecap",
sleeve: "sleeveBase",
pocket: "front",
pocketFacing: "pocket",
hoodCenter: "hoodSide",
hoodSide: ["front", "back"]
frontBase: 'base',
front: 'frontBase',
backBase: 'base',
back: 'backBase',
sleevecap: 'front',
sleeveBase: 'sleevecap',
sleeve: 'sleeveBase',
pocket: 'front',
pocketFacing: 'pocket',
hoodCenter: 'hoodSide',
hoodSide: ['front', 'back']
},
inject: {
frontBase: "base",
front: "frontBase",
backBase: "base",
back: "backBase",
sleeveBase: "sleevecap",
sleeve: "sleeveBase",
pocket: "front",
pocketFacing: "pocket"
frontBase: 'base',
front: 'frontBase',
backBase: 'base',
back: 'backBase',
sleeveBase: 'sleevecap',
sleeve: 'sleeveBase',
pocket: 'front',
pocketFacing: 'pocket'
},
hide: ["base", "frontBase", "backBase", "sleeveBase", "sleevecap"],
hide: ['base', 'frontBase', 'backBase', 'sleeveBase', 'sleevecap'],
options: {
// Constants
brianFitSleeve: false,
@ -93,4 +93,4 @@ export default {
ribbingStretch: { pct: 5, min: 0, max: 10 },
ribbingHeight: { pct: 10, min: 4, max: 20 }
}
};
}

View file

@ -12,10 +12,7 @@ export default function(part) {
macro
} = part.shorthand()
let width =
(measurements.centerBackNeckToWaist + measurements.naturalWaistToHip) *
options.ribbingHeight *
2
let width = measurements.hpsToHipsBack * options.ribbingHeight * 2
let length =
measurements.wristCircumference * (1 + options.cuffEase) * (1 - options.ribbingStretch)

View file

@ -23,14 +23,8 @@ export default function(part) {
} = part.shorthand()
// Absolute values for percentages
store.set(
'lengthBonus',
options.lengthBonus * (measurements.centerBackNeckToWaist + measurements.naturalWaistToHip)
)
store.set(
'ribbing',
(measurements.centerBackNeckToWaist + measurements.naturalWaistToHip) * options.ribbingHeight
)
store.set('lengthBonus', options.lengthBonus * measurements.hpsToHipsBack)
store.set('ribbing', measurements.hpsToHipsBack * options.ribbingHeight)
// Hem is more descripting than hips in this case
//points.cfHem = points.cfHips;
@ -49,7 +43,7 @@ export default function(part) {
points.pocketHem = points.cfRibbing.shiftFractionTowards(points.ribbing, 0.6)
points.pocketCf = points.cfHem.shift(
90,
measurements.centerBackNeckToWaist * 0.33 + store.get('ribbing')
(measurements.hpsToHipsBack - measurements.naturalWaistToHip) * 0.33 + store.get('ribbing')
)
points.pocketTop = new Point(points.pocketHem.x, points.pocketCf.y)
points.pocketTip = points.pocketHem

View file

@ -13,10 +13,7 @@ export default function(part) {
units
} = part.shorthand()
let width =
(measurements.centerBackNeckToWaist + measurements.naturalWaistToHip) *
options.ribbingHeight *
2
let width = measurements.hpsToHipsBack * options.ribbingHeight * 2
points.topLeft = new Point(0, 0)
points.bottomLeft = new Point(0, width)