diff --git a/designs/charlie/src/back-pocket-facing.mjs b/designs/charlie/src/back-pocket-facing.mjs index 7cac9f2e0b8..971ee7a496f 100644 --- a/designs/charlie/src/back-pocket-facing.mjs +++ b/designs/charlie/src/back-pocket-facing.mjs @@ -1,9 +1,17 @@ import { backPocket } from './back-pocket.mjs' -function draftCharlieBackPocketFacing (part) { - // Shorthand - let { points, Point, paths, Path, complete, paperless, macro, snippets, sa } = part.shorthand() - +function draftCharlieBackPocketFacing({ + points, + Point, + paths, + Path, + complete, + paperless, + macro, + snippets, + sa, + part, +}) { // Clean up delete paths.fold delete snippets.logo diff --git a/designs/charlie/src/back-pocket-interfacing.mjs b/designs/charlie/src/back-pocket-interfacing.mjs index 7501fe78c7b..077d2b1e4fd 100644 --- a/designs/charlie/src/back-pocket-interfacing.mjs +++ b/designs/charlie/src/back-pocket-interfacing.mjs @@ -1,9 +1,16 @@ import { backPocket } from './back-pocket.mjs' -function draftCharlieBackPocketInterfacing (part) { - // Shorthand - let { points, Point, paths, Path, complete, paperless, macro, snippets } = part.shorthand() - +function draftCharlieBackPocketInterfacing({ + points, + Point, + paths, + Path, + complete, + paperless, + macro, + snippets, + part, +}) { // Clean up for (let id in paths) delete paths[id] delete snippets.logo diff --git a/designs/charlie/src/back-pocket-welt.mjs b/designs/charlie/src/back-pocket-welt.mjs index d3fc138fda6..e8f9edf5e43 100644 --- a/designs/charlie/src/back-pocket-welt.mjs +++ b/designs/charlie/src/back-pocket-welt.mjs @@ -1,9 +1,16 @@ import { backPocketFacing } from './back-pocket-facing.mjs' -function draftCharlieBackPocketWelt (part) { - // Shorthand - let { points, Point, paths, Path, complete, paperless, macro, snippets } = part.shorthand() - +function draftCharlieBackPocketWelt({ + points, + Point, + paths, + Path, + complete, + paperless, + macro, + snippets, + part, +}) { // Clean up for (let id in paths) delete paths[id] delete snippets.logo diff --git a/designs/charlie/src/back-pocket.mjs b/designs/charlie/src/back-pocket.mjs index c055460b818..033d62d34fd 100644 --- a/designs/charlie/src/back-pocket.mjs +++ b/designs/charlie/src/back-pocket.mjs @@ -1,10 +1,19 @@ import { back } from './back.mjs' -function draftCharlieBackPocket (part) { - // Shorthand - let { points, Point, paths, Path, complete, paperless, store, macro, snippets, Snippet, sa } = - part.shorthand() - +function draftCharlieBackPocket({ + points, + Point, + paths, + Path, + complete, + paperless, + store, + macro, + snippets, + Snippet, + sa, + part, +}) { points.leftNotch = new Point(store.get('backPocketWidth') / -2, 0) points.rightNotch = points.leftNotch.flipX() points.waistbandLeft = new Point(points.leftNotch.x, store.get('backPocketToWaistband') * -1) diff --git a/designs/charlie/src/back.mjs b/designs/charlie/src/back.mjs index 47966c09d4b..dc78092edda 100644 --- a/designs/charlie/src/back.mjs +++ b/designs/charlie/src/back.mjs @@ -1,7 +1,23 @@ import { back as titanBack } from '@freesewing/titan' import { front } from './front.mjs' -function draftCharlieBack (part) { +function draftCharlieBack({ + points, + Point, + paths, + Path, + options, + complete, + paperless, + store, + macro, + snippets, + Snippet, + sa, + log, + units, + part, +}) { // Helper method to draw the outseam path const drawOutseam = () => { let outseam = new Path() @@ -29,24 +45,6 @@ function draftCharlieBack (part) { .curve(points.forkCp2, points.kneeInCp1, points.floorIn) } - // Shorthand - let { - points, - Point, - paths, - Path, - options, - complete, - paperless, - store, - macro, - snippets, - Snippet, - sa, - raise, - units, - } = part.shorthand() - // Mark back pocket let base = points.styleWaistIn.dist(points.styleWaistOut) let angle = points.styleWaistIn.angle(points.styleWaistOut) @@ -191,7 +189,7 @@ function draftCharlieBack (part) { .close() .attr('class', 'fabric sa') } - raise.info( + log.info( `Inseam height: ${units(points.fork.dy(points.floorIn))} | ` + `Waist: ${units((store.get('waistbandBack') + store.get('waistbandFront')) * 2)} | ` + `Bottom leg width: ${units((store.get('legWidthBack') + store.get('legWidthFront')) / 2)}` @@ -313,14 +311,10 @@ export const back = { after: front, hideDependencies: true, options: { - backPocketVerticalPlacement: { pct: 24, min: 18, max: 30, - menu: 'pockets.backpockets' }, - backPocketHorizontalPlacement: { pct: 55, min: 48, max: 62, - menu: 'pockets.backpockets' }, - backPocketWidth: { pct: 55, min: 50, max: 60, - menu: 'pockets.backpockets' }, - backPocketDepth: { pct: 60, min: 40, max: 80, - menu: 'pockets.backpockets' }, + backPocketVerticalPlacement: { pct: 24, min: 18, max: 30, menu: 'pockets.backpockets' }, + backPocketHorizontalPlacement: { pct: 55, min: 48, max: 62, menu: 'pockets.backpockets' }, + backPocketWidth: { pct: 55, min: 50, max: 60, menu: 'pockets.backpockets' }, + backPocketDepth: { pct: 60, min: 40, max: 80, menu: 'pockets.backpockets' }, backPocketFacing: { bool: true, menu: 'pockets.backpockets' }, }, draft: draftCharlieBack, diff --git a/designs/charlie/src/beltloops.mjs b/designs/charlie/src/beltloops.mjs index 533edfff953..7dbafe85937 100644 --- a/designs/charlie/src/beltloops.mjs +++ b/designs/charlie/src/beltloops.mjs @@ -1,10 +1,18 @@ import { waistband } from './waistband.mjs' -function draftCharlieBeltLoops (part) { - // Shorthand - let { store, points, Point, paths, Path, options, complete, paperless, macro, sa } = - part.shorthand() - +function draftCharlieBeltLoops({ + store, + points, + Point, + paths, + Path, + options, + complete, + paperless, + macro, + sa, + part, +}) { let count = options.beltLoops let length = store.get('waistbandWidth') * 2.5 * count let width = store.get('waistbandWidth') / 4 diff --git a/designs/charlie/src/fly-extension.mjs b/designs/charlie/src/fly-extension.mjs index d9a65eaf190..24bfd169592 100644 --- a/designs/charlie/src/fly-extension.mjs +++ b/designs/charlie/src/fly-extension.mjs @@ -1,9 +1,6 @@ import { flyFacing } from './fly-facing.mjs' -function draftCharlieFlyExtension (part) { - // Shorthand - let { points, paths, Path, complete, macro, sa } = part.shorthand() - +function draftCharlieFlyExtension({ points, paths, Path, complete, macro, sa, part }) { // Clean up for (let id in paths) delete paths[id] diff --git a/designs/charlie/src/fly-facing.mjs b/designs/charlie/src/fly-facing.mjs index e4855e2ec7e..62045e953ba 100644 --- a/designs/charlie/src/fly-facing.mjs +++ b/designs/charlie/src/fly-facing.mjs @@ -1,9 +1,16 @@ import { front } from './front.mjs' -function draftCharlieFlyFacing (part) { - // Shorthand - let { points, Point, paths, Path, complete, macro, snippets, sa } = part.shorthand() - +function draftCharlieFlyFacing({ + points, + Point, + paths, + Path, + complete, + macro, + snippets, + sa, + part, +}) { // Clean up for (let id in paths) delete paths[id] for (let id in snippets) delete snippets[id] diff --git a/designs/charlie/src/front-pocket-facing.mjs b/designs/charlie/src/front-pocket-facing.mjs index 6554c314a78..a640c101f8d 100644 --- a/designs/charlie/src/front-pocket-facing.mjs +++ b/designs/charlie/src/front-pocket-facing.mjs @@ -1,9 +1,16 @@ import { frontPocket } from './front-pocket.mjs' -function draftCharlieFrontPocketFacing (part) { - // Shorthand - let { points, Point, paths, Path, complete, macro, snippets, sa } = part.shorthand() - +function draftCharlieFrontPocketFacing({ + points, + Point, + paths, + Path, + complete, + macro, + snippets, + sa, + part, +}) { // Clean up for (let id in paths) delete paths[id] for (let id in snippets) delete snippets[id] diff --git a/designs/charlie/src/front-pocket.mjs b/designs/charlie/src/front-pocket.mjs index 11e1cef49ee..e8e32b5316d 100644 --- a/designs/charlie/src/front-pocket.mjs +++ b/designs/charlie/src/front-pocket.mjs @@ -1,9 +1,17 @@ import { front } from './front.mjs' -function draftCharlieFrontPocket (part) { - // Shorthand - let { points, paths, Path, complete, paperless, macro, snippets, Snippet, sa } = part.shorthand() - +function draftCharlieFrontPocket({ + points, + paths, + Path, + complete, + paperless, + macro, + snippets, + Snippet, + sa, + part, +}) { // Clean up for (let id in paths) delete paths[id] for (let id in snippets) delete snippets[id] diff --git a/designs/charlie/src/front.mjs b/designs/charlie/src/front.mjs index 4f550b1394e..9f8b17e5bc8 100644 --- a/designs/charlie/src/front.mjs +++ b/designs/charlie/src/front.mjs @@ -2,7 +2,23 @@ import { elastics } from '@freesewing/snapseries' import { pctBasedOn } from '@freesewing/core' import { front as titanFront } from '@freesewing/titan' -function draftCharlieFront (part) { +function draftCharlieFront({ + points, + Point, + paths, + Path, + options, + complete, + paperless, + store, + macro, + utils, + snippets, + Snippet, + sa, + log, + part, +}) { // Helper method to draw the outseam path const drawOutseam = () => new Path() @@ -23,24 +39,6 @@ function draftCharlieFront (part) { .join(outseam) } - // Shorthand - let { - points, - Point, - paths, - Path, - options, - complete, - paperless, - store, - macro, - utils, - snippets, - Snippet, - sa, - raise, - } = part.shorthand() - // Helper object holding the Titan side seam path const sideSeam = points.waistOut.x < points.seatOut.x @@ -61,7 +59,7 @@ function draftCharlieFront (part) { points.cfSeat.shiftFractionTowards(points.crotchSeamCurveCp2, options.flyLength).y ) if (flyBottom) points.flyBottom = flyBottom - else raise.error('Unable to locate the fly bottom. This draft will fail.') + else log.error('Unable to locate the fly bottom. This draft will fail.') points.flyBottom = utils.curveIntersectsY( points.crotchSeamCurveStart, @@ -388,8 +386,14 @@ export const front = { // Style (from Titan) waistHeight: { pct: -4, min: -15, max: 40, menu: 'style' }, - waistbandWidth: { pct: 3, min: 1, max: 6, snap: elastics, - ...pctBasedOn('waistToFloor'), menu: 'style' }, + waistbandWidth: { + pct: 3, + min: 1, + max: 6, + snap: elastics, + ...pctBasedOn('waistToFloor'), + menu: 'style', + }, //waistbandWidth: { pct: 3.5, min: 2, max: 5 }, lengthBonus: { pct: 2, min: -20, max: 10, menu: 'style' }, crotchDrop: { pct: 2, min: 0, max: 15, menu: 'style' }, @@ -406,28 +410,18 @@ export const front = { waistBalance: { pct: 55, min: 30, max: 90, menu: 'advanced' }, // Front pockets - frontPocketSlantDepth: { pct: 85, min: 70, max: 100, - menu: 'pockets.frontpockets' }, - frontPocketSlantWidth: { pct: 25, min: 15, max: 35, - menu: 'pockets.frontpockets' }, - frontPocketSlantRound: { pct: 30, min: 5, max: 50, - menu: 'pockets.frontpockets' }, - frontPocketSlantBend: { pct: 25, min: 5, max: 50, - menu: 'pockets.frontpockets' }, - frontPocketWidth: { pct: 55, min: 45, max: 65, - menu: 'pockets.frontpockets' }, - frontPocketDepth: { pct: 100, min: 85, max: 110, - menu: 'pockets.frontpockets' }, - frontPocketFacing: { pct: 45, min: 25, max: 65, - menu: 'pockets.frontpockets' }, + frontPocketSlantDepth: { pct: 85, min: 70, max: 100, menu: 'pockets.frontpockets' }, + frontPocketSlantWidth: { pct: 25, min: 15, max: 35, menu: 'pockets.frontpockets' }, + frontPocketSlantRound: { pct: 30, min: 5, max: 50, menu: 'pockets.frontpockets' }, + frontPocketSlantBend: { pct: 25, min: 5, max: 50, menu: 'pockets.frontpockets' }, + frontPocketWidth: { pct: 55, min: 45, max: 65, menu: 'pockets.frontpockets' }, + frontPocketDepth: { pct: 100, min: 85, max: 110, menu: 'pockets.frontpockets' }, + frontPocketFacing: { pct: 45, min: 25, max: 65, menu: 'pockets.frontpockets' }, // Fly - flyCurve: { pct: 72, min: 50, max: 100, - menu: 'advanced.fly' }, - flyLength: { pct: 45, min: 30, max: 60, - menu: 'advanced.fly' }, - flyWidth: { pct: 15, min: 10, max: 20, - menu: 'advanced.fly' }, + flyCurve: { pct: 72, min: 50, max: 100, menu: 'advanced.fly' }, + flyLength: { pct: 45, min: 30, max: 60, menu: 'advanced.fly' }, + flyWidth: { pct: 15, min: 10, max: 20, menu: 'advanced.fly' }, }, draft: draftCharlieFront, } diff --git a/designs/charlie/src/index.mjs b/designs/charlie/src/index.mjs index 05ab50d4a2d..29cc8837155 100644 --- a/designs/charlie/src/index.mjs +++ b/designs/charlie/src/index.mjs @@ -19,16 +19,36 @@ import { beltLoops } from './beltloops.mjs' const Charlie = new Design({ data, parts: [ - front, back, waistband, waistbandCurved, frontPocket, frontPocketFacing, - backPocket, backPocketFacing, backPocketInterfacing, backPocketWelt, - flyFacing, flyExtension, beltLoops, + front, + back, + waistband, + waistbandCurved, + frontPocket, + frontPocketFacing, + backPocket, + backPocketFacing, + backPocketInterfacing, + backPocketWelt, + flyFacing, + flyExtension, + beltLoops, ], }) // Named exports export { - front, back, waistband, waistbandCurved, frontPocket, frontPocketFacing, - backPocket, backPocketFacing, backPocketInterfacing, backPocketWelt, - flyFacing, flyExtension, beltLoops, + front, + back, + waistband, + waistbandCurved, + frontPocket, + frontPocketFacing, + backPocket, + backPocketFacing, + backPocketInterfacing, + backPocketWelt, + flyFacing, + flyExtension, + beltLoops, Charlie, } diff --git a/designs/charlie/src/waistband-curved.mjs b/designs/charlie/src/waistband-curved.mjs index 72ea0260f40..207634cec6b 100644 --- a/designs/charlie/src/waistband-curved.mjs +++ b/designs/charlie/src/waistband-curved.mjs @@ -3,25 +3,23 @@ import { back } from './back.mjs' import { front as titanFront } from '@freesewing/titan' import { back as titanBack } from '@freesewing/titan' -function draftCharlieWaistbandCurved (part) { - // Shorthand - let { - points, - Point, - paths, - Path, - options, - complete, - paperless, - store, - macro, - raise, - snippets, - Snippet, - sa, - units, - } = part.shorthand() - +function draftCharlieWaistbandCurved({ + points, + Point, + paths, + Path, + options, + complete, + paperless, + store, + macro, + log, + snippets, + Snippet, + sa, + units, + part, +}) { if (options.waistbandCurve == 0) { return part } @@ -93,7 +91,7 @@ function draftCharlieWaistbandCurved (part) { paths.seam = paths.saBase.clone().attr('class', 'fabric').setRender(true) if (complete) { - raise.info(`Top of waistband: ${units(paths.waistbandTop.length())}`) + log.info(`Top of waistband: ${units(paths.waistbandTop.length())}`) macro('sprinkle', { snippet: 'notch', on: [ @@ -292,6 +290,6 @@ function draftCharlieWaistbandCurved (part) { export const waistbandCurved = { name: 'charlie.waistbandCurved', - after: [ titanBack, titanFront, front, back ], + after: [titanBack, titanFront, front, back], draft: draftCharlieWaistbandCurved, } diff --git a/designs/charlie/src/waistband.mjs b/designs/charlie/src/waistband.mjs index c14320895a9..876b57f734f 100644 --- a/designs/charlie/src/waistband.mjs +++ b/designs/charlie/src/waistband.mjs @@ -3,24 +3,22 @@ import { back } from './back.mjs' import { front as titanFront } from '@freesewing/titan' import { back as titanBack } from '@freesewing/titan' -function draftCharlieWaistband (part) { - // Shorthand - let { - points, - Point, - paths, - Path, - options, - complete, - paperless, - store, - macro, - snippets, - Snippet, - sa, - absoluteOptions, - } = part.shorthand() - +function draftCharlieWaistband({ + points, + Point, + paths, + Path, + options, + complete, + paperless, + store, + macro, + snippets, + Snippet, + sa, + absoluteOptions, + part, +}) { store.set('waistbandWidth', absoluteOptions.waistbandWidth) if (options.waistbandCurve > 0) { @@ -143,7 +141,7 @@ function draftCharlieWaistband (part) { export const waistband = { name: 'charlie.waistband', - after: [ titanBack, titanFront, back, front ], + after: [titanBack, titanFront, back, front], options: { waistbandCurve: { pct: 0, min: 0, max: 35, menu: 'fit' }, },