1
0
Fork 0
freesewing/packages/simon/src/cuff-barrel-angled.js

55 lines
1.2 KiB
JavaScript
Raw Normal View History

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,
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;
};