1
0
Fork 0
freesewing/designs/teagan/src/back.mjs

98 lines
2.4 KiB
JavaScript
Raw Normal View History

2022-09-03 17:20:29 +02:00
import { front } from './front.mjs'
2022-09-11 17:02:10 +02:00
function teaganBack({
store,
sa,
Point,
points,
Path,
paths,
options,
complete,
paperless,
macro,
utils,
measurements,
part,
}) {
// Adjust neckline
points.cbNeck = new Point(0, points.neck.y + options.backNeckCutout * measurements.neck)
points.cbNeckCp1 = points.cbNeck.shift(0, points.neck.x / 2)
points.neckCp2 = utils.beamIntersectsY(points.neck, points.neckCp2, points.cbNeck.y)
// Adjust armhole
points.shoulderCp1 = points.shoulderCp1.shiftFractionTowards(points.shoulder, 0.25)
// Draw seamline
2020-08-25 17:36:53 +02:00
paths.hemBase = new Path().move(points.cfHem).line(points.hem).setRender(false)
paths.saBase = new Path()
.move(points.hem)
.curve_(points.waistCp2, points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.shoulderCp1, points.shoulder)
.line(points.neck)
.curve(points.neckCp2, points.cbNeckCp1, points.cbNeck)
2020-08-25 17:36:53 +02:00
.setRender(false)
paths.seam = new Path()
.move(points.cfHem)
.join(paths.hemBase)
.join(paths.saBase)
.line(points.cfHem)
.close()
2020-08-25 17:36:53 +02:00
.setRender(true)
.attr('class', 'fabric')
// Set store values required to draft sleevecap
store.set('sleevecapEase', 0)
store.set(
'backArmholeLength',
new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.shoulderCp1, points.shoulder)
.length()
)
// Complete pattern?
if (complete) {
macro('cutonfold', {
from: points.cfNeck,
to: points.cfHem,
2021-04-24 10:16:31 +02:00
grainline: true,
})
macro('title', { at: points.title, nr: 2, title: 'back' })
points.scaleboxAnchor = points.scalebox = points.title.shift(90, 100)
macro('scalebox', { at: points.scalebox })
2020-08-23 17:37:11 +02:00
if (sa) {
2020-08-25 17:36:53 +02:00
paths.sa = new Path()
.move(points.cfHem)
.join(paths.hemBase.offset(sa * 3))
.join(paths.saBase.offset(sa))
.line(points.cbNeck)
.attr('class', 'fabric sa')
2020-08-23 17:37:11 +02:00
}
}
// Paperless?
if (paperless) {
// Remove dimensions that are front only
macro('rmd', { ids: store.get('frontOnlyDimensions') })
// These dimensions are only for the front
macro('vd', {
from: points.cbHem,
to: points.cbNeck,
2021-04-24 10:16:31 +02:00
x: points.cbHem.x - sa - 15,
})
}
return part
}
2022-09-03 17:20:29 +02:00
export const back = {
name: 'teagan.back',
from: front,
draft: teaganBack,
}