chore: Changed neckstimate calculations and menswear base
This commit is contained in:
parent
396829b4ea
commit
44660ed9db
3 changed files with 66 additions and 26 deletions
|
@ -1,5 +1,6 @@
|
|||
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) => {
|
||||
|
@ -24,7 +25,9 @@ const neckstimate = (neckCircumference = false, measurement = false, breasts = f
|
|||
}
|
||||
|
||||
// This is what should happen
|
||||
return neckCircumference * (data[measurement] / data.neckCircumference)
|
||||
let delta = (neckCircumference / data.neckCircumference) * data[measurement] - data[measurement]
|
||||
|
||||
return data[measurement] + delta * ratio[measurement]
|
||||
}
|
||||
|
||||
export default neckstimate
|
||||
|
|
38
packages/utils/src/neckstimate/ratio.js
Normal file
38
packages/utils/src/neckstimate/ratio.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Since linear measurements don't scale the same as circumference
|
||||
* measurements, we apply a correction ratio.
|
||||
*/
|
||||
|
||||
export default {
|
||||
ankleCircumference: 1,
|
||||
bicepsCircumference: 1,
|
||||
bustFront: 0.5,
|
||||
bustSpan: 0.5,
|
||||
chestCircumference: 1,
|
||||
headCircumference: 1,
|
||||
highBust: 1,
|
||||
highBustFront: 0.5,
|
||||
hipsCircumference: 1,
|
||||
hipsToUpperLeg: 0.5,
|
||||
hpsToBust: 0.5,
|
||||
hpsToHipsBack: 0.5,
|
||||
hpsToHipsFront: 0.5,
|
||||
inseam: 0.5,
|
||||
kneeCircumference: 1,
|
||||
naturalWaist: 1,
|
||||
naturalWaistToFloor: 0.5,
|
||||
naturalWaistToHip: 0.5,
|
||||
naturalWaistToKnee: 0.5,
|
||||
naturalWaistToSeat: 0.5,
|
||||
naturalWaistToUnderbust: 0.5,
|
||||
neckCircumference: 1,
|
||||
seatCircumference: 1,
|
||||
seatDepth: 0.5,
|
||||
shoulderSlope: 0.5,
|
||||
shoulderToElbow: 0.5,
|
||||
shoulderToShoulder: 0.5,
|
||||
shoulderToWrist: 0.5,
|
||||
underbust: 1,
|
||||
upperLegCircumference: 1,
|
||||
wristCircumference: 1
|
||||
}
|
|
@ -1,34 +1,33 @@
|
|||
/*
|
||||
* These are a set of measurements of an average-sized woman.
|
||||
* These are a set of measurements of an average-sized man.
|
||||
* We simply extrapolate for other sizes (based on neckCircumference)
|
||||
* 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 {
|
||||
ankleCircumference: 256,
|
||||
bicepsCircumference: 325,
|
||||
chestCircumference: 1040,
|
||||
headCircumference: 579,
|
||||
hipsCircumference: 920,
|
||||
hipsToUpperLeg: 220,
|
||||
hpsToBust: 275,
|
||||
hpsToHipsBack: 690,
|
||||
hpsToHipsFront: 635,
|
||||
inseam: 859,
|
||||
ankleCircumference: 235,
|
||||
bicepsCircumference: 350,
|
||||
chestCircumference: 1000,
|
||||
headCircumference: 590,
|
||||
hipsCircumference: 840,
|
||||
hipsToUpperLeg: 210,
|
||||
hpsToBust: 28,
|
||||
hpsToHipsBack: 600,
|
||||
inseam: 780,
|
||||
kneeCircumference: 410,
|
||||
naturalWaist: 880,
|
||||
naturalWaistToFloor: 1300,
|
||||
naturalWaistToHip: 180,
|
||||
naturalWaistToKnee: 580,
|
||||
naturalWaistToSeat: 280,
|
||||
neckCircumference: 420,
|
||||
seatCircumference: 1060,
|
||||
seatDepth: 380,
|
||||
shoulderSlope: 690,
|
||||
shoulderToElbow: 345,
|
||||
shoulderToShoulder: 460,
|
||||
shoulderToWrist: 640,
|
||||
upperLegCircumference: 599,
|
||||
wristCircumference: 180
|
||||
naturalWaist: 810,
|
||||
naturalWaistToFloor: 1160,
|
||||
naturalWaistToHip: 130,
|
||||
naturalWaistToKnee: 640,
|
||||
naturalWaistToSeat: 270,
|
||||
neckCircumference: 380,
|
||||
seatCircumference: 1020,
|
||||
seatDepth: 210,
|
||||
shoulderSlope: 585,
|
||||
shoulderToElbow: 36,
|
||||
shoulderToShoulder: 450,
|
||||
shoulderToWrist: 630,
|
||||
upperLegCircumference: 625,
|
||||
wristCircumference: 175
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue