sparkles: Added sleeve
This commit is contained in:
parent
dab7345608
commit
9901d61f8d
5 changed files with 108 additions and 7 deletions
|
@ -26,7 +26,8 @@ export default {
|
|||
frontLeft: "front",
|
||||
buttonPlacket: "front",
|
||||
buttonholePlacket: "front",
|
||||
yoke: "backBase"
|
||||
yoke: "backBase",
|
||||
sleeve: ["sleeveBase", "front", "back"]
|
||||
},
|
||||
inject: {
|
||||
frontBase: "base",
|
||||
|
@ -37,16 +38,17 @@ export default {
|
|||
frontLeft: "front",
|
||||
buttonPlacket: "front",
|
||||
buttonholePlacket: "front",
|
||||
yoke: "backBase"
|
||||
yoke: "backBase",
|
||||
sleeve: "sleeveBase"
|
||||
},
|
||||
hide: ["base", "frontBase", "front", "backBase"],
|
||||
hide: ["base", "frontBase", "front", "backBase", "sleeveBase"],
|
||||
options: {
|
||||
// Constants
|
||||
collarFactor: 5,
|
||||
minimalDartShaping: 5,
|
||||
brianFitSleeve: true,
|
||||
|
||||
// Toggles
|
||||
cuffOverlap: 0.05,
|
||||
frenchCuffRoundFactor: 0.05,
|
||||
|
||||
// Lists
|
||||
extraTopButton: {
|
||||
|
|
|
@ -113,7 +113,7 @@ let settings1 = { ...settings };
|
|||
pattern1.settings.options.buttonholePlacketType = "seperate";
|
||||
//pattern1.settings.options.splitYoke = "yes";
|
||||
pattern1.settings.sa = 10;
|
||||
pattern1.settings.only = ["yoke" ];
|
||||
//pattern1.settings.only = "sleeve";
|
||||
pattern1.draft();
|
||||
console.log(pattern1);
|
||||
document.getElementById("svg1").innerHTML = pattern1.render();
|
||||
|
|
|
@ -12,6 +12,7 @@ import draftButtonPlacket from "./buttonplacket";
|
|||
import draftFrontLeft from "./frontleft";
|
||||
import draftButtonholePlacket from "./buttonholeplacket";
|
||||
import draftYoke from "./yoke";
|
||||
import draftSleeve from "./sleeve";
|
||||
|
||||
// Constructor
|
||||
const Simon = function(settings) {
|
||||
|
@ -38,6 +39,10 @@ Simon.prototype.draftFrontBase = function(part) {
|
|||
Simon.prototype.draftBackBase = function(part) {
|
||||
return new Brian(this.settings).draftBack(part);
|
||||
};
|
||||
Simon.prototype.draftSleeveBase = function(part) {
|
||||
let brian = new Brian(this.settings);
|
||||
return brian.draftSleeve(brian.draftSleevecap(part));
|
||||
};
|
||||
Simon.prototype.draftBack = draftBack;
|
||||
Simon.prototype.draftFront = draftFront;
|
||||
Simon.prototype.draftFrontRight = draftFrontRight;
|
||||
|
@ -45,6 +50,7 @@ Simon.prototype.draftButtonPlacket = draftButtonPlacket;
|
|||
Simon.prototype.draftFrontLeft = draftFrontLeft;
|
||||
Simon.prototype.draftButtonholePlacket = draftButtonholePlacket;
|
||||
Simon.prototype.draftYoke = draftYoke;
|
||||
Simon.prototype.draftSleeve = draftSleeve;
|
||||
|
||||
export default Simon;
|
||||
|
||||
|
|
93
packages/simon/src/sleeve.js
Normal file
93
packages/simon/src/sleeve.js
Normal file
|
@ -0,0 +1,93 @@
|
|||
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();
|
||||
|
||||
// TODO: Sleeve pleats
|
||||
|
||||
// Sleeve width depends on cuff style
|
||||
let width =
|
||||
measurements.wristCircumference *
|
||||
(1 + options.cuffEase + options.cuffOverlap + options.cuffDrape);
|
||||
if (
|
||||
options.cuffStyle === "straightFrenchcuff" ||
|
||||
options.cuffStyle === "roundedFrenchcuff" ||
|
||||
options.cuffStyle === "angledFrenchCuff"
|
||||
)
|
||||
width =
|
||||
measurements.wristCircumference *
|
||||
(1 + options.cuffEase + options.cuffOverlap * 1.5);
|
||||
points.wristRight.x = width / 2;
|
||||
points.wristLeft.x = width / -2;
|
||||
let cuffLength = measurements.shoulderToWrist * options.cuffLength;
|
||||
points.wristRight = points.wristRight.shift(90, cuffLength);
|
||||
points.wristLeft = points.wristLeft.shift(90, cuffLength);
|
||||
|
||||
points.cuffMid = new Point(0, points.wristLeft.y);
|
||||
points.cuffLeftMid = points.cuffMid.shiftFractionTowards(
|
||||
points.wristLeft,
|
||||
0.5
|
||||
);
|
||||
points.cuffRightMid = points.cuffMid.shiftFractionTowards(
|
||||
points.wristRight,
|
||||
0.5
|
||||
);
|
||||
points.cuffLeftCusp = points.cuffLeftMid.shift(90, width / 50);
|
||||
points.cuffRightCusp = points.cuffRightMid.shift(-90, width / 50);
|
||||
points.cuffLeftCuspCp1 = points.cuffLeftCusp.shift(180, width / 10);
|
||||
points.cuffLeftCuspCp2 = points.cuffLeftCusp.shift(0, width / 10);
|
||||
points.cuffRightCuspCp1 = points.cuffRightCusp.shift(180, width / 10);
|
||||
points.cuffRightCuspCp2 = points.cuffRightCusp.shift(0, width / 10);
|
||||
|
||||
paths.frenchBase = new Path()
|
||||
.move(points.wristRight)
|
||||
.line(points.bicepsRight)
|
||||
._curve(points.capQ1Cp1, points.capQ1)
|
||||
.curve(points.capQ1Cp2, points.capQ2Cp1, points.capQ2)
|
||||
.curve(points.capQ2Cp2, points.capQ3Cp1, points.capQ3)
|
||||
.curve(points.capQ3Cp2, points.capQ4Cp1, points.capQ4)
|
||||
.curve_(points.capQ4Cp2, points.bicepsLeft);
|
||||
paths.frenchBase.render = false;
|
||||
|
||||
paths.saBase = new Path().move(points.bicepsLeft).line(points.wristLeft);
|
||||
paths.saBase.render = false;
|
||||
|
||||
paths.cuffBase = new Path()
|
||||
.move(points.wristLeft)
|
||||
._curve(points.cuffLeftCuspCp1, points.cuffLeftCusp)
|
||||
.curve(
|
||||
points.cuffLeftCuspCp2,
|
||||
points.cuffRightCuspCp1,
|
||||
points.cuffRightCusp
|
||||
)
|
||||
.curve_(points.cuffRightCuspCp2, points.wristRight);
|
||||
paths.cuffBase.render = false;
|
||||
|
||||
paths.seam = paths.frenchBase
|
||||
.clone()
|
||||
.line(points.wristLeft)
|
||||
.join(paths.cuffBase)
|
||||
.attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
macro("title", { at: points.centerBiceps, nr: 5, title: "sleeve" });
|
||||
macro("grainline", { from: points.cuffMid, to: points.sleeveTip });
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.frenchBase
|
||||
.offset(sa * 2)
|
||||
.join(paths.saBase.offset(sa))
|
||||
.join(paths.cuffBase.offset(sa))
|
||||
.close()
|
||||
.attr("class", "fabric sa");
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
|
@ -23,7 +23,7 @@ export default part => {
|
|||
paths.seam = paths.seam.close().attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (sa) {
|
||||
if (complete) {
|
||||
delete snippets.armholePitchNotch;
|
||||
points.title = new Point(points.neck.x, points.cbYoke.y / 3);
|
||||
macro("title", { at: points.title, nr: 4, title: "yoke", scale: 0.8 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue