1
0
Fork 0
freesewing/packages/brian/src/back.js

71 lines
1.9 KiB
JavaScript
Raw Normal View History

import freesewing from "freesewing";
2018-07-24 10:16:31 +00:00
var back = {
draft: function(pattern) {
let part = new pattern.Part().copy(pattern.parts.base);
2018-08-03 17:44:55 +02:00
// prettier-ignore
let {sa, Point, points, Path, paths, Snippet, snippets, final, paperless, macro} = freesewing.utils.shorthand(part);
2018-08-03 17:44:55 +02:00
paths.seam = new Path()
.move(points.cbNeck)
.line(points.cbHips)
.line(points.hips)
.line(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow)
2018-07-24 10:16:31 +00:00
.curve(
points.armholeHollowCp1,
points.armholeHollowCp2,
points.armholePitch
)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder)
.line(points.neck)
.curve(points.neckCp1, points.cbNeck, points.cbNeck)
.close()
.attr("class", "fabric");
2018-07-19 14:43:27 +00:00
// Final?
if (final) {
macro("title", { at: points.title, nr: 2, title: "back" });
snippets.armholePitchNotch = new Snippet("notch", points.armholePitch);
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
2018-07-19 14:43:27 +00:00
}
// Paperless?
2018-07-24 10:16:31 +00:00
if (paperless) {
macro("pd", {
id: "armholeLengthDimension",
path: new Path()
.move(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow)
.curve(
points.armholeHollowCp1,
points.armholeHollowCp2,
points.armholePitch
)
.curve(
points.armholePitchCp1,
points.armholePitchCp2,
points.shoulder
),
d: sa + 15
});
2018-08-03 17:44:55 +02:00
macro("pd", {
id: "armholePitchDimension",
path: new Path()
2018-08-03 17:44:55 +02:00
.move(points.armholePitch)
.curve(
points.armholePitchCp1,
points.armholePitchCp2,
points.shoulder
),
d: -15
});
2018-07-19 14:43:27 +00:00
}
2018-08-03 17:44:55 +02:00
return part;
}
2018-07-24 10:16:31 +00:00
};
export default back;