1
0
Fork 0
freesewing/packages/jaeger/src/backbase.js

79 lines
2.6 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { calculateRatios, backSideBoundary } from './shared'
2019-03-16 11:39:06 +01:00
export default function (part) {
2019-08-03 15:03:33 +02:00
calculateRatios(part)
let { store, points, measurements, options, Point, paths, Path } = part.shorthand()
2019-03-16 11:39:06 +01:00
/**
* Shaping the back seam
*/
2019-08-03 15:03:33 +02:00
points.cbChest = new Point(0, points.armholePitchCp1.y)
2019-03-16 11:39:06 +01:00
if (options.centerBackDart > 0) {
2019-08-03 15:03:33 +02:00
points.cbChestCp1 = points.cbChest.shiftFractionTowards(points.cbNeck, 0.5)
points.cbNeck = points.cbNeck.shift(0, measurements.chest * options.centerBackDart)
2019-03-16 11:39:06 +01:00
}
2019-08-03 15:03:33 +02:00
points.cbChestCp2 = points.cbChest.shift(-90, points.cbChest.dy(points.cbWaist) / 3)
points.cbWaist = points.cbWaist.shift(
0,
store.get('waistReduction') * options.reduceWaistStandardFraction
)
points.cbWaistCp1 = points.cbWaist.shift(90, points.cbChest.dy(points.cbWaist) / 3)
points.cbHips = points.cbHips.shift(
0,
store.get('hipsReduction') * options.reduceHipsStandardFraction
)
points.cbHem = points.cbHem.shift(
0,
store.get('hipsReduction') * options.reduceHipsStandardFraction
)
points.cbWaistCp2 = points.cbWaist.shift(-90, points.cbWaist.dy(points.cbHips) / 3)
points.cbHipsCp1 = points.cbHips.shift(90, points.cbWaist.dy(points.cbHips) / 3)
2019-03-16 11:39:06 +01:00
/**
* Shaping the side seam
*/
2019-08-03 15:03:33 +02:00
backSideBoundary(part)
2019-03-16 11:39:06 +01:00
// Divide reduction by 4: two side panels x two sides per panel = 4
2019-08-03 15:03:33 +02:00
points.waist = points.bsWaist.shift(
180,
store.get('waistReduction') * options.reduceWaistStandardFraction
)
points.waistCp2 = points.waist.shift(90, points.cbChest.dy(points.waist) / 3)
points.hips = points.bsHips.shift(
180,
store.get('hipsReduction') * options.reduceHipsStandardFraction
)
points.waistCp1 = points.waist.shift(-90, points.waist.dy(points.hips) / 3)
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips) / 3)
points.hem = new Point(points.hips.x, points.hem.y)
2019-03-16 11:39:06 +01:00
// Store length of back collar
2019-08-03 15:03:33 +02:00
store.set(
'backCollarLength',
new Path().move(points.cbNeck)._curve(points.neckCp2, points.neck).length()
2019-08-03 15:03:33 +02:00
)
2019-03-16 11:39:06 +01:00
// Paths
2019-08-03 15:03:33 +02:00
paths.cb = new Path().move(points.cbNeck)
if (options.centerBackDart > 0) paths.cb._curve(points.cbChestCp1, points.cbChest)
else paths.cb.line(points.cbChest)
2019-03-16 11:39:06 +01:00
paths.cb
.curve(points.cbChestCp2, points.cbWaistCp1, points.cbWaist)
.curve(points.cbWaistCp2, points.cbHipsCp1, points.cbHips)
.line(points.cbHem)
2019-08-03 15:03:33 +02:00
.attr('class', 'stroke-xl lining')
2019-03-16 11:39:06 +01:00
paths.bss = new Path()
.move(points.armholeHollow)
.curve(points.bsArmholeHollowCp2, points.waistCp2, points.waist)
.curve(points.waistCp1, points.hipsCp2, points.hips)
.line(points.hem)
2019-08-03 15:03:33 +02:00
.attr('class', 'stroke-xl lining')
2019-03-16 11:39:06 +01:00
2019-08-03 15:03:33 +02:00
return part
2019-03-16 11:39:06 +01:00
}