2018-12-27 13:42:55 +01:00
|
|
|
import {
|
|
|
|
draftBarrelCuff,
|
|
|
|
decorateBarrelCuff,
|
|
|
|
paperlessBarrelCuff
|
|
|
|
} from "./shared";
|
2018-12-27 13:08:30 +01:00
|
|
|
|
|
|
|
export default part => {
|
2018-12-27 15:04:32 +01:00
|
|
|
let {
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
complete,
|
|
|
|
paperless,
|
2019-05-10 13:14:31 +02:00
|
|
|
macro
|
2018-12-27 15:04:32 +01:00
|
|
|
} = part.shorthand();
|
2018-12-27 13:08:30 +01:00
|
|
|
|
|
|
|
draftBarrelCuff(part);
|
|
|
|
let height = store.get("cuffHeight");
|
|
|
|
|
|
|
|
points.leftAngleTop = points.topLeft.shift(0, height / 3);
|
|
|
|
points.leftAngleBottom = points.topLeft.shift(-90, height / 3);
|
|
|
|
points.rightAngleTop = points.topRight.shift(180, height / 3);
|
|
|
|
points.rightAngleBottom = points.topRight.shift(-90, height / 3);
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.leftAngleBottom)
|
|
|
|
.line(points.bottomLeft)
|
|
|
|
.line(points.bottomRight)
|
|
|
|
.line(points.rightAngleBottom)
|
|
|
|
.line(points.rightAngleTop)
|
|
|
|
.line(points.leftAngleTop)
|
|
|
|
.line(points.leftAngleBottom)
|
|
|
|
.close()
|
|
|
|
.attr("class", "fabric");
|
|
|
|
|
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
|
|
|
decorateBarrelCuff(part);
|
|
|
|
if (sa) paths.sa = paths.seam.offset(sa);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2018-12-27 13:42:55 +01:00
|
|
|
paperlessBarrelCuff(part);
|
|
|
|
macro("vd", {
|
|
|
|
from: points.rightAngleBottom,
|
|
|
|
to: points.rightAngleTop,
|
|
|
|
x: points.rightAngleBottom.x + 15 + sa
|
|
|
|
});
|
2018-12-27 13:08:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return part;
|
|
|
|
};
|