sparkles: Added front left part
This commit is contained in:
parent
467e88f45a
commit
415f7c483e
9 changed files with 280 additions and 97 deletions
|
@ -1,71 +0,0 @@
|
|||
|
||||
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.buttonPlacketWidth;
|
||||
if(options.buttonHoleType === "seperate") {
|
||||
|
||||
} else {
|
||||
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width/-2, points.cfNeck.y+20),
|
||||
new Point(width/-2, points.cfNeck.y-20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width/2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width/2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width/2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.line(points.cfHem)
|
||||
.close();
|
||||
|
||||
}
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
paths.placketInnerFold = new Path()
|
||||
.move(points.placketTopIn)
|
||||
.line(points.placketBottomIn)
|
||||
.attr("class", "dotted");
|
||||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["placketTopIn", "placketTopOut", "cfNeck", "placketBottomIn", "placketBottomOut", "cfHem"]
|
||||
});
|
||||
|
||||
let len = points.cfNeck.dist(points.cfHips) * ( 1 - options.buttonFreeLength );
|
||||
for (let i=1; i<=options.buttons; i++) {
|
||||
points["button"+i] = points.cfNeck.shift(-90, len / options.buttons * i);
|
||||
snippets["button"+i] = new Snippet("button", points["button"+i]);
|
||||
}
|
||||
|
||||
if(sa) {
|
||||
paths.saFromArmhole
|
||||
.line(new Point(points.placketTopEdge.x + sa, points.placketTopEdge.y - sa))
|
||||
.line(new Point(points.placketBottomEdge.x + sa, points.placketBottomEdge.y + sa*3))
|
||||
.line(paths.hemSa.start());
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
|
@ -23,6 +23,7 @@ export default {
|
|||
back: "backBase",
|
||||
front: "frontBase",
|
||||
frontRight: "front",
|
||||
frontLeft: "front",
|
||||
buttonPlacket: "front"
|
||||
},
|
||||
inject: {
|
||||
|
@ -31,9 +32,10 @@ export default {
|
|||
back: "backBase",
|
||||
front: "frontBase",
|
||||
frontRight: "front",
|
||||
frontLeft: "front",
|
||||
buttonPlacket: "front"
|
||||
},
|
||||
hide: ["base", "frontBase", "backBase"],
|
||||
hide: ["base", "frontBase", "front", "backBase"],
|
||||
options: {
|
||||
// Constants
|
||||
collarFactor: 5,
|
||||
|
|
|
@ -108,11 +108,11 @@ let settings1 = { ...settings };
|
|||
pattern1.settings.options.yokeDart = 0.15;
|
||||
pattern1.settings.options.lengthBonus = 0.1;
|
||||
pattern1.settings.options.hemStyle = "slashed";
|
||||
pattern1.settings.options.buttonPlacketStyle = "classic";
|
||||
pattern1.settings.options.buttonholePlacketStyle = "classic";
|
||||
pattern1.settings.options.buttonPlacketType = "seperate";
|
||||
pattern1.settings.options.collarEase = 0.1;
|
||||
pattern1.settings.sa = 10;
|
||||
pattern1.settings.only = ["frontRight", "buttonPlacket"];
|
||||
pattern1.settings.only = ["frontLeft" ];
|
||||
pattern1.draft();
|
||||
console.log(pattern1);
|
||||
document.getElementById("svg1").innerHTML = pattern1.render();
|
||||
|
|
129
packages/simon/src/frontleft-classic-cuton.js
Normal file
129
packages/simon/src/frontleft-classic-cuton.js
Normal file
|
@ -0,0 +1,129 @@
|
|||
import { addButtonHoles } from "./shared";
|
||||
|
||||
export default part => {
|
||||
// prettier-ignore
|
||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||
|
||||
let fold = options.buttonholePlacketFoldWidth;
|
||||
let width = options.buttonholePlacketWidth;
|
||||
points.placketCfNeck = points.cfNeck.shift(180, fold * 2);
|
||||
points.placketTopInnerEdgeFold = points.placketCfNeck.shift(0, width / 2);
|
||||
points.placketTopInnerEdgeOver = points.placketCfNeck.shift(
|
||||
0,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketTopInnerEdgeUnder = points.placketCfNeck.shift(
|
||||
0,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketTopOuterEdgeFold = points.placketCfNeck.shift(180, width / 2);
|
||||
points.placketTopOuterEdgeOver = points.placketCfNeck.shift(
|
||||
180,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketTopOuterEdgeUnder = points.placketCfNeck.shift(
|
||||
180,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketCfHem = points.cfHem.shift(180, fold * 2);
|
||||
points.placketBottomInnerEdgeFold = points.placketCfHem.shift(0, width / 2);
|
||||
points.placketBottomInnerEdgeOver = points.placketCfHem.shift(
|
||||
0,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketBottomInnerEdgeUnder = points.placketCfHem.shift(
|
||||
0,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketBottomOuterEdgeFold = points.placketCfHem.shift(180, width / 2);
|
||||
points.placketBottomOuterEdgeOver = points.placketCfHem.shift(
|
||||
180,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketBottomOuterEdgeUnder = points.placketCfHem.shift(
|
||||
180,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketTopEdge = points.placketTopOuterEdgeFold.shift(180, width);
|
||||
points.placketBottomEdge = points.placketBottomOuterEdgeFold.shift(
|
||||
180,
|
||||
width
|
||||
);
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.close();
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Placket help lines
|
||||
paths.frontCenter = new Path()
|
||||
.move(points.placketCfNeck)
|
||||
.line(points.placketCfHem)
|
||||
.attr("class", "help");
|
||||
paths.placketInnerEdgeFold = new Path()
|
||||
.move(points.placketTopInnerEdgeFold)
|
||||
.line(points.placketBottomInnerEdgeFold)
|
||||
.attr("class", "dotted");
|
||||
paths.placketInnerEdgeOver = new Path()
|
||||
.move(points.placketTopInnerEdgeOver)
|
||||
.line(points.placketBottomInnerEdgeOver)
|
||||
.attr("class", "dotted");
|
||||
paths.placketInnerEdgeUnder = new Path()
|
||||
.move(points.placketTopInnerEdgeUnder)
|
||||
.line(points.placketBottomInnerEdgeUnder)
|
||||
.attr("class", "dotted");
|
||||
paths.placketOuterEdgeFold = new Path()
|
||||
.move(points.placketTopOuterEdgeFold)
|
||||
.line(points.placketBottomOuterEdgeFold)
|
||||
.attr("class", "dotted");
|
||||
paths.placketOuterEdgeOver = new Path()
|
||||
.move(points.placketTopOuterEdgeOver)
|
||||
.line(points.placketBottomOuterEdgeOver)
|
||||
.attr("class", "dotted");
|
||||
paths.placketOuterEdgeUnder = new Path()
|
||||
.move(points.placketTopOuterEdgeUnder)
|
||||
.line(points.placketBottomOuterEdgeUnder)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [
|
||||
"placketCfNeck",
|
||||
"placketCfHem",
|
||||
"placketTopInnerEdgeFold",
|
||||
"placketTopInnerEdgeOver",
|
||||
"placketTopInnerEdgeUnder",
|
||||
"placketTopOuterEdgeFold",
|
||||
"placketTopOuterEdgeOver",
|
||||
"placketTopOuterEdgeUnder",
|
||||
"placketBottomInnerEdgeFold",
|
||||
"placketBottomInnerEdgeOver",
|
||||
"placketBottomInnerEdgeUnder",
|
||||
"placketBottomOuterEdgeFold",
|
||||
"placketBottomOuterEdgeOver",
|
||||
"placketBottomOuterEdgeUnder"
|
||||
]
|
||||
});
|
||||
|
||||
// Buttons
|
||||
addButtonHoles(part);
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 2, title: "frontLeft" });
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
.line(points.placketTopEdge.shift(90, sa))
|
||||
.line(points.placketTopEdge)
|
||||
.move(points.placketBottomEdge)
|
||||
.line(points.placketBottomEdge.shift(-90, 3 * sa))
|
||||
.line(paths.hemSa.start());
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
return part;
|
||||
};
|
32
packages/simon/src/frontleft-classic-seperate.js
Normal file
32
packages/simon/src/frontleft-classic-seperate.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
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.buttonPlacketWidth;
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
paths.seam = paths.seam.split(points.placketTopIn)[0];
|
||||
paths.seam.ops[0].to = points.placketBottomIn;
|
||||
paths.seam.close().attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: "1a", title: "rightFront" });
|
||||
|
||||
if (sa) paths.saFromArmhole.line(paths.hemSa.start());
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
68
packages/simon/src/frontleft-seamless.js
Normal file
68
packages/simon/src/frontleft-seamless.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
import { addButtons } from "./shared";
|
||||
|
||||
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.buttonPlacketWidth;
|
||||
points.placketTopFold1 = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopFold2 = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 2.5);
|
||||
points.placketBottomFold1 = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomFold2 = points.cfHem.shift(0, width * 1.5);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 2.5);
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.line(points.cfHem)
|
||||
.close();
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Placket help lines
|
||||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
paths.placketFold1 = new Path()
|
||||
.move(points.placketTopFold1)
|
||||
.line(points.placketBottomFold1)
|
||||
.attr("class", "dotted");
|
||||
paths.placketFold2 = new Path()
|
||||
.move(points.placketTopFold2)
|
||||
.line(points.placketBottomFold2)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [
|
||||
"placketTopFold1",
|
||||
"placketTopFold2",
|
||||
"placketBottomFold1",
|
||||
"placketBottomFold2",
|
||||
"cfNeck",
|
||||
"cfHem"
|
||||
]
|
||||
});
|
||||
|
||||
// Buttons
|
||||
addButtons(part);
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 1, title: "frontRight" });
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
.line(new Point(points.placketTopEdge.x, points.placketTopEdge.y - sa))
|
||||
.line(points.placketTopEdge)
|
||||
.move(points.placketBottomEdge)
|
||||
.line(points.placketBottomEdge.shift(-90, sa * 3))
|
||||
.line(paths.hemSa.start());
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
13
packages/simon/src/frontleft.js
Normal file
13
packages/simon/src/frontleft.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import frontLeftClassicSeperate from "./frontleft-classic-seperate";
|
||||
import frontLeftClassicCuton from "./frontleft-classic-cuton";
|
||||
import frontLeftSeamless from "./frontleft-seamless";
|
||||
|
||||
export default part => {
|
||||
let { options } = part.shorthand();
|
||||
|
||||
return options.buttonholePlacketStyle === "seamless"
|
||||
? frontLeftSeamless(part)
|
||||
: options.buttonholePlacketType === "seperate"
|
||||
? frontLeftClassicSeperate(part)
|
||||
: frontLeftClassicCuton(part);
|
||||
};
|
|
@ -9,23 +9,7 @@ import draftBack from "./back";
|
|||
import draftFront from "./front";
|
||||
import draftFrontRight from "./frontright";
|
||||
import draftButtonPlacket from "./buttonplacket";
|
||||
//import draftSleevecap from "./sleevecap";
|
||||
//import draftSleeve from "./sleeve";
|
||||
// sleeveBlock: ".Sleeve block"
|
||||
// frontRight: "Front right"
|
||||
// frontLeft: "Front left"
|
||||
// buttonPlacket: "Button placket."
|
||||
// buttonholePlacket: "Buttonhole placket."
|
||||
// yoke: "Yoke"
|
||||
// back: "Back"
|
||||
// sleeve: "Sleeve"
|
||||
// collarStand: "Collar stand"
|
||||
// collar: "Collar"
|
||||
// undercollar: "Undercollar"
|
||||
// sleevePlacketUnderlap: "Sleeve placket underlap"
|
||||
// sleevePlacketOverlap: "Sleeve placket overlap"
|
||||
// barrelCuff: "Barrel cuff"
|
||||
// frenchCuff: "French cuff"
|
||||
import draftFrontLeft from "./frontleft";
|
||||
|
||||
// Constructor
|
||||
const Simon = function(settings) {
|
||||
|
@ -56,5 +40,24 @@ Simon.prototype.draftBack = draftBack;
|
|||
Simon.prototype.draftFront = draftFront;
|
||||
Simon.prototype.draftFrontRight = draftFrontRight;
|
||||
Simon.prototype.draftButtonPlacket = draftButtonPlacket;
|
||||
Simon.prototype.draftFrontLeft = draftFrontLeft;
|
||||
|
||||
export default Simon;
|
||||
|
||||
//import draftSleevecap from "./sleevecap";
|
||||
//import draftSleeve from "./sleeve";
|
||||
// sleeveBlock: ".Sleeve block"
|
||||
// frontRight: "Front right"
|
||||
// frontLeft: "Front left"
|
||||
// buttonPlacket: "Button placket."
|
||||
// buttonholePlacket: "Buttonhole placket."
|
||||
// yoke: "Yoke"
|
||||
// back: "Back"
|
||||
// sleeve: "Sleeve"
|
||||
// collarStand: "Collar stand"
|
||||
// collar: "Collar"
|
||||
// undercollar: "Undercollar"
|
||||
// sleevePlacketUnderlap: "Sleeve placket underlap"
|
||||
// sleevePlacketOverlap: "Sleeve placket overlap"
|
||||
// barrelCuff: "Barrel cuff"
|
||||
// frenchCuff: "French cuff"
|
||||
|
|
|
@ -16,19 +16,26 @@ export const calculateReduction = function(part) {
|
|||
store.set("reduction", true);
|
||||
};
|
||||
|
||||
export const addButtons = function(part) {
|
||||
export const addButtons = function(
|
||||
part,
|
||||
origin = "cfNeck",
|
||||
snippet = "button"
|
||||
) {
|
||||
let { points, options, snippets, Snippet } = part.shorthand();
|
||||
let len = points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength);
|
||||
for (let i = 1; i <= options.buttons; i++) {
|
||||
points["button" + i] = points.cfNeck.shift(
|
||||
points["button" + i] = points[origin].shift(
|
||||
-90,
|
||||
(len / options.buttons) * i
|
||||
);
|
||||
snippets["button" + i] = new Snippet("button", points["button" + i]);
|
||||
snippets[snippet + i] = new Snippet(snippet, points["button" + i]);
|
||||
}
|
||||
if (options.extraTopButton === "yes")
|
||||
snippets.topButton = new Snippet(
|
||||
"button",
|
||||
points.cfNeck.shift(-90, len / options.buttons / 2)
|
||||
snippets["top" + snippet] = new Snippet(
|
||||
snippet,
|
||||
points[origin].shift(-90, len / options.buttons / 2)
|
||||
);
|
||||
};
|
||||
|
||||
export const addButtonHoles = part =>
|
||||
addButtons(part, "placketCfNeck", "buttonhole");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue