From 0db1ebeb26f1d02b46387a7d63f4e34d6f879b26 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 17 Sep 2023 12:44:03 +0200 Subject: [PATCH] chore(hugo): Prepare for v3 beta --- config/software/designs.json | 2 +- designs/hugo/i18n/en.json | 12 +- designs/hugo/src/back.mjs | 132 +++++++------ designs/hugo/src/cuff.mjs | 82 +++++--- designs/hugo/src/front.mjs | 76 +++++--- designs/hugo/src/hoodcenter.mjs | 126 +++++++------ designs/hugo/src/hoodside.mjs | 177 ++++++++++-------- designs/hugo/src/options.mjs | 1 + designs/hugo/src/pocket.mjs | 105 +++++++---- designs/hugo/src/pocketfacing.mjs | 80 +++++--- designs/hugo/src/sleeve.mjs | 176 +++++++++-------- designs/hugo/src/waistband.mjs | 130 ++++++------- .../designs/hugo/options/pocketwidth/en.md | 7 + 13 files changed, 645 insertions(+), 461 deletions(-) create mode 100644 markdown/org/docs/designs/hugo/options/pocketwidth/en.md diff --git a/config/software/designs.json b/config/software/designs.json index 27258727131..e23579fd136 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -216,7 +216,7 @@ "design": "Joost De Cock", "difficulty": 3, "tags": ["tops"], - "techniques": [] + "techniques": ["curvedSeam", "pocket", "ribbing", "raglanSleeve"] }, "jaeger": { "description": "A FreeSewing pattern for a sport coat style jacket", diff --git a/designs/hugo/i18n/en.json b/designs/hugo/i18n/en.json index c923c2bdd80..765ea376031 100644 --- a/designs/hugo/i18n/en.json +++ b/designs/hugo/i18n/en.json @@ -18,7 +18,13 @@ "hoodSide": "Hood side", "pocketFacing": "Pocket facing", "pocket": "Pocket", - "waistband": "Waistband" + "waistband": "Waistband", + "cutPocket.t": "The pocket is not shown", + "cutPocket.d": "The **Pocket** (4) is not shown, but you can trace it from the Front part (1), which has the pocket outline on it (not including seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutCuff.t": "The cuff is not shown", + "cutCuff.d": "The **Cuff** (9) is a rectangular piece of ribbing fabric {{{ w }}} wide and {{{ l }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutWaistband.t": "The waistband is not shown", + "cutWaistband.d": "The **Waistband** (8) is a rectangular piece of ribbing fabric {{{ w }}} wide and {{{ l }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part." }, "o": { "ribbingHeight": { @@ -29,6 +35,10 @@ "t": "Ribbing stretch", "d": "Use this to adapt the pattern to how stretchy the ribbing that you are using is." }, + "pocketWidth": { + "t": "Pocket width", + "d": "Determined the width of the pocket." + }, "hipsEase": { "t": "Hips ease", "d": "The amount of ease at your hips." diff --git a/designs/hugo/src/back.mjs b/designs/hugo/src/back.mjs index a520f865299..77f8773599a 100644 --- a/designs/hugo/src/back.mjs +++ b/designs/hugo/src/back.mjs @@ -33,9 +33,11 @@ function hugoBack({ points.ribbing = points.hem.shift(90, store.get('ribbing')) // Raglan tip - let neckOpening = new Path().move(points.cbNeck).curve(points.cbNeck, points.neckCp2, points.neck) + const neckOpening = new Path() + .move(points.cbNeck) + .curve(points.cbNeck, points.neckCp2, points.neck) points.raglanTipBack = neckOpening.shiftFractionAlong(0.7) - let neckOpeningParts = neckOpening.split(points.raglanTipBack) + const neckOpeningParts = neckOpening.split(points.raglanTipBack) // Paths paths.saBase = new Path() .move(points.cbRibbing) @@ -47,69 +49,83 @@ function hugoBack({ paths.seam = paths.saBase.clone().close().attr('class', 'fabric') paths.saBase.hide() + if (sa) { + paths.sa = paths.saBase.offset(sa).line(points.cbNeck).attr('class', 'fabric sa') + paths.sa.move(points.cbRibbing).line(paths.sa.start()) + } // Store neck opening path store.set('neckOpeningPartBack', neckOpeningParts[1]) store.set('neckOpeningAnchorBack', points.neck) store.set('neckOpeningLenBack', neckOpening.length()) store.set('neckCutoutBack', points.cbNeck.y) - // Complete pattern? - if (complete) { - macro('cutonfold', { - from: points.cbNeck, - to: points.cbRibbing, - grainline: true, - }) - points.title = new Point(points.armhole.x / 2, points.armhole.y) - macro('title', { at: points.title, nr: 2, title: 'back' }) - store.set('notchBack', points.raglanTipBack.dist(points.armholeHollow) / 2) - points.sleeveNotch = points.raglanTipBack.shiftTowards( - points.armholeHollow, - store.get('notchBack') - ) - snippets.sleeveNotch = new Snippet('bnotch', points.sleeveNotch) - store.set('backRaglanTipToNotch', points.raglanTipBack.dist(points.sleeveNotch)) - points.logo = points.title.shift(-90, 70) - snippets.logo = new Snippet('logo', points.logo) - if (sa) { - paths.sa = paths.saBase.offset(sa).line(points.cbNeck).attr('class', 'fabric sa') - paths.sa.move(points.cbRibbing).line(paths.sa.start()) - } - } + /* + * Annotations + */ + // cutlist + store.cutlist.setCut({ cut: 1, from: 'fabric', onFold: true }) - // Paperless? - if (paperless) { - macro('vd', { - from: points.cbRibbing, - to: points.cbNeck, - x: points.cbNeck.x - 15, - }) - macro('vd', { - from: points.cbRibbing, - to: points.raglanTipBack, - x: points.cbNeck.x - 30, - }) - macro('vd', { - from: points.ribbing, - to: points.armhole, - x: points.ribbing.x + 15 + sa, - }) - macro('hd', { - from: points.cbNeck, - to: points.raglanTipBack, - y: points.raglanTipBack.y - 15 - sa, - }) - macro('hd', { - from: points.raglanTipBack, - to: points.armhole, - y: points.raglanTipBack.y - 15 - sa, - }) - macro('hd', { - from: points.cbRibbing, - to: points.ribbing, - y: points.cbRibbing.y + 15 + sa, - }) - } + // Cutonfold + macro('cutonfold', { + from: points.cbNeck, + to: points.cbRibbing, + grainline: true, + }) + + // Title + points.title = new Point(points.armhole.x / 2, points.armhole.y) + macro('title', { at: points.title, nr: 2, title: 'back' }) + + // Notches + store.set('notchBack', points.raglanTipBack.dist(points.armholeHollow) / 2) + points.sleeveNotch = points.raglanTipBack.shiftTowards( + points.armholeHollow, + store.get('notchBack') + ) + snippets.sleeveNotch = new Snippet('bnotch', points.sleeveNotch) + store.set('backRaglanTipToNotch', points.raglanTipBack.dist(points.sleeveNotch)) + + // Logo + points.logo = points.title.shift(-90, 70) + snippets.logo = new Snippet('logo', points.logo) + + // Dimensions + macro('vd', { + id: 'hHemToCfNeck', + from: points.cbRibbing, + to: points.cbNeck, + x: points.cbNeck.x - 15, + }) + macro('vd', { + id: 'hFull', + from: points.cbRibbing, + to: points.raglanTipBack, + x: points.cbNeck.x - 30, + }) + macro('vd', { + id: 'hHemToRaglanStart', + from: points.ribbing, + to: points.armhole, + x: points.ribbing.x + 15 + sa, + }) + macro('hd', { + id: 'wNeckOpening', + from: points.cbNeck, + to: points.raglanTipBack, + y: points.raglanTipBack.y - 15 - sa, + }) + macro('hd', { + id: 'wRaglan', + from: points.raglanTipBack, + to: points.armhole, + y: points.raglanTipBack.y - 15 - sa, + }) + macro('hd', { + id: 'wHem', + from: points.cbRibbing, + to: points.ribbing, + y: points.cbRibbing.y + 15 + sa, + }) return part } diff --git a/designs/hugo/src/cuff.mjs b/designs/hugo/src/cuff.mjs index 17de66ab28d..b2e3163484a 100644 --- a/designs/hugo/src/cuff.mjs +++ b/designs/hugo/src/cuff.mjs @@ -11,11 +11,38 @@ function hugoCuff({ complete, paperless, macro, + expand, + store, + units, part, }) { const width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2 const length = measurements.wrist * (1 + options.cuffEase) * (1 - options.ribbingStretch) + if (expand) { + store.flag.preset('expandIsOn') + } else { + // Expand is off, do not draw the part but flag this to the user + store.flag.note({ + msg: `hugo:cutCuff`, + replace: { + w: units(width + 2 * sa), + l: units(length + 2 * sa), + }, + suggest: { + text: 'flag:show', + icon: 'expand', + update: { + settings: ['expand', 1], + }, + }, + }) + // Also hint about expand + store.flag.preset('expandIsOff') + + return part.hide() + } + points.topLeft = new Point(0, 0) points.bottomLeft = new Point(0, width) points.topRight = new Point(length, 0) @@ -30,32 +57,37 @@ function hugoCuff({ .close() .attr('class', 'various') - // Complete pattern? - if (complete) { - if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'various sa') - } - points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) - macro('title', { at: points.title, nr: 9, title: 'cuff' }) - macro('grainline', { - from: points.bottomLeft.shift(0, 20), - to: points.topLeft.shift(0, 20), - }) - } + if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa') - // Paperless? - if (paperless) { - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomRight.y + sa + 15, - }) - } + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 2, from: 'ribbing' }) + + // Title + points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) + macro('title', { at: points.title, nr: 9, title: 'cuff' }) + + // Grainline + macro('grainline', { + from: points.bottomLeft.shift(0, 20), + to: points.topLeft.shift(0, 20), + }) + + // Dimensions + macro('vd', { + id: 'hFull', + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + macro('hd', { + id: 'wFull', + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomRight.y + sa + 15, + }) return part } diff --git a/designs/hugo/src/front.mjs b/designs/hugo/src/front.mjs index d755b1abafb..cda9b807693 100644 --- a/designs/hugo/src/front.mjs +++ b/designs/hugo/src/front.mjs @@ -13,6 +13,7 @@ import { lengthBonus, draftForHighBust, ribbingHeight, + pocketWidth, } from './options.mjs' function hugoFront({ @@ -57,14 +58,14 @@ function hugoFront({ points.ribbing = points.hem.shift(90, store.get('ribbing')) // Raglan tip - let neckOpening = new Path() + const neckOpening = new Path() .move(points.cfNeck) .curve(points.cfNeckCp1, points.neckCp2, points.neck) points.raglanTipFront = neckOpening.shiftFractionAlong(0.8) - let neckOpeningParts = neckOpening.split(points.raglanTipFront) + const neckOpeningParts = neckOpening.split(points.raglanTipFront) // Pocket - points.pocketHem = points.cfRibbing.shiftFractionTowards(points.ribbing, 0.6) + points.pocketHem = points.cfRibbing.shiftFractionTowards(points.ribbing, options.pocketWidth) points.pocketCf = points.cfHem.shift( 90, measurements.hpsToWaistBack * 0.33 + store.get('ribbing') @@ -90,12 +91,13 @@ function hugoFront({ .join(neckOpeningParts[0].reverse()) paths.saBase.hide() paths.seam = paths.saBase.clone().unhide().close().attr('class', 'fabric') - paths.pocket = new Path() - .move(points.pocketHem) - .line(points.pocketTip) - .curve(points.pocketTip, points.pocketTopCp, points.pocketTop) - .line(points.pocketCf) - .attr('class', 'fabric help') + if (complete) + paths.pocket = new Path() + .move(points.pocketHem) + .line(points.pocketTip) + .curve(points.pocketTip, points.pocketTopCp, points.pocketTop) + .line(points.pocketCf) + .attr('class', 'note help') // Store shoulder seam length, neck opening path, shoulder slope and raglan length store.set('shoulderLength', points.neck.dist(points.shoulder)) store.set('neckOpeningPartFront', neckOpeningParts[1]) @@ -112,30 +114,41 @@ function hugoFront({ store.set('neckOpeningLenFront', neckOpening.length()) store.set('neckCutoutFront', points.cfNeck.y) - // Complete pattern? - if (complete) { - macro('cutonfold', { - from: points.cfNeck, - to: points.cfRibbing, - grainline: true, - }) - points.title = new Point(points.armhole.x / 2, points.armhole.y) - macro('title', { at: points.title, nr: 1, title: 'front' }) - store.set('notchFront', points.raglanTipFront.dist(points.armholeHollow) / 2) - points.sleeveNotch = points.raglanTipFront.shiftTowards( - points.armholeHollow, - store.get('notchFront') - ) - snippets.sleeveNotch = new Snippet('notch', points.sleeveNotch) - store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch)) - points.logo = points.title.shift(-90, 70) - snippets.logo = new Snippet('logo', points.logo) - if (sa) { - paths.sa = paths.saBase.offset(sa).line(points.cfNeck).attr('class', 'fabric sa') - paths.sa.move(points.cfRibbing).line(paths.sa.start()) - } + if (sa) { + paths.sa = paths.saBase.offset(sa).line(points.cfNeck).attr('class', 'fabric sa') + paths.sa.move(points.cfRibbing).line(paths.sa.start()) } + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 1, from: 'fabric', onFold: true }) + + // Cutonfold + macro('cutonfold', { + from: points.cfNeck, + to: points.cfRibbing, + grainline: true, + }) + + // Title + points.title = new Point(points.armhole.x / 2, points.armhole.y) + macro('title', { at: points.title, nr: 1, title: 'front' }) + + // Notches + store.set('notchFront', points.raglanTipFront.dist(points.armholeHollow) / 2) + points.sleeveNotch = points.raglanTipFront.shiftTowards( + points.armholeHollow, + store.get('notchFront') + ) + snippets.sleeveNotch = new Snippet('notch', points.sleeveNotch) + store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch)) + + // Logo + points.logo = points.title.shift(-90, 70) + snippets.logo = new Snippet('logo', points.logo) + // Paperless? if (paperless) { macro('vd', { @@ -206,6 +219,7 @@ export const front = { draftForHighBust, lengthBonus, ribbingHeight, + pocketWidth, }, draft: hugoFront, } diff --git a/designs/hugo/src/hoodcenter.mjs b/designs/hugo/src/hoodcenter.mjs index cb4f90b0547..3a32a3215ab 100644 --- a/designs/hugo/src/hoodcenter.mjs +++ b/designs/hugo/src/hoodcenter.mjs @@ -10,74 +10,80 @@ function hugoHoodCenter({ complete, paperless, macro, + expand, units, part, }) { const width = store.get('hoodCenterWidth') - const length = complete ? width * 2.5 : store.get('hoodCenterLength') - points.topLeft = new Point(0, 0) - points.bottomLeft = new Point(0, width) - points.topMidLeft = new Point(width, 0) - points.bottomMidLeft = new Point(width, width) - points.topMidRight = new Point(width * 1.5, 0) - points.bottomMidRight = new Point(width * 1.5, width) - points.topRight = new Point(length, 0) - points.bottomRight = new Point(length, width) + const length = store.get('hoodCenterLength') - if (complete) { - paths.seam = new Path() - .move(points.topMidLeft) - .line(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomMidLeft) - .move(points.bottomMidRight) - .line(points.bottomRight) - .line(points.topRight) - .line(points.topMidRight) - .attr('class', 'fabric') - paths.hint = new Path() - .move(points.topMidLeft) - .line(points.topMidRight) - .move(points.bottomMidLeft) - .line(points.bottomMidRight) - .attr('class', 'fabric dashed') + if (expand) { + store.flag.preset('expandIsOn') } else { - paths.seam = new Path() - .move(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.topRight) - .close() - .attr('class', 'fabric') + // Expand is off, do not draw the part but flag this to the user + store.flag.note({ + msg: `hugo:cutHoodCenter`, + replace: { + w: units(width + 2 * sa), + l: units(length + 2 * sa), + }, + suggest: { + text: 'flag:show', + icon: 'expand', + update: { + settings: ['expand', 1], + }, + }, + }) + // Also hint about expand + store.flag.preset('expandIsOff') + + return part.hide() } - // Complete pattern? - if (complete) { - if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') - } - points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) - macro('title', { at: points.title, nr: 7, title: 'hoodCenter' }) - macro('grainline', { - from: points.topLeft.shift(-90, width / 2), - to: points.topRight.shift(-90, width / 2), - }) - // Always include this dimension as we don't print the entire part - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomRight.y + sa + 15, - text: units(store.get('hoodCenterLength')), - }) - // Paperless? - if (paperless) { - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) - } - } + points.topLeft = new Point(0, 0) + points.bottomLeft = new Point(0, length) + points.topRight = new Point(width, 0) + points.bottomRight = new Point(width, length) + + paths.seam = new Path() + .move(points.topLeft) + .line(points.bottomLeft) + .line(points.bottomRight) + .line(points.topRight) + .close() + .attr('class', 'fabric') + if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 2, from: 'fabric' }) + + // Title + points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) + macro('title', { at: points.title, nr: 7, title: 'hoodCenter', align: 'center' }) + + // grainline + macro('grainline', { + from: points.topLeft.shift(-90, width / 2), + to: points.topRight.shift(-90, width / 2), + }) + + // Dimensions + macro('hd', { + id: 'width', + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomRight.y + sa + 15, + }) + macro('vd', { + id: 'length', + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) return part } diff --git a/designs/hugo/src/hoodside.mjs b/designs/hugo/src/hoodside.mjs index 91e88c13eca..520ade6011a 100644 --- a/designs/hugo/src/hoodside.mjs +++ b/designs/hugo/src/hoodside.mjs @@ -63,6 +63,14 @@ function hugoHoodSide({ .close() .attr('class', 'fabric') + if (sa) { + // Reversing this curve sidesteps a bezierjs edge case + paths.sa = paths.seam + .reverse() + .offset(sa * -1) + .attr('class', 'fabric sa') + } + // Store length of center seam store.set( 'hoodCenterLength', @@ -73,89 +81,96 @@ function hugoHoodSide({ .length() ) - // Complete pattern? - if (complete) { - if (sa) { - // Reversing this curve sidesteps a bezierjs edge case - paths.sa = paths.seam - .reverse() - .offset(sa * -1) - .attr('class', 'fabric sa') - } - //notches - points.cfNotch = new Path() - .move(points.neckEdge) - .curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge) - .shiftAlong(neckOpening - halfCenterPanel) - macro('sprinkle', { - snippet: 'notch', - on: ['shoulderNotch', 'cfNotch'], - }) - //title - points.title = points.hoodTop.shift(-90, 50) - macro('title', { at: points.title, nr: 6, title: 'hoodSide' }) - points.logo = points.title.shift(-90, 60) - snippets.logo = new Snippet('logo', points.logo) - macro('grainline', { - from: points.shoulderNotch, - to: points.hoodTop, - }) - } + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 4, from: 'fabric' }) - // Paperless? - if (paperless) { - let neckSeam = new Path() - .move(points.neckEdge) - .curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge) - .split(points.shoulderNotch) - let centralSeam = new Path() - .move(points.hoodRim) - .curve(points.hoodRim, points.hoodTopCp1, points.hoodTop) - .curve(points.hoodTopCp2, points.neckEdge, points.neckEdge) - .reverse() - let openingSeam = new Path() - .move(points.neckRoll) - .curve(points.neckRollCp2, points.hoodRimCp, points.hoodRim) + //notches + points.cfNotch = new Path() + .move(points.neckEdge) + .curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge) + .shiftAlong(neckOpening - halfCenterPanel) + macro('sprinkle', { + snippet: 'notch', + on: ['shoulderNotch', 'cfNotch'], + }) - macro('pd', { - path: neckSeam[0], - d: sa + 15, - }) - macro('pd', { - path: neckSeam[1], - d: sa + 15, - }) - macro('pd', { - path: centralSeam, - d: sa * -1 - 15, - }) - macro('hd', { - from: points.neckEdge, - to: points.frontEdge, - y: points.frontEdge.y + sa + 30, - }) - macro('hd', { - from: centralSeam.edge('left'), - to: points.frontEdge, - y: points.frontEdge.y + sa + 45, - }) - let openingEdge = openingSeam.edge('left') - macro('hd', { - from: openingEdge, - to: points.frontEdge, - y: openingEdge.y, - }) - macro('vd', { - from: points.frontEdge, - to: points.hoodRim, - x: points.hoodRim.x + sa + 15, - }) - macro('vd', { - from: points.frontEdge, - to: points.hoodTop, - x: points.hoodRim.x + sa + 30, - }) - } + //title + points.title = new Point(points.hoodTop.x, points.neckEdge.y / 4) + macro('title', { at: points.title, nr: 6, title: 'hoodSide', align: 'center' }) + + // Logo + points.logo = new Point(points.hoodTop.x, points.neckEdge.y * 0.666) + snippets.logo = new Snippet('logo', points.logo) + + // Grainline + macro('grainline', { + from: points.shoulderNotch, + to: points.hoodTop, + }) + + // Dimensions + const neckSeam = new Path() + .move(points.neckEdge) + .curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge) + .split(points.shoulderNotch) + const centralSeam = new Path() + .move(points.hoodRim) + .curve(points.hoodRim, points.hoodTopCp1, points.hoodTop) + .curve(points.hoodTopCp2, points.neckEdge, points.neckEdge) + .reverse() + const openingSeam = new Path() + .move(points.neckRoll) + .curve(points.neckRollCp2, points.hoodRimCp, points.hoodRim) + + macro('pd', { + id: 'lNeckToNotch', + path: neckSeam[0], + d: sa + 15, + }) + macro('pd', { + id: 'lNotchToNeck', + path: neckSeam[1], + d: sa + 15, + }) + macro('pd', { + id: 'lHood', + path: centralSeam, + d: sa * -1 - 15, + }) + macro('hd', { + id: 'wAtNeck', + from: points.neckEdge, + to: points.frontEdge, + y: points.frontEdge.y + sa + 30, + }) + macro('hd', { + id: 'wFull', + from: centralSeam.edge('left'), + to: points.frontEdge, + y: points.frontEdge.y + sa + 45, + }) + const openingEdge = openingSeam.edge('left') + macro('hd', { + id: 'wOpeningToTip', + from: openingEdge, + to: points.frontEdge, + y: openingEdge.y, + }) + macro('vd', { + id: 'hTipToOpeningTip', + from: points.frontEdge, + to: points.hoodRim, + x: points.hoodRim.x + sa + 15, + }) + macro('vd', { + id: 'hFull', + from: points.frontEdge, + to: points.hoodTop, + x: points.hoodRim.x + sa + 30, + }) return part } diff --git a/designs/hugo/src/options.mjs b/designs/hugo/src/options.mjs index 676da34b3fe..cdb7a7a17bd 100644 --- a/designs/hugo/src/options.mjs +++ b/designs/hugo/src/options.mjs @@ -13,3 +13,4 @@ export const draftForHighBust = { bool: false, menu: 'fit' } export const lengthBonus = { pct: 10, min: 0, max: 20, menu: 'style' } export const sleeveLengthBonus = { pct: 2, min: 0, max: 10, menu: 'style' } export const ribbingHeight = { pct: 10, min: 4, max: 20, menu: 'style' } +export const pocketWidth = { pct: 50, min: 35, max: 65, menu: 'style' } diff --git a/designs/hugo/src/pocket.mjs b/designs/hugo/src/pocket.mjs index 95c2c67d938..562f6b3becf 100644 --- a/designs/hugo/src/pocket.mjs +++ b/designs/hugo/src/pocket.mjs @@ -10,9 +10,29 @@ function hugoPocket({ complete, paperless, macro, + expand, snippets, part, }) { + if (expand) store.flag.preset('expandIsOn') + else { + // Expand is on, do not draw the part but flag this to the user + store.flag.note({ + msg: `hugo:cutPocket`, + suggest: { + text: 'flag:show', + icon: 'expand', + update: { + settings: ['expand', 1], + }, + }, + }) + // Also hint about expand + store.flag.preset('expandIsOff') + + return part.hide() + } + // Remove clutter for (const key in paths) { if (key !== 'pocket') delete paths[key] @@ -55,45 +75,56 @@ function hugoPocket({ .attr('class', ' fabric help') paths.facing.hide() - // Complete pattern? - if (complete) { - paths.facing.unhide() - macro('cutonfold', { - from: points.pocketCf, - to: points.cfRibbing, - grainline: true, - }) - points.title = points.cfRibbing.shiftFractionTowards(points.pocketTop, 0.5) - macro('title', { at: points.title, nr: 4, title: 'pocket' }) - if (sa) { - paths.sa = paths.saBase.offset(sa).line(points.pocketCf).move(points.cfRibbing) - paths.sa.line(paths.sa.start()).attr('class', 'fabric sa') - } + if (complete) paths.facing.unhide().addClass('note dashed') + + if (sa) { + paths.sa = paths.saBase.offset(sa).line(points.pocketCf).move(points.cfRibbing) + paths.sa.line(paths.sa.start()).attr('class', 'fabric sa') } - // Paperless? - if (paperless) { - macro('hd', { - from: points.cfRibbing, - to: points.pocketTop, - y: points.cfRibbing.y + 15 + sa, - }) - macro('hd', { - from: points.cfRibbing, - to: points.pocketTip, - y: points.cfRibbing.y + 30 + sa, - }) - macro('vd', { - from: points.pocketHem, - to: points.pocketTip, - x: points.pocketTip.x + 15 + sa, - }) - macro('vd', { - from: points.pocketHem, - to: points.pocketTop, - x: points.cfRibbing.x - 15 - sa, - }) - } + /* + * Annotations + */ + // cutlist + store.cutlist.setCut({ cut: 2, from: 'fabric' }) + + // Cutonfold + macro('cutonfold', { + to: points.cfRibbing, + from: points.pocketCf, + grainline: true, + reverse: true, + }) + + // Title + points.title = points.cfRibbing.shiftFractionTowards(points.pocketTop, 0.5) + macro('title', { at: points.title, nr: 4, title: 'pocket' }) + + // Dimensions + macro('hd', { + id: 'wAtWaist', + from: points.cfRibbing, + to: points.pocketHem, + y: points.cfRibbing.y + 15 + sa, + }) + macro('hd', { + id: 'wFull', + from: points.cfRibbing, + to: points.pocketTip, + y: points.cfRibbing.y + 30 + sa, + }) + macro('vd', { + id: 'hWaistToTip', + from: points.pocketHem, + to: points.pocketTip, + x: points.pocketTip.x + 15 + sa, + }) + macro('vd', { + id: 'hFull', + from: points.pocketHem, + to: points.pocketTop, + x: points.cfRibbing.x - 15 - sa, + }) return part } diff --git a/designs/hugo/src/pocketfacing.mjs b/designs/hugo/src/pocketfacing.mjs index c2ab9853e5a..0c08307686a 100644 --- a/designs/hugo/src/pocketfacing.mjs +++ b/designs/hugo/src/pocketfacing.mjs @@ -1,6 +1,36 @@ import { pocket } from './pocket.mjs' -function hugoPocketFacing({ sa, points, Path, paths, complete, paperless, macro, store, part }) { +function hugoPocketFacing({ + sa, + points, + Path, + paths, + complete, + paperless, + macro, + store, + expand, + part, +}) { + if (expand) store.flag.preset('expandIsOn') + else { + // Expand is on, do not draw the part but flag this to the user + store.flag.note({ + msg: `hugo:cutPocketFacing`, + suggest: { + text: 'flag:show', + icon: 'expand', + update: { + settings: ['expand', 1], + }, + }, + }) + // Also hint about expand + store.flag.preset('expandIsOff') + + return part.hide() + } + // Remove clutter for (const key in paths) { if (key !== 'facing') delete paths[key] @@ -16,30 +46,34 @@ function hugoPocketFacing({ sa, points, Path, paths, complete, paperless, macro, points.saStart = points.pocketTop.shift(180, store.get('facingWidth')) - // Complete pattern? - if (complete) { - points.title = points.pocketTopCp.clone() - macro('title', { at: points.title, nr: 5, title: 'pocketFacing' }) - if (sa) { - paths.sa = new Path() - .move(points.saStart) - .line(points.pocketTop) - .curve(points.pocketTopCp, points.pocketTip, points.pocketTip) - .line(points.facingEnd) - .offset(sa * -1) - .attr('class', 'fabric sa') - paths.sa.line(points.facingEnd).move(points.saStart).line(paths.sa.start()) - } + if (sa) { + paths.sa = new Path() + .move(points.saStart) + .line(points.pocketTop) + .curve(points.pocketTopCp, points.pocketTip, points.pocketTip) + .line(points.facingEnd) + .offset(sa * -1) + .attr('class', 'fabric sa') + paths.sa.line(points.facingEnd).move(points.saStart).line(paths.sa.start()) } - // Paperless? - if (paperless) { - macro('hd', { - from: points.saStart, - to: points.pocketTop, - y: points.saStart.y - 15 - sa, - }) - } + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 2, from: 'fabric' }) + + // Title + points.title = points.pocketTopCp.clone() + macro('title', { at: points.title, nr: 5, title: 'pocketFacing', scale: 0.666, align: 'center' }) + + // Dimensions + macro('hd', { + id: 'width', + from: points.saStart, + to: points.pocketTop, + y: points.saStart.y - 15 - sa, + }) return part } diff --git a/designs/hugo/src/sleeve.mjs b/designs/hugo/src/sleeve.mjs index 5aaabf357dd..f855ba95aae 100644 --- a/designs/hugo/src/sleeve.mjs +++ b/designs/hugo/src/sleeve.mjs @@ -138,87 +138,103 @@ function hugoSleeve({ .close() .attr('class', 'fabric') - // Complete pattern? - if (complete) { - macro('grainline', { - from: points.centerWrist, - to: points.raglanTop, - }) - //points.title = new Point(points.armhole.x/2, points.armhole.y); - macro('title', { at: points.gridAnchor, nr: 3, title: 'sleeve' }) - //points.sleeveNotch = points.raglanTipFront.shiftFractionTowards(points.armholeHollow, 0.5); - //snippets.sleeveNotch = new Snippet("notch", points.sleeveNotch); - //store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch)); - points.logo = points.gridAnchor.shift(-90, 70) - snippets.logo = new Snippet('logo', points.logo) - points.scalebox = points.logo.shift(-90, 70) - macro('scalebox', { at: points.scalebox }) - points.frontNotch = new Path() - .move(points.raglanTipFront) - .curve(points.raglanTipFront, points.slopeFrontCp1, points.slopeFront) - .curve(points.slopeFrontCp2, points.capQ4Cp2, points.bicepsLeft) - .shiftAlong(store.get('notchFront')) - snippets.frontNotch = new Snippet('notch', points.frontNotch) - snippets.shoulderNotch = new Snippet('notch', points.raglanTop) - points.backNotch = new Path() - .move(points.raglanTipBack) - .curve(points.raglanTipBack, points.slopeBackCp2, points.slopeBack) - .curve(points.slopeBackCp1, points.capQ1Cp1, points.bicepsRight) - .shiftAlong(store.get('notchBack')) - snippets.backNotch = new Snippet('bnotch', points.backNotch) - if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') - } - } + if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 2, from: 'fabric' }) + + // Grainline + macro('grainline', { + from: points.centerWrist, + to: points.raglanTop, + }) + + // Title + macro('title', { at: points.gridAnchor, nr: 3, title: 'sleeve' }) + + // Logo + points.logo = points.gridAnchor.shift(-90, 70) + snippets.logo = new Snippet('logo', points.logo) + + // Scalebox + points.scalebox = points.logo.shift(-90, 70) + macro('scalebox', { at: points.scalebox }) + + // Notches + points.frontNotch = new Path() + .move(points.raglanTipFront) + .curve(points.raglanTipFront, points.slopeFrontCp1, points.slopeFront) + .curve(points.slopeFrontCp2, points.capQ4Cp2, points.bicepsLeft) + .shiftAlong(store.get('notchFront')) + snippets.frontNotch = new Snippet('notch', points.frontNotch) + snippets.shoulderNotch = new Snippet('notch', points.raglanTop) + points.backNotch = new Path() + .move(points.raglanTipBack) + .curve(points.raglanTipBack, points.slopeBackCp2, points.slopeBack) + .curve(points.slopeBackCp1, points.capQ1Cp1, points.bicepsRight) + .shiftAlong(store.get('notchBack')) + snippets.backNotch = new Snippet('bnotch', points.backNotch) + + // Dimensions + macro('rmad') + macro('vd', { + id: 'hCuffToRaglan', + from: points.wristLeft, + to: points.bicepsLeft, + x: points.bicepsLeft.x - 15 - sa, + }) + macro('vd', { + id: 'hRaglanFront', + from: points.bicepsLeft, + to: points.raglanTipFront, + x: points.bicepsLeft.x - 15 - sa, + }) + macro('vd', { + id: 'hRaglanToTip', + from: points.bicepsRight, + to: points.raglanTop, + x: points.bicepsRight.x + 15 + sa, + }) + macro('vd', { + id: 'hRaglanBack', + from: points.bicepsRight, + to: points.raglanTipBack, + x: points.bicepsRight.x + 30 + sa, + }) + macro('hd', { + id: 'wRaglanTopFront', + from: points.raglanTipFront, + to: points.raglanTop, + y: points.raglanTipBack.y - 15 - sa, + }) + macro('hd', { + id: 'wRaglanTopBack', + from: points.raglanTop, + to: points.raglanTipBack, + y: points.raglanTipBack.y - 15 - sa, + }) + macro('hd', { + id: 'wSleeveFrontHalf', + from: points.bicepsLeft, + to: points.raglanTop, + y: points.raglanTipBack.y - 30 - sa, + }) + macro('hd', { + id: 'wFull', + from: points.bicepsLeft, + to: points.bicepsRight, + y: points.raglanTipBack.y - 45 - sa, + }) + macro('hd', { + id: 'wCuff', + from: points.wristLeft, + to: points.wristRight, + y: points.wristLeft.y + 15 + sa, + }) - // Paperless? - if (paperless) { - macro('vd', { - from: points.wristLeft, - to: points.bicepsLeft, - x: points.bicepsLeft.x - 15 - sa, - }) - macro('vd', { - from: points.bicepsLeft, - to: points.raglanTipFront, - x: points.bicepsLeft.x - 15 - sa, - }) - macro('vd', { - from: points.bicepsRight, - to: points.raglanTop, - x: points.bicepsRight.x + 15 + sa, - }) - macro('vd', { - from: points.bicepsRight, - to: points.raglanTipBack, - x: points.bicepsRight.x + 30 + sa, - }) - macro('hd', { - from: points.raglanTipFront, - to: points.raglanTop, - y: points.raglanTipBack.y - 15 - sa, - }) - macro('hd', { - from: points.raglanTop, - to: points.raglanTipBack, - y: points.raglanTipBack.y - 15 - sa, - }) - macro('hd', { - from: points.bicepsLeft, - to: points.raglanTop, - y: points.raglanTipBack.y - 30 - sa, - }) - macro('hd', { - from: points.bicepsLeft, - to: points.bicepsRight, - y: points.raglanTipBack.y - 45 - sa, - }) - macro('hd', { - from: points.wristLeft, - to: points.wristRight, - y: points.wristLeft.y + 15 + sa, - }) - } return part } diff --git a/designs/hugo/src/waistband.mjs b/designs/hugo/src/waistband.mjs index de43c7bbce9..ba48dee24f7 100644 --- a/designs/hugo/src/waistband.mjs +++ b/designs/hugo/src/waistband.mjs @@ -12,78 +12,80 @@ function hugoWaistband({ paperless, macro, units, + expand, + store, part, }) { - let width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2 - let length = complete - ? width * 2.5 - : measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch) + const width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2 + const length = measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch) - // We only print a part, unless complete is false in which case - // we print the entire thing (because laser cutters and so on) - points.topLeft = new Point(0, 0) - points.bottomLeft = new Point(0, width) - points.topMidLeft = new Point(width, 0) - points.bottomMidLeft = new Point(width, width) - points.topMidRight = new Point(width * 1.5, 0) - points.bottomMidRight = new Point(width * 1.5, width) - points.topRight = new Point(length, 0) - points.bottomRight = new Point(length, width) - - if (complete) { - paths.seam = new Path() - .move(points.topMidLeft) - .line(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomMidLeft) - .move(points.bottomMidRight) - .line(points.bottomRight) - .line(points.topRight) - .line(points.topMidRight) - .attr('class', 'various') - paths.hint = new Path() - .move(points.topMidLeft) - .line(points.topMidRight) - .move(points.bottomMidLeft) - .line(points.bottomMidRight) - .attr('class', 'various dashed') + if (expand) { + store.flag.preset('expandIsOn') } else { - paths.seam = new Path() - .move(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.topRight) - .close() - .attr('class', 'various') + // Expand is off, do not draw the part but flag this to the user + store.flag.note({ + msg: `hugo:cutWaistband`, + replace: { + w: units(width + 2 * sa), + l: units(length + 2 * sa), + }, + suggest: { + text: 'flag:show', + icon: 'expand', + update: { + settings: ['expand', 1], + }, + }, + }) + // Also hint about expand + store.flag.preset('expandIsOff') + + return part.hide() } - // Complete pattern? - if (complete) { - if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa') - points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) - macro('title', { at: points.title, nr: 8, title: 'waistband' }) - macro('grainline', { - from: points.bottomMidLeft, - to: points.topMidLeft, - }) + points.topLeft = new Point(0, 0) + points.bottomLeft = new Point(0, length) + points.topRight = new Point(width, 0) + points.bottomRight = new Point(width, length) - // Always include this dimension as we don't print the entire part - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomRight.y + sa + 15, - text: units(measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch)), - }) - } + paths.seam = new Path() + .move(points.topLeft) + .line(points.bottomLeft) + .line(points.bottomRight) + .line(points.topRight) + .close() + .attr('class', 'various') - // Paperless? - if (paperless) { - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) - } + if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa') + /* + * Annotations + */ + // Cutlist + store.cutlist.setCut({ cut: 1, from: 'ribbing' }) + + // Title + points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) + macro('title', { at: points.title, nr: 8, title: 'waistband', align: 'center' }) + + // Grainline + macro('grainline', { + from: points.bottomLeft.shift(0, 15), + to: points.topLeft.shift(0, 15), + }) + + // Dimensions + macro('hd', { + id: 'wFull', + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomRight.y + sa + 15, + }) + macro('vd', { + id: 'hFull', + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) return part } diff --git a/markdown/org/docs/designs/hugo/options/pocketwidth/en.md b/markdown/org/docs/designs/hugo/options/pocketwidth/en.md new file mode 100644 index 00000000000..638dec509cf --- /dev/null +++ b/markdown/org/docs/designs/hugo/options/pocketwidth/en.md @@ -0,0 +1,7 @@ +--- +title: "Pocket width" +--- + +This option controls the width of the front pocket. + +