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",
"difficulty": 3,
"tags": ["tops"],
"techniques": []
"techniques": ["curvedSeam", "pocket", "ribbing", "raglanSleeve"]
},
"jaeger": {
"description": "A FreeSewing pattern for a sport coat style jacket",

View file

@ -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."

View file

@ -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,21 +49,34 @@ 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) {
/*
* Annotations
*/
// cutlist
store.cutlist.setCut({ cut: 1, from: 'fabric', onFold: true })
// 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,
@ -69,47 +84,48 @@ function hugoBack({
)
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)
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?
if (paperless) {
// 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
}

View file

@ -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')
}
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)
macro('title', { at: points.title, nr: 9, title: 'cuff' })
// Grainline
macro('grainline', {
from: points.bottomLeft.shift(0, 20),
to: points.topLeft.shift(0, 20),
})
}
// Paperless?
if (paperless) {
// 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
}

View file

@ -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')
if (complete)
paths.pocket = new Path()
.move(points.pocketHem)
.line(points.pocketTip)
.curve(points.pocketTip, points.pocketTopCp, points.pocketTop)
.line(points.pocketCf)
.attr('class', 'fabric help')
.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,15 +114,29 @@ function hugoFront({
store.set('neckOpeningLenFront', neckOpening.length())
store.set('neckCutoutFront', points.cfNeck.y)
// Complete pattern?
if (complete) {
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,
@ -128,13 +144,10 @@ function hugoFront({
)
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)
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?
if (paperless) {
@ -206,6 +219,7 @@ export const front = {
draftForHighBust,
lengthBonus,
ribbingHeight,
pocketWidth,
},
draft: hugoFront,
}

View file

@ -10,38 +10,42 @@ 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 {
// 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()
.move(points.topLeft)
.line(points.bottomLeft)
@ -49,35 +53,37 @@ function hugoHoodCenter({
.line(points.topRight)
.close()
.attr('class', 'fabric')
}
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
// Complete pattern?
if (complete) {
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' })
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),
})
// Always include this dimension as we don't print the entire part
// Dimensions
macro('hd', {
id: 'width',
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomRight.y + sa + 15,
text: units(store.get('hoodCenterLength')),
})
// Paperless?
if (paperless) {
macro('vd', {
id: 'length',
from: points.bottomRight,
to: points.topRight,
x: points.topRight.x + sa + 15,
})
}
}
return part
}

View file

@ -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,15 +81,12 @@ 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')
}
/*
* Annotations
*/
// Cutlist
store.cutlist.setCut({ cut: 4, from: 'fabric' })
//notches
points.cfNotch = new Path()
.move(points.neckEdge)
@ -91,71 +96,81 @@ function hugoHoodSide({
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)
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,
})
}
// Paperless?
if (paperless) {
let neckSeam = new Path()
// Dimensions
const neckSeam = new Path()
.move(points.neckEdge)
.curve(points.neckEdgeCp2, points.frontEdgeCp1, points.frontEdge)
.split(points.shoulderNotch)
let centralSeam = new Path()
const 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()
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,
})
let openingEdge = openingSeam.edge('left')
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
}

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 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' }

View file

@ -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 (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) {
/*
* 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.pocketTop,
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
}

View file

@ -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,10 +46,6 @@ 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)
@ -30,16 +56,24 @@ function hugoPocketFacing({ sa, points, Path, paths, complete, paperless, macro,
.attr('class', 'fabric sa')
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', {
id: 'width',
from: points.saStart,
to: points.pocketTop,
y: points.saStart.y - 15 - sa,
})
}
return part
}

View file

@ -138,21 +138,32 @@ function hugoSleeve({
.close()
.attr('class', 'fabric')
// Complete pattern?
if (complete) {
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,
})
//points.title = new Point(points.armhole.x/2, points.armhole.y);
// Title
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));
// 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)
@ -166,59 +177,64 @@ function hugoSleeve({
.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')
}
}
// Paperless?
if (paperless) {
// 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,
})
}
return part
}

View file

@ -12,42 +12,42 @@ 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 {
// 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()
.move(points.topLeft)
.line(points.bottomLeft)
@ -55,35 +55,37 @@ function hugoWaistband({
.line(points.topRight)
.close()
.attr('class', 'various')
}
// Complete pattern?
if (complete) {
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' })
macro('title', { at: points.title, nr: 8, title: 'waistband', align: 'center' })
// Grainline
macro('grainline', {
from: points.bottomMidLeft,
to: points.topMidLeft,
from: points.bottomLeft.shift(0, 15),
to: points.topLeft.shift(0, 15),
})
// Always include this dimension as we don't print the entire part
// Dimensions
macro('hd', {
id: 'wFull',
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomRight.y + sa + 15,
text: units(measurements.chest * (1 + options.chestEase) * (1 - options.ribbingStretch)),
})
}
// Paperless?
if (paperless) {
macro('vd', {
id: 'hFull',
from: points.bottomRight,
to: points.topRight,
x: points.topRight.x + sa + 15,
})
}
return part
}

View file

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