2020-04-18 16:23:17 +02:00
|
|
|
export default (part) => {
|
2021-08-30 11:40:16 +02:00
|
|
|
let { points, Point, paths, Path, measurements, options, macro, complete, paperless, store } =
|
|
|
|
part.shorthand()
|
2019-02-18 17:52:34 +01:00
|
|
|
|
2020-06-28 12:26:05 +02:00
|
|
|
let pw = measurements.hips * options.pocketWidth // Pocket width
|
2019-08-03 15:03:33 +02:00
|
|
|
let ph = store.get('pocketBagLength') // Pocket height
|
2019-02-18 17:52:34 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
points.topLeft = new Point(0, 0)
|
|
|
|
points.topRight = new Point(pw + 30, 0)
|
|
|
|
points.bottomLeft = new Point(0, ph + 10)
|
|
|
|
points.bottomRight = new Point(points.topRight.x, points.bottomLeft.y)
|
|
|
|
macro('round', {
|
2019-02-18 17:52:34 +01:00
|
|
|
from: points.topLeft,
|
|
|
|
to: points.bottomRight,
|
|
|
|
via: points.bottomLeft,
|
|
|
|
radius: pw / 8,
|
2020-04-18 16:23:17 +02:00
|
|
|
render: false,
|
2021-04-24 10:16:31 +02:00
|
|
|
prefix: 'roundLeft',
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('round', {
|
2019-02-18 17:52:34 +01:00
|
|
|
from: points.bottomLeft,
|
|
|
|
to: points.topRight,
|
|
|
|
via: points.bottomRight,
|
|
|
|
radius: pw / 8,
|
2020-04-18 16:23:17 +02:00
|
|
|
render: false,
|
2021-04-24 10:16:31 +02:00
|
|
|
prefix: 'roundRight',
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-02-18 17:52:34 +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', 'lining')
|
2019-02-18 17:52:34 +01:00
|
|
|
|
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
|
|
|
macro('title', {
|
2019-02-18 17:52:34 +01:00
|
|
|
nr: 7,
|
2019-08-03 15:03:33 +02:00
|
|
|
title: 'pocketBag',
|
2021-04-24 10:16:31 +02:00
|
|
|
at: points.title,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-02-18 17:52:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2019-02-18 17:52:34 +01:00
|
|
|
from: points.bottomLeft,
|
|
|
|
to: points.bottomRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.bottomLeft.y + 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2019-02-18 17:52:34 +01:00
|
|
|
from: points.bottomRight,
|
|
|
|
to: points.topRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.topRight.x + 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-02-18 17:52:34 +01:00
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
|
|
|
}
|