1
0
Fork 0

chore(shin): Ported shin to new measurements. See #416

This commit is contained in:
Joost De Cock 2020-06-07 14:00:09 +02:00
parent 4104b03fc2
commit 6170b8cf40
3 changed files with 38 additions and 33 deletions

View file

@ -1,24 +1,20 @@
import { version } from "../package.json"; import { version } from '../package.json'
export default { export default {
name: "shin", name: 'shin',
version: version, version: version,
design: "Joost De Cock", design: 'Joost De Cock',
code: "Joost De Cock", code: 'Joost De Cock',
department: "menswear", department: 'menswear',
type: "pattern", type: 'pattern',
difficulty: 2, difficulty: 2,
tags: ["swimwear", "bottom"], tags: ['swimwear', 'bottom'],
optionGroups: { optionGroups: {
fit: ["bulge", "backRise", "legReduction", "stretch"], fit: ['bulge', 'backRise', 'legReduction', 'stretch'],
style: ["lengthBonus", "rise"] style: ['lengthBonus', 'rise']
}, },
measurements: [ measurements: ['hipsCircumference', 'upperLegCircumference', 'waistToUpperLeg', 'waistToHips'],
"hipsCircumference", parts: ['back', 'front', 'waistband'],
"upperLegCircumference",
"hipsToUpperLeg"
],
parts: ["back", "front", "waistband"],
options: { options: {
// Constants // Constants
frontFactor: 0.58, frontFactor: 0.58,
@ -37,4 +33,4 @@ export default {
rise: { pct: 0, min: 0, max: 25 }, rise: { pct: 0, min: 0, max: 25 },
backRise: { pct: 5, min: 0, max: 10 } backRise: { pct: 5, min: 0, max: 10 }
} }
}; }

View file

@ -1,4 +1,4 @@
export default function(part) { export default function (part) {
let { let {
store, store,
macro, macro,
@ -27,17 +27,20 @@ export default function(part) {
points.hipSide = new Point(0, 0) points.hipSide = new Point(0, 0)
points.hipCb = new Point(store.get('hipBack'), 0) points.hipCb = new Point(store.get('hipBack'), 0)
points.legSide = points.hipSide.shift(-90 - options.angle, measurements.hipsToUpperLeg) points.legSide = points.hipSide.shift(
-90 - options.angle,
measurements.waistToUpperLeg - measurements.waistToHips
)
points.legSideCp = points.legSide.shift(options.angle * -1 + 7, store.get('legBack')) points.legSideCp = points.legSide.shift(options.angle * -1 + 7, store.get('legBack'))
points.legInner = points.legSideCp.shift(options.angle * -1 - 90, store.get('gusset') / 2) points.legInner = points.legSideCp.shift(options.angle * -1 - 90, store.get('gusset') / 2)
points.legSideCp = points.legSideCp.shiftFractionTowards(points.legSide, 0.5) points.legSideCp = points.legSideCp.shiftFractionTowards(points.legSide, 0.5)
let tmp = new Path() let tmp = new Path().move(points.legInner)._curve(points.legSideCp, points.legSide).shiftAlong(2)
.move(points.legInner)
._curve(points.legSideCp, points.legSide)
.shiftAlong(2)
let gussetAngle = points.legInner.angle(tmp) let gussetAngle = points.legInner.angle(tmp)
points.crossSeam = points.legInner.shift(gussetAngle - 90, store.get('gusset')) points.crossSeam = points.legInner.shift(gussetAngle - 90, store.get('gusset'))
points.seatCb = points.hipCb.shift(-86, measurements.hipsToUpperLeg * 0.62) points.seatCb = points.hipCb.shift(
-86,
(measurements.waistToUpperLeg - measurements.waistToHips) * 0.62
)
tmp = utils.beamsIntersect( tmp = utils.beamsIntersect(
points.crossSeam, points.crossSeam,
points.crossSeam.shift(gussetAngle, 20), points.crossSeam.shift(gussetAngle, 20),
@ -60,7 +63,7 @@ export default function(part) {
// Lengthen the legs // Lengthen the legs
if (options.legBonus > 0) { if (options.legBonus > 0) {
let bonus = measurements.hipsToUpperLeg * options.legBonus let bonus = (measurements.waistToUpperLeg - measurements.waistToHips) * options.legBonus
points.legSide = points.legSide.shift(-90, bonus) points.legSide = points.legSide.shift(-90, bonus)
points.legSideCp = points.legSideCp.shift(-90, bonus) points.legSideCp = points.legSideCp.shift(-90, bonus)
points.reducedLegInner = points.reducedLegInner.shift(-90, bonus) points.reducedLegInner = points.reducedLegInner.shift(-90, bonus)
@ -68,14 +71,14 @@ export default function(part) {
// Rise // Rise
if (options.rise > 0) { if (options.rise > 0) {
let rise = measurements.hipsToUpperLeg * options.rise let rise = (measurements.waistToUpperLeg - measurements.waistToHips) * options.rise
points.hipSide = points.hipSide.shift(90, rise) points.hipSide = points.hipSide.shift(90, rise)
points.hipCb = points.hipCb.shift(90, rise) points.hipCb = points.hipCb.shift(90, rise)
} }
// Back rise // Back rise
if (options.backRise > 0) { if (options.backRise > 0) {
let backRise = measurements.hipsToUpperLeg * options.backRise let backRise = (measurements.waistToUpperLeg - measurements.waistToHips) * options.backRise
points.hipCb = points.hipCb.shift(90, backRise) points.hipCb = points.hipCb.shift(90, backRise)
points.hipSide = points.hipSide.shift(90, backRise) points.hipSide = points.hipSide.shift(90, backRise)
points.hipCbCp = new Point(points.hipCb.x / 2, points.hipCb.y) points.hipCbCp = new Point(points.hipCb.x / 2, points.hipCb.y)

View file

@ -1,4 +1,4 @@
export default function(part) { export default function (part) {
let { let {
store, store,
macro, macro,
@ -17,15 +17,21 @@ export default function(part) {
} = part.shorthand() } = part.shorthand()
let angle = -12 let angle = -12
let bulge = measurements.hipsToUpperLeg * options.bulge let bulge = (measurements.waistToUpperLeg - measurements.waistToHips) * options.bulge
points.hipSide = new Point(0, 0) points.hipSide = new Point(0, 0)
points.hipCb = new Point(store.get('hipFront'), 0) points.hipCb = new Point(store.get('hipFront'), 0)
points.legSide = points.hipSide.shift(-90 - angle, measurements.hipsToUpperLeg) points.legSide = points.hipSide.shift(
-90 - angle,
measurements.waistToUpperLeg - measurements.waistToHips
)
points.legSideCp = points.legSide.shift(0, store.get('legFront')) points.legSideCp = points.legSide.shift(0, store.get('legFront'))
points.legInner = points.legSideCp.shift(-100, store.get('gusset') / 2) points.legInner = points.legSideCp.shift(-100, store.get('gusset') / 2)
points.crossSeam = points.legSideCp.shift(80, store.get('gusset') / 2) points.crossSeam = points.legSideCp.shift(80, store.get('gusset') / 2)
points.legSideCp = points.legSide.shiftFractionTowards(points.legSideCp, 0.4) points.legSideCp = points.legSide.shiftFractionTowards(points.legSideCp, 0.4)
points.seatCb = points.hipCb.shift(-90 - angle - 5, measurements.hipsToUpperLeg * 0.67) points.seatCb = points.hipCb.shift(
-90 - angle - 5,
(measurements.waistToUpperLeg - measurements.waistToHips) * 0.67
)
points._tmp2 = points.crossSeam.shift(angle, 20) points._tmp2 = points.crossSeam.shift(angle, 20)
points._tmp3 = utils.beamsIntersect(points.crossSeam, points._tmp2, points.hipCb, points.seatCb) points._tmp3 = utils.beamsIntersect(points.crossSeam, points._tmp2, points.hipCb, points.seatCb)
points.seatCp = points.seatCb.shiftFractionTowards(points._tmp3, 0.7) points.seatCp = points.seatCb.shiftFractionTowards(points._tmp3, 0.7)
@ -58,7 +64,7 @@ export default function(part) {
// Lengthen legs // Lengthen legs
if (options.legBonus > 0) { if (options.legBonus > 0) {
let shift = measurements.hipsToUpperLeg * options.legBonus let shift = (measurements.waistToUpperLeg - measurements.waistToHips) * options.legBonus
points.legSide = points.legSide.shift(-90, shift) points.legSide = points.legSide.shift(-90, shift)
points.legSideCp = points.legSideCp.shift(-90, shift) points.legSideCp = points.legSideCp.shift(-90, shift)
points.reducedLegInner = points.reducedLegInner(-90, shift) points.reducedLegInner = points.reducedLegInner(-90, shift)
@ -66,14 +72,14 @@ export default function(part) {
// Rise // Rise
if (options.rise > 0) { if (options.rise > 0) {
let shift = measurements.hipsToUpperLeg * options.rise let shift = (measurements.waistToUpperLeg - measurements.waistToHips) * options.rise
points.hipSide = points.hipSide.shift(90, shift) points.hipSide = points.hipSide.shift(90, shift)
points.hipCb = points.hipCb.shift(0, shift) points.hipCb = points.hipCb.shift(0, shift)
} }
// Back rise // Back rise
if (options.backRise > 0) { if (options.backRise > 0) {
let shift = measurements.hipsToUpperLeg * options.backRise let shift = (measurements.waistToUpperLeg - measurements.waistToHips) * options.backRise
points.hipSide = points.hipSide.shift(90, shift / 2) points.hipSide = points.hipSide.shift(90, shift / 2)
points.hipCbCp = new Point(points.hipCb.x / 2, points.hipCb.y) points.hipCbCp = new Point(points.hipCb.x / 2, points.hipCb.y)
} }