1
0
Fork 0
freesewing/packages/jaeger/src/undercollar.js

96 lines
2.5 KiB
JavaScript
Raw Normal View History

2019-03-16 11:39:06 +01:00
/*
2019-03-16 17:41:53 +01:00
* This collar would benefit from a redesign
2019-03-16 11:39:06 +01:00
* but I find collar design to be rather tricky business and
* would love the input from someone with more pattern design
* experience, or more tailoring exprience.
*/
2021-01-31 09:22:15 +01:00
export default function (part) {
2019-08-03 15:03:33 +02:00
let { paperless, sa, snippets, complete, points, macro, paths, Path } = part.shorthand()
2019-03-16 11:39:06 +01:00
2019-03-16 17:41:53 +01:00
// Clean up
2019-08-03 15:03:33 +02:00
for (let i of Object.keys(paths)) delete paths[i]
for (let i of Object.keys(snippets)) delete snippets[i]
2019-03-16 17:41:53 +01:00
2019-03-16 11:39:06 +01:00
paths.seam = new Path()
.move(points.collarCbTop)
.curve_(points.collarCbTopCp, points.notchTip)
.line(points.notch)
.line(points.collarstandTip)
._curve(points.collarstandCbTopCp, points.collarstandCbTop)
2019-03-16 17:41:53 +01:00
.line(points.collarCbTop)
2019-03-16 11:39:06 +01:00
.close()
2019-08-03 15:03:33 +02:00
.attr('class', 'various')
2019-03-16 17:41:53 +01:00
if (complete) {
// Title
2019-08-03 15:03:33 +02:00
points.title = points.collarCbTopCp.shiftFractionTowards(points.collarstandCbTopCp, 0.5)
macro('title', {
2019-03-16 17:41:53 +01:00
at: points.title,
nr: 6,
2021-04-24 10:16:31 +02:00
title: 'underCollar',
2019-08-03 15:03:33 +02:00
})
2019-03-16 11:39:06 +01:00
2019-03-16 17:56:38 +01:00
if (sa) {
2021-01-31 09:22:15 +01:00
paths.sa1 = new Path().move(points.collarstandCbTop).line(points.collarCbTop).offset(sa)
2019-03-16 17:56:38 +01:00
paths.sa2 = new Path()
.move(points.collarstandTip)
.line(points.notch)
.line(points.notchTip)
2019-08-03 15:03:33 +02:00
.offset(-1 * sa)
2019-03-16 17:56:38 +01:00
paths.sa = new Path()
.move(points.collarstandTip)
.line(paths.sa2.start())
.join(paths.sa2)
.line(points.notchTip)
.move(points.collarstandCbTop)
.line(paths.sa1.start())
.line(paths.sa1.end())
.line(points.collarCbTop)
2019-08-03 15:03:33 +02:00
.attr('class', 'various sa')
paths.sa1.render = false
paths.sa2.render = false
2019-03-16 17:56:38 +01:00
}
2019-03-17 17:15:59 +01:00
if (paperless) {
2019-08-03 15:03:33 +02:00
macro('hd', {
2019-03-17 17:15:59 +01:00
from: points.collarstandCbTop,
to: points.collarstandTip,
2021-04-24 10:16:31 +02:00
y: points.collarstandCbTop.y - 15,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2019-03-17 17:15:59 +01:00
from: points.collarstandCbTop,
to: points.notch,
2021-04-24 10:16:31 +02:00
y: points.collarstandCbTop.y - 30,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2019-03-17 17:15:59 +01:00
from: points.collarCbTop,
to: points.notchTip,
2021-04-24 10:16:31 +02:00
y: points.notchTip.y + 15,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2019-03-17 17:15:59 +01:00
from: points.collarCbTop,
to: points.collarstandCbTop,
2021-04-24 10:16:31 +02:00
x: points.collarCbTop.x - sa - 15,
2019-08-03 15:03:33 +02:00
})
macro('ld', {
2019-03-17 17:15:59 +01:00
from: points.collarstandTip,
to: points.notch,
2021-04-24 10:16:31 +02:00
d: sa + 15,
2019-08-03 15:03:33 +02:00
})
macro('ld', {
2019-03-17 17:15:59 +01:00
from: points.notchTip,
to: points.notch,
2021-04-24 10:16:31 +02:00
d: -15 - sa,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2019-03-17 17:15:59 +01:00
from: points.notchTip,
to: points.collarstandCbTop,
2021-04-24 10:16:31 +02:00
x: points.notch.x + sa + 40,
2019-08-03 15:03:33 +02:00
})
2019-03-17 17:15:59 +01:00
}
2019-03-16 17:41:53 +01:00
}
2019-03-16 17:56:38 +01:00
2019-08-03 15:03:33 +02:00
return part
2019-03-16 11:39:06 +01:00
}