From eebbdd7842e70d82e575b9865bc2528cd3fca1e8 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 17 Oct 2020 15:00:17 +0200 Subject: [PATCH] fix(albert): Keep straps even when there's no SA The width of the straps was calculated by multiplying with the `sa` value. As a result, when the user asks to draft a pattern without SA, the straps drop off the pattern. I've also change the way the width is calculated. It used to be based on a percentage option that was then multiplied by SA. While technically that follows the best practice of using percentages, it won't scale with the model unless you multiply it with a measurement. --- packages/albert/config/index.js | 2 +- packages/albert/src/front.js | 2 +- packages/albert/src/strap.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/albert/config/index.js b/packages/albert/config/index.js index afea3f41ddf..81fe924f9e8 100644 --- a/packages/albert/config/index.js +++ b/packages/albert/config/index.js @@ -34,6 +34,6 @@ export default { chestDepth: { pct: 22, min: 15, max: 90 }, bibLength: { pct: 75, min: 0, max: 90 }, bibWidth: { pct: 100, min: 50, max: 125 }, - strapWidth: { pct: 750, min: 100, max: 1500 } + strapWidth: { pct: 60, min: 20, max: 100 } } } diff --git a/packages/albert/src/front.js b/packages/albert/src/front.js index 631332fd3d2..b5dbd29a6c1 100644 --- a/packages/albert/src/front.js +++ b/packages/albert/src/front.js @@ -26,7 +26,7 @@ export default function (part) { (1 - options.backOpening) */ let apronWidth = measurements.waist * (1 - options.backOpening) - let strapWidth = options.strapWidth * sa + let strapWidth = (measurements.hpsToWaistBack * options.strapWidth) / 8 let hemWidth = 3 * sa let pocketSize = apronLength / 4 diff --git a/packages/albert/src/strap.js b/packages/albert/src/strap.js index 9f32048a9b0..adccac30e3b 100644 --- a/packages/albert/src/strap.js +++ b/packages/albert/src/strap.js @@ -31,9 +31,9 @@ export default function (part) { measurements.hpsToWaistBack - measurements.hpsToWaistBack * options.bibLength + let strapWidth = (measurements.hpsToWaistBack * options.strapWidth) / 8 let strapLength = Math.sqrt(hSpan * hSpan + vSpan * vSpan) + measurements.chest * options.chestDepth - let strapWidth = options.strapWidth * sa /* console.log('chestWidth ' + chestWidth) console.log('backOpening ' + backOpening)