2018-12-23 13:57:40 +01:00
|
|
|
import { addButtonHoles } from "./shared";
|
|
|
|
|
2018-12-23 12:13:37 +01:00
|
|
|
export default part => {
|
2018-12-27 15:04:32 +01:00
|
|
|
let {
|
|
|
|
store,
|
|
|
|
measurements,
|
|
|
|
utils,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
complete,
|
|
|
|
paperless,
|
|
|
|
macro,
|
|
|
|
options
|
|
|
|
} = part.shorthand();
|
2018-12-23 12:13:37 +01:00
|
|
|
|
2018-12-23 13:57:40 +01:00
|
|
|
let fold = options.buttonholePlacketFoldWidth;
|
|
|
|
points.neckEdge = utils.lineIntersectsCurve(
|
|
|
|
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y + 20),
|
|
|
|
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y - 20),
|
2018-12-23 12:13:37 +01:00
|
|
|
points.cfNeck,
|
|
|
|
points.cfNeckCp1,
|
|
|
|
points.neckCp2Front,
|
|
|
|
points.neck
|
|
|
|
);
|
2018-12-23 13:57:40 +01:00
|
|
|
points.hemEdge = new Point(points.neckEdge.x, points.cfHem.y);
|
|
|
|
|
|
|
|
paths.seam = paths.seam.split(points.neckEdge)[0];
|
|
|
|
paths.seam.ops[0].to = points.hemEdge;
|
2018-12-23 12:13:37 +01:00
|
|
|
paths.seam.close().attr("class", "fabric");
|
|
|
|
|
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
|
|
|
// Title
|
2018-12-23 13:57:40 +01:00
|
|
|
macro("title", { at: points.title, nr: "2a", title: "frontLeft" });
|
2018-12-23 12:13:37 +01:00
|
|
|
|
2018-12-23 13:57:40 +01:00
|
|
|
if (sa) {
|
|
|
|
paths.saFromArmhole.end().x = points.neckEdge.x - sa;
|
|
|
|
paths.hemSa.start().x = points.neckEdge.x - sa;
|
|
|
|
paths.saClosure = new Path()
|
|
|
|
.move(paths.saFromArmhole.end())
|
|
|
|
.line(paths.hemSa.start())
|
|
|
|
.attr("class", "fabric sa");
|
|
|
|
}
|
2018-12-23 12:13:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
|
|
|
}
|
|
|
|
return part;
|
|
|
|
};
|