From 5049380656cb4da9f873ebe90a0fb2b44e808e4a Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 13 Jun 2020 10:11:32 +0200 Subject: [PATCH] chore(trayvon): Ported trayvon to new measurements. See #416 --- packages/trayvon/config/index.js | 2 +- packages/trayvon/src/shared.js | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/trayvon/config/index.js b/packages/trayvon/config/index.js index 29ec783bcae..7dffe274683 100644 --- a/packages/trayvon/config/index.js +++ b/packages/trayvon/config/index.js @@ -12,7 +12,7 @@ export default { optionGroups: { style: ['tipWidth', 'knotWidth', 'lengthBonus'] }, - measurements: ['hpsToHipsBack', 'naturalWaistToHip', 'neckCircumference'], + measurements: ['hpsToWaistBack', 'waistToHips', 'neckCircumference'], parts: [ 'interfacingTip', 'interfacingTail', diff --git a/packages/trayvon/src/shared.js b/packages/trayvon/src/shared.js index f1418fcdaff..fe722fd7c4b 100644 --- a/packages/trayvon/src/shared.js +++ b/packages/trayvon/src/shared.js @@ -1,8 +1,9 @@ -export const calculateHelpers = part => { +export const calculateHelpers = (part) => { let { store, measurements, options } = part.shorthand() let halfLength = - (measurements.hpsToHipsBack + measurements.neckCircumference / 2) * (1 + options.lengthBonus) + (measurements.hpsToWaistBack + measurements.waistToHips + measurements.neckCircumference / 2) * + (1 + options.lengthBonus) let backTip = options.tipWidth * 0.7 if (backTip < options.knotWidth) backTip = options.knotWidth @@ -94,9 +95,5 @@ export const seamAllowance = (part, className) => { .line(points.tipRight) .offset(sa * -1) .attr('class', 'sa ' + className) - paths.sa - .move(paths.sa.end()) - .line(points.tipRight) - .move(paths.sa.start()) - .line(points.tipLeft) + paths.sa.move(paths.sa.end()).line(points.tipRight).move(paths.sa.start()).line(points.tipLeft) }