1
0
Fork 0
freesewing/packages/carlton/src/innerpockettab.js

67 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-03-25 18:20:15 +01:00
export default function(part) {
let { paperless, sa, snippets, Snippet, utils, store, complete, points, measurements, options, macro, Point, paths, Path } = part.shorthand();
points.topLeft = new Point(0, 0);
points.topRight = new Point(
store.get("innerPocketWidth") * 1.2,
0
);
points.bottom = new Point(
store.get("innerPocketWidth") * 0.6,
store.get("innerPocketWidth") * 0.6,
);
points.top = new Point(
store.get("innerPocketWidth") * 0.6,
0
);
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottom)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr("class", "lining");
paths.hint = new Path()
.move(points.top)
.line(points.bottom)
.attr("class", "lining dashed");
2019-03-30 13:51:23 +01:00
if (complete) {
points.title = points.top.shiftFractionTowards(points.bottom, 0.5);
macro("title", {
at: points.title,
nr: 15,
title: "innerPocketTab"
});
macro("grainline", {
from: points.top,
to: points.top.shift(-45, points.top.x*0.7)
});
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "lining sa");
if (paperless) {
macro("hd", {
from: points.topLeft,
to: points.top,
y: points.topLeft.y - sa - 15
});
macro("hd", {
from: points.topLeft,
to: points.topRight,
y: points.topLeft.y - sa - 30
});
macro("vd", {
from: points.bottom,
to: points.topRight,
x: points.topRight.x + sa + 15
});
}
}
2019-03-25 18:20:15 +01:00
return part;
}