1
0
Fork 0
freesewing/packages/wahid/src/pocketinterfacing.js

65 lines
1.5 KiB
JavaScript
Raw Normal View History

export default (part) => {
let {
points,
Point,
paths,
Path,
measurements,
options,
macro,
complete,
paperless
2019-08-03 15:03:33 +02:00
} = part.shorthand()
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-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)
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')
if (complete) {
2019-08-03 15:03:33 +02:00
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
macro('title', {
nr: 8,
2019-08-03 15:03:33 +02:00
title: 'pocketInterfacing',
at: points.title
2019-08-03 15:03:33 +02:00
})
macro('sprinkle', {
snippet: 'notch',
on: ['notchLeft', 'notchRight']
})
paths.cutline = new Path()
.move(points.notchLeft)
.line(points.notchRight)
2019-08-03 15:03:33 +02:00
.attr('class', 'interfacing stroke-sm dashed')
}
if (paperless) {
2019-08-03 15:03:33 +02:00
macro('hd', {
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomLeft.y + 15
2019-08-03 15:03:33 +02:00
})
macro('vd', {
from: points.bottomRight,
to: points.topRight,
x: points.topRight.x + 15
2019-08-03 15:03:33 +02:00
})
}
2019-08-03 15:03:33 +02:00
return part
}