2021-01-31 09:22:15 +01:00
|
|
|
export default function (part) {
|
2019-08-03 15:03:33 +02:00
|
|
|
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
points.topLeft = new Point(0, 0)
|
2019-03-25 18:20:15 +01:00
|
|
|
points.bottomRight = new Point(
|
2019-08-03 15:03:33 +02:00
|
|
|
store.get('topCuffWidth') + store.get('underCuffWidth'),
|
|
|
|
store.get('cuffLength') * 1.5
|
|
|
|
)
|
|
|
|
points.bottomLeft = new Point(points.topLeft.x, points.bottomRight.y)
|
|
|
|
points.topRight = new Point(points.bottomRight.x, points.topLeft.y)
|
|
|
|
macro('round', {
|
2019-03-25 18:20:15 +01:00
|
|
|
from: points.topLeft,
|
|
|
|
to: points.bottomRight,
|
|
|
|
via: points.bottomLeft,
|
2019-08-03 15:03:33 +02:00
|
|
|
radius: store.get('cuffRadius'),
|
|
|
|
prefix: 'roundLeft'
|
|
|
|
})
|
|
|
|
macro('round', {
|
2019-03-25 18:20:15 +01:00
|
|
|
from: points.bottomLeft,
|
|
|
|
to: points.topRight,
|
|
|
|
via: points.bottomRight,
|
2019-08-03 15:03:33 +02:00
|
|
|
radius: store.get('cuffRadius'),
|
|
|
|
prefix: 'roundRight'
|
|
|
|
})
|
2019-03-25 18:20:15 +01:00
|
|
|
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.topLeft)
|
|
|
|
.line(points.roundLeftStart)
|
|
|
|
.curve(points.roundLeftCp1, points.roundLeftCp2, points.roundLeftEnd)
|
|
|
|
.line(points.roundRightStart)
|
|
|
|
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
|
|
|
.line(points.topRight)
|
|
|
|
.line(points.topLeft)
|
|
|
|
.close()
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2019-03-30 13:51:23 +01:00
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
|
|
|
macro('title', {
|
2019-03-30 13:51:23 +01:00
|
|
|
at: points.title,
|
|
|
|
nr: 9,
|
2019-08-03 15:03:33 +02:00
|
|
|
title: 'cuffFacing'
|
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('grainline', {
|
|
|
|
from: points.bottomLeft.shift(0, 10 + store.get('cuffRadius')),
|
|
|
|
to: points.topLeft.shift(0, 10 + store.get('cuffRadius'))
|
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
2019-03-30 13:51:23 +01:00
|
|
|
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('vd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.roundRightStart,
|
|
|
|
to: points.roundRightEnd,
|
|
|
|
x: points.topRight.x + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.roundRightStart,
|
|
|
|
to: points.topRight,
|
|
|
|
x: points.topRight.x + sa + 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.roundRightStart,
|
|
|
|
to: points.roundRightEnd,
|
|
|
|
y: points.bottomRight.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.roundLeftStart,
|
|
|
|
to: points.roundRightEnd,
|
|
|
|
y: points.bottomRight.y + sa + 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
2019-03-25 18:20:15 +01:00
|
|
|
}
|