2021-01-31 09:22:15 +01:00
|
|
|
export default function (part) {
|
2019-08-03 15:03:33 +02:00
|
|
|
let { paperless, sa, complete, points, macro, paths, Path, snippets, Snippet } = part.shorthand()
|
2019-04-07 17:01:58 +02:00
|
|
|
|
|
|
|
// Clean up
|
2019-04-08 08:05:26 +02:00
|
|
|
for (let i of Object.keys(paths)) {
|
2019-08-03 15:03:33 +02:00
|
|
|
if (i !== 'side') delete paths[i]
|
2019-04-08 08:05:26 +02:00
|
|
|
}
|
2019-04-07 17:01:58 +02:00
|
|
|
|
2021-01-31 09:22:15 +01:00
|
|
|
paths.seam = paths.side.clone().line(points.foldTop).attr('class', 'fabric')
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.seam.render = true
|
2019-04-07 17:01:58 +02:00
|
|
|
|
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
points.title = points.innerGuide.shiftFractionTowards(points.outerGuide, 0.5)
|
|
|
|
macro('title', {
|
2019-04-08 08:05:26 +02:00
|
|
|
at: points.title,
|
|
|
|
nr: 2,
|
2019-08-03 15:03:33 +02:00
|
|
|
title: 'side'
|
|
|
|
})
|
|
|
|
points.logo = points.tipCp2.shiftFractionTowards(points.outerTopCp1, 0.5)
|
|
|
|
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.75)
|
|
|
|
macro('cutonfold', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldBottom,
|
|
|
|
to: points.foldTop,
|
|
|
|
offset: 15,
|
|
|
|
grainline: true
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-04-08 08:05:26 +02:00
|
|
|
|
2019-04-07 17:01:58 +02:00
|
|
|
if (sa) {
|
2019-04-08 08:05:26 +02:00
|
|
|
paths.sa = new Path()
|
|
|
|
.move(points.foldTop)
|
|
|
|
.line(points.foldTop.shift(180, sa))
|
|
|
|
.join(paths.side.offset(sa))
|
|
|
|
.line(points.foldBottom)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric sa')
|
2019-04-07 17:01:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('vd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.tip,
|
|
|
|
to: points.foldBottom,
|
|
|
|
x: points.tip.x + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.outerTop,
|
|
|
|
to: points.foldBottom,
|
|
|
|
x: points.tip.x + sa + 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldTop,
|
|
|
|
to: points.foldBottom,
|
|
|
|
y: points.foldTop.y - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldTop,
|
|
|
|
to: points.outerTop,
|
|
|
|
y: points.outerTop.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldTop,
|
|
|
|
to: points.tip,
|
|
|
|
y: points.outerTop.y + sa + 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-04-07 17:01:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
2019-04-07 17:01:58 +02:00
|
|
|
}
|