2018-08-06 16:19:12 +02:00
|
|
|
import * as shared from "./shared";
|
2018-08-03 17:44:55 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
export default part => {
|
2019-05-10 13:14:31 +02:00
|
|
|
let {
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
options,
|
|
|
|
measurements,
|
|
|
|
complete,
|
|
|
|
paperless,
|
|
|
|
macro
|
|
|
|
} = part.shorthand();
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Cut arm a bit deeper at the front
|
|
|
|
let deeper = measurements.chestCircumference * options.frontArmholeDeeper;
|
|
|
|
points.armholePitchCp1.x -= deeper;
|
|
|
|
points.armholePitch.x -= deeper;
|
|
|
|
points.armholePitchCp2.x -= deeper;
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Rename cb (center back) to cf (center front)
|
2018-12-21 12:55:50 +01:00
|
|
|
for (let key of ["Shoulder", "Armhole", "Waist", "Hips", "Hem"]) {
|
2018-12-17 14:42:28 +01:00
|
|
|
points[`cf${key}`] = new Point(points[`cb${key}`].x, points[`cb${key}`].y);
|
|
|
|
delete points[`cb${key}`];
|
|
|
|
}
|
|
|
|
// Front neckline points
|
|
|
|
points.neckCp2 = new Point(points.neckCp2Front.x, points.neckCp2Front.y);
|
2018-08-06 16:19:12 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Seamline
|
|
|
|
paths.saBase = shared.saBase("front", points, Path);
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.cfNeck)
|
2018-12-21 12:55:50 +01:00
|
|
|
.line(points.cfHem)
|
2018-12-17 14:42:28 +01:00
|
|
|
.join(paths.saBase)
|
|
|
|
.attr("class", "fabric");
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Store lengths to fit sleeve
|
|
|
|
store.set("frontArmholeLength", shared.armholeLength(points, Path));
|
|
|
|
store.set(
|
|
|
|
"frontShoulderToArmholePitch",
|
|
|
|
shared.shoulderToArmholePitch(points, Path)
|
|
|
|
);
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
|
|
|
macro("cutonfold", {
|
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.cfHips,
|
|
|
|
grainline: true
|
|
|
|
});
|
|
|
|
macro("title", { at: points.title, nr: 1, title: "front" });
|
|
|
|
snippets.armholePitchNotch = new Snippet("notch", points.armholePitch);
|
|
|
|
if (sa) {
|
|
|
|
paths.sa = paths.saBase
|
|
|
|
.offset(sa)
|
|
|
|
.attr("class", "fabric sa")
|
|
|
|
.line(points.cfNeck)
|
|
|
|
.move(points.cfHips);
|
|
|
|
paths.sa.line(paths.sa.start());
|
2018-08-05 15:53:09 +02:00
|
|
|
}
|
2018-12-17 14:42:28 +01:00
|
|
|
}
|
2018-08-03 17:44:55 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
|
|
|
shared.dimensions(macro, points, Path, sa);
|
|
|
|
macro("hd", {
|
|
|
|
from: points.cfHips,
|
|
|
|
to: points.hips,
|
|
|
|
y: points.hips.y + sa + 15
|
|
|
|
});
|
|
|
|
macro("vd", {
|
|
|
|
from: points.cfHips,
|
|
|
|
to: points.cfNeck,
|
|
|
|
x: points.cfHips.x - sa - 15
|
|
|
|
});
|
|
|
|
macro("hd", {
|
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.neck,
|
|
|
|
y: points.neck.y - sa - 15
|
|
|
|
});
|
|
|
|
macro("hd", {
|
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.shoulder,
|
|
|
|
y: points.neck.y - sa - 30
|
|
|
|
});
|
2018-08-03 17:44:55 +02:00
|
|
|
}
|
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
return part;
|
|
|
|
};
|