2020-06-28 12:26:05 +02:00
|
|
|
export default (part) => {
|
2021-08-30 11:40:16 +02:00
|
|
|
let { points, Point, paths, Path, measurements, options, macro, complete, paperless } =
|
|
|
|
part.shorthand()
|
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
|
|
|
|
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',
|
2021-04-24 10:16:31 +02:00
|
|
|
at: points.title,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2022-08-13 21:09:23 +00:00
|
|
|
//Grainline
|
2022-08-14 08:44:50 +00:00
|
|
|
let grainlineVariableShift = points.topLeft.dist(points.topRight) * 0.1
|
|
|
|
|
|
|
|
points.grainlineFromInterfacing = new Point(points.topLeft.x, points.topLeft.y).shift(
|
|
|
|
0,
|
|
|
|
grainlineVariableShift
|
|
|
|
)
|
2022-08-13 21:09:23 +00:00
|
|
|
points.grainlineToInterfacing = new Point(points.topLeft.x, points.topLeft.y)
|
2022-08-14 08:44:50 +00:00
|
|
|
.shift(0, grainlineVariableShift)
|
2022-08-13 21:09:23 +00:00
|
|
|
.shift(-90, pwh + 20)
|
|
|
|
points.grainlineToInterfacingRotated = points.grainlineToInterfacing.rotate(
|
|
|
|
options.pocketAngle,
|
|
|
|
points.grainlineFromInterfacing
|
|
|
|
)
|
|
|
|
macro('grainline', {
|
|
|
|
from: points.grainlineFromInterfacing,
|
|
|
|
to: points.grainlineToInterfacingRotated,
|
|
|
|
})
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('sprinkle', {
|
|
|
|
snippet: 'notch',
|
2021-04-24 10:16:31 +02:00
|
|
|
on: ['notchLeft', 'notchRight'],
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
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,
|
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
|
|
|
|
}
|