2022-09-05 18:47:21 +02:00
|
|
|
import { calculateRatios, backSideBoundary } from './shared.mjs'
|
|
|
|
import { back as bentBack } from '@freesewing/bent'
|
2023-03-08 12:12:13 -06:00
|
|
|
import { hidePresets } from '@freesewing/core'
|
2022-09-05 18:47:21 +02:00
|
|
|
import {
|
|
|
|
centerBackDart,
|
|
|
|
hipsEase,
|
|
|
|
waistEase,
|
|
|
|
rollLineCollarHeight,
|
|
|
|
reduceWaistStandardFraction,
|
|
|
|
reduceWaistDartFraction,
|
|
|
|
reduceHipsStandardFraction,
|
2022-09-28 21:58:39 +02:00
|
|
|
lengthBonus,
|
2022-09-05 18:47:21 +02:00
|
|
|
} from './options.mjs'
|
2019-03-16 11:39:06 +01:00
|
|
|
|
2022-09-11 15:48:48 +02:00
|
|
|
function jaegerBackBase({ store, points, measurements, options, Point, paths, Path, part }) {
|
2019-08-03 15:03:33 +02:00
|
|
|
calculateRatios(part)
|
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)
|
2020-06-28 13:08:33 +02:00
|
|
|
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',
|
2020-06-28 13:08:33 +02:00
|
|
|
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
|
|
|
}
|
2022-09-05 18:47:21 +02:00
|
|
|
|
|
|
|
export const backBase = {
|
|
|
|
name: 'jaeger.backBase',
|
|
|
|
measurements: ['hips', 'waist'],
|
|
|
|
from: bentBack,
|
2023-03-08 12:12:13 -06:00
|
|
|
hide: hidePresets.HIDE_ALL,
|
2022-09-05 18:47:21 +02:00
|
|
|
options: {
|
|
|
|
centerBackDart,
|
|
|
|
hipsEase,
|
|
|
|
waistEase,
|
|
|
|
rollLineCollarHeight,
|
|
|
|
reduceWaistStandardFraction,
|
|
|
|
reduceWaistDartFraction,
|
|
|
|
reduceHipsStandardFraction,
|
2022-09-28 21:58:39 +02:00
|
|
|
lengthBonus,
|
2022-09-05 18:47:21 +02:00
|
|
|
},
|
|
|
|
draft: jaegerBackBase,
|
|
|
|
}
|