From 61a1acb84514b3ac6e22e2179662669ff4d016a7 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 30 Jan 2021 16:30:45 +0100 Subject: [PATCH] feat(charlie): Initial commit --- .github/workflows/tests.charlie.yml | 32 +++++ config/descriptions.yaml | 1 + packages/charlie/CHANGELOG.md | 9 ++ packages/charlie/README.md | 100 ++++++++++++++ packages/charlie/config/index.js | 71 ++++++++++ packages/charlie/drafting-instructions.md | 77 +++++++++++ packages/charlie/example/.babelrc | 10 ++ packages/charlie/example/README.md | 96 ++++++++++++++ packages/charlie/example/netlify.toml | 9 ++ packages/charlie/example/package.json | 51 ++++++++ packages/charlie/example/public/App.js | 16 +++ packages/charlie/example/public/favicon.ico | Bin 0 -> 12053 bytes packages/charlie/example/public/index.html | 41 ++++++ packages/charlie/example/public/layout.css | 1 + packages/charlie/example/public/manifest.json | 15 +++ packages/charlie/example/src/App.js | 35 +++++ packages/charlie/example/src/index.js | 11 ++ packages/charlie/example/src/serviceWorker.js | 123 ++++++++++++++++++ packages/charlie/package.json | 95 ++++++++++++++ packages/charlie/rollup.config.js | 37 ++++++ packages/charlie/src/back.js | 30 +++++ packages/charlie/src/front.js | 30 +++++ packages/charlie/src/index.js | 24 ++++ packages/charlie/tests/shared.test.js | 39 ++++++ 24 files changed, 953 insertions(+) create mode 100644 .github/workflows/tests.charlie.yml create mode 100644 packages/charlie/CHANGELOG.md create mode 100644 packages/charlie/README.md create mode 100644 packages/charlie/config/index.js create mode 100644 packages/charlie/drafting-instructions.md create mode 100644 packages/charlie/example/.babelrc create mode 100644 packages/charlie/example/README.md create mode 100644 packages/charlie/example/netlify.toml create mode 100644 packages/charlie/example/package.json create mode 100644 packages/charlie/example/public/App.js create mode 100644 packages/charlie/example/public/favicon.ico create mode 100644 packages/charlie/example/public/index.html create mode 100644 packages/charlie/example/public/layout.css create mode 100644 packages/charlie/example/public/manifest.json create mode 100644 packages/charlie/example/src/App.js create mode 100644 packages/charlie/example/src/index.js create mode 100644 packages/charlie/example/src/serviceWorker.js create mode 100644 packages/charlie/package.json create mode 100644 packages/charlie/rollup.config.js create mode 100644 packages/charlie/src/back.js create mode 100644 packages/charlie/src/front.js create mode 100644 packages/charlie/src/index.js create mode 100644 packages/charlie/tests/shared.test.js diff --git a/.github/workflows/tests.charlie.yml b/.github/workflows/tests.charlie.yml new file mode 100644 index 00000000000..7ab9496c1c3 --- /dev/null +++ b/.github/workflows/tests.charlie.yml @@ -0,0 +1,32 @@ +name: Unit tests - Charlie + +on: [pull_request] + +jobs: + test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: cd packages/charlie && npm install + env: + CI: true + - name: Install peer & test dependencies + run: "cd packages/charlie && npm install @freesewing/core@^2.12.1 @freesewing/plugin-bundle@^2.12.1 @freesewing/models@2.12.1 @freesewing/pattern-info@2.12.1 mocha chai" + env: + CI: true + - name: Build pattern + run: cd packages/charlie && npm run build + - name: Run pattern unit tests + run: cd packages/charlie && npm run testci diff --git a/config/descriptions.yaml b/config/descriptions.yaml index 85f773cea26..fe37aa58c29 100644 --- a/config/descriptions.yaml +++ b/config/descriptions.yaml @@ -9,6 +9,7 @@ bruce: 'A FreeSewing pattern for boxer briefs' carlita: 'A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat' carlton: 'A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat' cathrin: 'A FreeSewing pattern for a underbust corset / waist trainer' +charlie: 'A FreeSewing pattern for chino trousers' components: 'A collection of React components for FreeSewing web UIs' core: 'A library for creating made-to-measure sewing patterns' create-freesewing-pattern: 'Initializer package for FreeSewing patterns: npm init FreeSewing-pattern' diff --git a/packages/charlie/CHANGELOG.md b/packages/charlie/CHANGELOG.md new file mode 100644 index 00000000000..4c276f600af --- /dev/null +++ b/packages/charlie/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change log for: @freesewing/charlie + + + +This is the **initial release**, and the start of this change log. + +> Prior to version 2, FreeSewing was not a JavaScript project. +> As such, that history is out of scope for this change log. + diff --git a/packages/charlie/README.md b/packages/charlie/README.md new file mode 100644 index 00000000000..106618d22ed --- /dev/null +++ b/packages/charlie/README.md @@ -0,0 +1,100 @@ +![FreeSewing](https://freesewing.org/banner.jpg) +

@freesewing/charlie on NPM + License: MIT + Code quality on DeepScan + Open issues tagged pkg:charlie +

Follow @freesewing_org on Twitter + Chat with us on Discord + Become a FreeSewing Patron + Follow @freesewing_org on Twitter +

+ +## What am I looking at? 🤔 + +This repository is our *monorepo* holding [all our NPM packages](https://www.npmjs.com/search?q=keywords:freesewing). +This folder holds **@freesewing/charlie** + +A FreeSewing pattern for chino trousers + + + +## About FreeSewing 💀 + +Where the world of makers and developers collide, that's where you'll find FreeSewing. + +Our [core library](https://freesewing.dev/reference/api/) is a *batteries-included* toolbox +for parametric design of sewing patterns. It's a modular system (check our list +of [plugins](https://freesewing.dev/reference/plugins/) and getting started is as simple as: + +```bash +npm init freesewing-pattern +``` + +The [getting started](https://freesewing.dev/guides/getting-started/) section on [freesewing.dev](https://freesewing.dev/) is a good +entrypoint to our documentation, but you'll find a lot more there, including +our [API reference](https://freesewing.dev/reference/api/), +as well as [our turorial](https://freesewing.dev/tutorials/pattern-design/), +and [howtos](https://freesewing.dev/howtos/). + +If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate +our sewing patterns adapted to your measurements. + +## Support FreeSewing: Become a patron 🥰 + +FreeSewing is an open source project run by a community, +and financially supported by our patrons. + +If you feel what we do is worthwhile, you too +should [become a patron](https://freesewing.org/patrons/join). + +## Links 👩‍💻 + + - 💻 Makers website: [freesewing.org](https://freesewing.org) + - 💻 Developers website: [freesewing.dev](https://freesewing.dev) + - 💬 Chat: On Discord via [chat.freesewing.org](https://chat.freesewing.org/) + - 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org) + - 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org) + +## License: MIT 🤓 + +© [Joost De Cock](https://github.com/joostdecock). +See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details. + +## Where to get help 🤯 + +Our [chatrooms on Discord](https://chat.freesewing.org/) are the best place to ask questions, +share your feedback, or just hang out. + +If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new). diff --git a/packages/charlie/config/index.js b/packages/charlie/config/index.js new file mode 100644 index 00000000000..62630754dc1 --- /dev/null +++ b/packages/charlie/config/index.js @@ -0,0 +1,71 @@ +import { version } from '../package.json' + +export default { + name: 'charlie', + version, + design: 'Joost De Cock', + code: 'Joost De Cock', + department: 'unisex', + type: 'block', + difficulty: 2, + tags: ['bottom', 'basics'], + optionGroups: { + fit: ['seatEase', 'kneeEase', 'waistEase'], + style: ['waistHeight', 'fitKnee', 'lengthBonus', 'crotchDrop'], + advanced: [ + 'crossSeamCurveStart', + 'crossSeamCurveBend', + 'crotchSeamCurveStart', + 'crotchSeamCurveBend', + 'grainlinePosition', + 'legBalance', + 'waistBalance' + ] + }, + measurements: [ + 'crossSeam', + 'crossSeamFront', + 'knee', + 'seat', + 'seatBack', + 'waist', + 'waistBack', + 'waistToFloor', + 'waistToKnee', + 'waistToHips', + 'waistToSeat', + 'waistToUpperLeg' + ], + hide: ['titanBack', 'titanFront'], + inject: { + back: 'titanBack', + front: 'titanFront', + }, + options: { + // Constants (from Titan) + titanPaperless: true, + fitCrossSeam: true, + fitCrossSeamFront: true, + fitCrossSeamBack: true, + + // Fit (from Titan) + waistEase: { pct: 3, min: 0, max: 10 }, + seatEase: { pct: 3, min: 0, max: 10 }, + kneeEase: { pct: 15, min: 1, max: 25 }, + + // Style (from Titan) + waistHeight: { pct: 25, min: 5, max: 45 }, + lengthBonus: { pct: 2, min: -20, max: 10 }, + crotchDrop: { pct: 2, min: 0, max: 15 }, + fitKnee: { bool: false }, + + // Advanced (from Titan) + legBalance: { pct: 57.5, min: 52.5, max: 62.5 }, + crossSeamCurveStart: { pct: 85, min: 60, max: 100 }, + crossSeamCurveBend: { pct: 65, min: 45, max: 85 }, + crotchSeamCurveStart: { pct: 80, min: 60, max: 95 }, + crotchSeamCurveBend: { pct: 80, min: 45, max: 100 }, + waistBalance: { pct: 60, min: 30, max: 90 }, + grainlinePosition: { pct: 45, min: 30, max: 60 } + } +} diff --git a/packages/charlie/drafting-instructions.md b/packages/charlie/drafting-instructions.md new file mode 100644 index 00000000000..2ef52e5b70f --- /dev/null +++ b/packages/charlie/drafting-instructions.md @@ -0,0 +1,77 @@ +# Titan drafting instructions + +As provided by @dfbean + +## Back + +| Action | # Value | Draft value (cm) | Code value (mm) | Drafter comments | Programmer comments | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Make a point, label A | | | | | | +| Square line down # from A, mark point at end, label D | crotch depth | 31.1 | 311 | | used `crotchDepth` measurement | +| On line A-D, measure # from point A, mark new point, label C | hip depth | 22.9 | 229 | | used `naturalWaistToSeat` measurement | +| From point A, square a line # left, mark endpoint, label H | back hip arc + .3cm | 28.2 | -281.79 | .3cm for ease | used `hipsEase` option, `backHipArc` measurement provided by the `measurements` plugin (part of titan for now) | +| From point C, square a line # left, mark endpoint, label F | back hip arc + .3cm | 28.2 | -281.79 | .3cm for ease | | +| From point D, square a line #, mark endpoint, label I | Use greater of 1.25 x (back hip arc + .3) | 35.3 | 352.2375 | this step incorporates a subsequent fit check, and includes some adjustments required to draft this piece independent of the front piece. | | +| | **OR**, (upperleg + 3.8 + 1.9) – (front hip arc + .3+ front crotch extension) | (64.8 + 3.8 + 1.9) – (25.4 +.3 +5.7) = 39.1 | 393.23 | Includes 3.8 cm recommended crotch ease and 1.9cm placeholder that will be removed later. | used `upperLegEase` and `crotchExtension` options. `crotchExtension` being based on `hipsCircumference` measurement | +| Starting at point H, square down through point F, till intersecting with line D-I. Label intersection point G | | | | | | +| On line G-H, measure # from point G, mark endpoint, label X | .5(crotch depth) | 15.6 | 155.5 | | | +| On line A-H, measure # from point H, toward point A, mark point, label N | 4.5 | 4.5 | 45.1 | Fixed value, sets reference point for back waist | This doesn't work for us. We can't just put in an arbitrary 4.5cm value. That doesn't scale. So I've added a static option called `backWaistFactor` that is 14.5% of the `crotchDepth` measurement. That way, the slant of the back seam should always be the same. This might need tweaking though. | +| On line A-H, measure from point N toward point A, # mark endpoint, label O | back waist arc + 2.5 | 22.8 | 227.36 | 2.5 fixed value for dart width. Ok that it's fixed, it's mostly a placeholder and gets removed, rolled or replaced in pant patterns. If additional shaping is required it can be placed in hip curve. | I've added the `backWaistDart` option which is 12% of the `backWaistArc` measurement, which gives us 24.36mm | +| On line A-H, measure from point N # toward O, mark endpoint, label P | .5 (back waist arc + 2.5) | 11.4 | 113.68 | 2.5 fixed value for dart placement. | went with time .56 instead of fixed value | +| Square line # down from P, mark endpoint, no label | | 8.9 | 88.64 | Fixed value for dart length. See previous note onfixed dart value. | Added the `backWaistDartLength` option, which is based on the `crotchDepth` measurement. 28.5% by default | +| Square out # from P on both sides, mark endpoints, no label. | | 1.0 | 12.5 | 1.0 Fixed value for dart width. See previous note. | Earlier on, draft instructions specify _2.5cm fixed value for dart width_. Now, it's _1cm fixed value for (half of the) dart width_. Rather than an introduce a 0.5cm error, I've kept the dart width at 2.5 cm (12.5mm to each side). | +| Square up # from point N, mark endpoint, label T | 2.5 | 2.5 | -24.88 | Fixed value for height of back rise. | Once again not loving the fixed 2.5cm value here. But I'm not certain whether it's best to make this a fraction of `crotchDepth` or rather `backWaistArc`. Went with `crotchDepth` since it is a vertical measurement after all. Added the `backRise` option for this. | +| Draw a line from T, through X, to line D-I, no label | | | -320.67 | | Point name: `extendedBackSeam` | +| Square # up/left diagonally from G , mark endpoint, label g | 4.4 | 4.4 | 44 | Fixed value as reference for crotch curve. | I'm a bit confused here about the _fixed value_ note here. The intersection of the line from `T` through `X` and a line from `G` 45 degrees NW can only intersect in 1 point. It so happens that point is 4.4cm from G, but why is it described as a _fixed value_? | +| Draw curve touching X and g, ending at/near I, blend at g if needed. | | | | | I had a look at the hand-drawn version, and I do find the bend of this curve to be really sharp. I have approximated it in the code, but I have also added the `backSeamCurveStart` and `backSeamCurveBend` options to control the curvature. | +| Draw slightly curved line from T to O. | | | | | +| Draw dart legs through side points, up to curved T-O line | | | | | +| True dart by raising shorter leg and redrawing line to O. | | | | We don't _true_, we just get it right :) | +| Draw hip curve from just above C to O | | | | | Just above C? Why just above C as C marks the fullest part of the seat? | +| On line D-I, mark new point # to left of D, label V | 1 | 1 | 9.84 | Fixed point as reference for hip curve. This value was already included in line D-I, so that it could be removed at this stage. | This seems a bit random. I don't see any reference to _1cm_ when constructing point I, so not sure where to get this from. See next step for workaround | +| On line D-I, mark new point # halfway between between V and I, label W | | 19.0 | 191.5 | I measured/divided manually, you'll let the computer do this. | Went with 51.25% instead (because of the 1cm). Stored in the static `grainlineBackFactor` option | +| From point W, square up to line A-H (waistline) and down # waist to ankle, to knee and # to ankle to create grainline Mark knee and ankle points | | 100.3, 61.0 | 1053, 610 | Threw this in so I could complete the crotch and hip curves. | We have a `naturalWaistToFloor` measurement. Adding `naturalWaistToAnkle` seems excessive. I'm drafting this block to the floor and will leave it to the designer how long they want things. I guesstimated 105.3cm for the fit model. | +| At knee point square and center a # line, mark endpoints, no label | (knee circ / 2) + 2.5 | (40.6/2) + 2.5 = 22.8 | 221.2 | Knee and ankle circs are needed to build hip and crotch curves correctly. I used my measurement with 1 inch of ease allocated to the back. I want to fiddle with this and get your comments. | Is it custom to only apply ease to the back? I've added a `kneeEase` options for this combined with that `legBalance` option to control this. Default = 75% (meaning that 75% of ease is applied to the back) | +| At ankle point, square and center a line, mark endpoints, no label | (ankle entry circ / 2) - 2.5 | (31.8/2) + 2.5 = 18.4 | 173.4 | Same approach as the knee, just to have a point to work with. See above note about revisiting after testing. | I noticed we don't have an `ankleCircumference` measurement, but only `ankleEntry`. I've based it on the latter for now, but this feels a bit contra-intuitive. Added `ankleEase` option for this. | +| Draw a line from ankle points, through knee points, to line D-I. | | | Creates in/out seams and guide for hip and crotch curves | | +| Draw curve down from I to inseam, blending curve into seam about midway between knee and line D-I. Ensure first inch of curve down from I is at 90 degree angle to upward curve from I. | | | | | Ignored the 90 degree thing for now. Added `inseamCurve` option to control shape of curve. | +| Draw curve down from V to outseam, blending curve into seam about midway between knee and line D-I. | | | | | I've added the `outSeamCurveKnee` and `outSeamCurveSeat` options to control this. Set the defaults so that the curve deviates 1cm (9.66mm to be exact) at the D-I line as instructed earlier | +| Correct crotch length by pitching crotch seam up/down at point F. | back crotch length – (T-X-g-I) = pitch up | 45.2 – 40 = 5.2 | | Lucky you, the computer will handle this! Negative result means downward pitch | Implemented by slashing horizontally, then rotating, in combination with shifting the tip of the inseam outwards. The balance between these two ways to increase (or decrease) the cross seam is the `crossSeamFitBalance` option which defaults to `0.5`. Once the cross seam is the correct length, we also make sure we respect the horizontal distance from cross seam to side by shifting the side seam outwards. | + +## Front + +| Action | # Value | Draft value (cm) | Code value (mm) | Drafter comments | Programmer comments | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Make a point, label A | | | | | | +| Square line down # from A, mark point at end, label D | crotch depth | 31.1 | 311 | | used `crotchDepth` measurement | +| On line A-D, measure # from point A, mark new point, label C | hip depth | 22.9 | 229 | | used `naturalWaistToSeat` measurement | +| From point A, square a line # right mark endpoint, label L | front hip arc + .3cm | 25.4 + .3 = 25.7 | 256.54 | .3cm for ease | used `hipsEase` option, `frontHipArc` measurement provided by the `measurements` plugin (part of titan for now) | +| From point C, square a line # right, mark endpoint, label J | front hip arc + .3cm | 25.4 + .3 = 25.7 | 256.54 | .3cm for ease | | +| From point D, square a line # right, mark endpoint, label K | front hip arc + .3cm | 25.4 + .3 = 25.7 | 256.54 | .3 cm for ease | | +| Extend line D-K # to the right, label endpoint M | crotch extension | | | | Used `crotchExtension` option (same as back) as basis but applied a `7%` extra stored in fixed option `crotchFrontExtention` | +| Connect L to K touching J | | | | | | +| On line L-K, measure # from point from K, mark endpoint, label X | .5(crotch depth) + 1.3 | 15.5 + 1.3 = 16.8 | 18.8 | | Went with `54%` of `crotchDepth` instead. Created a new option for this: `flySlopeHinge`, fixed to `0.54` | +| On line A-L, measure # from point L, mark point, label Q | 1.3 | 1.3 | 12.88 | | Based this on the vertical distance between X and L, this should keep the slop consistent across sizes. Created new option for this: `flySlopeFactor`, fixed to `0.09` | +| On line A-L, measure # from point Q toward point A, mark endpoint, label R | front waist arc + 1.9 | 20.3 + 1.9 = 22.2 | 19.05 | 1.9 fixed value for dart width. OK that it's fixed, it's mostly a placeholder and gets removed, rolled or replaced in pant patterns. If additional shaping is required it can be placed in hip curve. | Added the `frontWaistDart` option which defaults to `7.5%` | +| On line A-L, measure # from point Q toward R, mark endpoint, label S | 8.3 | 8.3 | 81.9 | fixed value for dart placement. See previous note on fixed dart value | Went with `frontWaistDartLocation` option which is be default `30%` from `Q` towards `R` | +| Square line # down from S, mark endpoint, no label | 6.4 | 6.4 | 64.38 | Fixed value for dart length. See previous note on fixed dart value. | Went with `frontWaistDartLenght` option, which defaults to `45%` (based on distance down to `X`) | +| Square out # from S on both sides, mark endpoints, no label. | .6 | .6 | 6.35 | Fixed value for dart width. See previous note. | Earlier, you used `1.9` as a fixed value for dart with. Now, half the dart width is `0.6` 7mm went missing somewhere and I can't see what happened to them. So, I aimed for `12.7mm` dart width and am thus not respecting the `19mm` above | +| Square up # from point Q, mark endpoint, label U | .6 | .6 | 6.35 | Fixed value for waistband reference | Created `frontWaistRise` options for this, defaults to `2.5%` (of `frontWaistArc` measurement) | +| Draw a line from U, through X, to line D-K-M, no label | | | | | +| Square # up/right diagonally from K , mark endpoint, label k | 3.2 | 3.2 | | Fixed value as reference for crotch curve. | Didn't bother with this, as it's not a point we'll use in construction, but merely an indicator where our curve should be. | +| Draw curve touching X, k and M, blend at k if needed. | | | | | Similar options as the back: `flyCurveStart` and `flyCurveBend` | +| Draw slightly curved line from U to R | | | | | If there's a curve in your drawing, it's too subtle to see. So I just used a straight line as that makes handling the dart so so much easier. On that note, we've already constructed the dart at this point. Now we don't only have to move it, but it's also no longer on a horizontal line, so we have to slightly rotate it. AS such, I'm going to move the construction of the dart further down the code so that we construct it in the right place rather than moving it afterwards. | +| Draw dart legs through side points, up to curved U-R line | | | | | | | +| True dart by raising shorter leg and redrawing line to R | | | | | No trueing needed, our dart is correct already | +| Draw hip curve from just above C to R | | | | | Same remark as for the back: Why just above C as C marks the fullest part of the seat? | +| On line D-M, mark new point # to right of D, label Y | 1.0 | 1.0 | | Fixed point as reference for hip curve. This value was already included in line D-I, so that it could be removed at this stage. | This is one of those control points not actuall used in construction. Will just use `52%` of the horizontal distance instead, stored in the `frontGrainLineFactor` option | +| On line D-M, mark new point halfway between between Y and M, label Z | | 15.2 | 153 | Value only for reference, you use that new-fangled computer to generate this. | Why did we go through all that trouble figuring out where to put the dart, when we now determine this is the grainline, which is probably where the dart should be anyway? | +| From point Z, square up to line A-L (waistline) and down # to waist to ankle, knee and # to ankle to create grainline Mark knee and ankle waist to knee points | | 100.3 | | | | We have a `naturalWaistToFloor` measurement. Adding `naturalWaistToAnkle` seems excessive. I'm drafting this block to the floor and will leave it to the designer how long they want things. I guesstimated 105.3cm for the fit model. | +| At knee point square and center a # line, mark endpoints, no label | knee circ / 2 | 40.6/2 = 20.3 | 209.1 | Threw this in so I could complete the crotch and hip curves. Knee and ankle circ”s are needed to build hip and crotch curves correctly. I used my measurements with 1 inch of ease at knee, allocated to the back. I want to fiddle with this and get your comments. | I used the `kneeEase` and `legBalance` options for this (same as in the back). Hence slightly different value | +| At ankle point, square and center a line, mark endpoints, no label | ankle entry circ / 2 | 31.8/2 = 15.9 | `163.76` because we added `ankleEase` | Same approach as the knee, just to have a point to work with. See above note about revisiting after testing. | Note that we're drafting to the floor | +| Draw a line from ankle points, through knee points, to line D-M Creates in/out seams and guide for hip and crotch curves | | | | | | +| Draw curve down from M to inseam, blending curve into seam about midway between knee and line D-M. Ensure first inch of curve down from M is at 90 degree angle to upward curve from M. | | | | | | +| Draw curve down from Y to outseam, blending curve into seam about midway between knee and line D-M. | | | | | | +| Correct crotch length by pitching crotch seam up/down at point J | | | | | | + +All implemented. And more. For one thing, there's no trueing of the inseam and outseam here. diff --git a/packages/charlie/example/.babelrc b/packages/charlie/example/.babelrc new file mode 100644 index 00000000000..6e3090a4956 --- /dev/null +++ b/packages/charlie/example/.babelrc @@ -0,0 +1,10 @@ +{ + "plugins": [ + ["prismjs", { + "languages": ["javascript", "css", "markup"], + "plugins": ["line-numbers"], + "theme": "twilight", + "css": true + }] + ] +} diff --git a/packages/charlie/example/README.md b/packages/charlie/example/README.md new file mode 100644 index 00000000000..d92d8c77d3f --- /dev/null +++ b/packages/charlie/example/README.md @@ -0,0 +1,96 @@ +

+Freesewing logo +
+FreeSewing v2 +

+

A JavaScript library for made-to-measure sewing patterns

+

Follow @freesewing_org on Twitter + Chat with us on Gitter + Become a FreeSewing Patron + Follow @freesewing_org on Twitter + +

+ +# charlie example + +This project was bootstrapped with [Create Freesewing Pattern](https://en.freesewing.dev/create-freesewing-pattern): + +```js +npm init freesewing-pattern +``` + +This example folder is part of the local development environment. +It is **not** part of the pattern's source code. + +To run this example, follow these steps: + + - In the folder above this one, run: `yarn start` (or `npm start`) + - Then, in new terminal, run the same command in this folder: `yarn start` (or `npm start`) + +This will spin up the development environment, similar to [our online demo](https://charlie.freesewing.dev/). + +## About FreeSewing 🤔 + +Where the world of makers and developers collide, that's where you'll find FreeSewing. + +Our [core library](https://freesewing.dev/en/freesewing) is a *batteries-included* toolbox +for parametric design of sewing patterns. It's a modular system (check our list +of [plugins](https://freesewing.dev/en/plugins) and getting started is as simple as: + +```bash +npm init freesewing-pattern +``` + +The [getting started] section on [freesewing.dev](https://freesewing.dev/) is a good +entrypoint to our documentation, but you'll find a lot more there, including +our [API documentation](https://freesewing.dev/en/freesewing/api), +as well as [examples](https://freesewing.dev/en/freesewing/examples), +and [best practices](https://freesewing.dev/en/do). + +If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate +our sewing patterns adapted to your measurements. + +## Support FreeSewing: Become a patron 🥰 + +FreeSewing is an open source project run by a community, +and financially supported by our patrons. + +If you feel what we do is worthwhile, you too +should [become a patron](https://freesewing.org/patrons/join). + +## Links 👩‍💻 + + - 💻 Makers website: [freesewing.org](https://freesewing.org) + - 💻 Developers website: [freesewing.dev](https://freesewing.org) + - 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/freesewing) + - 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org) + - 📷 Instagram: [@freesewing_org](https://instagram.com/freesewing_org) + +## License: MIT 🤓 + +© [Joost De Cock](https://github.com/joostdecock). +See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details. + +## Where to get help 🤯 + +Our [chatroom on Gitter](https://gitter.im) is the best place to ask questions, +share your feedback, or just hang out. + +If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new). + diff --git a/packages/charlie/example/netlify.toml b/packages/charlie/example/netlify.toml new file mode 100644 index 00000000000..5269be9f9c3 --- /dev/null +++ b/packages/charlie/example/netlify.toml @@ -0,0 +1,9 @@ +[build] + base = "packages/charlie/example" + publish = "build" + command = "npm run build" + +[[redirects]] + from = "/*" + to = "/index.html" + status = 200 diff --git a/packages/charlie/example/package.json b/packages/charlie/example/package.json new file mode 100644 index 00000000000..0f82bb75aaf --- /dev/null +++ b/packages/charlie/example/package.json @@ -0,0 +1,51 @@ +{ + "name": "charlie", + "homepage": "https://charlie.freesewing.dev/", + "version": "", + "private": true, + "dependencies": { + "@fontsource/permanent-marker": "^4.1.0", + "@fontsource/roboto-mono": "^4.1.0", + "@fontsource/ubuntu": "^4.1.0", + "@freesewing/components": "latest", + "@freesewing/core": "latest", + "@freesewing/css-theme": "latest", + "@freesewing/i18n": "latest", + "@freesewing/models": "latest", + "@freesewing/mui-theme": "latest", + "@freesewing/pattern-info": "latest", + "@freesewing/plugin-bundle": "latest", + "@freesewing/plugin-theme": "latest", + "@freesewing/plugin-i18n": "latest", + "@freesewing/plugin-svgattr": "latest", + "@freesewing/utils": "latest", + "@material-ui/core": "^4.11.2", + "@material-ui/icons": "^4.11.2", + "@material-ui/lab": "^v4.0.0-alpha.57", + "pattern": "link:..", + "prismjs": "1.22.0", + "react": "^17.0.1", + "react-dom": "^17.0.1", + "react-scripts": "^3.4.4", + "file-saver": "^2.0.5", + "react-markdown": "5.0.3" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ], + "devDependencies": { + "babel-plugin-prismjs": "2.0.1" + } +} diff --git a/packages/charlie/example/public/App.js b/packages/charlie/example/public/App.js new file mode 100644 index 00000000000..e1d3f30cacb --- /dev/null +++ b/packages/charlie/example/public/App.js @@ -0,0 +1,16 @@ +import React from 'react' +import freesewing from '@freesewing/core' +import { Workbench } from '@freesewing/components' +import 'typeface-roboto-condensed' +import '@freesewing/css-theme' +import './App.css' + +import Pattern from 'pattern' + +const App = (props) => { + let instance = new Pattern() + let config = instance.config + return +} + +export default App diff --git a/packages/charlie/example/public/favicon.ico b/packages/charlie/example/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..95061a260f10f9f0fb6464069a6d65df8dc8a471 GIT binary patch literal 12053 zcmZQzU}Ruq00Bk@1&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q)h6LUp&qF%)-D^+aci7q63mA>{m#I zFH1UfFkJTIckcsNw&MNuez@)MpJ(daEwgPWr2jXx`7~9pWuMSK#*-I{b?$$xT#|c0DxmyEGwVCYxJo0r*K2>= zEL^bKitX*$ES6Zs2~ymeJ*)y1k)7X{9eAXY{LL+=*|>~j5%Zg?&jmdcZ*W&K3J16c zyi7W*->Cdi@n$t2kNZy#yH&GZtun1Vig+nB-T6 z6mfBJ-8l1H@Q!0d#;V2MAE&;EdD8lFw+H`U{_N#p7TJ@*`xr-ky>D){|XNk72#Xb+d%!hPJ=Sxje!uuWF5 zcq+$zHZ4MC(&-1@DH^BP#F7iFypvAv4!CI%^B}CzdV!0aScTVvRGa%HEjH5+Snt33 z`1w`UHz!i&t3SAKI#{jl^Ru&+${#uYD?D7EGv`XW^NW3rAHsfVBsd=C3wgYkJO1EB zg|w%W=ee(0)2y{%omI#Kt}Xhr+f^2Ib#PRxiris3@;l%0KAYvHnaPdrZ`zA;4sN{8 zq2u!Wu*rXhd0);d25=b(=i4rloE+Fttk_{W`@sGKOy`^1ng2WTT0FK|te0q^(>jxh z`(ezTX-rQ8I2rFV`5k3l5Ivv4QC_7$DX6OW@q`CQn%%8*TdNADi7Ijx%sg*PWTszBgHdG*SUBl-B>y|3pIg`5|OrH?hm%q5XuS6t{d%tVBg~@E?TLHem%q;}f cZ65z;e6+jU{sPb0%b+Fjp00i_>zopr0KR{Z`2YX_ literal 0 HcmV?d00001 diff --git a/packages/charlie/example/public/index.html b/packages/charlie/example/public/index.html new file mode 100644 index 00000000000..51fcf4bd757 --- /dev/null +++ b/packages/charlie/example/public/index.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + charlie + + + +
+ + + diff --git a/packages/charlie/example/public/layout.css b/packages/charlie/example/public/layout.css new file mode 100644 index 00000000000..c62502f9791 --- /dev/null +++ b/packages/charlie/example/public/layout.css @@ -0,0 +1 @@ +div.layout-wrapper{width:100%;margin:0;padding:0;background-color:red;background:#f8f9fa;background:linear-gradient(90deg, #f1f3f5 0%, #f1f3f5 25%, #f8f9fa 26%, #f8f9fa 100%)}div.layout-wrapper div.layout{display:flex;max-width:1600px;margin:auto;padding:0;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;background-color:#f8f9fa;min-height:calc(100vh - 64px)}div.layout-wrapper div.layout>aside{width:33%;background:#f1f3f5;border-right:2px solid #dee2e6}div.layout-wrapper div.layout>section{margin:0;padding:1rem}div.layout-wrapper div.layout>section>div.content{max-width:66ch;min-width:340px}div.layout-wrapper div.layout>section>div.content.wide{max-width:100%;margin:auto}.theme-wrapper.dark header{background-color:#1a1d21}.theme-wrapper.dark div.layout-wrapper{background:#f8f9fa;background:linear-gradient(90deg, #1a1d21 0%, #1a1d21 25%, #212529 26%, #212529 100%)}.theme-wrapper.dark div.layout-wrapper div.layout{background-color:#212529}.theme-wrapper.dark div.layout-wrapper div.layout>aside{background-color:#1a1d21;border-right:2px solid #343a40}header a svg{color:#ced4da}header a:first-of-type svg{color:#f8f9fa}header a:hover svg{color:#b197fc}header a span,header button span{color:#ced4da}header a span svg,header button span svg{color:#dee2e6}header a:hover span,header button:hover span{color:#f8f9fa}header a:hover span svg,header button:hover span svg{color:#b197fc}header a,header button{padding:0 1vw !important}@media (min-width: 1200px){div.layout>section{width:63%}}@media (max-width: 1199px) and (min-width: 960px){div.layout>aside{width:298px}div.layout>section{width:calc(100% - 300px - 4rem);max-width:none;margin:0 1rem 0 3rem}}@media (max-width: 959px){div.layout>aside{width:218px}div.layout>section{width:calc(100% - 220px - 4rem);max-width:none;margin:0;padding:0 2rem}div.layout>section div.content{min-width:inherit}}@media (max-width: 599px){div.layout>aside{display:none}div.layout>section{width:calc(100%);margin:0 auto;padding:0 1.5rem;max-width:none}}div.gatsby-highlight{margin-bottom:1rem}@media (max-width: 599px){#mobile-menu{position:fixed;top:0;left:0;width:100%;height:100vh;padding:0 0 1rem;max-width:600px;z-index:-10;transition:opacity 0.25s ease 0s;opacity:0;overflow:scroll}#mobile-menu>ul,#mobile-menu>div{transform:translate(0px, 10px);transition:transform 0.25s ease 0s}.theme-wrapper.show-menu #mobile-menu{opacity:1;z-index:10}.theme-wrapper.show-menu #mobile-menu>div{transform:translate(0px, 0px)}}.theme-wrapper.light div.draft-ui-menu,.theme-wrapper.light div.menu{background:#f1f3f5}.theme-wrapper.dark div.draft-ui-menu,.theme-wrapper.dark div.menu{background:#343a40}.theme-wrapper.show-menu div.menu{opacity:1;z-index:10}.theme-wrapper.show-menu div.menu>div{transform:translate(0px, 0px)}div.spaced-buttons>button{margin:0 0.5rem 0.5rem 0}div.spaced>*{margin:0 0.5rem 0.5rem 0}ul#pre-main-menu{margin:0;padding:0}.boldish{font-weight:500}.freesewing.draft{padding:1rem}li.action{clear:both}li.action span.MuiSwitch-root{float:right}.theme-wrapper.light ul#draft-config li.action.toggle.off,.theme-wrapper.dark ul#draft-config li.action.toggle.off{color:#868e96}.theme-wrapper.light ul#draft-config li.action.toggle.off>span svg,.theme-wrapper.dark ul#draft-config li.action.toggle.off>span svg{color:#868e96}footer{background-color:#1a1d21;color:#adb5bd;padding:3rem 0 6rem}footer a{color:#dee2e6 !important;font-weight:400}footer a:hover{color:#d0bfff !important}footer div.cols{display:flex;flex-direction:row;justify-content:space-between;max-width:1600px;margin:auto;padding:0 1.5rem}footer div.cols>div{min-width:150px;max-width:calc(20% - 4rem);padding:0 2rem 0 0;width:100%}footer ul{text-align:left;font-size:1.1rem;margin:0;padding:0;width:100%}footer ul li:first-of-type{padding:0.35rem 0.75rem}footer ul li{display:block}footer ul li a:hover{text-decoration:none !important}footer ul li.heading{font-weight:bold;border-bottom:3px solid #adb5bd;margin-bottom:0.5rem}@media (min-width: 1200px){footer div.cols>div:last-of-type{min-width:350px}}@media (min-width: 600px) and (max-width: 959px){footer div.cols{flex-wrap:wrap}footer div.cols>div{width:calc(30% - 4rem);padding:0 1rem}}@media (max-width: 599px){footer div.cols{display:block}footer div.cols>div{margin:2rem auto 0;max-width:calc(100% - 4rem)}footer div.cols>div:first-of-type{margin-top:0}} diff --git a/packages/charlie/example/public/manifest.json b/packages/charlie/example/public/manifest.json new file mode 100644 index 00000000000..f3d43d5441e --- /dev/null +++ b/packages/charlie/example/public/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "charlie", + "name": "charlie", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/packages/charlie/example/src/App.js b/packages/charlie/example/src/App.js new file mode 100644 index 00000000000..79b7751e342 --- /dev/null +++ b/packages/charlie/example/src/App.js @@ -0,0 +1,35 @@ +import React from 'react' +import freesewing from '@freesewing/core' +import Workbench from '@freesewing/components/Workbench' +import '@freesewing/css-theme' + +import Pattern from 'pattern' + +const App = (props) => { + // You can use this to add transations + /* + let translations = { + JSON: 'JSON', + someOtherString: 'Some other string that needs translation' + } + */ + + // Adds support for loading an external pattern configuration + let recreate = false + if (window) recreate = window.location.pathname.substr(1).split('/') + if (recreate.length === 3 && recreate[0] === 'recreate') + recreate = { from: recreate[1], id: recreate[2] } + else recreate = false + + return ( + + ) +} + +export default App diff --git a/packages/charlie/example/src/index.js b/packages/charlie/example/src/index.js new file mode 100644 index 00000000000..9dd7ba788d4 --- /dev/null +++ b/packages/charlie/example/src/index.js @@ -0,0 +1,11 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import App from './App' +import * as serviceWorker from './serviceWorker' + +ReactDOM.render(, document.getElementById('root')) + +// If you want your app to work offline and load faster, you can change +// unregister() to register() below. Note this comes with some pitfalls. +// Learn more about service workers: http://bit.ly/CRA-PWA +serviceWorker.unregister() diff --git a/packages/charlie/example/src/serviceWorker.js b/packages/charlie/example/src/serviceWorker.js new file mode 100644 index 00000000000..44e1b1b2f8c --- /dev/null +++ b/packages/charlie/example/src/serviceWorker.js @@ -0,0 +1,123 @@ +// In production, we register a service worker to serve assets from local cache. + +// This lets the app load faster on subsequent visits in production, and gives +// it offline capabilities. However, it also means that developers (and users) +// will only see deployed updates on the "N+1" visit to a page, since previously +// cached resources are updated in the background. + +// To learn more about the benefits of this model, read https://goo.gl/KwvDNy. +// This link also includes instructions on opting out of this behavior. + +const isLocalhost = Boolean( + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/) +) + +export function register(config) { + if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL, window.location) + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebook/create-react-app/issues/2374 + return + } + + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js` + + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config) + + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + 'This web app is being served cache-first by a service ' + + 'worker. To learn more, visit https://goo.gl/SC7cgQ' + ) + }) + } else { + // Is not local host. Just register service worker + registerValidSW(swUrl, config) + } + }) + } +} + +function registerValidSW(swUrl, config) { + navigator.serviceWorker + .register(swUrl) + .then(registration => { + registration.onupdatefound = () => { + const installingWorker = registration.installing + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + // At this point, the old content will have been purged and + // the fresh content will have been added to the cache. + // It's the perfect time to display a "New content is + // available; please refresh." message in your web app. + console.log('New content is available; please refresh.') + + // Execute callback + if (config.onUpdate) { + config.onUpdate(registration) + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log('Content is cached for offline use.') + + // Execute callback + if (config.onSuccess) { + config.onSuccess(registration) + } + } + } + } + } + }) + .catch(error => { + console.error('Error during service worker registration:', error) + }) +} + +function checkValidServiceWorker(swUrl, config) { + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl) + .then(response => { + // Ensure service worker exists, and that we really are getting a JS file. + if ( + response.status === 404 || + response.headers.get('content-type').indexOf('javascript') === -1 + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then(registration => { + registration.unregister().then(() => { + window.location.reload() + }) + }) + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config) + } + }) + .catch(() => { + console.log('No internet connection found. App is running in offline mode.') + }) +} + +export function unregister() { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then(registration => { + registration.unregister() + }) + } +} diff --git a/packages/charlie/package.json b/packages/charlie/package.json new file mode 100644 index 00000000000..66b8fc4f2bd --- /dev/null +++ b/packages/charlie/package.json @@ -0,0 +1,95 @@ +{ + "name": "@freesewing/charlie", + "version": "2.12.1", + "description": "A FreeSewing pattern for chino trousers", + "author": "Joost De Cock (https://github.com/joostdecock)", + "homepage": "https://freesewing.org/", + "repository": "github:freesewing/freesewing", + "license": "MIT", + "bugs": { + "url": "https://github.com/freesewing/freesewing/issues" + }, + "keywords": [ + "freesewing", + "design", + "diy", + "fashion", + "made to measure", + "parametric design", + "pattern", + "sewing", + "sewing pattern" + ], + "main": "dist/index.js", + "module": "dist/index.mjs", + "scripts": { + "clean": "rimraf dist", + "build": "rollup -c", + "test": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.js --require @babel/register", + "pubtest": "npm publish --registry http://localhost:6662", + "pubforce": "npm publish", + "symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -", + "start": "rollup -c -w", + "netlify": "echo \"Not configured yet\"", + "testci": "BABEL_ENV=production ./node_modules/.bin/_mocha tests/*.test.js --require @babel/register" + }, + "peerDependencies": { + "@freesewing/core": "^2.12.1", + "@freesewing/plugin-bundle": "^2.12.1" + }, + "dependencies": {}, + "devDependencies": { + "react": "^16.13.1", + "react-dom": "^16.13.1", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "babel-eslint": "^10.1.0", + "eslint": "^7.6.0", + "babel-jest": "^26.2.2", + "jest": "26.2.2", + "@freesewing/components": "^2.12.1", + "@freesewing/css-theme": "^2.12.1", + "@freesewing/i18n": "^2.12.1", + "@freesewing/mui-theme": "^2.12.1", + "@freesewing/plugin-bust": "^2.12.1", + "@freesewing/plugin-buttons": "^2.12.1", + "@freesewing/plugin-flip": "^2.12.1", + "@freesewing/utils": "^2.12.1", + "@svgr/rollup": "^2.4.1", + "cross-env": "^7.0.2", + "react-scripts": "^3.4.1", + "webpack": "^4.44.1", + "rollup": "^2.23.0", + "@rollup/plugin-babel": "^5.1.0", + "rollup-plugin-terser": "^6.1.0", + "@rollup/plugin-commonjs": "^14.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^8.4.0", + "rollup-plugin-peer-deps-external": "^2.2.3", + "@material-ui/core": "^4.11.0", + "@material-ui/icons": "4.9.1", + "@material-ui/lab": "^v4.0.0-alpha.56", + "axios": "0.21.1", + "react-intl": "^5.4.5", + "prop-types": "^15.7.2", + "mocha": "^8.1.0", + "chai": "^4.2.0", + "chai-string": "^1.5.0", + "@babel/register": "^7.10.5" + }, + "files": [ + "dist/*", + "README.md", + "package.json" + ], + "publishConfig": { + "access": "public", + "tag": "latest" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=6" + }, + "rollup": { + "exports": "default" + } +} diff --git a/packages/charlie/rollup.config.js b/packages/charlie/rollup.config.js new file mode 100644 index 00000000000..a885f4cb4ec --- /dev/null +++ b/packages/charlie/rollup.config.js @@ -0,0 +1,37 @@ +import resolve from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' +import json from '@rollup/plugin-json' +import { terser } from 'rollup-plugin-terser' +import peerDepsExternal from 'rollup-plugin-peer-deps-external' +import { name, version, description, author, license, main, module, rollup } from './package.json' + +const output = [ + { + file: main, + format: 'cjs', + sourcemap: true, + exports: rollup.exports + } +] +if (typeof module !== 'undefined') + output.push({ + file: module, + format: 'es', + sourcemap: true + }) + +export default { + input: 'src/index.js', + output, + plugins: [ + peerDepsExternal(), + resolve({ modulesOnly: true }), + commonjs(), + json(), + terser({ + output: { + preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */` + } + }) + ] +} diff --git a/packages/charlie/src/back.js b/packages/charlie/src/back.js new file mode 100644 index 00000000000..d0ccbc3b872 --- /dev/null +++ b/packages/charlie/src/back.js @@ -0,0 +1,30 @@ +export default (part) => { + + // Shorthand + let { + points, + Point, + paths, + Path, + measurements, + options, + complete, + paperless, + store, + macro, + utils, + snippets, + Snippet, + sa + } = part.shorthand() + + if (complete) { + if (sa) { + } + + if (paperless) { + } + } + + return part +} diff --git a/packages/charlie/src/front.js b/packages/charlie/src/front.js new file mode 100644 index 00000000000..d0ccbc3b872 --- /dev/null +++ b/packages/charlie/src/front.js @@ -0,0 +1,30 @@ +export default (part) => { + + // Shorthand + let { + points, + Point, + paths, + Path, + measurements, + options, + complete, + paperless, + store, + macro, + utils, + snippets, + Snippet, + sa + } = part.shorthand() + + if (complete) { + if (sa) { + } + + if (paperless) { + } + } + + return part +} diff --git a/packages/charlie/src/index.js b/packages/charlie/src/index.js new file mode 100644 index 00000000000..3ab59f86b7c --- /dev/null +++ b/packages/charlie/src/index.js @@ -0,0 +1,24 @@ +import freesewing from '@freesewing/core' +import Titan from '@freesewing/titan' +import plugins from '@freesewing/plugin-bundle' + +import config from '../config' +// Parts +import draftBack from './back' +import draftFront from './front' + +// Create design +const Pattern = new freesewing.Design(config, plugins) + +// Attach titan draft methods to prototype +for (let p of ['Front', 'Back']) { + Pattern.prototype[`draftTitan${p}`] = function(part) { + return new Titan(this.settings)[`draft${p}`](part) + } +} + +// Attach charlie draft methods to prototype +Pattern.prototype.draftBack = part => draftBack(part) +Pattern.prototype.draftFront = part => draftFront(part) + +export default Pattern diff --git a/packages/charlie/tests/shared.test.js b/packages/charlie/tests/shared.test.js new file mode 100644 index 00000000000..05e3be19016 --- /dev/null +++ b/packages/charlie/tests/shared.test.js @@ -0,0 +1,39 @@ +// This file is auto-generated. +// Changes you make will be overwritten. +const expect = require("chai").expect; +const models = require("@freesewing/models") +const patterns = require("@freesewing/pattern-info") + +const Charlie = require('../dist') + +// Shared tests +const testPatternConfig = require('../../../tests/patterns/config') +const testPatternDrafting = require('../../../tests/patterns/drafting') +const testPatternSampling = require('../../../tests/patterns/sampling') + +// Test config +testPatternConfig( + 'charlie', + new Charlie(), + expect, + models, + patterns +) + +// Test drafting +testPatternDrafting( + 'charlie', + Charlie, + expect, + models, + patterns +) + +// Test sampling +testPatternSampling( + 'charlie', + Charlie, + expect, + models, + patterns +)