diff --git a/packages/simon/index.html b/packages/simon/index.html index 4455a8289f5..b064acc3aa7 100644 --- a/packages/simon/index.html +++ b/packages/simon/index.html @@ -103,21 +103,23 @@ let settings1 = { ...settings }; var pattern1 = new freesewing.patterns.simon(settings1); pattern1.use(freesewing.plugins.theme); - //pattern1.use(freesewing.plugins.designer); + pattern1.use(freesewing.plugins.designer); pattern1.use(freesewing.plugins.flip); pattern1.use(freesewing.plugins.banner); pattern1.use(freesewing.plugins.debug); pattern1.settings.options.yokeDart = 0; pattern1.settings.options.lengthBonus = 0.1; - pattern1.settings.options.hemStyle = "slashed"; - pattern1.settings.options.buttonholePlacketType = "seperate"; + pattern1.settings.options.hemStyle = "baseball"; + pattern1.settings.options.buttonPlacketType = "cut-on"; + pattern1.settings.options.buttonPlacketStyle = "classic"; + pattern1.settings.options.buttonholePlacketType = "cut-on"; pattern1.settings.options.buttonholePlacketStyle = "seamless"; pattern1.settings.options.cuffButtonRows = 2; pattern1.settings.options.barrelCuffNarrowButton = "yes"; pattern1.settings.options.cuffStyle = "straightBarrelCuff"; pattern1.settings.options.splitYoke = "yes"; pattern1.settings.sa = 10; - pattern1.settings.nly = ["sleeve"]; + //pattern1.settings.only = ["frontRight", "frontLeft"]; pattern1.draft(); document.getElementById("svg1").innerHTML = pattern1.render(); diff --git a/packages/simon/src/buttonplacket.js b/packages/simon/src/buttonplacket.js index 0d65d9b6f93..247e3bb5886 100644 --- a/packages/simon/src/buttonplacket.js +++ b/packages/simon/src/buttonplacket.js @@ -120,6 +120,33 @@ export default part => { // Paperless? if (paperless) { + macro("hd", { + from: points.placketTopIn, + to: points.placketTopOut, + y: points.placketTopIn.y - 15 - sa + }); + macro("hd", { + from: points.placketTopIn, + to: points.placketTopEdge, + y: points.placketTopIn.y - 30 - sa + }); + macro("vd", { + from: points.placketBottomEdge, + to: points.placketTopEdge, + x: points.placketTopEdge.x + 15 + sa + }); + let len = + points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength); + points.button0 = points.placketTopEdge; + let j; + for (let i = 0; i < options.buttons; i++) { + j = i + 1; + macro("vd", { + from: points["button" + j], + to: points["button" + i], + x: points.placketTopIn.x - 15 - sa + }); + } } return part; diff --git a/packages/simon/src/frontleft-seamless.js b/packages/simon/src/frontleft-seamless.js index 075b165d72c..aa50641f872 100644 --- a/packages/simon/src/frontleft-seamless.js +++ b/packages/simon/src/frontleft-seamless.js @@ -83,7 +83,6 @@ export default part => { "placketBottomFold2", "placketBottomFold1", "cfHem", - "slashEnd", "hips" ]) { offset += 15; diff --git a/packages/simon/src/frontleft.js b/packages/simon/src/frontleft.js index 4c21b88aa2f..fa0ca5cf834 100644 --- a/packages/simon/src/frontleft.js +++ b/packages/simon/src/frontleft.js @@ -1,125 +1,18 @@ +import { frontDimensions } from "./shared"; import frontLeftClassicSeperate from "./frontleft-classic-seperate"; import frontLeftClassicCuton from "./frontleft-classic-cuton"; import frontLeftSeamless from "./frontleft-seamless"; export default part => { - let { - sa, - options, - complete, - paperless, - points, - macro, - Path, - paths - } = part.shorthand(); + let { sa, options, complete, paperless, points, macro } = part.shorthand(); - if (complete) { - macro("banner", { - path: "hemSa", - text: ["hem", ": 3x", "seamAllowance"] + if (complete && paperless) { + frontDimensions(part, "left"); + macro("ld", { + from: points.neck, + to: points.shoulder, + d: 15 + sa }); - macro("banner", { - path: "saFrench", - text: ["frenchSeam", ": 2x", "seamAllowance"] - }); - if (paperless) { - macro("ld", { - from: points.neck, - to: points.shoulder, - d: 15 + sa - }); - macro("pd", { - path: new Path() - .move(points.armholePitch) - .curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder), - d: -15 - }); - macro("vd", { - from: points.armhole, - to: points.armholePitch, - x: points.armhole.x + 15 + sa * 2 - }); - macro("vd", { - from: points.armhole, - to: points.shoulder, - x: points.armhole.x + 30 + sa * 2 - }); - macro("vd", { - from: points.armhole, - to: points.neck, - x: points.armhole.x + 45 + sa * 2 - }); - macro("vd", { - from: points.waist, - to: points.armhole, - x: points.armhole.x + 15 + sa * 2 - }); - macro("vd", { - from: points.hips, - to: points.armhole, - x: points.armhole.x + 30 + sa * 2 - }); - if (options.hemStyle === "baseball") { - macro("vd", { - from: points.bballStart, - to: points.bballEnd, - x: points.hips.x + 15 + 2 * sa - }); - macro("vd", { - from: points.bballStart, - to: points.hips, - x: points.hips.x + 30 + 2 * sa - }); - macro("vd", { - from: points.bballStart, - to: points.armhole, - x: points.hips.x + 45 + 2 * sa - }); - macro("vd", { - from: points.bballStart, - to: points.neck, - x: points.hips.x + 60 + 2 * sa - }); - macro("hd", { - from: points.bballStart, - to: points.bballEnd, - y: points.bballStart.y + 15 + 3 * sa - }); - } else if (options.hemStyle === "slashed") { - macro("vd", { - from: points.slashEnd, - to: points.slashStart, - x: points.hips.x + 15 + 3 * sa - }); - macro("vd", { - from: points.slashEnd, - to: points.hips, - x: points.hips.x + 30 + 3 * sa - }); - macro("vd", { - from: points.slashEnd, - to: points.armhole, - x: points.hips.x + 45 + 3 * sa - }); - macro("vd", { - from: points.slashEnd, - to: points.neck, - x: points.hips.x + 60 + 3 * sa - }); - } else { - macro("vd", { - from: points.hem, - to: points.armhole, - x: points.armhole.x + 45 + 2 * sa - }); - macro("vd", { - from: points.hem, - to: points.neck, - x: points.armhole.x + 60 + 2 * sa - }); - } - } } return options.buttonholePlacketStyle === "seamless" diff --git a/packages/simon/src/frontright-classic-cuton.js b/packages/simon/src/frontright-classic-cuton.js index a5e0bdce063..b6b0d4b7f8b 100644 --- a/packages/simon/src/frontright-classic-cuton.js +++ b/packages/simon/src/frontright-classic-cuton.js @@ -89,6 +89,48 @@ export default part => { // Paperless? if (paperless) { + macro("hd", { + from: points.placketTopOut, + to: points.placketTopEdge, + y: points.placketTopEdge.y - 15 - sa + }); + macro("hd", { + from: points.cfNeck, + to: points.placketTopEdge, + y: points.placketTopEdge.y - 30 - sa + }); + macro("hd", { + from: points.placketTopIn, + to: points.placketTopEdge, + y: points.placketTopEdge.y - 45 - sa + }); + macro("hd", { + from: points.neck, + to: points.placketTopEdge, + y: points.neck.y - 15 - sa + }); + macro("hd", { + from: points.shoulder, + to: points.placketTopEdge, + y: points.neck.y - 30 - sa + }); + let len = + points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength); + points.button0 = points.placketTopEdge; + let j; + for (let i = 0; i < options.buttons; i++) { + j = i + 1; + macro("vd", { + from: points["button" + j], + to: points["button" + i], + x: points.placketTopEdge.x + 15 + sa + }); + } + macro("vd", { + from: points.placketBottomEdge, + to: points.placketTopEdge, + x: points.placketTopEdge.x + 30 + sa + }); } return part; diff --git a/packages/simon/src/frontright-classic-seperate.js b/packages/simon/src/frontright-classic-seperate.js index b4600227874..ab316acf6e1 100644 --- a/packages/simon/src/frontright-classic-seperate.js +++ b/packages/simon/src/frontright-classic-seperate.js @@ -34,12 +34,44 @@ export default part => { if (complete) { // Title macro("title", { at: points.title, nr: "1a", title: "rightFront" }); + delete snippets["cfWaist-notch"]; + delete snippets["cfHips-notch"]; + delete snippets["cfArmhole-notch"]; + points.edgeArmhole = new Point(points.placketTopIn.x, points.armhole.y); + points.edgeWaist = new Point(points.placketTopIn.x, points.waist.y); + points.edgeHips = new Point(points.placketTopIn.x, points.hips.y); if (sa) paths.saFromArmhole.line(paths.hemSa.start()); } // Paperless? if (paperless) { + macro("hd", { + from: points.neck, + to: points.placketTopIn, + y: points.neck.y - sa - 15 + }); + macro("hd", { + from: points.shoulder, + to: points.placketTopIn, + y: points.neck.y - sa - 30 + }); + macro("vd", { + from: points.placketTopIn, + to: points.neck, + x: points.placketTopIn.x + sa + 15 + }); + macro("vd", { + from: points.placketBottomIn, + to: points.placketTopIn, + x: points.placketTopIn.x + sa + 15 + }); + for (let pid of ["Armhole", "Waist", "Hips"]) { + macro("hd", { + from: points["edge" + pid], + to: points[pid.toLowerCase()] + }); + } } return part; diff --git a/packages/simon/src/frontright.js b/packages/simon/src/frontright.js index d119e2b8a4f..dd0208ac0a4 100644 --- a/packages/simon/src/frontright.js +++ b/packages/simon/src/frontright.js @@ -1,13 +1,33 @@ +import { frontDimensions } from "./shared"; import frontRightClassicSeperate from "./frontright-classic-seperate"; import frontRightClassicCuton from "./frontright-classic-cuton"; import frontRightSeamless from "./frontright-seamless"; export default part => { - let { macro, options, points } = part.shorthand(); + let { + sa, + options, + complete, + paperless, + points, + macro, + paths + } = part.shorthand(); macro("flip"); points.scalebox = points.waist.shiftFractionTowards(points.cfWaist, 0.5); macro("scalebox", { at: points.scalebox }); + if (complete && paperless) { + frontDimensions(part, "right"); + macro("ld", { + from: points.shoulder, + to: points.neck, + d: 15 + sa + }); + paths.hemSa.attr("data-text-dy", 7, true); + paths.saFrench.attr("data-text-dy", 7, true); + } + return options.buttonPlacketStyle === "seamless" ? frontRightSeamless(part) : options.buttonPlacketType === "seperate" diff --git a/packages/simon/src/shared.js b/packages/simon/src/shared.js index cb41a1e5e7e..d2fdfffc50e 100644 --- a/packages/simon/src/shared.js +++ b/packages/simon/src/shared.js @@ -248,3 +248,119 @@ export const paperlessFrenchCuff = part => { return part; }; + +export const frontDimensions = (part, side = "left") => { + let { + sa, + options, + complete, + paperless, + points, + macro, + Path, + paths + } = part.shorthand(); + let factor = side === "right" ? -1 : 1; + macro("banner", { + path: "hemSa", + text: ["hem", ": 3x", "seamAllowance"] + }); + macro("banner", { + path: "saFrench", + text: ["frenchSeam", ": 2x", "seamAllowance"] + }); + if (paperless) { + macro("pd", { + path: new Path() + .move(points.armholePitch) + .curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder), + d: -15 * factor + }); + macro("vd", { + from: points.armhole, + to: points.armholePitch, + x: points.armhole.x + (15 + sa * 2) * factor + }); + macro("vd", { + from: points.armhole, + to: points.shoulder, + x: points.armhole.x + (30 + sa * 2) * factor + }); + macro("vd", { + from: points.armhole, + to: points.neck, + x: points.armhole.x + (45 + sa * 2) * factor + }); + macro("vd", { + from: points.waist, + to: points.armhole, + x: points.armhole.x + (15 + sa * 2) * factor + }); + macro("vd", { + from: points.hips, + to: points.armhole, + x: points.armhole.x + (30 + sa * 2) * factor + }); + if (options.hemStyle === "baseball") { + macro("vd", { + from: points.bballStart, + to: points.bballEnd, + x: points.hips.x + (15 + 2 * sa) * factor + }); + macro("vd", { + from: points.bballStart, + to: points.hips, + x: points.hips.x + (30 + 2 * sa) * factor + }); + macro("vd", { + from: points.bballStart, + to: points.armhole, + x: points.hips.x + (45 + 2 * sa) * factor + }); + macro("vd", { + from: points.bballStart, + to: points.neck, + x: points.hips.x + (60 + 2 * sa) * factor + }); + macro("hd", { + from: points.bballStart, + to: points.bballEnd, + y: points.bballStart.y + 15 + 3 * sa + }); + } else if (options.hemStyle === "slashed") { + macro("vd", { + from: points.slashEnd, + to: points.slashStart, + x: points.hips.x + (15 + 3 * sa) * factor + }); + macro("vd", { + from: points.slashEnd, + to: points.hips, + x: points.hips.x + (30 + 3 * sa) * factor + }); + macro("vd", { + from: points.slashEnd, + to: points.armhole, + x: points.hips.x + (45 + 3 * sa) * factor + }); + macro("vd", { + from: points.slashEnd, + to: points.neck, + x: points.hips.x + (60 + 3 * sa) * factor + }); + } else { + macro("vd", { + from: points.hem, + to: points.armhole, + x: points.armhole.x + (45 + 2 * sa) * factor + }); + macro("vd", { + from: points.hem, + to: points.neck, + x: points.armhole.x + (60 + 2 * sa) * factor + }); + } + } + + return part; +};