2021-01-31 09:22:15 +01:00
|
|
|
export default function (part) {
|
2021-02-13 19:09:18 +01:00
|
|
|
let { store, Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand()
|
2021-01-30 13:15:25 +01:00
|
|
|
|
2021-01-31 09:22:15 +01:00
|
|
|
let z = store.get('zipperWidth')
|
|
|
|
let w = (store.get('zipperPanelWidth') - z) / 2
|
|
|
|
let h = store.get('depth')
|
2021-01-30 13:15:25 +01:00
|
|
|
|
|
|
|
points.topLeft = new Point(0, 0)
|
|
|
|
points.topRight = new Point(w, 0)
|
|
|
|
points.bottomLeft = new Point(0, h)
|
|
|
|
points.bottomRight = new Point(w, h)
|
|
|
|
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.topLeft)
|
|
|
|
.line(points.bottomLeft)
|
|
|
|
.line(points.bottomRight)
|
|
|
|
.line(points.topRight)
|
|
|
|
.line(points.topLeft)
|
|
|
|
.close()
|
|
|
|
.attr('class', 'fabric')
|
|
|
|
|
|
|
|
// Complete?
|
|
|
|
if (complete) {
|
|
|
|
paths.text = new Path()
|
|
|
|
.move(points.topLeft)
|
|
|
|
.line(points.bottomLeft)
|
|
|
|
.attr('data-text', 'ZipperPanel')
|
|
|
|
.attr('data-text-class', 'center text-xs')
|
|
|
|
|
|
|
|
if (sa) {
|
|
|
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
|
|
|
macro('hd', {
|
|
|
|
from: points.bottomLeft,
|
|
|
|
to: points.bottomRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.bottomLeft.y + sa + 15,
|
2021-01-30 13:15:25 +01:00
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.bottomRight,
|
|
|
|
to: points.topRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.topRight.x + sa + 15,
|
2021-01-30 13:15:25 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return part
|
|
|
|
}
|