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
export default function complete(m) {
// Added by plugin-bust:
m.bust = m.chestCircumference
m.bust = m.chest
// Added by plugin-measurements:
m.backCrossSeam = m.crossSeam - m.frontCrossSeam
m.backSeatArc = m.backSeat / 2
m.backWaistArc = m.backWaist / 2
m.crossSeamBack = m.crossSeam - m.crossSeamFront
m.seatBackArc = m.seatBack / 2
m.waistBackArc = m.waistBack / 2
if (m.bust && m.bustFront) m.bustBack = m.bust - m.bustFront
m.frontSeat = m.seatCircumference - m.backSeat
m.frontSeatArc = m.frontSeat / 2
m.frontWaist = m.waistCircumference - m.backWaist
m.frontWaistArc = m.frontWaist / 2
m.seatFront = m.seat - m.seatBack
m.seatFrontArc = m.seatFront / 2
m.waistFront = m.waist - m.waistBack
m.waistFrontArc = m.waistFront / 2
if (m.hightBust && m.highBustFront) m.highBustBack = m.highBust - m.highBustFront
return m

View file

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

View file

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

View file

@ -2,46 +2,46 @@ import complete from './complete'
/*
* 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.
* 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.
*/
export default complete({
ankleCircumference: 245,
backSeat: 520,
backWaist: 380,
bicepsCircumference: 270,
ankle: 245,
biceps: 270,
bustFront: 480,
bustSpan: 160,
chestCircumference: 925,
chest: 925,
crossSeam: 740,
crossSeamFront: 370,
crotchDepth: 270,
frontCrossSeam: 370,
headCircumference: 565,
head: 565,
highBust: 865,
highBustFront: 440,
hipsCircumference: 900,
hips: 900,
hpsToBust: 275,
hpsToWaistBack: 395,
hpsToWaistFront: 400,
inseam: 765,
kneeCircumference: 380,
neckCircumference: 340,
seatCircumference: 1010,
knee: 380,
neck: 340,
seat: 1010,
seatBack: 520,
shoulderSlope: 13,
shoulderToElbow: 340,
shoulderToShoulder: 415,
shoulderToWrist: 590,
underbust: 780,
upperLegCircumference: 570,
waistCircumference: 750,
upperLeg: 570,
waist: 750,
waistBack: 380,
waistToFloor: 1050,
waistToHips: 125,
waistToKnee: 600,
waistToSeat: 250,
waistToUnderbust: 80,
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.
* We simply extrapolate for other sizes (based on neckCircumference)
* We simply extrapolate for other sizes (based on neck)
* by keeping the same proportions.
* 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.
*/
export default complete({
ankleCircumference: 235,
backSeat: 560,
backWaist: 410,
bicepsCircumference: 350,
chestCircumference: 1000,
ankle: 235,
biceps: 350,
chest: 1000,
crossSeam: 870,
crossSeamFront: 410,
crotchDepth: 340,
frontCrossSeam: 410,
headCircumference: 590,
hipsCircumference: 840,
head: 590,
hips: 840,
hpsToBust: 280,
hpsToWaistBack: 470,
inseam: 780,
kneeCircumference: 410,
neckCircumference: 380,
seatCircumference: 1020,
knee: 410,
neck: 380,
seat: 1020,
seatBack: 560,
shoulderSlope: 13,
shoulderToElbow: 360,
shoulderToShoulder: 450,
shoulderToWrist: 630,
upperLegCircumference: 625,
waistCircumference: 810,
upperLeg: 625,
waist: 810,
waistBack: 410,
waistToFloor: 1160,
waistToHips: 130,
waistToKnee: 640,
waistToSeat: 270,
waistToUpperLeg: 340,
wristCircumference: 175
wrist: 175
})