1
0
Fork 0

sparkles: Updates for freesewing v0.23

This commit is contained in:
Joost De Cock 2018-12-20 11:41:35 +01:00
parent 0e726bd55b
commit 8f5747e078
14 changed files with 1949 additions and 2058 deletions

View file

@ -1,63 +1,59 @@
var cuff = {
draft: function(part) {
// prettier-ignore
let {measurements, options, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
export default function(part) {
// prettier-ignore
let {measurements, options, sa, Point, points, Path, paths, complete, paperless, macro, units} = part.shorthand();
let width =
(measurements.centerBackNeckToWaist + measurements.naturalWaistToHip) *
options.ribbingWidth *
2;
let length =
measurements.wristCircumference *
(1 + options.cuffEase) *
(1 - options.ribbingStretchFactor);
let width =
(measurements.centerBackNeckToWaist + measurements.naturalWaistToHip) *
options.ribbingWidth *
2;
let length =
measurements.wristCircumference *
(1 + options.cuffEase) *
(1 - options.ribbingStretchFactor);
points.topLeft = new Point(0, 0);
points.bottomLeft = new Point(0, width);
points.topRight = new Point(length, 0);
points.bottomRight = new Point(length, width);
points.topLeft = new Point(0, 0);
points.bottomLeft = new Point(0, width);
points.topRight = new Point(length, 0);
points.bottomRight = new Point(length, width);
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottomLeft)
.line(points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr("class", "fabric");
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottomLeft)
.line(points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr("class", "fabric");
// Complete pattern?
if (complete) {
if (sa) {
paths.sa = paths.seam.offset(sa);
}
points.title = points.bottomLeft.shiftFractionTowards(
points.topRight,
0.5
);
macro("title", { at: points.title, nr: 9, title: "cuff" });
macro("grainline", {
from: points.bottomLeft.shift(0, 20),
to: points.topLeft.shift(0, 20)
});
// Complete pattern?
if (complete) {
if (sa) {
paths.sa = paths.seam.offset(sa);
}
// Paperless?
if (paperless) {
macro("vd", {
from: points.bottomRight,
to: points.topRight,
x: points.topRight.x + sa + 15
});
macro("hd", {
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomRight.y + sa + 15
});
}
return part;
points.title = points.bottomLeft.shiftFractionTowards(
points.topRight,
0.5
);
macro("title", { at: points.title, nr: 9, title: "cuff" });
macro("grainline", {
from: points.bottomLeft.shift(0, 20),
to: points.topLeft.shift(0, 20)
});
}
};
export default cuff;
// Paperless?
if (paperless) {
macro("vd", {
from: points.bottomRight,
to: points.topRight,
x: points.topRight.x + sa + 15
});
macro("hd", {
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomRight.y + sa + 15
});
}
return part;
};