From 674e80b591e5c46b078816fb32f48c4aa0cd0876 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 11 Sep 2022 17:02:10 +0200 Subject: [PATCH] chore(teagan): Port to v3 stage 2 --- designs/teagan/src/back.mjs | 31 ++++++++++++------------- designs/teagan/src/front.mjs | 43 +++++++++++++++++------------------ designs/teagan/src/sleeve.mjs | 17 ++++++++++---- 3 files changed, 49 insertions(+), 42 deletions(-) diff --git a/designs/teagan/src/back.mjs b/designs/teagan/src/back.mjs index e1f7fb52d1b..2faa0119784 100644 --- a/designs/teagan/src/back.mjs +++ b/designs/teagan/src/back.mjs @@ -1,21 +1,20 @@ import { front } from './front.mjs' -function teaganBack(part) { - const { - store, - sa, - Point, - points, - Path, - paths, - options, - complete, - paperless, - macro, - utils, - measurements, - } = part.shorthand() - +function teaganBack({ + store, + sa, + Point, + points, + Path, + paths, + options, + complete, + paperless, + macro, + utils, + measurements, + part, +}) { // Adjust neckline points.cbNeck = new Point(0, points.neck.y + options.backNeckCutout * measurements.neck) points.cbNeckCp1 = points.cbNeck.shift(0, points.neck.x / 2) diff --git a/designs/teagan/src/front.mjs b/designs/teagan/src/front.mjs index 621564524da..a3950b5f8fe 100644 --- a/designs/teagan/src/front.mjs +++ b/designs/teagan/src/front.mjs @@ -1,25 +1,24 @@ import { base } from '@freesewing/brian' -function teaganFront(part) { - const { - utils, - store, - sa, - Point, - points, - Path, - paths, - Snippet, - snippets, - options, - measurements, - complete, - paperless, - macro, - raise, - units, - } = part.shorthand() - +function teaganFront({ + utils, + store, + sa, + Point, + points, + Path, + paths, + Snippet, + snippets, + options, + measurements, + complete, + paperless, + macro, + log, + units, + part, +}) { // Hide Brian paths for (let key of Object.keys(paths)) paths[key].render = false @@ -58,8 +57,8 @@ function teaganFront(part) { points.armholePitch.x ) - // Raise info for full length - raise.info(['fullLengthFromHps', units(points.hps.dy(points.hem))]) + // Log info for full length + log.info(['fullLengthFromHps', units(points.hps.dy(points.hem))]) // Draw seamline paths.hemBase = new Path().move(points.cfHem).line(points.hem).setRender(false) diff --git a/designs/teagan/src/sleeve.mjs b/designs/teagan/src/sleeve.mjs index d5bd0fb43a7..edba8540e32 100644 --- a/designs/teagan/src/sleeve.mjs +++ b/designs/teagan/src/sleeve.mjs @@ -1,9 +1,18 @@ import { sleevecap } from '@freesewing/brian' -function teaganSleeve(part) { - const { sa, Point, points, Path, paths, options, complete, paperless, macro, measurements } = - part.shorthand() - +function teaganSleeve({ + sa, + Point, + points, + Path, + paths, + options, + complete, + paperless, + macro, + measurements, + part, +}) { let height = points.bicepsRight.x * options.sleeveLength let width = measurements.biceps * (1 + options.bicepsEase) * (1 + options.sleeveEase) if (width > points.bicepsRight.x * 2) width = points.bicepsRight.x * 2