1
0
Fork 0

chore(utils): Updated measurement names

This commit is contained in:
Joost De Cock 2020-06-30 17:05:53 +02:00
parent 37bad3e849
commit b8db39cf15
5 changed files with 45 additions and 46 deletions

View file

@ -2,17 +2,17 @@
// we can calculate based on what we already have // we can calculate based on what we already have
export default function complete(m) { export default function complete(m) {
// Added by plugin-bust: // Added by plugin-bust:
m.bust = m.chestCircumference m.bust = m.chest
// Added by plugin-measurements: // Added by plugin-measurements:
m.backCrossSeam = m.crossSeam - m.frontCrossSeam m.crossSeamBack = m.crossSeam - m.crossSeamFront
m.backSeatArc = m.backSeat / 2 m.seatBackArc = m.seatBack / 2
m.backWaistArc = m.backWaist / 2 m.waistBackArc = m.waistBack / 2
if (m.bust && m.bustFront) m.bustBack = m.bust - m.bustFront if (m.bust && m.bustFront) m.bustBack = m.bust - m.bustFront
m.frontSeat = m.seatCircumference - m.backSeat m.seatFront = m.seat - m.seatBack
m.frontSeatArc = m.frontSeat / 2 m.seatFrontArc = m.seatFront / 2
m.frontWaist = m.waistCircumference - m.backWaist m.waistFront = m.waist - m.waistBack
m.frontWaistArc = m.frontWaist / 2 m.waistFrontArc = m.waistFront / 2
if (m.hightBust && m.highBustFront) m.highBustBack = m.highBust - m.highBustFront if (m.hightBust && m.highBustFront) m.highBustBack = m.highBust - m.highBustFront
return m return m

View file

@ -2,15 +2,14 @@ import withBreasts from './with-breasts'
import withoutBreasts from './without-breasts' import withoutBreasts from './without-breasts'
import ratio from './ratio' import ratio from './ratio'
// This estimates a measurement based on the neck circumference // This estimates a measurement based on the neck
const neckstimate = (neckCircumference = false, measurement = false, breasts = false) => { const neckstimate = (neck = false, measurement = false, breasts = false) => {
let data = breasts ? withBreasts : withoutBreasts let data = breasts ? withBreasts : withoutBreasts
// Shoulder slope is in degrees now. Always return de default. // Shoulder slope is in degrees now. Always return de default.
if (measurement === 'shoulderSlope') return withBreasts.shoulderSlope if (measurement === 'shoulderSlope') return withBreasts.shoulderSlope
if (!neckCircumference) if (!neck) throw new Error('neckstimate() requires a neck measurement in mm as first parameter')
throw new Error('neckstimate() requires a neck circumference in mm as first parameter')
if (!measurement) { if (!measurement) {
// No measurement passed // No measurement passed
throw new Error( throw new Error(
@ -36,7 +35,7 @@ const neckstimate = (neckCircumference = false, measurement = false, breasts = f
} }
// This is what should happen // This is what should happen
let delta = (neckCircumference / data.neckCircumference) * data[measurement] - data[measurement] let delta = (neck / data.neck) * data[measurement] - data[measurement]
return Math.round(data[measurement] + delta * ratio[measurement]) return Math.round(data[measurement] + delta * ratio[measurement])
} }

View file

@ -31,10 +31,10 @@ export default {
waistToUnderbust: v, waistToUnderbust: v,
waistToUpperLeg: v, waistToUpperLeg: v,
// Other // Other
backSeat: 0.6, seatBack: 0.6,
backWaist: 0.85, waistBack: 0.85,
crossSeam: 0.6, crossSeam: 0.6,
frontCrossSeam: 0.3, crossSeamFront: 0.3,
head: 0.35, head: 0.35,
inseam: 0.25, inseam: 0.25,
knee: 0.65, knee: 0.65,

View file

@ -2,46 +2,46 @@ import complete from './complete'
/* /*
* These are a set of measurements of an average-sized woman. * These are a set of measurements of an average-sized woman.
* We simply extrapolate for other sizes (based on neckCircumference) * We simply extrapolate for other sizes (based on neck)
* by keeping the same proportions. * by keeping the same proportions.
* That is almost certainly not the best sizing table you can get, * That is almost certainly not the best sizing table you can get,
* but we are not in the business of standard sizes, so this will do. * but we are not in the business of standard sizes, so this will do.
*/ */
export default complete({ export default complete({
ankleCircumference: 245, ankle: 245,
backSeat: 520, biceps: 270,
backWaist: 380,
bicepsCircumference: 270,
bustFront: 480, bustFront: 480,
bustSpan: 160, bustSpan: 160,
chestCircumference: 925, chest: 925,
crossSeam: 740, crossSeam: 740,
crossSeamFront: 370,
crotchDepth: 270, crotchDepth: 270,
frontCrossSeam: 370, head: 565,
headCircumference: 565,
highBust: 865, highBust: 865,
highBustFront: 440, highBustFront: 440,
hipsCircumference: 900, hips: 900,
hpsToBust: 275, hpsToBust: 275,
hpsToWaistBack: 395, hpsToWaistBack: 395,
hpsToWaistFront: 400, hpsToWaistFront: 400,
inseam: 765, inseam: 765,
kneeCircumference: 380, knee: 380,
neckCircumference: 340, neck: 340,
seatCircumference: 1010, seat: 1010,
seatBack: 520,
shoulderSlope: 13, shoulderSlope: 13,
shoulderToElbow: 340, shoulderToElbow: 340,
shoulderToShoulder: 415, shoulderToShoulder: 415,
shoulderToWrist: 590, shoulderToWrist: 590,
underbust: 780, underbust: 780,
upperLegCircumference: 570, upperLeg: 570,
waistCircumference: 750, waist: 750,
waistBack: 380,
waistToFloor: 1050, waistToFloor: 1050,
waistToHips: 125, waistToHips: 125,
waistToKnee: 600, waistToKnee: 600,
waistToSeat: 250, waistToSeat: 250,
waistToUnderbust: 80, waistToUnderbust: 80,
waistToUpperLeg: 285, waistToUpperLeg: 285,
wristCircumference: 165 wrist: 165
}) })

View file

@ -2,38 +2,38 @@ import complete from './complete'
/* /*
* These are a set of measurements of an average-sized man. * These are a set of measurements of an average-sized man.
* We simply extrapolate for other sizes (based on neckCircumference) * We simply extrapolate for other sizes (based on neck)
* by keeping the same proportions. * by keeping the same proportions.
* That is almost certainly not the best sizing table you can get, * That is almost certainly not the best sizing table you can get,
* but we are not in the business of standard sizes, so this will do. * but we are not in the business of standard sizes, so this will do.
*/ */
export default complete({ export default complete({
ankleCircumference: 235, ankle: 235,
backSeat: 560, biceps: 350,
backWaist: 410, chest: 1000,
bicepsCircumference: 350,
chestCircumference: 1000,
crossSeam: 870, crossSeam: 870,
crossSeamFront: 410,
crotchDepth: 340, crotchDepth: 340,
frontCrossSeam: 410, head: 590,
headCircumference: 590, hips: 840,
hipsCircumference: 840,
hpsToBust: 280, hpsToBust: 280,
hpsToWaistBack: 470, hpsToWaistBack: 470,
inseam: 780, inseam: 780,
kneeCircumference: 410, knee: 410,
neckCircumference: 380, neck: 380,
seatCircumference: 1020, seat: 1020,
seatBack: 560,
shoulderSlope: 13, shoulderSlope: 13,
shoulderToElbow: 360, shoulderToElbow: 360,
shoulderToShoulder: 450, shoulderToShoulder: 450,
shoulderToWrist: 630, shoulderToWrist: 630,
upperLegCircumference: 625, upperLeg: 625,
waistCircumference: 810, waist: 810,
waistBack: 410,
waistToFloor: 1160, waistToFloor: 1160,
waistToHips: 130, waistToHips: 130,
waistToKnee: 640, waistToKnee: 640,
waistToSeat: 270, waistToSeat: 270,
waistToUpperLeg: 340, waistToUpperLeg: 340,
wristCircumference: 175 wrist: 175
}) })