2018-12-20 11:41:35 +01:00
|
|
|
export default function(part) {
|
|
|
|
// Remove clutter
|
2019-08-03 15:03:33 +02:00
|
|
|
let pocket = part.paths.pocket
|
|
|
|
part.paths = {}
|
|
|
|
part.snippets = {}
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2019-05-10 13:14:31 +02:00
|
|
|
let {
|
|
|
|
utils,
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
complete,
|
|
|
|
paperless,
|
|
|
|
macro,
|
|
|
|
debug
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2018-12-20 11:41:35 +01:00
|
|
|
paths.seam = pocket
|
|
|
|
.line(points.cfRibbing)
|
|
|
|
.line(points.pocketHem)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric', true)
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
store.set('facingWidth', points.pocketHem.dist(points.pocketTip) / 2)
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2018-12-20 11:41:35 +01:00
|
|
|
let facing = new Path()
|
|
|
|
.move(points.pocketTip)
|
|
|
|
.curve(points.pocketTip, points.pocketTopCp, points.pocketTop)
|
2019-08-03 15:03:33 +02:00
|
|
|
.offset(store.get('facingWidth') * -1)
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
points._tmp = facing.shiftAlong(2)
|
2018-12-20 11:41:35 +01:00
|
|
|
points.facingEnd = utils.beamsIntersect(
|
|
|
|
points._tmp,
|
|
|
|
facing.start(),
|
|
|
|
points.pocketHem,
|
|
|
|
points.pocketTip
|
2019-08-03 15:03:33 +02:00
|
|
|
)
|
2018-12-20 11:41:35 +01:00
|
|
|
paths.facing = new Path()
|
|
|
|
.move(points.facingEnd)
|
|
|
|
.line(facing.start())
|
|
|
|
.join(facing)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', ' fabric help')
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2018-12-20 11:41:35 +01:00
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('grainline', {
|
2018-12-20 11:41:35 +01:00
|
|
|
from: points.cfRibbing.shift(0, 15),
|
|
|
|
to: points.pocketCf.shift(0, 15)
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
points.title = points.cfRibbing.shiftFractionTowards(points.pocketTop, 0.5)
|
|
|
|
macro('title', { at: points.title, nr: 4, title: 'pocket' })
|
2018-12-20 11:41:35 +01:00
|
|
|
if (sa) {
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
2018-09-21 21:30:20 +02:00
|
|
|
}
|
2018-12-20 11:41:35 +01:00
|
|
|
}
|
2018-09-21 21:30:20 +02:00
|
|
|
|
2018-12-20 11:41:35 +01:00
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-20 11:41:35 +01:00
|
|
|
from: points.cfRibbing,
|
|
|
|
to: points.pocketTop,
|
|
|
|
y: points.cfRibbing.y + 15 + sa
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-20 11:41:35 +01:00
|
|
|
from: points.cfRibbing,
|
|
|
|
to: points.pocketTip,
|
|
|
|
y: points.cfRibbing.y + 30 + sa
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-20 11:41:35 +01:00
|
|
|
from: points.pocketHem,
|
|
|
|
to: points.pocketTip,
|
|
|
|
x: points.pocketTip.x + 15 + sa
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-20 11:41:35 +01:00
|
|
|
from: points.pocketHem,
|
|
|
|
to: points.pocketTop,
|
|
|
|
x: points.cfRibbing.x - 15 - sa
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-09-21 21:30:20 +02:00
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
2019-05-10 13:14:31 +02:00
|
|
|
}
|