2022-09-03 14:46:40 +02:00
|
|
|
/*
|
|
|
|
* We don't move this draft method under the part object
|
|
|
|
* because doing so changes the indentation which causes
|
|
|
|
* us to lose all history of changes to this method.
|
|
|
|
*
|
|
|
|
* So to maintain the history of contributions over the
|
|
|
|
* years, keeps this method here, and resist the urge to
|
|
|
|
* move it into the named export at the bottom of this file.
|
|
|
|
*/
|
|
|
|
function waraleePocket(part) {
|
|
|
|
const {
|
2019-09-21 19:42:53 +02:00
|
|
|
options,
|
|
|
|
measurements,
|
|
|
|
Point,
|
|
|
|
Path,
|
|
|
|
points,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
complete,
|
|
|
|
sa,
|
|
|
|
paperless,
|
2021-04-24 10:16:31 +02:00
|
|
|
macro,
|
2019-09-21 19:42:53 +02:00
|
|
|
} = part.shorthand()
|
|
|
|
|
2022-09-03 14:46:40 +02:00
|
|
|
const pocketDepth =
|
2020-06-13 14:01:19 +02:00
|
|
|
(measurements.crotchDepth - measurements.waistToHips) * options.frontPocketDepthFactor
|
2019-09-21 19:42:53 +02:00
|
|
|
|
|
|
|
points.topLeft = new Point(0, 0)
|
|
|
|
points.bottomLeft = points.topLeft.shift(270, pocketDepth)
|
|
|
|
|
|
|
|
points.topRight = points.topLeft.shift(0, pocketDepth * (1 / 3))
|
|
|
|
points.bottomRight = points.topRight.shift(290, pocketDepth * (5 / 6))
|
|
|
|
|
|
|
|
points.bottomLeftCP = points.bottomLeft.shift(0, pocketDepth * (1 / 6))
|
|
|
|
points.bottomRightCP = points.bottomRight.shift(225, pocketDepth * (1 / 4))
|
|
|
|
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.topLeft)
|
|
|
|
.line(points.bottomLeft)
|
|
|
|
.curve(points.bottomLeftCP, points.bottomRightCP, points.bottomRight)
|
|
|
|
.line(points.topRight)
|
|
|
|
.line(points.topLeft)
|
|
|
|
.close()
|
|
|
|
.attr('class', 'fabric')
|
|
|
|
|
|
|
|
// Complete?
|
|
|
|
if (complete) {
|
|
|
|
macro('cutonfold', {
|
|
|
|
from: points.topLeft,
|
|
|
|
to: points.bottomLeft,
|
|
|
|
margin: 5,
|
2021-04-24 10:16:31 +02:00
|
|
|
offset: 10,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
points.title = points.topLeft.shift(270, 75).shift(0, 50)
|
|
|
|
macro('title', {
|
|
|
|
nr: 3,
|
|
|
|
at: points.title,
|
2021-04-24 10:16:31 +02:00
|
|
|
title: 'pocket',
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
points.logo = points.title.shift(270, 75)
|
|
|
|
snippets.logo = new Snippet('logo', points.logo)
|
|
|
|
points.text = points.logo
|
|
|
|
.shift(-90, 25)
|
|
|
|
.attr('data-text', 'Waralee')
|
|
|
|
.attr('data-text-class', 'center')
|
|
|
|
|
|
|
|
if (sa) {
|
|
|
|
paths.sa = new Path()
|
|
|
|
.move(points.bottomLeft)
|
|
|
|
.join(
|
|
|
|
new Path()
|
|
|
|
.move(points.bottomLeft)
|
|
|
|
.curve(points.bottomLeftCP, points.bottomRightCP, points.bottomRight)
|
|
|
|
.line(points.topRight)
|
|
|
|
.line(points.topLeft)
|
|
|
|
.offset(sa)
|
|
|
|
)
|
|
|
|
.line(points.topLeft)
|
|
|
|
.attr('class', 'fabric sa')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
|
|
|
macro('hd', {
|
|
|
|
from: points.topLeft,
|
|
|
|
to: points.topRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.topLeft.y + 15,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: points.bottomLeft,
|
|
|
|
to: points.bottomRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.bottomRight.y,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.topLeft,
|
|
|
|
to: points.bottomLeft,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.topLeft.x + 15,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.topRight,
|
|
|
|
to: points.bottomRight,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.bottomRight.x,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.bottomRight,
|
|
|
|
to: points.bottomLeft,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.bottomRight.x,
|
2019-09-21 19:42:53 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return part
|
|
|
|
}
|
2022-09-03 14:46:40 +02:00
|
|
|
|
|
|
|
export const pocket = {
|
|
|
|
name: 'waralee.pocket',
|
|
|
|
measurements: ['crotchDepth', 'waistToHips'],
|
|
|
|
draft: waraleePocket,
|
|
|
|
}
|