1
0
Fork 0

chore(hugo): Prepare for v3 beta

This commit is contained in:
joostdecock 2023-09-17 12:44:03 +02:00
parent b5ca1a7fb7
commit 0db1ebeb26
13 changed files with 645 additions and 461 deletions

View file

@ -216,7 +216,7 @@
"design": "Joost De Cock", "design": "Joost De Cock",
"difficulty": 3, "difficulty": 3,
"tags": ["tops"], "tags": ["tops"],
"techniques": [] "techniques": ["curvedSeam", "pocket", "ribbing", "raglanSleeve"]
}, },
"jaeger": { "jaeger": {
"description": "A FreeSewing pattern for a sport coat style jacket", "description": "A FreeSewing pattern for a sport coat style jacket",

View file

@ -18,7 +18,13 @@
"hoodSide": "Hood side", "hoodSide": "Hood side",
"pocketFacing": "Pocket facing", "pocketFacing": "Pocket facing",
"pocket": "Pocket", "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": { "o": {
"ribbingHeight": { "ribbingHeight": {
@ -29,6 +35,10 @@
"t": "Ribbing stretch", "t": "Ribbing stretch",
"d": "Use this to adapt the pattern to how stretchy the ribbing that you are using is." "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": { "hipsEase": {
"t": "Hips ease", "t": "Hips ease",
"d": "The amount of ease at your hips." "d": "The amount of ease at your hips."

View file

@ -33,9 +33,11 @@ function hugoBack({
points.ribbing = points.hem.shift(90, store.get('ribbing')) points.ribbing = points.hem.shift(90, store.get('ribbing'))
// Raglan tip // 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) points.raglanTipBack = neckOpening.shiftFractionAlong(0.7)
let neckOpeningParts = neckOpening.split(points.raglanTipBack) const neckOpeningParts = neckOpening.split(points.raglanTipBack)
// Paths // Paths
paths.saBase = new Path() paths.saBase = new Path()
.move(points.cbRibbing) .move(points.cbRibbing)
@ -47,21 +49,34 @@ function hugoBack({
paths.seam = paths.saBase.clone().close().attr('class', 'fabric') paths.seam = paths.saBase.clone().close().attr('class', 'fabric')
paths.saBase.hide() 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 neck opening path
store.set('neckOpeningPartBack', neckOpeningParts[1]) store.set('neckOpeningPartBack', neckOpeningParts[1])
store.set('neckOpeningAnchorBack', points.neck) store.set('neckOpeningAnchorBack', points.neck)
store.set('neckOpeningLenBack', neckOpening.length()) store.set('neckOpeningLenBack', neckOpening.length())
store.set('neckCutoutBack', points.cbNeck.y) store.set('neckCutoutBack', points.cbNeck.y)
// Complete pattern? /*
if (complete) { * Annotations
*/
// cutlist
store.cutlist.setCut({ cut: 1, from: 'fabric', onFold: true })
// Cutonfold
macro('cutonfold', { macro('cutonfold', {
from: points.cbNeck, from: points.cbNeck,
to: points.cbRibbing, to: points.cbRibbing,
grainline: true, grainline: true,
}) })
// Title
points.title = new Point(points.armhole.x / 2, points.armhole.y) points.title = new Point(points.armhole.x / 2, points.armhole.y)
macro('title', { at: points.title, nr: 2, title: 'back' }) macro('title', { at: points.title, nr: 2, title: 'back' })
// Notches
store.set('notchBack', points.raglanTipBack.dist(points.armholeHollow) / 2) store.set('notchBack', points.raglanTipBack.dist(points.armholeHollow) / 2)
points.sleeveNotch = points.raglanTipBack.shiftTowards( points.sleeveNotch = points.raglanTipBack.shiftTowards(
points.armholeHollow, points.armholeHollow,
@ -69,47 +84,48 @@ function hugoBack({
) )
snippets.sleeveNotch = new Snippet('bnotch', points.sleeveNotch) snippets.sleeveNotch = new Snippet('bnotch', points.sleeveNotch)
store.set('backRaglanTipToNotch', points.raglanTipBack.dist(points.sleeveNotch)) store.set('backRaglanTipToNotch', points.raglanTipBack.dist(points.sleeveNotch))
// Logo
points.logo = points.title.shift(-90, 70) points.logo = points.title.shift(-90, 70)
snippets.logo = new Snippet('logo', points.logo) 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())
}
}
// Paperless? // Dimensions
if (paperless) {
macro('vd', { macro('vd', {
id: 'hHemToCfNeck',
from: points.cbRibbing, from: points.cbRibbing,
to: points.cbNeck, to: points.cbNeck,
x: points.cbNeck.x - 15, x: points.cbNeck.x - 15,
}) })
macro('vd', { macro('vd', {
id: 'hFull',
from: points.cbRibbing, from: points.cbRibbing,
to: points.raglanTipBack, to: points.raglanTipBack,
x: points.cbNeck.x - 30, x: points.cbNeck.x - 30,
}) })
macro('vd', { macro('vd', {
id: 'hHemToRaglanStart',
from: points.ribbing, from: points.ribbing,
to: points.armhole, to: points.armhole,
x: points.ribbing.x + 15 + sa, x: points.ribbing.x + 15 + sa,
}) })
macro('hd', { macro('hd', {
id: 'wNeckOpening',
from: points.cbNeck, from: points.cbNeck,
to: points.raglanTipBack, to: points.raglanTipBack,
y: points.raglanTipBack.y - 15 - sa, y: points.raglanTipBack.y - 15 - sa,
}) })
macro('hd', { macro('hd', {
id: 'wRaglan',
from: points.raglanTipBack, from: points.raglanTipBack,
to: points.armhole, to: points.armhole,
y: points.raglanTipBack.y - 15 - sa, y: points.raglanTipBack.y - 15 - sa,
}) })
macro('hd', { macro('hd', {
id: 'wHem',
from: points.cbRibbing, from: points.cbRibbing,
to: points.ribbing, to: points.ribbing,
y: points.cbRibbing.y + 15 + sa, y: points.cbRibbing.y + 15 + sa,
}) })
}
return part return part
} }

View file

@ -11,11 +11,38 @@ function hugoCuff({
complete, complete,
paperless, paperless,
macro, macro,
expand,
store,
units,
part, part,
}) { }) {
const width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2 const width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2
const length = measurements.wrist * (1 + options.cuffEase) * (1 - options.ribbingStretch) 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.topLeft = new Point(0, 0)
points.bottomLeft = new Point(0, width) points.bottomLeft = new Point(0, width)
points.topRight = new Point(length, 0) points.topRight = new Point(length, 0)
@ -30,32 +57,37 @@ function hugoCuff({
.close() .close()
.attr('class', 'various') .attr('class', 'various')
// Complete pattern? if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa')
if (complete) {
if (sa) { /*
paths.sa = paths.seam.offset(sa).attr('class', 'various sa') * Annotations
} */
// Cutlist
store.cutlist.setCut({ cut: 2, from: 'ribbing' })
// Title
points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5)
macro('title', { at: points.title, nr: 9, title: 'cuff' }) macro('title', { at: points.title, nr: 9, title: 'cuff' })
// Grainline
macro('grainline', { macro('grainline', {
from: points.bottomLeft.shift(0, 20), from: points.bottomLeft.shift(0, 20),
to: points.topLeft.shift(0, 20), to: points.topLeft.shift(0, 20),
}) })
}
// Paperless? // Dimensions
if (paperless) {
macro('vd', { macro('vd', {
id: 'hFull',
from: points.bottomRight, from: points.bottomRight,
to: points.topRight, to: points.topRight,
x: points.topRight.x + sa + 15, x: points.topRight.x + sa + 15,
}) })
macro('hd', { macro('hd', {
id: 'wFull',
from: points.bottomLeft, from: points.bottomLeft,
to: points.bottomRight, to: points.bottomRight,
y: points.bottomRight.y + sa + 15, y: points.bottomRight.y + sa + 15,
}) })
}
return part return part
} }

View file

@ -13,6 +13,7 @@ import {
lengthBonus, lengthBonus,
draftForHighBust, draftForHighBust,
ribbingHeight, ribbingHeight,
pocketWidth,
} from './options.mjs' } from './options.mjs'
function hugoFront({ function hugoFront({
@ -57,14 +58,14 @@ function hugoFront({
points.ribbing = points.hem.shift(90, store.get('ribbing')) points.ribbing = points.hem.shift(90, store.get('ribbing'))
// Raglan tip // Raglan tip
let neckOpening = new Path() const neckOpening = new Path()
.move(points.cfNeck) .move(points.cfNeck)
.curve(points.cfNeckCp1, points.neckCp2, points.neck) .curve(points.cfNeckCp1, points.neckCp2, points.neck)
points.raglanTipFront = neckOpening.shiftFractionAlong(0.8) points.raglanTipFront = neckOpening.shiftFractionAlong(0.8)
let neckOpeningParts = neckOpening.split(points.raglanTipFront) const neckOpeningParts = neckOpening.split(points.raglanTipFront)
// Pocket // Pocket
points.pocketHem = points.cfRibbing.shiftFractionTowards(points.ribbing, 0.6) points.pocketHem = points.cfRibbing.shiftFractionTowards(points.ribbing, options.pocketWidth)
points.pocketCf = points.cfHem.shift( points.pocketCf = points.cfHem.shift(
90, 90,
measurements.hpsToWaistBack * 0.33 + store.get('ribbing') measurements.hpsToWaistBack * 0.33 + store.get('ribbing')
@ -90,12 +91,13 @@ function hugoFront({
.join(neckOpeningParts[0].reverse()) .join(neckOpeningParts[0].reverse())
paths.saBase.hide() paths.saBase.hide()
paths.seam = paths.saBase.clone().unhide().close().attr('class', 'fabric') paths.seam = paths.saBase.clone().unhide().close().attr('class', 'fabric')
if (complete)
paths.pocket = new Path() paths.pocket = new Path()
.move(points.pocketHem) .move(points.pocketHem)
.line(points.pocketTip) .line(points.pocketTip)
.curve(points.pocketTip, points.pocketTopCp, points.pocketTop) .curve(points.pocketTip, points.pocketTopCp, points.pocketTop)
.line(points.pocketCf) .line(points.pocketCf)
.attr('class', 'fabric help') .attr('class', 'note help')
// Store shoulder seam length, neck opening path, shoulder slope and raglan length // Store shoulder seam length, neck opening path, shoulder slope and raglan length
store.set('shoulderLength', points.neck.dist(points.shoulder)) store.set('shoulderLength', points.neck.dist(points.shoulder))
store.set('neckOpeningPartFront', neckOpeningParts[1]) store.set('neckOpeningPartFront', neckOpeningParts[1])
@ -112,15 +114,29 @@ function hugoFront({
store.set('neckOpeningLenFront', neckOpening.length()) store.set('neckOpeningLenFront', neckOpening.length())
store.set('neckCutoutFront', points.cfNeck.y) store.set('neckCutoutFront', points.cfNeck.y)
// Complete pattern? if (sa) {
if (complete) { 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', { macro('cutonfold', {
from: points.cfNeck, from: points.cfNeck,
to: points.cfRibbing, to: points.cfRibbing,
grainline: true, grainline: true,
}) })
// Title
points.title = new Point(points.armhole.x / 2, points.armhole.y) points.title = new Point(points.armhole.x / 2, points.armhole.y)
macro('title', { at: points.title, nr: 1, title: 'front' }) macro('title', { at: points.title, nr: 1, title: 'front' })
// Notches
store.set('notchFront', points.raglanTipFront.dist(points.armholeHollow) / 2) store.set('notchFront', points.raglanTipFront.dist(points.armholeHollow) / 2)
points.sleeveNotch = points.raglanTipFront.shiftTowards( points.sleeveNotch = points.raglanTipFront.shiftTowards(
points.armholeHollow, points.armholeHollow,
@ -128,13 +144,10 @@ function hugoFront({
) )
snippets.sleeveNotch = new Snippet('notch', points.sleeveNotch) snippets.sleeveNotch = new Snippet('notch', points.sleeveNotch)
store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch)) store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch))
// Logo
points.logo = points.title.shift(-90, 70) points.logo = points.title.shift(-90, 70)
snippets.logo = new Snippet('logo', points.logo) 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())
}
}
// Paperless? // Paperless?
if (paperless) { if (paperless) {
@ -206,6 +219,7 @@ export const front = {
draftForHighBust, draftForHighBust,
lengthBonus, lengthBonus,
ribbingHeight, ribbingHeight,
pocketWidth,
}, },
draft: hugoFront, draft: hugoFront,
} }

View file

@ -10,38 +10,42 @@ function hugoHoodCenter({
complete, complete,
paperless, paperless,
macro, macro,
expand,
units, units,
part, part,
}) { }) {
const width = store.get('hoodCenterWidth') const width = store.get('hoodCenterWidth')
const length = complete ? width * 2.5 : store.get('hoodCenterLength') const length = 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)
if (complete) { if (expand) {
paths.seam = new Path() store.flag.preset('expandIsOn')
.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')
} else { } else {
// 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()
}
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() paths.seam = new Path()
.move(points.topLeft) .move(points.topLeft)
.line(points.bottomLeft) .line(points.bottomLeft)
@ -49,35 +53,37 @@ function hugoHoodCenter({
.line(points.topRight) .line(points.topRight)
.close() .close()
.attr('class', 'fabric') .attr('class', 'fabric')
} if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
// Complete pattern? /*
if (complete) { * Annotations
if (sa) { */
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') // Cutlist
} store.cutlist.setCut({ cut: 2, from: 'fabric' })
// Title
points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5)
macro('title', { at: points.title, nr: 7, title: 'hoodCenter' }) macro('title', { at: points.title, nr: 7, title: 'hoodCenter', align: 'center' })
// grainline
macro('grainline', { macro('grainline', {
from: points.topLeft.shift(-90, width / 2), from: points.topLeft.shift(-90, width / 2),
to: points.topRight.shift(-90, width / 2), to: points.topRight.shift(-90, width / 2),
}) })
// Always include this dimension as we don't print the entire part
// Dimensions
macro('hd', { macro('hd', {
id: 'width',
from: points.bottomLeft, from: points.bottomLeft,
to: points.bottomRight, to: points.bottomRight,
y: points.bottomRight.y + sa + 15, y: points.bottomRight.y + sa + 15,
text: units(store.get('hoodCenterLength')),
}) })
// Paperless?
if (paperless) {
macro('vd', { macro('vd', {
id: 'length',
from: points.bottomRight, from: points.bottomRight,
to: points.topRight, to: points.topRight,
x: points.topRight.x + sa + 15, x: points.topRight.x + sa + 15,
}) })
}
}
return part return part
} }

View file

@ -63,6 +63,14 @@ function hugoHoodSide({
.close() .close()
.attr('class', 'fabric') .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 length of center seam
store.set( store.set(
'hoodCenterLength', 'hoodCenterLength',
@ -73,15 +81,12 @@ function hugoHoodSide({
.length() .length()
) )
// Complete pattern? /*
if (complete) { * Annotations
if (sa) { */
// Reversing this curve sidesteps a bezierjs edge case // Cutlist
paths.sa = paths.seam store.cutlist.setCut({ cut: 4, from: 'fabric' })
.reverse()
.offset(sa * -1)
.attr('class', 'fabric sa')
}
//notches //notches
points.cfNotch = new Path() points.cfNotch = new Path()
.move(points.neckEdge) .move(points.neckEdge)
@ -91,71 +96,81 @@ function hugoHoodSide({
snippet: 'notch', snippet: 'notch',
on: ['shoulderNotch', 'cfNotch'], on: ['shoulderNotch', 'cfNotch'],
}) })
//title //title
points.title = points.hoodTop.shift(-90, 50) points.title = new Point(points.hoodTop.x, points.neckEdge.y / 4)
macro('title', { at: points.title, nr: 6, title: 'hoodSide' }) macro('title', { at: points.title, nr: 6, title: 'hoodSide', align: 'center' })
points.logo = points.title.shift(-90, 60)
// Logo
points.logo = new Point(points.hoodTop.x, points.neckEdge.y * 0.666)
snippets.logo = new Snippet('logo', points.logo) snippets.logo = new Snippet('logo', points.logo)
// Grainline
macro('grainline', { macro('grainline', {
from: points.shoulderNotch, from: points.shoulderNotch,
to: points.hoodTop, to: points.hoodTop,
}) })
}
// Paperless? // Dimensions
if (paperless) { const neckSeam = new Path()
let neckSeam = new Path()
.move(points.neckEdge) .move(points.neckEdge)
.curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge) .curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge)
.split(points.shoulderNotch) .split(points.shoulderNotch)
let centralSeam = new Path() const centralSeam = new Path()
.move(points.hoodRim) .move(points.hoodRim)
.curve(points.hoodRim, points.hoodTopCp1, points.hoodTop) .curve(points.hoodRim, points.hoodTopCp1, points.hoodTop)
.curve(points.hoodTopCp2, points.neckEdge, points.neckEdge) .curve(points.hoodTopCp2, points.neckEdge, points.neckEdge)
.reverse() .reverse()
let openingSeam = new Path() const openingSeam = new Path()
.move(points.neckRoll) .move(points.neckRoll)
.curve(points.neckRollCp2, points.hoodRimCp, points.hoodRim) .curve(points.neckRollCp2, points.hoodRimCp, points.hoodRim)
macro('pd', { macro('pd', {
id: 'lNeckToNotch',
path: neckSeam[0], path: neckSeam[0],
d: sa + 15, d: sa + 15,
}) })
macro('pd', { macro('pd', {
id: 'lNotchToNeck',
path: neckSeam[1], path: neckSeam[1],
d: sa + 15, d: sa + 15,
}) })
macro('pd', { macro('pd', {
id: 'lHood',
path: centralSeam, path: centralSeam,
d: sa * -1 - 15, d: sa * -1 - 15,
}) })
macro('hd', { macro('hd', {
id: 'wAtNeck',
from: points.neckEdge, from: points.neckEdge,
to: points.frontEdge, to: points.frontEdge,
y: points.frontEdge.y + sa + 30, y: points.frontEdge.y + sa + 30,
}) })
macro('hd', { macro('hd', {
id: 'wFull',
from: centralSeam.edge('left'), from: centralSeam.edge('left'),
to: points.frontEdge, to: points.frontEdge,
y: points.frontEdge.y + sa + 45, y: points.frontEdge.y + sa + 45,
}) })
let openingEdge = openingSeam.edge('left') const openingEdge = openingSeam.edge('left')
macro('hd', { macro('hd', {
id: 'wOpeningToTip',
from: openingEdge, from: openingEdge,
to: points.frontEdge, to: points.frontEdge,
y: openingEdge.y, y: openingEdge.y,
}) })
macro('vd', { macro('vd', {
id: 'hTipToOpeningTip',
from: points.frontEdge, from: points.frontEdge,
to: points.hoodRim, to: points.hoodRim,
x: points.hoodRim.x + sa + 15, x: points.hoodRim.x + sa + 15,
}) })
macro('vd', { macro('vd', {
id: 'hFull',
from: points.frontEdge, from: points.frontEdge,
to: points.hoodTop, to: points.hoodTop,
x: points.hoodRim.x + sa + 30, x: points.hoodRim.x + sa + 30,
}) })
}
return part return part
} }

View file

@ -13,3 +13,4 @@ export const draftForHighBust = { bool: false, menu: 'fit' }
export const lengthBonus = { pct: 10, min: 0, max: 20, menu: 'style' } export const lengthBonus = { pct: 10, min: 0, max: 20, menu: 'style' }
export const sleeveLengthBonus = { pct: 2, min: 0, max: 10, 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 ribbingHeight = { pct: 10, min: 4, max: 20, menu: 'style' }
export const pocketWidth = { pct: 50, min: 35, max: 65, menu: 'style' }

View file

@ -10,9 +10,29 @@ function hugoPocket({
complete, complete,
paperless, paperless,
macro, macro,
expand,
snippets, snippets,
part, 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 // Remove clutter
for (const key in paths) { for (const key in paths) {
if (key !== 'pocket') delete paths[key] if (key !== 'pocket') delete paths[key]
@ -55,45 +75,56 @@ function hugoPocket({
.attr('class', ' fabric help') .attr('class', ' fabric help')
paths.facing.hide() paths.facing.hide()
// Complete pattern? if (complete) paths.facing.unhide().addClass('note dashed')
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) { if (sa) {
paths.sa = paths.saBase.offset(sa).line(points.pocketCf).move(points.cfRibbing) paths.sa = paths.saBase.offset(sa).line(points.pocketCf).move(points.cfRibbing)
paths.sa.line(paths.sa.start()).attr('class', 'fabric sa') paths.sa.line(paths.sa.start()).attr('class', 'fabric sa')
} }
}
// Paperless? /*
if (paperless) { * 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', { macro('hd', {
id: 'wAtWaist',
from: points.cfRibbing, from: points.cfRibbing,
to: points.pocketTop, to: points.pocketHem,
y: points.cfRibbing.y + 15 + sa, y: points.cfRibbing.y + 15 + sa,
}) })
macro('hd', { macro('hd', {
id: 'wFull',
from: points.cfRibbing, from: points.cfRibbing,
to: points.pocketTip, to: points.pocketTip,
y: points.cfRibbing.y + 30 + sa, y: points.cfRibbing.y + 30 + sa,
}) })
macro('vd', { macro('vd', {
id: 'hWaistToTip',
from: points.pocketHem, from: points.pocketHem,
to: points.pocketTip, to: points.pocketTip,
x: points.pocketTip.x + 15 + sa, x: points.pocketTip.x + 15 + sa,
}) })
macro('vd', { macro('vd', {
id: 'hFull',
from: points.pocketHem, from: points.pocketHem,
to: points.pocketTop, to: points.pocketTop,
x: points.cfRibbing.x - 15 - sa, x: points.cfRibbing.x - 15 - sa,
}) })
}
return part return part
} }

View file

@ -1,6 +1,36 @@
import { pocket } from './pocket.mjs' 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 // Remove clutter
for (const key in paths) { for (const key in paths) {
if (key !== 'facing') delete paths[key] if (key !== 'facing') delete paths[key]
@ -16,10 +46,6 @@ function hugoPocketFacing({ sa, points, Path, paths, complete, paperless, macro,
points.saStart = points.pocketTop.shift(180, store.get('facingWidth')) 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) { if (sa) {
paths.sa = new Path() paths.sa = new Path()
.move(points.saStart) .move(points.saStart)
@ -30,16 +56,24 @@ function hugoPocketFacing({ sa, points, Path, paths, complete, paperless, macro,
.attr('class', 'fabric sa') .attr('class', 'fabric sa')
paths.sa.line(points.facingEnd).move(points.saStart).line(paths.sa.start()) paths.sa.line(points.facingEnd).move(points.saStart).line(paths.sa.start())
} }
}
// Paperless? /*
if (paperless) { * 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', { macro('hd', {
id: 'width',
from: points.saStart, from: points.saStart,
to: points.pocketTop, to: points.pocketTop,
y: points.saStart.y - 15 - sa, y: points.saStart.y - 15 - sa,
}) })
}
return part return part
} }

View file

@ -138,21 +138,32 @@ function hugoSleeve({
.close() .close()
.attr('class', 'fabric') .attr('class', 'fabric')
// Complete pattern? if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
if (complete) {
/*
* Annotations
*/
// Cutlist
store.cutlist.setCut({ cut: 2, from: 'fabric' })
// Grainline
macro('grainline', { macro('grainline', {
from: points.centerWrist, from: points.centerWrist,
to: points.raglanTop, to: points.raglanTop,
}) })
//points.title = new Point(points.armhole.x/2, points.armhole.y);
// Title
macro('title', { at: points.gridAnchor, nr: 3, title: 'sleeve' }) 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); // Logo
//store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch));
points.logo = points.gridAnchor.shift(-90, 70) points.logo = points.gridAnchor.shift(-90, 70)
snippets.logo = new Snippet('logo', points.logo) snippets.logo = new Snippet('logo', points.logo)
// Scalebox
points.scalebox = points.logo.shift(-90, 70) points.scalebox = points.logo.shift(-90, 70)
macro('scalebox', { at: points.scalebox }) macro('scalebox', { at: points.scalebox })
// Notches
points.frontNotch = new Path() points.frontNotch = new Path()
.move(points.raglanTipFront) .move(points.raglanTipFront)
.curve(points.raglanTipFront, points.slopeFrontCp1, points.slopeFront) .curve(points.raglanTipFront, points.slopeFrontCp1, points.slopeFront)
@ -166,59 +177,64 @@ function hugoSleeve({
.curve(points.slopeBackCp1, points.capQ1Cp1, points.bicepsRight) .curve(points.slopeBackCp1, points.capQ1Cp1, points.bicepsRight)
.shiftAlong(store.get('notchBack')) .shiftAlong(store.get('notchBack'))
snippets.backNotch = new Snippet('bnotch', points.backNotch) snippets.backNotch = new Snippet('bnotch', points.backNotch)
if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
}
}
// Paperless? // Dimensions
if (paperless) { macro('rmad')
macro('vd', { macro('vd', {
id: 'hCuffToRaglan',
from: points.wristLeft, from: points.wristLeft,
to: points.bicepsLeft, to: points.bicepsLeft,
x: points.bicepsLeft.x - 15 - sa, x: points.bicepsLeft.x - 15 - sa,
}) })
macro('vd', { macro('vd', {
id: 'hRaglanFront',
from: points.bicepsLeft, from: points.bicepsLeft,
to: points.raglanTipFront, to: points.raglanTipFront,
x: points.bicepsLeft.x - 15 - sa, x: points.bicepsLeft.x - 15 - sa,
}) })
macro('vd', { macro('vd', {
id: 'hRaglanToTip',
from: points.bicepsRight, from: points.bicepsRight,
to: points.raglanTop, to: points.raglanTop,
x: points.bicepsRight.x + 15 + sa, x: points.bicepsRight.x + 15 + sa,
}) })
macro('vd', { macro('vd', {
id: 'hRaglanBack',
from: points.bicepsRight, from: points.bicepsRight,
to: points.raglanTipBack, to: points.raglanTipBack,
x: points.bicepsRight.x + 30 + sa, x: points.bicepsRight.x + 30 + sa,
}) })
macro('hd', { macro('hd', {
id: 'wRaglanTopFront',
from: points.raglanTipFront, from: points.raglanTipFront,
to: points.raglanTop, to: points.raglanTop,
y: points.raglanTipBack.y - 15 - sa, y: points.raglanTipBack.y - 15 - sa,
}) })
macro('hd', { macro('hd', {
id: 'wRaglanTopBack',
from: points.raglanTop, from: points.raglanTop,
to: points.raglanTipBack, to: points.raglanTipBack,
y: points.raglanTipBack.y - 15 - sa, y: points.raglanTipBack.y - 15 - sa,
}) })
macro('hd', { macro('hd', {
id: 'wSleeveFrontHalf',
from: points.bicepsLeft, from: points.bicepsLeft,
to: points.raglanTop, to: points.raglanTop,
y: points.raglanTipBack.y - 30 - sa, y: points.raglanTipBack.y - 30 - sa,
}) })
macro('hd', { macro('hd', {
id: 'wFull',
from: points.bicepsLeft, from: points.bicepsLeft,
to: points.bicepsRight, to: points.bicepsRight,
y: points.raglanTipBack.y - 45 - sa, y: points.raglanTipBack.y - 45 - sa,
}) })
macro('hd', { macro('hd', {
id: 'wCuff',
from: points.wristLeft, from: points.wristLeft,
to: points.wristRight, to: points.wristRight,
y: points.wristLeft.y + 15 + sa, y: points.wristLeft.y + 15 + sa,
}) })
}
return part return part
} }

View file

@ -12,42 +12,42 @@ function hugoWaistband({
paperless, paperless,
macro, macro,
units, units,
expand,
store,
part, part,
}) { }) {
let width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2 const width = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight * 2
let length = complete const length = measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch)
? width * 2.5
: measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch)
// We only print a part, unless complete is false in which case if (expand) {
// we print the entire thing (because laser cutters and so on) store.flag.preset('expandIsOn')
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')
} else { } else {
// 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()
}
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() paths.seam = new Path()
.move(points.topLeft) .move(points.topLeft)
.line(points.bottomLeft) .line(points.bottomLeft)
@ -55,35 +55,37 @@ function hugoWaistband({
.line(points.topRight) .line(points.topRight)
.close() .close()
.attr('class', 'various') .attr('class', 'various')
}
// Complete pattern?
if (complete) {
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa') 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) points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5)
macro('title', { at: points.title, nr: 8, title: 'waistband' }) macro('title', { at: points.title, nr: 8, title: 'waistband', align: 'center' })
// Grainline
macro('grainline', { macro('grainline', {
from: points.bottomMidLeft, from: points.bottomLeft.shift(0, 15),
to: points.topMidLeft, to: points.topLeft.shift(0, 15),
}) })
// Always include this dimension as we don't print the entire part // Dimensions
macro('hd', { macro('hd', {
id: 'wFull',
from: points.bottomLeft, from: points.bottomLeft,
to: points.bottomRight, to: points.bottomRight,
y: points.bottomRight.y + sa + 15, y: points.bottomRight.y + sa + 15,
text: units(measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch)),
}) })
}
// Paperless?
if (paperless) {
macro('vd', { macro('vd', {
id: 'hFull',
from: points.bottomRight, from: points.bottomRight,
to: points.topRight, to: points.topRight,
x: points.topRight.x + sa + 15, x: points.topRight.x + sa + 15,
}) })
}
return part return part
} }

View file

@ -0,0 +1,7 @@
---
title: "Pocket width"
---
This option controls the width of the front pocket.