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

63 lines
1.7 KiB
JavaScript
Raw Normal View History

2019-03-16 11:39:06 +01:00
/*
* FIXME
*
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.
*/
export default function(part) {
let { sa, snippets, Snippet, utils, store, complete, points, measurements, options, macro, Point, paths, Path } = part.shorthand();
2019-03-16 17:41:53 +01:00
// Clean up
for (let i of Object.keys(paths)) delete paths[i];
for (let i of Object.keys(snippets)) delete snippets[i];
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-03-16 17:41:53 +01:00
.attr("class", "various");
if (complete) {
// Title
points.title = points.collarCbTopCp.shiftFractionTowards(points.collarstandCbTopCp, 0.5);
macro("title", {
at: points.title,
nr: 6,
title: "underCollar"
});
2019-03-16 11:39:06 +01:00
2019-03-16 17:56:38 +01:00
if (sa) {
paths.sa1 = new Path()
.move(points.collarstandCbTop)
.line(points.collarCbTop)
.offset(sa);
paths.sa2 = new Path()
.move(points.collarstandTip)
.line(points.notch)
.line(points.notchTip)
.offset(-1 * sa);
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)
.attr("class", "various sa");
paths.sa1.render = false;
paths.sa2.render = false;
}
2019-03-16 17:41:53 +01:00
}
2019-03-16 17:56:38 +01:00
2019-03-16 11:39:06 +01:00
return part;
}