2020-04-18 17:35:25 +02:00
|
|
|
export default (part) => {
|
2019-02-17 21:26:39 +01:00
|
|
|
let {
|
|
|
|
points,
|
|
|
|
Point,
|
|
|
|
paths,
|
|
|
|
Path,
|
|
|
|
options,
|
|
|
|
macro,
|
|
|
|
snippets,
|
|
|
|
Snippet,
|
|
|
|
complete,
|
2021-04-24 10:16:31 +02:00
|
|
|
sa,
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2019-02-17 21:26:39 +01:00
|
|
|
|
|
|
|
// Cleanup from front part
|
2019-08-03 15:03:33 +02:00
|
|
|
for (let i of Object.keys(paths)) delete paths[i]
|
|
|
|
for (let i of Object.keys(snippets)) delete snippets[i]
|
2019-02-17 21:26:39 +01:00
|
|
|
|
|
|
|
// Seam line
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.dartStart)
|
|
|
|
.line(points.dartHipLeft)
|
2019-08-03 15:03:33 +02:00
|
|
|
.curve(points.dartHipLeftCpTop, points.dartWaistLeftCpBottom, points.dartWaistLeft)
|
2019-02-17 21:26:39 +01:00
|
|
|
.curve_(points.dartWaistLeftCpTop, points.dartTop)
|
|
|
|
.curve_(points.flbCp, points.flbTop)
|
|
|
|
.line(points.neck)
|
2019-08-03 15:03:33 +02:00
|
|
|
.curve(points.neckCp2, points.closureTopCp1, points.closureTop)
|
|
|
|
if (options.hemStyle === 'classic') {
|
2019-02-17 21:26:39 +01:00
|
|
|
paths.seam
|
|
|
|
.line(points.closureBottom)
|
|
|
|
.line(points.hemTip)
|
2019-08-03 15:03:33 +02:00
|
|
|
._curve(points.splitDartHemLeftCp1, points.splitDartHemLeft)
|
2020-07-23 12:30:26 +02:00
|
|
|
} else if (options.hemStyle === 'rounded') {
|
2019-02-17 21:26:39 +01:00
|
|
|
paths.seam
|
|
|
|
.line(points.roundStart)
|
|
|
|
.curve(points.roundCp1, points.roundCp2, points.roundEnd)
|
2019-08-03 15:03:33 +02:00
|
|
|
.line(points.dartHemLeft)
|
2020-07-23 12:30:26 +02:00
|
|
|
} else {
|
|
|
|
paths.seam.line(points.closureBottom).line(points.dartHemLeft)
|
2019-02-17 21:26:39 +01:00
|
|
|
}
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.seam.close().attr('class', 'fabric')
|
2019-02-17 21:26:39 +01:00
|
|
|
|
2020-04-18 17:35:25 +02:00
|
|
|
if (complete) {
|
|
|
|
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
2019-02-17 21:26:39 +01:00
|
|
|
|
2020-04-18 17:35:25 +02:00
|
|
|
points.title = new Point(points.dartWaistLeft.x / 2, points.waist.y)
|
|
|
|
macro('title', {
|
|
|
|
nr: 3,
|
|
|
|
at: points.title,
|
2021-04-24 10:16:31 +02:00
|
|
|
title: 'frontFacing',
|
2020-04-18 17:35:25 +02:00
|
|
|
})
|
|
|
|
points.logo = points.closureTop.shiftFractionTowards(points.dartWaistLeft, 0.5)
|
|
|
|
snippets.logo = new Snippet('logo', points.logo)
|
|
|
|
}
|
2019-02-17 21:26:39 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
|
|
|
}
|