2018-07-26 23:30:43 +02:00
|
|
|
import freesewing from "freesewing";
|
2018-07-24 10:16:31 +00:00
|
|
|
import base from "./base";
|
|
|
|
|
|
|
|
var back = {
|
2018-08-05 13:57:24 +02:00
|
|
|
draft: function(pattern) {
|
|
|
|
let part = new pattern.part();
|
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-07-26 10:03:19 +00:00
|
|
|
base.draft(part);
|
2018-07-19 13:14:50 +00:00
|
|
|
|
2018-07-26 23:30:43 +02:00
|
|
|
paths.seam = new path()
|
2018-07-19 13:14:50 +00:00
|
|
|
.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
|
|
|
|
)
|
2018-07-19 13:14:50 +00:00
|
|
|
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder)
|
|
|
|
.line(points.neck)
|
|
|
|
.curve(points.neckCp1, points.cbNeck, points.cbNeck)
|
2018-07-30 13:42:28 +02:00
|
|
|
.close()
|
|
|
|
.attr("class", "fabric");
|
2018-07-19 14:43:27 +00:00
|
|
|
|
2018-08-03 17:44:55 +02:00
|
|
|
// Anchor point for sampling
|
|
|
|
points.gridAnchor = points.cbHips;
|
|
|
|
|
2018-07-19 14:43:27 +00:00
|
|
|
// Final?
|
2018-08-01 14:55:16 +02:00
|
|
|
if (final) {
|
2018-07-24 10:16:31 +00:00
|
|
|
macro("cutonfold", {
|
|
|
|
from: points.cbNeck,
|
|
|
|
to: points.cbHips,
|
|
|
|
grainline: true
|
2018-07-21 12:54:05 +02:00
|
|
|
});
|
2018-07-26 10:03:19 +00:00
|
|
|
|
2018-07-26 23:30:43 +02:00
|
|
|
points.title = new point(
|
2018-07-26 10:03:19 +00:00
|
|
|
points.armholePitch.x / 2,
|
|
|
|
points.armholePitch.y
|
|
|
|
);
|
2018-07-26 12:38:46 +00:00
|
|
|
macro("title", { at: points.title, nr: 2 });
|
|
|
|
|
|
|
|
points.logo = points.title.shift(-90, 100);
|
2018-07-26 23:30:43 +02:00
|
|
|
snippets.logo = new snippet("logo", points.logo);
|
2018-08-03 17:44:55 +02:00
|
|
|
snippets.armholePitchNotch = new snippet("notch", points.armholePitch);
|
2018-07-26 13:43:45 +00:00
|
|
|
|
2018-08-01 14:55:16 +02:00
|
|
|
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) {
|
2018-08-01 14:55:16 +02:00
|
|
|
macro("hd", {
|
|
|
|
from: points.cbHips,
|
|
|
|
to: points.hips,
|
|
|
|
y: points.hips.y + sa + 15
|
|
|
|
});
|
|
|
|
macro("vd", {
|
|
|
|
from: points.hips,
|
|
|
|
to: points.armhole,
|
|
|
|
x: points.hips.x + sa + 15
|
|
|
|
});
|
|
|
|
macro("vd", {
|
|
|
|
from: points.hips,
|
|
|
|
to: points.armholePitch,
|
|
|
|
x: points.hips.x + sa + 30
|
|
|
|
});
|
|
|
|
macro("vd", {
|
|
|
|
from: points.hips,
|
|
|
|
to: points.shoulder,
|
|
|
|
x: points.hips.x + sa + 45
|
|
|
|
});
|
|
|
|
macro("vd", {
|
|
|
|
from: points.hips,
|
|
|
|
to: points.neck,
|
|
|
|
x: points.hips.x + sa + 60
|
|
|
|
});
|
|
|
|
macro("vd", {
|
|
|
|
from: points.cbHips,
|
|
|
|
to: points.cbNeck,
|
|
|
|
x: points.cbHips.x - sa - 15
|
|
|
|
});
|
|
|
|
macro("hd", {
|
|
|
|
from: points.cbNeck,
|
|
|
|
to: points.neck,
|
|
|
|
y: points.neck.y - sa - 15
|
|
|
|
});
|
|
|
|
macro("hd", {
|
|
|
|
from: points.cbNeck,
|
|
|
|
to: points.shoulder,
|
|
|
|
y: points.neck.y - sa - 30
|
|
|
|
});
|
|
|
|
macro("ld", { from: points.neck, to: points.shoulder, d: sa + 15 });
|
|
|
|
macro("pd", {
|
|
|
|
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", {
|
|
|
|
path: new path()
|
|
|
|
.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-19 13:14:50 +00:00
|
|
|
}
|
2018-07-24 10:16:31 +00:00
|
|
|
};
|
2018-07-19 13:14:50 +00:00
|
|
|
|
|
|
|
export default back;
|