1
0
Fork 0

sparkles: Added sleeve placket overlap

This commit is contained in:
Joost De Cock 2018-12-24 17:35:06 +01:00
parent 1bccf5c827
commit 3afdaf751d
7 changed files with 265 additions and 40 deletions

View file

@ -41,7 +41,12 @@ export default {
yoke: "backBase",
sleeve: "sleeveBase"
},
parts: ["collarStand", "collar"],
parts: [
"collarStand",
"collar",
"sleevePlacketUnderlap",
"sleevePlacketOverlap"
],
hide: ["base", "frontBase", "front", "backBase", "sleeveBase"],
options: {
// Constants

View file

@ -113,7 +113,7 @@ let settings1 = { ...settings };
pattern1.settings.options.buttonholePlacketType = "seperate";
//pattern1.settings.options.splitYoke = "yes";
pattern1.settings.sa = 10;
pattern1.settings.only = "collar";
pattern1.settings.only = "sleevePlacketOverlap";
pattern1.draft();
console.log(pattern1);
document.getElementById("svg1").innerHTML = pattern1.render();

View file

@ -27,7 +27,7 @@
"major": "npm version major -m ':bookmark: v%s' && npm run build",
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "rimraf dist",
"pretty": "npx prettier --write \"src/*.js\"",
"pretty": "npx prettier --write \"src/*.js\" \"config/*.js\"",
"lint": "eslint --fix \"src/*.js\"",
"watch": "nodemon -w src --exec npm run browserbuild",
"browserbuild": "rollup -c rollup.js -o dist/browser.js -f iife -m true -n freesewing_patterns_simon --footer 'freesewing.patterns.simon = freesewing_patterns_simon;'",

View file

@ -6,27 +6,52 @@ export default part => {
// Populare store with data we need
calculateReduction(part);
store.set("backArmholeLength", new Path()
store.set(
"backArmholeLength",
new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.curve(
points.armholeHollowCp2,
points.armholePitchCp1,
points.armholePitch
)
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
.length());
.length()
);
// Waist shaping
let reduce = store.get('waistReduction');
if(reduce/4 > options.minimalDartShaping) {
let reduce = store.get("waistReduction");
if (reduce / 4 > options.minimalDartShaping) {
// Add darts in the back
points.waist = points.waist.shift(180, reduce/8);
points.waist = points.waist.shift(180, reduce / 8);
points.dartCenter = points.cbWaist.shiftFractionTowards(points.waist, 0.6);
points.dartTop = points.dartCenter.shift(90, points.armhole.dy(points.waist) * 0.75);
points.dartBottom = points.dartCenter.shift(-90, measurements.naturalWaistToHip * 0.75);
points.dartCenterIn = points.dartCenter.shift(180, reduce/8);
points.dartCenterOut = points.dartCenter.shift(0, reduce/8);
points.dartCenterInCp1 = points.dartCenterIn.shift(90, points.dartTop.dy(points.dartCenter) * 0.2);
points.dartCenterInCp2 = points.dartCenterIn.shift(90, points.dartBottom.dy(points.dartCenter) * 0.2);
points.dartCenterOutCp1 = points.dartCenterOut.shift(90, points.dartBottom.dy(points.dartCenter) * 0.2);
points.dartCenterOutCp2 = points.dartCenterOut.shift(90, points.dartTop.dy(points.dartCenter) * 0.2);
points.dartTop = points.dartCenter.shift(
90,
points.armhole.dy(points.waist) * 0.75
);
points.dartBottom = points.dartCenter.shift(
-90,
measurements.naturalWaistToHip * 0.75
);
points.dartCenterIn = points.dartCenter.shift(180, reduce / 8);
points.dartCenterOut = points.dartCenter.shift(0, reduce / 8);
points.dartCenterInCp1 = points.dartCenterIn.shift(
90,
points.dartTop.dy(points.dartCenter) * 0.2
);
points.dartCenterInCp2 = points.dartCenterIn.shift(
90,
points.dartBottom.dy(points.dartCenter) * 0.2
);
points.dartCenterOutCp1 = points.dartCenterOut.shift(
90,
points.dartBottom.dy(points.dartCenter) * 0.2
);
points.dartCenterOutCp2 = points.dartCenterOut.shift(
90,
points.dartTop.dy(points.dartCenter) * 0.2
);
paths.dart = new Path()
.move(points.dartTop)
._curve(points.dartCenterInCp1, points.dartCenterIn)
@ -34,25 +59,35 @@ export default part => {
._curve(points.dartCenterOutCp1, points.dartCenterOut)
.curve_(points.dartCenterOutCp2, points.dartTop)
.close()
.attr('class', 'fabric');
.attr("class", "fabric");
} else {
// No darts in the back
points.waist = points.waist.shift(180, reduce/4);
points.waist = points.waist.shift(180, reduce / 4);
}
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);
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);
// Yoke dart
paths.armhole = new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch);
.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);
points.tmp2 = points.tmp1.shift(180,50);
points.tmp3 = points.tmp1.shift(0,50);
if (options.yokeDart > 0) {
points.tmp1 = points.armholePitch.shift(
-90,
points.armholePitch.dy(points.armhole) * options.yokeDart
);
points.tmp2 = points.tmp1.shift(180, 50);
points.tmp3 = points.tmp1.shift(0, 50);
points.yokeDartEdge = utils.lineIntersectsCurve(
points.tmp2,
points.tmp3,
@ -61,14 +96,21 @@ export default part => {
points.armholeHollowCp2,
points.armholeHollow
);
points.yokeDartTip = points.armholePitch.shift(180, points.armholePitch.x * 0.4);
points.yokeDartTipCp1 = points.armholePitch.shiftFractionTowards(points.yokeDartTip, 0.4);
points.yokeDartTip = points.armholePitch.shift(
180,
points.armholePitch.x * 0.4
);
points.yokeDartTipCp1 = points.armholePitch.shiftFractionTowards(
points.yokeDartTip,
0.4
);
paths.armhole = paths.armhole.split(points.yokeDartEdge)[0];
paths.armhole._curve(points.yokeDartTipCp1, points.yokeDartTip)
paths.armhole._curve(points.yokeDartTipCp1, points.yokeDartTip);
// Adapt armhole length to accomodate dart
store.set(
"backArmholeLength",
store.get("backArmholeLength") - points.yokeDartEdge.dist(points.armholePitch)
store.get("backArmholeLength") -
points.yokeDartEdge.dist(points.armholePitch)
);
}
@ -76,10 +118,13 @@ export default part => {
points.cbYoke = new Point(0, points.armholePitch.y);
// Draft hem
switch(options.hemStyle) {
switch (options.hemStyle) {
case "baseball":
points.bballStart = points.cbHem.shiftFractionTowards(points.hem, 0.5);
points.bballEnd = points.hem.shiftFractionTowards(points.hips, options.hemCurve);
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()
@ -100,7 +145,7 @@ export default part => {
to: points.cbHem,
via: points.hem,
radius: points.hips.dist(points.hem) * options.hemCurve,
prefix: "slash",
prefix: "slash"
});
paths.saBase = new Path()
.move(points.hips)
@ -127,7 +172,10 @@ export default part => {
// Paths
paths.saBase.render = false;
paths.hemBase.render = false;
paths.seam = paths.hemBase.join(paths.saBase).close().attr('class', 'fabric');
paths.seam = paths.hemBase
.join(paths.saBase)
.close()
.attr("class", "fabric");
// Complete pattern?
if (complete) {
@ -137,14 +185,14 @@ export default part => {
to: points.cbHem,
grainline: true
});
points.title = new Point(points.armhole.x/4, points.armhole.y);
points.title = new Point(points.armhole.x / 4, points.armhole.y);
macro("title", { at: points.title, nr: 3, title: "back" });
points.logo = points.title.shift(-90, 70);
snippets.logo = new Snippet("logo", points.logo);
if(sa) {
paths.sa = paths.saBase.offset(sa).attr('class', 'fabric sa');
paths.hemSa = paths.hemBase.offset(sa*3).attr('class', 'fabric sa');
if (sa) {
paths.sa = paths.saBase.offset(sa).attr("class", "fabric sa");
paths.hemSa = paths.hemBase.offset(sa * 3).attr("class", "fabric sa");
paths.saConnect = new Path()
.move(points.cbHem)
.line(paths.hemSa.start())
@ -152,7 +200,7 @@ export default part => {
.line(paths.sa.start())
.move(paths.sa.end())
.line(points.cbYoke)
.attr('class', 'fabric sa');
.attr("class", "fabric sa");
}
}

View file

@ -15,6 +15,8 @@ import draftYoke from "./yoke";
import draftSleeve from "./sleeve";
import draftCollarStand from "./collarstand";
import draftCollar from "./collar";
import draftSleevePlacketUnderlap from "./sleeveplacket-underlap";
import draftSleevePlacketOverlap from "./sleeveplacket-overlap";
// Constructor
const Simon = function(settings) {
@ -55,5 +57,7 @@ Simon.prototype.draftYoke = draftYoke;
Simon.prototype.draftSleeve = draftSleeve;
Simon.prototype.draftCollarStand = draftCollarStand;
Simon.prototype.draftCollar = draftCollar;
Simon.prototype.draftSleevePlacketUnderlap = draftSleevePlacketUnderlap;
Simon.prototype.draftSleevePlacketOverlap = draftSleevePlacketOverlap;
export default Simon;

View file

@ -0,0 +1,100 @@
export default part => {
// prettier-ignore
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
let width = options.sleevePlacketWidth;
let length = measurements.shoulderToWrist * options.sleevePlacketLength;
points.midLeft = new Point(0, 0);
points.midLen = points.midLeft.shift(0, length);
points.midRight = points.midLeft.shift(0, length + width * 1.25);
points.fold1Left = points.midLeft.shift(90, width / 2);
points.fold2Left = points.midLeft.shift(-90, width / 2);
points.boxTopRight = points.midRight.shift(90, width / 2);
points.boxBottomRight = points.midRight.shift(-90, width / 2);
points.boxTopLeft = points.midLen.shift(90, width / 2);
points.boxBottomLeft = points.midLen.shift(-90, width / 2);
points.boxTip = points.midLen.shift(0, width * 1.5);
points.fold1Right = points.boxTopRight.shift(0, width * 0.5);
points.fold2Right = points.boxBottomRight.shift(0, width * 0.5);
points.topLeft = points.fold1Left.shift(90, width / 2 - 1.5);
points.topRight = points.fold1Right.shift(90, width / 2 - 1.5);
points.bottomRight = points.fold2Right.shift(-90, width * 1.5 - 1.5);
points.bottomLeft = points.fold2Left.shift(-90, width * 1.5 - 1.5);
points.cutRight = points.fold2Right.shift(-90, width / 2 - 1.5);
points.zig = points.cutRight.shift(180, width * 0.6);
points.zag = new Point(
points.bottomRight.x - width,
points.bottomRight.y - width * 0.6
);
points.cutLeft = points.zag.shift(180, width / 2);
points.cutBottom = new Point(points.cutLeft.x, points.bottomLeft.y);
points.fold3Left = new Point(0, width * 1.5);
points.fold3Right = new Point(points.cutBottom.x, width * 1.5);
paths.seam = new Path()
.move(points.topLeft)
.line(points.topRight)
.line(points.cutRight)
.line(points.zig)
.line(points.zag)
.line(points.cutLeft)
.line(points.cutBottom)
.line(points.bottomLeft)
.close()
.attr("class", "fabric");
paths.outline = new Path()
.move(points.fold1Left)
.line(points.boxTopRight)
.line(points.boxTip)
.line(points.boxBottomRight)
.line(points.fold2Left)
.move(points.boxTopLeft)
.line(points.boxBottomLeft)
.attr("class", "dashed");
paths.folds = new Path()
.move(points.fold3Left)
.line(points.fold3Right)
.move(points.boxBottomRight)
.line(points.fold2Right)
.line(points.boxTip)
.line(points.fold1Right)
.line(points.boxTopRight)
.attr("class", "dotted");
// Complete pattern?
if (complete) {
// Title
points.title = new Point(length / 4, 0);
macro("title", {
at: points.title,
nr: 10,
title: "sleevePlacketOverlap",
scale: 0.6
});
// Button
points.buttonhole = new Point(length / 2, 0);
snippets.buttonhole = new Snippet("buttonhole", points.buttonhole).attr(
"data-rotate",
90
);
if (sa) {
paths.sa = new Path()
.move(points.bottomLeft)
.line(points.bottomLeft.shift(180, sa))
.line(points.topLeft.shift(180, sa))
.line(points.topLeft)
.attr("class", "fabric sa");
}
}
// Paperless?
if (paperless) {
}
return part;
};

View file

@ -0,0 +1,68 @@
export default part => {
// prettier-ignore
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
let width =
options.sleevePlacketWidth > 20 ? 10 : options.sleevePlacketWidth / 4;
let length = measurements.shoulderToWrist * options.sleevePlacketLength;
points.midLeft = new Point(0, 0);
points.midRight = points.midLeft.shift(0, length);
points.fold1Left = points.midLeft.shift(90, width);
points.fold2Left = points.midLeft.shift(-90, width);
points.fold1Right = points.fold1Left.shift(0, length);
points.fold2Right = points.fold2Left.shift(0, length);
points.topLeft = points.midLeft.shift(90, width * 2 - 1.5);
points.topRight = points.midRight.shift(90, width * 2 - 1.5);
points.bottomLeft = points.midLeft.shift(-90, width * 2 - 1.5);
points.bottomRight = points.midRight.shift(-90, width * 2 - 1.5);
paths.seam = new Path()
.move(points.topLeft)
.line(points.topRight)
.line(points.bottomRight)
.line(points.bottomLeft)
.close()
.attr("class", "fabric");
paths.folds = new Path()
.move(points.fold1Left)
.line(points.fold1Right)
.move(points.fold2Left)
.line(points.fold2Right)
.move(points.midLeft)
.line(points.midRight)
.attr("class", "help");
// Complete pattern?
if (complete) {
// Title
points.title = new Point(length / 4, 0);
macro("title", {
at: points.title,
nr: 9,
title: "sleevePlacketUnderlap",
scale: 0.6,
append: true
});
// Button
points.button = new Point(length / 2, width / 2);
snippets.button = new Snippet("button", points.button);
if (sa) {
paths.sa = new Path()
.move(points.bottomLeft)
.line(points.bottomLeft.shift(180, sa))
.line(points.topLeft.shift(180, sa))
.line(points.topLeft)
.attr("class", "fabric sa");
}
}
// Paperless?
if (paperless) {
}
return part;
};