2020-06-28 12:26:05 +02:00
|
|
|
export default (part) => {
|
2019-02-18 17:52:34 +01:00
|
|
|
let {
|
|
|
|
points,
|
|
|
|
Point,
|
|
|
|
paths,
|
|
|
|
Path,
|
|
|
|
measurements,
|
|
|
|
options,
|
|
|
|
macro,
|
|
|
|
complete,
|
2019-05-10 13:14:31 +02:00
|
|
|
paperless
|
2019-08-03 15:03:33 +02:00
|
|
|
} = 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 pwh = pw * options.weltHeight // Pocket welt 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, pwh + 20)
|
|
|
|
points.bottomRight = new Point(points.topRight.x, points.bottomLeft.y)
|
|
|
|
points.notchLeft = new Point(15, 10)
|
|
|
|
points.notchRight = new Point(pw + 15, 10)
|
2019-02-18 17:52:34 +01:00
|
|
|
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.topLeft)
|
|
|
|
.line(points.bottomLeft)
|
|
|
|
.line(points.bottomRight)
|
|
|
|
.line(points.topRight)
|
|
|
|
.line(points.topLeft)
|
|
|
|
.close()
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'interfacing')
|
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: 8,
|
2019-08-03 15:03:33 +02:00
|
|
|
title: 'pocketInterfacing',
|
2019-02-18 17:52:34 +01:00
|
|
|
at: points.title
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('sprinkle', {
|
|
|
|
snippet: 'notch',
|
|
|
|
on: ['notchLeft', 'notchRight']
|
|
|
|
})
|
2019-02-18 17:52:34 +01:00
|
|
|
paths.cutline = new Path()
|
|
|
|
.move(points.notchLeft)
|
|
|
|
.line(points.notchRight)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'interfacing stroke-sm dashed')
|
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,
|
|
|
|
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,
|
|
|
|
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
|
|
|
|
}
|