2018-12-23 12:13:37 +01:00
|
|
|
export default part => {
|
2018-12-27 15:04:32 +01:00
|
|
|
let {
|
|
|
|
utils,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
snippets,
|
|
|
|
complete,
|
|
|
|
paperless,
|
|
|
|
macro,
|
|
|
|
options
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2018-12-23 12:13:37 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
let fold = options.buttonholePlacketFoldWidth
|
2018-12-23 13:57:40 +01:00
|
|
|
points.neckEdge = utils.lineIntersectsCurve(
|
|
|
|
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y + 20),
|
|
|
|
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y - 20),
|
2018-12-23 12:13:37 +01:00
|
|
|
points.cfNeck,
|
|
|
|
points.cfNeckCp1,
|
|
|
|
points.neckCp2Front,
|
|
|
|
points.neck
|
2019-08-03 15:03:33 +02:00
|
|
|
)
|
|
|
|
points.hemEdge = new Point(points.neckEdge.x, points.cfHem.y)
|
2018-12-23 13:57:40 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.seam = paths.seam.split(points.neckEdge)[0]
|
|
|
|
paths.seam.ops[0].to = points.hemEdge
|
|
|
|
paths.seam.close().attr('class', 'fabric')
|
2018-12-23 12:13:37 +01:00
|
|
|
|
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
|
|
|
// Title
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('title', { at: points.title, nr: '2a', title: 'frontLeft' })
|
2018-12-23 12:13:37 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
delete snippets['cfWaist-notch']
|
|
|
|
delete snippets['cfHips-notch']
|
|
|
|
delete snippets['cfArmhole-notch']
|
|
|
|
points.edgeArmhole = new Point(points.neckEdge.x, points.armhole.y)
|
|
|
|
points.edgeWaist = new Point(points.neckEdge.x, points.waist.y)
|
|
|
|
points.edgeHips = new Point(points.neckEdge.x, points.hips.y)
|
|
|
|
macro('sprinkle', {
|
|
|
|
snippet: 'notch',
|
|
|
|
on: ['edgeArmhole', 'edgeWaist', 'edgeHips']
|
|
|
|
})
|
2018-12-23 13:57:40 +01:00
|
|
|
if (sa) {
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.saFromArmhole.end().x = points.neckEdge.x - sa
|
|
|
|
paths.hemSa.start().x = points.neckEdge.x - sa
|
2018-12-23 13:57:40 +01:00
|
|
|
paths.saClosure = new Path()
|
|
|
|
.move(paths.saFromArmhole.end())
|
|
|
|
.line(paths.hemSa.start())
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric sa')
|
2018-12-23 13:57:40 +01:00
|
|
|
}
|
2018-12-23 12:13:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-28 15:42:53 +01:00
|
|
|
from: points.neckEdge,
|
|
|
|
to: points.neck,
|
|
|
|
y: points.neck.y - sa - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-28 15:42:53 +01:00
|
|
|
from: points.neckEdge,
|
|
|
|
to: points.shoulder,
|
|
|
|
y: points.neck.y - sa - 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-28 15:42:53 +01:00
|
|
|
from: points.neckEdge,
|
|
|
|
to: points.neck,
|
|
|
|
x: points.neckEdge.x - sa - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-28 15:42:53 +01:00
|
|
|
from: points.hemEdge,
|
|
|
|
to: points.neck,
|
|
|
|
x: points.neckEdge.x - sa - 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
for (let pid of ['Armhole', 'Waist', 'Hips']) {
|
|
|
|
macro('hd', {
|
|
|
|
from: points['edge' + pid],
|
2018-12-28 15:42:53 +01:00
|
|
|
to: points[pid.toLowerCase()]
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-12-28 15:42:53 +01:00
|
|
|
}
|
2018-12-23 12:13:37 +01:00
|
|
|
}
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
|
|
|
}
|