sparkles: Added yoke
This commit is contained in:
parent
c5d12ff4bd
commit
dab7345608
6 changed files with 99 additions and 4 deletions
|
@ -25,7 +25,8 @@ export default {
|
||||||
frontRight: "front",
|
frontRight: "front",
|
||||||
frontLeft: "front",
|
frontLeft: "front",
|
||||||
buttonPlacket: "front",
|
buttonPlacket: "front",
|
||||||
buttonholePlacket: "front"
|
buttonholePlacket: "front",
|
||||||
|
yoke: "backBase"
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
frontBase: "base",
|
frontBase: "base",
|
||||||
|
@ -35,7 +36,8 @@ export default {
|
||||||
frontRight: "front",
|
frontRight: "front",
|
||||||
frontLeft: "front",
|
frontLeft: "front",
|
||||||
buttonPlacket: "front",
|
buttonPlacket: "front",
|
||||||
buttonholePlacket: "front"
|
buttonholePlacket: "front",
|
||||||
|
yoke: "backBase"
|
||||||
},
|
},
|
||||||
hide: ["base", "frontBase", "front", "backBase"],
|
hide: ["base", "frontBase", "front", "backBase"],
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -109,10 +109,11 @@ let settings1 = { ...settings };
|
||||||
pattern1.settings.options.lengthBonus = 0.1;
|
pattern1.settings.options.lengthBonus = 0.1;
|
||||||
pattern1.settings.options.hemStyle = "slashed";
|
pattern1.settings.options.hemStyle = "slashed";
|
||||||
pattern1.settings.options.buttonholePlacketStyle = "classic";
|
pattern1.settings.options.buttonholePlacketStyle = "classic";
|
||||||
|
pattern1.settings.options.buttonPlacketType = "seperate";
|
||||||
pattern1.settings.options.buttonholePlacketType = "seperate";
|
pattern1.settings.options.buttonholePlacketType = "seperate";
|
||||||
pattern1.settings.options.collarEase = 0.1;
|
//pattern1.settings.options.splitYoke = "yes";
|
||||||
pattern1.settings.sa = 10;
|
pattern1.settings.sa = 10;
|
||||||
pattern1.settings.only = ["frontLeft", "buttonholePlacket" ];
|
pattern1.settings.only = ["yoke" ];
|
||||||
pattern1.draft();
|
pattern1.draft();
|
||||||
console.log(pattern1);
|
console.log(pattern1);
|
||||||
document.getElementById("svg1").innerHTML = pattern1.render();
|
document.getElementById("svg1").innerHTML = pattern1.render();
|
||||||
|
|
|
@ -4,6 +4,17 @@ export default part => {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||||
|
|
||||||
|
if (
|
||||||
|
options.buttonholePlacketType !== "seperate" ||
|
||||||
|
options.buttonholePlacketStyle !== "classic"
|
||||||
|
) {
|
||||||
|
part.paths = {};
|
||||||
|
part.snippets = {};
|
||||||
|
part.points = {};
|
||||||
|
return part;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(options);
|
||||||
for (let id of Object.keys(part.paths)) delete part.paths[id];
|
for (let id of Object.keys(part.paths)) delete part.paths[id];
|
||||||
let width = options.buttonholePlacketWidth;
|
let width = options.buttonholePlacketWidth;
|
||||||
let fold = options.buttonholePlacketFoldWidth;
|
let fold = options.buttonholePlacketFoldWidth;
|
||||||
|
|
|
@ -4,6 +4,16 @@ export default part => {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||||
|
|
||||||
|
if (
|
||||||
|
options.buttonPlacketType !== "seperate" ||
|
||||||
|
options.buttonPlacketStyle !== "classic"
|
||||||
|
) {
|
||||||
|
part.paths = {};
|
||||||
|
part.snippets = {};
|
||||||
|
part.points = {};
|
||||||
|
return part;
|
||||||
|
}
|
||||||
|
|
||||||
for (let id of Object.keys(part.paths)) {
|
for (let id of Object.keys(part.paths)) {
|
||||||
if (id !== "seam") delete part.paths[id];
|
if (id !== "seam") delete part.paths[id];
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import draftFrontRight from "./frontright";
|
||||||
import draftButtonPlacket from "./buttonplacket";
|
import draftButtonPlacket from "./buttonplacket";
|
||||||
import draftFrontLeft from "./frontleft";
|
import draftFrontLeft from "./frontleft";
|
||||||
import draftButtonholePlacket from "./buttonholeplacket";
|
import draftButtonholePlacket from "./buttonholeplacket";
|
||||||
|
import draftYoke from "./yoke";
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
const Simon = function(settings) {
|
const Simon = function(settings) {
|
||||||
|
@ -43,6 +44,7 @@ Simon.prototype.draftFrontRight = draftFrontRight;
|
||||||
Simon.prototype.draftButtonPlacket = draftButtonPlacket;
|
Simon.prototype.draftButtonPlacket = draftButtonPlacket;
|
||||||
Simon.prototype.draftFrontLeft = draftFrontLeft;
|
Simon.prototype.draftFrontLeft = draftFrontLeft;
|
||||||
Simon.prototype.draftButtonholePlacket = draftButtonholePlacket;
|
Simon.prototype.draftButtonholePlacket = draftButtonholePlacket;
|
||||||
|
Simon.prototype.draftYoke = draftYoke;
|
||||||
|
|
||||||
export default Simon;
|
export default Simon;
|
||||||
|
|
||||||
|
|
69
packages/simon/src/yoke.js
Normal file
69
packages/simon/src/yoke.js
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
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();
|
||||||
|
|
||||||
|
for (let id of Object.keys(part.paths)) delete part.paths[id];
|
||||||
|
|
||||||
|
// Cut off at yoke
|
||||||
|
points.cbYoke = new Point(0, points.armholePitch.y);
|
||||||
|
|
||||||
|
// Paths
|
||||||
|
paths.saBase = new Path()
|
||||||
|
.move(points.cbYoke)
|
||||||
|
.line(points.armholePitch)
|
||||||
|
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
||||||
|
.line(points.neck)
|
||||||
|
.curve_(points.neckCp2, points.cbNeck);
|
||||||
|
if (options.splitYoke === "yes")
|
||||||
|
paths.saBase = paths.saBase.line(points.cbYoke).close();
|
||||||
|
paths.seam = paths.saBase.clone();
|
||||||
|
paths.saBase.render = false;
|
||||||
|
paths.seam = paths.seam.close().attr("class", "fabric");
|
||||||
|
|
||||||
|
// Complete pattern?
|
||||||
|
if (sa) {
|
||||||
|
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 });
|
||||||
|
points.logo = points.title.shift(-90, 50);
|
||||||
|
snippets.logo = new Snippet("logo", points.logo);
|
||||||
|
snippets.logo.attr("data-scale", 0.8);
|
||||||
|
if (options.splitYoke === "yes") {
|
||||||
|
points.grainlineFrom = points.cbYoke.shift(0, 20);
|
||||||
|
points.grainlineTo = points.cbNeck.shift(0, 20);
|
||||||
|
macro("grainline", {
|
||||||
|
from: points.grainlineFrom,
|
||||||
|
to: points.grainlineTo
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
macro("cutonfold", {
|
||||||
|
from: points.cbNeck,
|
||||||
|
to: points.cbYoke,
|
||||||
|
grainline: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
macro("sprinkle", {
|
||||||
|
snippet: "notch",
|
||||||
|
on: ["neck", "shoulder"]
|
||||||
|
});
|
||||||
|
|
||||||
|
if (sa) {
|
||||||
|
paths.sa = paths.saBase.offset(sa).attr("class", "fabric sa");
|
||||||
|
if (options.splitYoke === "no") {
|
||||||
|
paths.sa = paths.sa
|
||||||
|
.line(points.cbNeck)
|
||||||
|
.move(points.cbYoke)
|
||||||
|
.line(paths.sa.start());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Paperless?
|
||||||
|
if (paperless) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return part;
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue