1
0
Fork 0
freesewing/packages/cathrin/src/panel5.js

85 lines
1.9 KiB
JavaScript
Raw Normal View History

2018-12-20 08:32:21 +01:00
export default function(part) {
let {
macro,
sa,
points,
paths,
Point,
complete,
paperless
} = part.shorthand();
2018-09-11 16:26:38 +02:00
2018-12-20 08:32:21 +01:00
delete paths.outline;
delete paths.panel1;
delete paths.panel2;
delete paths.panel3;
delete paths.panel4;
delete paths.panel6;
2018-09-11 16:26:38 +02:00
2018-12-20 08:32:21 +01:00
// Complete pattern?
if (complete) {
2018-12-20 08:32:21 +01:00
points.grainlineTop = new Point(
points.waistGap4Right.shiftFractionTowards(points.waistGap5Left, 0.5).x,
points.underbustGap4Right.y
);
points.grainlineBottom = new Point(
points.grainlineTop.x,
points.hipsGap5.y
);
macro("grainline", {
2018-12-20 08:32:21 +01:00
from: points.grainlineBottom,
to: points.grainlineTop
});
points.title = points.grainlineTop.shift(
-90,
points.grainlineTop.dy(points.waistGap5Left) / 2
);
macro("title", {
2018-12-20 08:32:21 +01:00
nr: 5,
title: "",
2018-12-20 08:32:21 +01:00
at: points.title
});
if (sa) paths.sa = paths.panel5.offset(sa).attr("class", "fabric sa");
2018-12-20 08:32:21 +01:00
}
2018-09-11 16:26:38 +02:00
2018-12-20 08:32:21 +01:00
// Paperless?
if (paperless) {
macro("hd", {
2018-12-20 08:32:21 +01:00
from: points.hipsGap4,
to: points.hipsGap5,
y: points.hipsGap4.y + sa + 15
});
macro("ld", {
2018-12-20 08:32:21 +01:00
from: points.waistGap4Right,
to: points.waistGap5Left
});
macro("hd", {
2018-12-20 08:32:21 +01:00
from: points.underbustGap4Right,
to: points.underbustGap5Left,
y: points.underbustGap5Left.y - sa - 15
});
macro("vd", {
2018-12-20 08:32:21 +01:00
from: points.hipsGap4,
to: points.waistGap4Right,
x: points.hipsGap4.x - sa - 15
});
macro("vd", {
2018-12-20 08:32:21 +01:00
from: points.waistGap4Right,
to: points.underbustGap4Right,
x: points.hipsGap4.x - sa - 15
});
macro("vd", {
2018-12-20 08:32:21 +01:00
from: points.hipsGap5,
to: points.waistGap4Right,
x: points.hipsGap5.x + sa + 15
});
macro("vd", {
2018-12-20 08:32:21 +01:00
from: points.waistGap4Right,
to: points.underbustGap5Left,
x: points.hipsGap5.x + sa + 15
});
2018-09-11 16:26:38 +02:00
}
2018-12-20 08:32:21 +01:00
return part;
}