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,69 +49,83 @@ 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
macro('cutonfold', { */
from: points.cbNeck, // cutlist
to: points.cbRibbing, store.cutlist.setCut({ cut: 1, from: 'fabric', onFold: true })
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())
}
}
// Paperless? // Cutonfold
if (paperless) { macro('cutonfold', {
macro('vd', { from: points.cbNeck,
from: points.cbRibbing, to: points.cbRibbing,
to: points.cbNeck, grainline: true,
x: points.cbNeck.x - 15, })
})
macro('vd', { // Title
from: points.cbRibbing, points.title = new Point(points.armhole.x / 2, points.armhole.y)
to: points.raglanTipBack, macro('title', { at: points.title, nr: 2, title: 'back' })
x: points.cbNeck.x - 30,
}) // Notches
macro('vd', { store.set('notchBack', points.raglanTipBack.dist(points.armholeHollow) / 2)
from: points.ribbing, points.sleeveNotch = points.raglanTipBack.shiftTowards(
to: points.armhole, points.armholeHollow,
x: points.ribbing.x + 15 + sa, store.get('notchBack')
}) )
macro('hd', { snippets.sleeveNotch = new Snippet('bnotch', points.sleeveNotch)
from: points.cbNeck, store.set('backRaglanTipToNotch', points.raglanTipBack.dist(points.sleeveNotch))
to: points.raglanTipBack,
y: points.raglanTipBack.y - 15 - sa, // Logo
}) points.logo = points.title.shift(-90, 70)
macro('hd', { snippets.logo = new Snippet('logo', points.logo)
from: points.raglanTipBack,
to: points.armhole, // Dimensions
y: points.raglanTipBack.y - 15 - sa, macro('vd', {
}) id: 'hHemToCfNeck',
macro('hd', { from: points.cbRibbing,
from: points.cbRibbing, to: points.cbNeck,
to: points.ribbing, x: points.cbNeck.x - 15,
y: points.cbRibbing.y + 15 + sa, })
}) 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 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')
}
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),
})
}
// Paperless? /*
if (paperless) { * Annotations
macro('vd', { */
from: points.bottomRight, // Cutlist
to: points.topRight, store.cutlist.setCut({ cut: 2, from: 'ribbing' })
x: points.topRight.x + sa + 15,
}) // Title
macro('hd', { points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5)
from: points.bottomLeft, macro('title', { at: points.title, nr: 9, title: 'cuff' })
to: points.bottomRight,
y: points.bottomRight.y + sa + 15, // 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 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')
paths.pocket = new Path() if (complete)
.move(points.pocketHem) paths.pocket = new Path()
.line(points.pocketTip) .move(points.pocketHem)
.curve(points.pocketTip, points.pocketTopCp, points.pocketTop) .line(points.pocketTip)
.line(points.pocketCf) .curve(points.pocketTip, points.pocketTopCp, points.pocketTop)
.attr('class', 'fabric help') .line(points.pocketCf)
.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,30 +114,41 @@ 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')
macro('cutonfold', { paths.sa.move(points.cfRibbing).line(paths.sa.start())
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())
}
} }
/*
* 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? // Paperless?
if (paperless) { if (paperless) {
macro('vd', { macro('vd', {
@ -206,6 +219,7 @@ export const front = {
draftForHighBust, draftForHighBust,
lengthBonus, lengthBonus,
ribbingHeight, ribbingHeight,
pocketWidth,
}, },
draft: hugoFront, draft: hugoFront,
} }

View file

@ -10,74 +10,80 @@ 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 {
paths.seam = new Path() // Expand is off, do not draw the part but flag this to the user
.move(points.topLeft) store.flag.note({
.line(points.bottomLeft) msg: `hugo:cutHoodCenter`,
.line(points.bottomRight) replace: {
.line(points.topRight) w: units(width + 2 * sa),
.close() l: units(length + 2 * sa),
.attr('class', 'fabric') },
suggest: {
text: 'flag:show',
icon: 'expand',
update: {
settings: ['expand', 1],
},
},
})
// Also hint about expand
store.flag.preset('expandIsOff')
return part.hide()
} }
// Complete pattern? points.topLeft = new Point(0, 0)
if (complete) { points.bottomLeft = new Point(0, length)
if (sa) { points.topRight = new Point(width, 0)
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') points.bottomRight = new Point(width, length)
}
points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) paths.seam = new Path()
macro('title', { at: points.title, nr: 7, title: 'hoodCenter' }) .move(points.topLeft)
macro('grainline', { .line(points.bottomLeft)
from: points.topLeft.shift(-90, width / 2), .line(points.bottomRight)
to: points.topRight.shift(-90, width / 2), .line(points.topRight)
}) .close()
// Always include this dimension as we don't print the entire part .attr('class', 'fabric')
macro('hd', { if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
from: points.bottomLeft,
to: points.bottomRight, /*
y: points.bottomRight.y + sa + 15, * Annotations
text: units(store.get('hoodCenterLength')), */
}) // Cutlist
// Paperless? store.cutlist.setCut({ cut: 2, from: 'fabric' })
if (paperless) {
macro('vd', { // Title
from: points.bottomRight, points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5)
to: points.topRight, macro('title', { at: points.title, nr: 7, title: 'hoodCenter', align: 'center' })
x: points.topRight.x + sa + 15,
}) // 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 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,89 +81,96 @@ 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
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,
})
}
// Paperless? //notches
if (paperless) { points.cfNotch = 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) .shiftAlong(neckOpening - halfCenterPanel)
.split(points.shoulderNotch) macro('sprinkle', {
let centralSeam = new Path() snippet: 'notch',
.move(points.hoodRim) on: ['shoulderNotch', 'cfNotch'],
.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)
macro('pd', { //title
path: neckSeam[0], points.title = new Point(points.hoodTop.x, points.neckEdge.y / 4)
d: sa + 15, macro('title', { at: points.title, nr: 6, title: 'hoodSide', align: 'center' })
})
macro('pd', { // Logo
path: neckSeam[1], points.logo = new Point(points.hoodTop.x, points.neckEdge.y * 0.666)
d: sa + 15, snippets.logo = new Snippet('logo', points.logo)
})
macro('pd', { // Grainline
path: centralSeam, macro('grainline', {
d: sa * -1 - 15, from: points.shoulderNotch,
}) to: points.hoodTop,
macro('hd', { })
from: points.neckEdge,
to: points.frontEdge, // Dimensions
y: points.frontEdge.y + sa + 30, const neckSeam = new Path()
}) .move(points.neckEdge)
macro('hd', { .curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge)
from: centralSeam.edge('left'), .split(points.shoulderNotch)
to: points.frontEdge, const centralSeam = new Path()
y: points.frontEdge.y + sa + 45, .move(points.hoodRim)
}) .curve(points.hoodRim, points.hoodTopCp1, points.hoodTop)
let openingEdge = openingSeam.edge('left') .curve(points.hoodTopCp2, points.neckEdge, points.neckEdge)
macro('hd', { .reverse()
from: openingEdge, const openingSeam = new Path()
to: points.frontEdge, .move(points.neckRoll)
y: openingEdge.y, .curve(points.neckRollCp2, points.hoodRimCp, points.hoodRim)
})
macro('vd', { macro('pd', {
from: points.frontEdge, id: 'lNeckToNotch',
to: points.hoodRim, path: neckSeam[0],
x: points.hoodRim.x + sa + 15, d: sa + 15,
}) })
macro('vd', { macro('pd', {
from: points.frontEdge, id: 'lNotchToNeck',
to: points.hoodTop, path: neckSeam[1],
x: points.hoodRim.x + sa + 30, 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 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() if (sa) {
macro('cutonfold', { paths.sa = paths.saBase.offset(sa).line(points.pocketCf).move(points.cfRibbing)
from: points.pocketCf, paths.sa.line(paths.sa.start()).attr('class', 'fabric sa')
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')
}
} }
// Paperless? /*
if (paperless) { * Annotations
macro('hd', { */
from: points.cfRibbing, // cutlist
to: points.pocketTop, store.cutlist.setCut({ cut: 2, from: 'fabric' })
y: points.cfRibbing.y + 15 + sa,
}) // Cutonfold
macro('hd', { macro('cutonfold', {
from: points.cfRibbing, to: points.cfRibbing,
to: points.pocketTip, from: points.pocketCf,
y: points.cfRibbing.y + 30 + sa, grainline: true,
}) reverse: true,
macro('vd', { })
from: points.pocketHem,
to: points.pocketTip, // Title
x: points.pocketTip.x + 15 + sa, points.title = points.cfRibbing.shiftFractionTowards(points.pocketTop, 0.5)
}) macro('title', { at: points.title, nr: 4, title: 'pocket' })
macro('vd', {
from: points.pocketHem, // Dimensions
to: points.pocketTop, macro('hd', {
x: points.cfRibbing.x - 15 - sa, 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 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,30 +46,34 @@ 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 (sa) {
if (complete) { paths.sa = new Path()
points.title = points.pocketTopCp.clone() .move(points.saStart)
macro('title', { at: points.title, nr: 5, title: 'pocketFacing' }) .line(points.pocketTop)
if (sa) { .curve(points.pocketTopCp, points.pocketTip, points.pocketTip)
paths.sa = new Path() .line(points.facingEnd)
.move(points.saStart) .offset(sa * -1)
.line(points.pocketTop) .attr('class', 'fabric sa')
.curve(points.pocketTopCp, points.pocketTip, points.pocketTip) paths.sa.line(points.facingEnd).move(points.saStart).line(paths.sa.start())
.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) { * Annotations
macro('hd', { */
from: points.saStart, // Cutlist
to: points.pocketTop, store.cutlist.setCut({ cut: 2, from: 'fabric' })
y: points.saStart.y - 15 - sa,
}) // 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 return part
} }

View file

@ -138,87 +138,103 @@ 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) {
macro('grainline', { /*
from: points.centerWrist, * Annotations
to: points.raglanTop, */
}) // Cutlist
//points.title = new Point(points.armhole.x/2, points.armhole.y); store.cutlist.setCut({ cut: 2, from: 'fabric' })
macro('title', { at: points.gridAnchor, nr: 3, title: 'sleeve' })
//points.sleeveNotch = points.raglanTipFront.shiftFractionTowards(points.armholeHollow, 0.5); // Grainline
//snippets.sleeveNotch = new Snippet("notch", points.sleeveNotch); macro('grainline', {
//store.set('frontRaglanTipToNotch', points.raglanTipFront.dist(points.sleeveNotch)); from: points.centerWrist,
points.logo = points.gridAnchor.shift(-90, 70) to: points.raglanTop,
snippets.logo = new Snippet('logo', points.logo) })
points.scalebox = points.logo.shift(-90, 70)
macro('scalebox', { at: points.scalebox }) // Title
points.frontNotch = new Path() macro('title', { at: points.gridAnchor, nr: 3, title: 'sleeve' })
.move(points.raglanTipFront)
.curve(points.raglanTipFront, points.slopeFrontCp1, points.slopeFront) // Logo
.curve(points.slopeFrontCp2, points.capQ4Cp2, points.bicepsLeft) points.logo = points.gridAnchor.shift(-90, 70)
.shiftAlong(store.get('notchFront')) snippets.logo = new Snippet('logo', points.logo)
snippets.frontNotch = new Snippet('notch', points.frontNotch)
snippets.shoulderNotch = new Snippet('notch', points.raglanTop) // Scalebox
points.backNotch = new Path() points.scalebox = points.logo.shift(-90, 70)
.move(points.raglanTipBack) macro('scalebox', { at: points.scalebox })
.curve(points.raglanTipBack, points.slopeBackCp2, points.slopeBack)
.curve(points.slopeBackCp1, points.capQ1Cp1, points.bicepsRight) // Notches
.shiftAlong(store.get('notchBack')) points.frontNotch = new Path()
snippets.backNotch = new Snippet('bnotch', points.backNotch) .move(points.raglanTipFront)
if (sa) { .curve(points.raglanTipFront, points.slopeFrontCp1, points.slopeFront)
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') .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 return part
} }

View file

@ -12,78 +12,80 @@ 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 {
paths.seam = new Path() // Expand is off, do not draw the part but flag this to the user
.move(points.topLeft) store.flag.note({
.line(points.bottomLeft) msg: `hugo:cutWaistband`,
.line(points.bottomRight) replace: {
.line(points.topRight) w: units(width + 2 * sa),
.close() l: units(length + 2 * sa),
.attr('class', 'various') },
suggest: {
text: 'flag:show',
icon: 'expand',
update: {
settings: ['expand', 1],
},
},
})
// Also hint about expand
store.flag.preset('expandIsOff')
return part.hide()
} }
// Complete pattern? points.topLeft = new Point(0, 0)
if (complete) { points.bottomLeft = new Point(0, length)
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa') points.topRight = new Point(width, 0)
points.title = points.bottomLeft.shiftFractionTowards(points.topRight, 0.5) points.bottomRight = new Point(width, length)
macro('title', { at: points.title, nr: 8, title: 'waistband' })
macro('grainline', {
from: points.bottomMidLeft,
to: points.topMidLeft,
})
// Always include this dimension as we don't print the entire part paths.seam = new Path()
macro('hd', { .move(points.topLeft)
from: points.bottomLeft, .line(points.bottomLeft)
to: points.bottomRight, .line(points.bottomRight)
y: points.bottomRight.y + sa + 15, .line(points.topRight)
text: units(measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch)), .close()
}) .attr('class', 'various')
}
// Paperless? if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'various sa')
if (paperless) { /*
macro('vd', { * Annotations
from: points.bottomRight, */
to: points.topRight, // Cutlist
x: points.topRight.x + sa + 15, 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 return part
} }

View file

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