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 withBreasts from './with-breasts'
|
||||||
import withoutBreasts from './without-breasts'
|
import withoutBreasts from './without-breasts'
|
||||||
|
import ratio from './ratio'
|
||||||
|
|
||||||
// This estimates a measurement based on the neck circumference
|
// This estimates a measurement based on the neck circumference
|
||||||
const neckstimate = (neckCircumference = false, measurement = false, breasts = false) => {
|
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
|
// 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
|
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)
|
* We simply extrapolate for other sizes (based on neckCircumference)
|
||||||
* 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 {
|
export default {
|
||||||
ankleCircumference: 256,
|
ankleCircumference: 235,
|
||||||
bicepsCircumference: 325,
|
bicepsCircumference: 350,
|
||||||
chestCircumference: 1040,
|
chestCircumference: 1000,
|
||||||
headCircumference: 579,
|
headCircumference: 590,
|
||||||
hipsCircumference: 920,
|
hipsCircumference: 840,
|
||||||
hipsToUpperLeg: 220,
|
hipsToUpperLeg: 210,
|
||||||
hpsToBust: 275,
|
hpsToBust: 28,
|
||||||
hpsToHipsBack: 690,
|
hpsToHipsBack: 600,
|
||||||
hpsToHipsFront: 635,
|
inseam: 780,
|
||||||
inseam: 859,
|
|
||||||
kneeCircumference: 410,
|
kneeCircumference: 410,
|
||||||
naturalWaist: 880,
|
naturalWaist: 810,
|
||||||
naturalWaistToFloor: 1300,
|
naturalWaistToFloor: 1160,
|
||||||
naturalWaistToHip: 180,
|
naturalWaistToHip: 130,
|
||||||
naturalWaistToKnee: 580,
|
naturalWaistToKnee: 640,
|
||||||
naturalWaistToSeat: 280,
|
naturalWaistToSeat: 270,
|
||||||
neckCircumference: 420,
|
neckCircumference: 380,
|
||||||
seatCircumference: 1060,
|
seatCircumference: 1020,
|
||||||
seatDepth: 380,
|
seatDepth: 210,
|
||||||
shoulderSlope: 690,
|
shoulderSlope: 585,
|
||||||
shoulderToElbow: 345,
|
shoulderToElbow: 36,
|
||||||
shoulderToShoulder: 460,
|
shoulderToShoulder: 450,
|
||||||
shoulderToWrist: 640,
|
shoulderToWrist: 630,
|
||||||
upperLegCircumference: 599,
|
upperLegCircumference: 625,
|
||||||
wristCircumference: 180
|
wristCircumference: 175
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue