1
0
Fork 0

fix(hugo): Add Collar Ease option to allow neck opening size adjustments

This commit is contained in:
Benjamin Fan 2024-11-23 23:42:05 -08:00 committed by Joost De Cock
parent c66c9e0a93
commit 7a456d4004
5 changed files with 57 additions and 1 deletions

View file

@ -34,6 +34,8 @@ function hugoBack({
const neckOpening = new Path()
.move(points.cbNeck)
.curve(points.cbNeck, points.neckCp2, points.neck)
const length = neckOpening.length() * 2
store.set('front_neck_len', length)
points.raglanTipBack = neckOpening.shiftFractionAlong(0.7)
const neckOpeningParts = neckOpening.split(points.raglanTipBack)
// Paths

View file

@ -61,6 +61,8 @@ function hugoFront({
const neckOpening = new Path()
.move(points.cfNeck)
.curve(points.cfNeckCp1, points.neckCp2, points.neck)
const length = neckOpening.length() * 2
store.set('back_neck_len', length)
points.raglanTipFront = neckOpening.shiftFractionAlong(0.8)
const neckOpeningParts = neckOpening.split(points.raglanTipFront)

View file

@ -1,4 +1,3 @@
export const collarEase = 0.05
export const armholeDepthFactor = 0.5
export const shoulderEase = 0
export const shoulderSlopeReduction = 0
@ -14,3 +13,4 @@ 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' }
export const collarEase = { pct: 15, min: 0, max: 40, menu: 'fit' }

View file

@ -17,6 +17,8 @@ function hugoSleeve({
options,
measurements,
macro,
log,
units,
part,
}) {
// Top of raglan sleeve
@ -233,6 +235,44 @@ function hugoSleeve({
y: points.wristLeft.y + 15 + sa,
})
/*
* Check neck opening size and warn if necessary.
*/
const sleeve_neck_len =
new Path()
.move(points.raglanTipBack)
.curve(points.raglanTipBackCp2, points.raglanTopCp1, points.raglanTop)
.curve(points.raglanTopCp2, points.raglanTipFrontCp1, points.raglanTipFront)
.length() * 2
const neck_opening = store.get('front_neck_len') + store.get('back_neck_len') + sleeve_neck_len
const diff = measurements.head - neck_opening
const discrepancy = diff / measurements.head
const warning_limit = 0.04
let label = ' bigger than '
if (diff > 0) label = ' smaller than '
log.info(
': ' +
units(neck_opening) +
' neck opening is ' +
units(Math.abs(diff)) +
label +
' than ' +
units(measurements.head) +
' head circumference, with Collar Ease set to ' +
(options.collarEase * 100).toFixed(0) +
'%.'
)
if (discrepancy > warning_limit) {
log.warn(
'Please check and adjust Collar Ease option setting ' +
'as needed to ensure neck opening is large enough to accommodate ' +
'head circumference.'
)
}
return part
}

View file

@ -0,0 +1,12 @@
---
title: 'Collar ease'
---
![Collar ease](collarease.svg)
Controls the amount of ease at your collar/neck and the size
of the neck opening..
Hugo uses the neck circumference measurement rather than head
circumference to produce the neck opening size when generating patterns.
Use this option to adjust the neck opening size if needed.