1
0
Fork 0
freesewing/packages/bent/src/undersleeve.js

64 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-02-26 17:46:07 +01:00
import dimensions from "./shared";
export default function(part) {
let {
macro,
Path,
points,
paths,
complete,
paperless,
snippets,
Snippet,
sa
} = part.shorthand();
2019-02-26 17:46:07 +01:00
// Extract seamline from sleeve
delete paths.ts;
paths.seam = paths.us.clone().attr("class", "fabric", true);
2019-02-26 17:46:07 +01:00
delete paths.us;
// Complete?
if (complete) {
snippets.logo = new Snippet("logo", points.elbowCenter);
macro("title", {
at: points.armCenter,
nr: 4,
title: "undersleeve"
});
if (sa) {
paths.sa = paths.seam.clone();
// Remove hem
paths.sa.ops.splice(-2);
paths.sa = paths.sa
.offset(sa)
.join(
new Path()
.move(points.usWristLeft)
.line(points.usWristRight)
.offset(sa * 3)
2019-02-26 17:46:07 +01:00
)
.close()
.attr("class", "fabric sa");
}
}
// Paperless?
if (paperless) {
dimensions(part, "us");
macro("hd", {
from: points.usLeftEdge,
to: points.usTip,
y: points.usTip.y - sa - 15
});
macro("vd", {
from: points.tsRightEdge,
to: points.usTip,
x: points.tsRightEdge.x + sa + 15
});
}
return part;
}