2018-08-03 17:44:55 +02:00
|
|
|
import freesewing from "freesewing";
|
|
|
|
import base from "./base";
|
2018-08-06 16:19:12 +02:00
|
|
|
import * as shared from "./shared";
|
2018-08-03 17:44:55 +02:00
|
|
|
|
|
|
|
var front = {
|
2018-08-05 15:53:09 +02:00
|
|
|
draft: function(pattern) {
|
2018-08-05 18:34:32 +02:00
|
|
|
let part = new pattern.Part().copy(pattern.parts.back);
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-08-03 17:44:55 +02:00
|
|
|
// prettier-ignore
|
2018-08-08 14:38:19 +02:00
|
|
|
let {store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, final, paperless, macro} = part.shorthand();
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-08-06 07:48:37 +02:00
|
|
|
// Cut arm a bit deeper at the front
|
2018-08-05 15:53:09 +02:00
|
|
|
let deeper = measurements.chestCircumference * options.frontArmholeDeeper;
|
|
|
|
points.armholeHollowCp2.x -= deeper;
|
|
|
|
points.armholePitch.x -= deeper;
|
|
|
|
points.armholePitchCp1.x -= deeper;
|
|
|
|
|
2018-08-06 07:48:37 +02:00
|
|
|
// Rename cb (center back) to cf (center front)
|
|
|
|
for (let key of ["Neck", "Shoulder", "Armhole", "Waist", "Hips"]) {
|
|
|
|
points[`cf${key}`] = new Point(
|
|
|
|
points[`cb${key}`].x,
|
|
|
|
points[`cb${key}`].y
|
|
|
|
);
|
|
|
|
delete points[`cb${key}`];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Adapt neck opening
|
|
|
|
points.cfNeck = points.cfNeck.shift(-90, points.neck.x);
|
|
|
|
points.neckCp2 = points.cfNeck.shift(0, points.neck.x * 0.7);
|
|
|
|
|
2018-08-06 16:19:12 +02:00
|
|
|
paths.seam = shared.seamLine("front", points, Path);
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
// Final?
|
|
|
|
if (final) {
|
2018-08-06 16:19:12 +02:00
|
|
|
macro("cutonfold", {
|
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.cfHips,
|
|
|
|
grainline: true
|
|
|
|
});
|
2018-08-05 15:53:09 +02:00
|
|
|
macro("title", { at: points.title, nr: 1, title: "front" });
|
2018-08-05 18:34:32 +02:00
|
|
|
snippets.armholePitchNotch = new Snippet("notch", points.armholePitch);
|
2018-08-05 15:53:09 +02:00
|
|
|
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2018-08-06 16:19:12 +02:00
|
|
|
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
|
2018-08-05 15:53:09 +02:00
|
|
|
});
|
2018-08-06 16:19:12 +02:00
|
|
|
macro("hd", {
|
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.shoulder,
|
|
|
|
y: points.neck.y - sa - 30
|
2018-08-05 15:53:09 +02:00
|
|
|
});
|
|
|
|
}
|
2018-08-03 17:44:55 +02:00
|
|
|
|
|
|
|
return part;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default front;
|