1
0
Fork 0

sparkles: Front part

This commit is contained in:
Joost De Cock 2018-12-21 19:38:05 +01:00
parent 58729a32b0
commit f72ddf53cb
7 changed files with 146 additions and 24 deletions

View file

@ -47,8 +47,7 @@ export default part => {
paths.armhole = new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.attr("class", "stroke-xxl");
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch);
paths.armhole.render = false;
if(options.yokeDart > 0) {
points.tmp1 = points.armholePitch.shift(-90, points.armholePitch.dy(points.armhole) * options.yokeDart);
@ -66,8 +65,11 @@ export default part => {
points.yokeDartTipCp1 = points.armholePitch.shiftFractionTowards(points.yokeDartTip, 0.4);
paths.armhole = paths.armhole.split(points.yokeDartEdge)[0];
paths.armhole._curve(points.yokeDartTipCp1, points.yokeDartTip)
// FIXME: Must adapt sleeve to compensate for this dart.
// Perhaps by reducing sleevecap ease?
// Adapt armhole length to accomodate dart
store.set(
"backArmholeLength",
store.get("backArmholeLength") - points.yokeDartEdge.dist(points.armholePitch)
);
}
// Cut off at yoke
@ -86,13 +88,11 @@ export default part => {
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole)
.join(paths.armhole)
.line(points.cbYoke)
.attr("class", "stroke-xxl");
.line(points.cbYoke);
paths.hemBase = new Path()
.move(points.cbHem)
.line(points.bballStart)
.curve(points.bballCp1, points.bballCp2, points.bballEnd);
break;
case "slashed":
macro("round", {
@ -107,8 +107,7 @@ export default part => {
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole)
.join(paths.armhole)
.line(points.cbYoke)
.attr("class", "stroke-xxl");
.line(points.cbYoke);
paths.hemBase = new Path()
.move(points.cbHem)
.line(points.slashEnd)
@ -121,11 +120,8 @@ export default part => {
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole)
.join(paths.armhole)
.line(points.cbYoke)
.attr("class", "stroke-xxl");
paths.hemBase = new Path()
.move(points.cbHem)
.line(points.hem);
.line(points.cbYoke);
paths.hemBase = new Path().move(points.cbHem).line(points.hem);
}
// Paths

121
packages/simon/src/front.js Normal file
View file

@ -0,0 +1,121 @@
import { calculateReduction } from "./shared";
export default part => {
// prettier-ignore
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
const collarDelta = () => paths.collar.length() * 2 + store.get("backCollarLength") - store.get("collarLength");
// Populare store with data we need
calculateReduction(part);
store.set("frontArmholeLength", new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
.length());
store.set("collarLength", measurements.neckCircumference * (1+options.collarEase));
// Waist shaping
let reduce = store.get('waistReduction');
if(reduce/4 > options.minimalDartShaping) reduce = reduce/8;
else reduce = reduce/4;
points.waist = points.waist.shift(180, reduce);
points.waistCp1 = points.waist.shift(-90, measurements.naturalWaistToHip * 0.5);
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist)/2);
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips)/4);
// Draft hem
paths.saBaseFromHips = new Path()
.move(points.hips)
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole);
paths.saBaseFromArmhole = new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
.line(points.neck)
.curve(points.neckCp2Front, points.cfNeckCp1, points.cfNeck);
switch(options.hemStyle) {
case "baseball":
points.bballStart = points.cfHem.shiftFractionTowards(points.hem, 0.5);
points.bballEnd = points.hem.shiftFractionTowards(points.hips, options.hemCurve);
points.bballCp1 = points.bballStart.shiftFractionTowards(points.hem, 0.5);
points.bballCp2 = new Point(points.bballCp1.x, points.bballEnd.y);
paths.saBase = new Path()
.move(points.bballEnd)
.line(points.hips)
.join(paths.saBaseFromHips);
paths.hemBase = new Path()
.move(points.cfHem)
.line(points.bballStart)
.curve(points.bballCp1, points.bballCp2, points.bballEnd);
break;
case "slashed":
macro("round", {
from: points.hips,
to: points.cfHem,
via: points.hem,
radius: points.hips.dist(points.hem) * options.hemCurve,
prefix: "slash",
});
paths.saBase = new Path()
.move(points.hips)
.join(paths.saBaseFromHips);
paths.hemBase = new Path()
.move(points.cfHem)
.line(points.slashEnd)
.curve(points.slashCp2, points.slashCp1, points.slashStart);
break;
default:
paths.saBase = new Path()
.move(points.hem)
.line(points.hips)
.join(paths.saBaseFromHips);
paths.hemBase = new Path().move(points.cfHem).line(points.hem);
}
// Paths
paths.saBase.render = false;
paths.saBaseFromHips.render = false;
paths.saBaseFromArmhole.render = false;
paths.hemBase.render = false;
paths.seam = paths.hemBase.join(paths.saBase).join(paths.saBaseFromArmhole).close().attr('class', 'fabric');
// Complete pattern?
if (complete) {
delete paths.cutonfold;
macro("grainline", {
from: points.cfHem.shift(0, 45),
to: points.cfNeck.shift(0, 45)
});
macro("title", { at: points.title, nr: "X", title: "front" });
if(sa) {
paths.saFrench = paths.saBase.offset(sa*2).attr('class', 'fabric sa');
paths.saFromArmhole = paths.saBaseFromArmhole.offset(sa).attr('class', 'fabric sa');
paths.hemSa = paths.hemBase.offset(sa*3).attr('class', 'fabric sa');
paths.saConnect = new Path()
.move(points.cfHem)
.line(paths.hemSa.start())
.move(paths.hemSa.end())
.line(paths.saFrench.start())
.move(paths.saFrench.end())
.line(paths.saFromArmhole.start())
.move(paths.saFromArmhole.end())
.line(points.cfNeck)
.attr('class', 'fabric sa');
delete paths.sa;
}
}
// Paperless?
if (paperless) {
}
return part;
};

View file

@ -5,7 +5,7 @@ import config from "../config/config";
import { version } from "../package.json";
// Parts
import draftBack from "./back";
//import draftFront from "./front";
import draftFront from "./front";
//import draftSleevecap from "./sleevecap";
//import draftSleeve from "./sleeve";
// backBlock: ".Back block"
@ -52,6 +52,7 @@ Simon.prototype.draftBackBase = function (part) {
return new Brian(this.settings).draftBack(part);
}
Simon.prototype.draftBack = draftBack;
Simon.prototype.draftFront = draftFront;