2019-09-21 19:42:53 +02:00
|
|
|
import { BuildMainShape } from './shape'
|
2019-08-21 11:11:05 -07:00
|
|
|
|
2021-01-31 09:22:15 +01:00
|
|
|
export default function (part) {
|
2019-08-21 11:11:05 -07:00
|
|
|
let {
|
|
|
|
options,
|
|
|
|
Path,
|
|
|
|
points,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
complete,
|
|
|
|
sa,
|
|
|
|
paperless,
|
2021-04-24 10:16:31 +02:00
|
|
|
macro,
|
2019-09-21 19:42:53 +02:00
|
|
|
} = part.shorthand()
|
2019-08-21 11:11:05 -07:00
|
|
|
|
2019-09-21 19:42:53 +02:00
|
|
|
BuildMainShape(part, true)
|
2019-08-21 11:11:05 -07:00
|
|
|
|
|
|
|
paths.seam = paths.leftSide
|
|
|
|
.clone()
|
|
|
|
.join(paths.bottom)
|
|
|
|
.join(paths.sideSeam)
|
|
|
|
.join(paths.waist)
|
2019-09-21 19:42:53 +02:00
|
|
|
.attr('class', 'fabric')
|
2019-08-21 11:11:05 -07:00
|
|
|
|
|
|
|
// Complete?
|
|
|
|
if (complete) {
|
2019-09-21 19:42:53 +02:00
|
|
|
macro('cutonfold', {
|
2019-08-21 11:11:05 -07:00
|
|
|
from: points.lWaist,
|
|
|
|
to: points.lLeg,
|
|
|
|
margin: 5,
|
2021-04-24 10:16:31 +02:00
|
|
|
offset: 10,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
macro('title', {
|
|
|
|
nr: 1,
|
2019-08-21 11:11:05 -07:00
|
|
|
at: points.titleAnchor,
|
2021-04-24 10:16:31 +02:00
|
|
|
title: 'front',
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
macro('grainline', {
|
2019-08-21 11:11:05 -07:00
|
|
|
from: points.grainlineTop,
|
2021-04-24 10:16:31 +02:00
|
|
|
to: points.grainlineBottom,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
2019-08-21 11:11:05 -07:00
|
|
|
|
2019-09-21 19:42:53 +02:00
|
|
|
points.scaleBox = points.logoAnchor.shift(270, 100)
|
|
|
|
macro('scalebox', { at: points.scaleBox })
|
2019-08-21 11:11:05 -07:00
|
|
|
|
2019-09-21 19:42:53 +02:00
|
|
|
snippets.logo = new Snippet('logo', points.logoAnchor)
|
2019-08-21 11:11:05 -07:00
|
|
|
|
|
|
|
if (sa) {
|
|
|
|
paths.sa = new Path()
|
|
|
|
.move(points.lHem)
|
2021-01-31 09:22:15 +01:00
|
|
|
.join(paths.bottom.join(paths.sideSeam).join(paths.waistSA).offset(sa))
|
2019-08-21 11:11:05 -07:00
|
|
|
.line(points.lWaist)
|
2019-09-21 19:42:53 +02:00
|
|
|
.attr('class', 'fabric sa')
|
2019-08-21 11:11:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (paperless) {
|
2019-09-21 19:42:53 +02:00
|
|
|
macro('hd', {
|
2019-08-21 11:11:05 -07:00
|
|
|
from: points.lHem,
|
|
|
|
to: points.rHem,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.rHem.y - options.paperlessOffset,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
2019-08-21 11:11:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-21 19:42:53 +02:00
|
|
|
return part
|
2019-08-21 11:11:05 -07:00
|
|
|
}
|