2019-08-03 15:03:33 +02:00
|
|
|
import * as shared from './shared'
|
2018-07-24 10:16:31 +00:00
|
|
|
|
2020-04-18 16:09:04 +02:00
|
|
|
export default (part) => {
|
2019-05-10 13:14:31 +02:00
|
|
|
let {
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
complete,
|
|
|
|
paperless,
|
2021-04-24 10:16:31 +02:00
|
|
|
macro,
|
2021-06-12 14:05:28 +02:00
|
|
|
options,
|
|
|
|
Point,
|
|
|
|
utils
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2018-08-03 17:44:55 +02:00
|
|
|
|
2020-06-01 13:02:31 +02:00
|
|
|
points.anchor = points.hps.clone()
|
|
|
|
|
2021-06-12 14:05:28 +02:00
|
|
|
// Adapt the shoulder seam according to the relevant options
|
|
|
|
// Note: s3 stands for Shoulder Seam Shift
|
|
|
|
if (options.s3Collar === 0) {
|
|
|
|
points.s3CollarSplit = points.hps
|
|
|
|
paths.backCollar = new Path()
|
|
|
|
.move(points.hps)
|
|
|
|
.curve_(points.neckCp2, points.cbNeck)
|
|
|
|
.setRender(false)
|
|
|
|
}
|
|
|
|
else if (options.s3Collar > 0) {
|
|
|
|
// Shift shoulder seam forward on the collar side
|
|
|
|
points.s3CollarSplit = utils.curveIntersectsY(
|
|
|
|
points.hps,
|
|
|
|
points.mirroredNeckCp2Front,
|
|
|
|
points.mirroredCfNeckCp1,
|
|
|
|
points.mirroredCfNeck,
|
|
|
|
store.get('s3CollarMaxFront') * -1 * options.s3Collar
|
|
|
|
)
|
|
|
|
paths.backCollar = new Path()
|
|
|
|
.move(points.hps)
|
|
|
|
._curve(points.mirroredNeckCp2Front, points.mirroredCfNeckCp1, points.mirroredCfNeck)
|
|
|
|
.split(points.s3CollarSplit)[0]
|
|
|
|
.reverse()
|
|
|
|
.join(new Path()
|
|
|
|
.move(points.hps)
|
|
|
|
.curve_(points.neckCp2, points.cbNeck)
|
|
|
|
)
|
|
|
|
.setRender(false)
|
|
|
|
}
|
|
|
|
else if (options.s3Collar < 0) {
|
|
|
|
// Shift shoulder seam backward on the collar side
|
|
|
|
points.s3CollarSplit = utils.curveIntersectsY(
|
|
|
|
points.hps, points.neckCp2, points.cbNeck, points.cbNeck,
|
|
|
|
store.get('s3CollarMaxBack') * -1 * options.s3Collar
|
|
|
|
)
|
|
|
|
paths.backCollar = new Path()
|
|
|
|
.move(points.cbNeck)
|
|
|
|
._curve(points.neckCp2, points.neck)
|
|
|
|
.split(points.s3CollarSplit)[0]
|
|
|
|
.reverse()
|
|
|
|
.setRender(false)
|
|
|
|
}
|
|
|
|
if (options.s3Armhole === 0) {
|
|
|
|
points.s3ArmholeSplit = points.shoulder
|
|
|
|
paths.backArmhole = new Path()
|
|
|
|
.move(points.armholePitch)
|
|
|
|
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
|
|
|
.setRender(false)
|
|
|
|
}
|
|
|
|
else if (options.s3Armhole > 0) {
|
|
|
|
// Shift shoulder seam forward on the armhole side
|
|
|
|
points.s3ArmholeSplit = utils.curveIntersectsY(
|
|
|
|
points.shoulder,
|
|
|
|
points.mirroredShoulderCp1,
|
|
|
|
points.mirroredFrontArmholePitchCp2,
|
|
|
|
points.mirroredFrontArmholePitch,
|
|
|
|
store.get('s3ArmholeMax') * -1 * options.s3Armhole + points.shoulder.y
|
|
|
|
)
|
|
|
|
paths.backArmhole = new Path()
|
|
|
|
.move(points.armholePitch)
|
|
|
|
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
|
|
|
.join(new Path()
|
|
|
|
.move(points.shoulder)
|
|
|
|
.curve(points.mirroredShoulderCp1, points.mirroredFrontArmholePitchCp2, points.mirroredFrontArmholePitch)
|
|
|
|
.split(points.s3ArmholeSplit)[0]
|
|
|
|
)
|
|
|
|
.setRender(false)
|
|
|
|
}
|
|
|
|
else if (options.s3Armhole < 0) {
|
|
|
|
// Shift shoulder seam backward on the armhole side
|
|
|
|
points.s3ArmholeSplit = utils.curveIntersectsY(
|
|
|
|
points.shoulder,
|
|
|
|
points.shoulderCp1,
|
|
|
|
points.armholePitchCp2,
|
|
|
|
points.armholePitch,
|
|
|
|
store.get('s3ArmholeMax') * -1 * options.s3Armhole + points.shoulder.y
|
|
|
|
)
|
|
|
|
paths.backArmhole = new Path()
|
|
|
|
.move(points.armholePitch)
|
|
|
|
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
|
|
|
.split(points.s3ArmholeSplit)[0]
|
|
|
|
.setRender(false)
|
|
|
|
}
|
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Seamline
|
2021-06-12 14:05:28 +02:00
|
|
|
paths.saBase = new Path()
|
|
|
|
.move(points.cbHem)
|
|
|
|
.line(points.hem)
|
|
|
|
.line(points.armhole)
|
|
|
|
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
|
|
|
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
|
|
|
|
.join(paths.backArmhole)
|
|
|
|
.line(points.s3CollarSplit)
|
|
|
|
.join(paths.backCollar)
|
|
|
|
.setRender(false)
|
2018-12-17 14:42:28 +01:00
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.cbNeck)
|
|
|
|
.line(points.cbHips)
|
|
|
|
.join(paths.saBase)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2018-08-06 16:19:12 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Store lengths to fit sleeve
|
2019-08-03 15:03:33 +02:00
|
|
|
store.set('backArmholeLength', shared.armholeLength(points, Path))
|
|
|
|
store.set('backShoulderToArmholePitch', shared.shoulderToArmholePitch(points, Path))
|
2018-07-19 14:43:27 +00:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('cutonfold', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cbNeck,
|
|
|
|
to: points.cbHips,
|
2021-04-24 10:16:31 +02:00
|
|
|
grainline: true,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-08-06 16:19:12 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('title', { at: points.title, nr: 2, title: 'back' })
|
|
|
|
snippets.armholePitchNotch = new Snippet('bnotch', points.armholePitch)
|
2021-01-31 09:22:15 +01:00
|
|
|
paths.waist = new Path().move(points.cbWaist).line(points.waist).attr('class', 'help')
|
2018-12-17 14:42:28 +01:00
|
|
|
if (sa) {
|
|
|
|
paths.sa = paths.saBase
|
|
|
|
.offset(sa)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric sa')
|
2018-12-17 14:42:28 +01:00
|
|
|
.line(points.cbNeck)
|
2019-08-03 15:03:33 +02:00
|
|
|
.move(points.cbHips)
|
|
|
|
paths.sa.line(paths.sa.start())
|
2018-07-19 14:43:27 +00:00
|
|
|
}
|
2021-06-12 14:05:28 +02:00
|
|
|
|
|
|
|
// Add notches if the shoulder seam is shifted
|
|
|
|
shared.s3Notches(part, 'bnotch')
|
2018-12-17 14:42:28 +01:00
|
|
|
}
|
2018-08-03 17:44:55 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2021-06-12 14:05:28 +02:00
|
|
|
shared.dimensions(part, 'back')
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cbHips,
|
|
|
|
to: points.hips,
|
2021-05-24 10:28:25 +02:00
|
|
|
y: points.hem.y + sa + 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2021-05-24 10:28:25 +02:00
|
|
|
from: points.cbHem,
|
2021-01-11 19:50:25 +01:00
|
|
|
to: points.cbWaist,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.cbHips.x - sa - 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2021-01-11 19:50:25 +01:00
|
|
|
macro('vd', {
|
2021-05-24 10:28:25 +02:00
|
|
|
from: points.cbHem,
|
2021-01-11 19:50:25 +01:00
|
|
|
to: points.cbNeck,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.cbHips.x - sa - 30,
|
2021-01-11 19:50:25 +01:00
|
|
|
})
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cbNeck,
|
2021-06-12 14:05:28 +02:00
|
|
|
to: points.s3CollarSplit,
|
|
|
|
y: points.s3CollarSplit.y - sa - 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cbNeck,
|
2021-06-12 14:05:28 +02:00
|
|
|
to: points.s3ArmholeSplit,
|
|
|
|
y: points.s3CollarSplit.y - sa - 30,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-07-19 13:14:50 +00:00
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
|
|
|
}
|