1
0
Fork 0

construction: Sleeve head

This commit is contained in:
Joost De Cock 2018-08-06 16:19:12 +02:00
parent b77c146a7e
commit 8379361e47
8 changed files with 381 additions and 145 deletions

View file

@ -1,12 +1,13 @@
import freesewing from "freesewing";
import base from "./base";
import * as shared from "./shared";
var front = {
draft: function(pattern) {
let part = new pattern.Part().copy(pattern.parts.back);
// prettier-ignore
let {sa, Point, points, Path, paths, Snippet, snippets, options, measurements, final, paperless, macro} = freesewing.utils.shorthand(part);
let {store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, final, paperless, macro} = freesewing.utils.shorthand(part);
// Cut arm a bit deeper at the front
let deeper = measurements.chestCircumference * options.frontArmholeDeeper;
@ -16,7 +17,6 @@ var front = {
// Rename cb (center back) to cf (center front)
for (let key of ["Neck", "Shoulder", "Armhole", "Waist", "Hips"]) {
console.log("key is", key);
points[`cf${key}`] = new Point(
points[`cb${key}`].x,
points[`cb${key}`].y
@ -28,58 +28,49 @@ var front = {
points.cfNeck = points.cfNeck.shift(-90, points.neck.x);
points.neckCp2 = points.cfNeck.shift(0, points.neck.x * 0.7);
paths.seam = new Path()
.move(points.cfNeck)
.line(points.cfHips)
.line(points.hips)
.line(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow)
.curve(
points.armholeHollowCp1,
points.armholeHollowCp2,
points.armholePitch
)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder)
.line(points.neck)
.curve(points.neckCp1, points.neckCp2, points.cfNeck)
.close()
.attr("class", "fabric");
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)
);
// Final?
if (final) {
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.seam.offset(sa).attr("class", "fabric sa");
}
// Paperless?
if (paperless) {
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
shared.dimensions(macro, points, Path, sa);
macro("hd", {
from: points.cfHips,
to: points.hips,
y: points.hips.y + sa + 15
});
macro("pd", {
path: new Path()
.move(points.armholePitch)
.curve(
points.armholePitchCp1,
points.armholePitchCp2,
points.shoulder
),
d: -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
});
}