✨ Initial port of Theo(dore)
This commit is contained in:
parent
e6cea282b0
commit
6a461e0ee9
33 changed files with 13099 additions and 0 deletions
|
@ -45,6 +45,7 @@ shin: "A FreeSewing pattern for swim trunks"
|
|||
simon: "A FreeSewing pattern for a button down shirt"
|
||||
sven: "A FreeSewing pattern for a straightforward sweater"
|
||||
tamiko: "A FreeSewing pattern for a zero-waste top"
|
||||
theo: "A FreeSewing pattern for classic trousers"
|
||||
trayvon: "A FreeSewing pattern for a tie"
|
||||
tutorial: "A FreeSewing pattern for a baby bib that's used in our tutorial"
|
||||
utils: "A collection of utilities shared across freesewing frontend projects"
|
||||
|
|
107
packages/theo/README.md
Normal file
107
packages/theo/README.md
Normal file
|
@ -0,0 +1,107 @@
|
|||
> **Note**: This is part of version 2 of FreeSewing.
|
||||
> It is a work in progress, and not ready for prime-time yet
|
||||
>
|
||||
> For all questions, please come say hello in [our chatroom on Gitter](https://gitter.im/).
|
||||
|
||||
<p align="center">
|
||||
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||
<br>
|
||||
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||
</p>
|
||||
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||
<p align='center'><a
|
||||
href="https://www.npmjs.com/package/@freesewing/theo"
|
||||
title="@freesewing/theo on NPM"
|
||||
><img src="https://img.shields.io/npm/v/@freesewing/theo.svg"
|
||||
alt="@freesewing/theo on NPM"/>
|
||||
</a><a
|
||||
href="https://opensource.org/licenses/MIT"
|
||||
title="License: MIT"
|
||||
><img src="https://img.shields.io/npm/l/@freesewing/theo.svg?label=License"
|
||||
alt="License: MIT"/>
|
||||
</a><a
|
||||
href="https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256"
|
||||
title="Code quality on DeepScan"
|
||||
><img src="https://deepscan.io/api/teams/2114/projects/2993/branches/23256/badge/grade.svg"
|
||||
alt="Code quality on DeepScan"/>
|
||||
</a><a
|
||||
href="https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Atheo"
|
||||
title="Open issues tagged pkg:theo"
|
||||
><img src="https://img.shields.io/github/issues/freesewing/freesewing/pkg:theo.svg?label=Issues"
|
||||
alt="Open issues tagged pkg:theo"/>
|
||||
</a></p><p align='center'><a
|
||||
href="https://twitter.com/freesewing_org"
|
||||
title="Follow @freesewing_org on Twitter"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||
alt="Follow @freesewing_org on Twitter"/>
|
||||
</a><a
|
||||
href="https://gitter.im/freesewing/freesewing"
|
||||
title="Chat with us on Gitter"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||
alt="Chat with us on Gitter"/>
|
||||
</a><a
|
||||
href="https://freesewing.org/patrons/join"
|
||||
title="Become a FreeSewing Patron"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||
alt="Become a FreeSewing Patron"/>
|
||||
</a><a
|
||||
href="https://instagram.com/freesewing_org"
|
||||
title="Follow @freesewing_org on Twitter"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||
alt="Follow @freesewing_org on Twitter"/>
|
||||
</a></p>
|
||||
|
||||
# @freesewing/theo
|
||||
|
||||
A FreeSewing pattern for classic trousers
|
||||
|
||||
|
||||
|
||||
## 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).
|
56
packages/theo/config/index.js
Normal file
56
packages/theo/config/index.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
import { version } from "../package.json";
|
||||
|
||||
export default {
|
||||
name: "theo",
|
||||
version,
|
||||
design: "Joost De Cock",
|
||||
code: "Joost De Cock",
|
||||
department: "menswear",
|
||||
type: "pattern",
|
||||
difficulty: 4,
|
||||
tags: ["trousers", "bottom"],
|
||||
optionGroups: {
|
||||
fit: ["backRise", "wedge"],
|
||||
style: ["waistbandWidth", "lengthBonus", "legWidth"]
|
||||
},
|
||||
measurements: [
|
||||
"hipsCircumference",
|
||||
"seatCircumference",
|
||||
"inseam",
|
||||
"seatDepth",
|
||||
"kneeCircumference"
|
||||
],
|
||||
dependencies: {},
|
||||
inject: {
|
||||
front: "back",
|
||||
waistbandLeft: "waistbandInterfacingLeft",
|
||||
waistbandRight: "waistbandInterfacingRight",
|
||||
waistbandLiningLeft: "waistbandInterfacingLeft",
|
||||
waistbandLiningRight: "waistbandInterfacingRight",
|
||||
flyPiece: "front",
|
||||
flyShield: "flyPiece",
|
||||
sidePiece: "front",
|
||||
frontPocketBag: "front",
|
||||
backOuterPocketBag: "backInnerPocketBag",
|
||||
backPocketInterfacing: "backPocketFacing"
|
||||
},
|
||||
hide: [],
|
||||
parts: [
|
||||
"waistbandInterfacingLeft",
|
||||
"waistbandInterfacingRight",
|
||||
"backPocketFacing",
|
||||
"beltLoop"
|
||||
],
|
||||
options: {
|
||||
// Constants
|
||||
|
||||
// Millimeter
|
||||
waistbandWidth: { mm: 40, min: 5, max: 80 },
|
||||
|
||||
// Percentages
|
||||
legWidth: { pct: 10, min: 0, max: 30 },
|
||||
backRise: { pct: 3.5, min: 0.5, max: 8 },
|
||||
lengthBonus: { pct: 0, min: -10, max: 10 },
|
||||
wedge: { pct: 0, min: -3, max: 3 }
|
||||
}
|
||||
};
|
10
packages/theo/example/.babelrc
Normal file
10
packages/theo/example/.babelrc
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"plugins": [
|
||||
["prismjs", {
|
||||
"languages": ["javascript", "css", "markup"],
|
||||
"plugins": ["line-numbers"],
|
||||
"theme": "twilight",
|
||||
"css": true
|
||||
}]
|
||||
]
|
||||
}
|
96
packages/theo/example/README.md
Normal file
96
packages/theo/example/README.md
Normal file
|
@ -0,0 +1,96 @@
|
|||
<p align="center">
|
||||
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
|
||||
<br>
|
||||
<a href="https://freesewing.org/">FreeSewing v2</a>
|
||||
</p>
|
||||
<p align="center">A JavaScript library for made-to-measure sewing patterns</p>
|
||||
<p align='center'><a
|
||||
href="https://twitter.com/freesewing_org"
|
||||
title="Follow @freesewing_org on Twitter"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-blue.svg?logo=twitter&logoColor=white&logoWidth=15"
|
||||
alt="Follow @freesewing_org on Twitter"/>
|
||||
</a><a
|
||||
href="https://gitter.im/freesewing/freesewing"
|
||||
title="Chat with us on Gitter"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Chat%20with%20us-CA0547.svg?logo=gitter&logoColor=white&logoWidth=15"
|
||||
alt="Chat with us on Gitter"/>
|
||||
</a><a
|
||||
href="https://freesewing.org/patrons/join"
|
||||
title="Become a FreeSewing Patron"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Support%20us-blueviolet.svg?logo=cash-app&logoColor=white&logoWidth=15"
|
||||
alt="Become a FreeSewing Patron"/>
|
||||
</a><a
|
||||
href="https://instagram.com/freesewing_org"
|
||||
title="Follow @freesewing_org on Twitter"
|
||||
><img src="https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15"
|
||||
alt="Follow @freesewing_org on Twitter"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# theo 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://theo.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).
|
||||
|
46
packages/theo/example/package.json
Normal file
46
packages/theo/example/package.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "theo-example",
|
||||
"homepage": "https://freesewing.github.io/theo",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@freesewing/components": "2.0.0-beta.31",
|
||||
"@freesewing/core": "beta",
|
||||
"@freesewing/css-theme": "beta",
|
||||
"@freesewing/i18n": "beta",
|
||||
"@freesewing/models": "beta",
|
||||
"@freesewing/mui-theme": "beta",
|
||||
"@freesewing/pattern-info": "beta",
|
||||
"@freesewing/plugin-bundle": "beta",
|
||||
"@freesewing/plugin-i18n": "beta",
|
||||
"@freesewing/plugin-svgattr": "beta",
|
||||
"@freesewing/utils": "2.0.0-beta.31",
|
||||
"@material-ui/core": "^4.0.1",
|
||||
"@material-ui/icons": "^4.0.1",
|
||||
"@material-ui/lab": "^v4.0.0-alpha.14",
|
||||
"pattern": "link:..",
|
||||
"prismjs": "1.16.0",
|
||||
"react": "^16.8",
|
||||
"react-dom": "^16.8",
|
||||
"react-scripts": "^3.0.0",
|
||||
"typeface-roboto-condensed": "latest"
|
||||
},
|
||||
"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": "1.0.2"
|
||||
}
|
||||
}
|
BIN
packages/theo/example/public/favicon.ico
Normal file
BIN
packages/theo/example/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
40
packages/theo/example/public/index.html
Normal file
40
packages/theo/example/public/index.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is added to the
|
||||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>theo</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
15
packages/theo/example/public/manifest.json
Normal file
15
packages/theo/example/public/manifest.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"short_name": "theo",
|
||||
"name": "theo",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
22
packages/theo/example/src/App.js
Normal file
22
packages/theo/example/src/App.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import React from "react";
|
||||
import freesewing from "@freesewing/core";
|
||||
import Workbench from "@freesewing/components/Workbench";
|
||||
import "typeface-roboto-condensed";
|
||||
import "@freesewing/css-theme";
|
||||
|
||||
import Pattern from "pattern";
|
||||
|
||||
const App = props => {
|
||||
let instance = new Pattern();
|
||||
let config = instance.config;
|
||||
return (
|
||||
<Workbench
|
||||
freesewing={freesewing}
|
||||
Pattern={Pattern}
|
||||
config={config}
|
||||
userLanguage="en"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
11
packages/theo/example/src/index.js
Normal file
11
packages/theo/example/src/index.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import App from "./App";
|
||||
import * as serviceWorker from "./serviceWorker";
|
||||
|
||||
ReactDOM.render(<App />, 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();
|
127
packages/theo/example/src/serviceWorker.js
Normal file
127
packages/theo/example/src/serviceWorker.js
Normal file
|
@ -0,0 +1,127 @@
|
|||
// 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();
|
||||
});
|
||||
}
|
||||
}
|
10572
packages/theo/example/yarn.lock
Normal file
10572
packages/theo/example/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
90
packages/theo/package.json
Normal file
90
packages/theo/package.json
Normal file
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"name": "@freesewing/theo",
|
||||
"version": "2.0.0-beta.31",
|
||||
"description": "A FreeSewing pattern for classic trousers",
|
||||
"author": "Joost De Cock <joost@decock.org> (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": "npm run clean && rollup -c",
|
||||
"test": "echo \"theo: No tests configured. Perhaps you'd like to do this?\" && exit 0",
|
||||
"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\""
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@freesewing/core": "^2.0.0-beta.31",
|
||||
"@freesewing/plugin-bundle": "^2.0.0-beta.31"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"react": "^16.8",
|
||||
"react-dom": "^16.8",
|
||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||
"babel-eslint": "10.0.1",
|
||||
"eslint": "^5.16.0",
|
||||
"babel-jest": "24.7.1",
|
||||
"jest": "24.7.1",
|
||||
"@freesewing/components": "^2.0.0-beta.31",
|
||||
"@freesewing/css-theme": "^2.0.0-beta.31",
|
||||
"@freesewing/i18n": "^2.0.0-beta.31",
|
||||
"@freesewing/mui-theme": "^2.0.0-beta.31",
|
||||
"@freesewing/patterns": "^2.0.0-beta.31",
|
||||
"@freesewing/plugin-bust": "^2.0.0-beta.31",
|
||||
"@freesewing/plugin-buttons": "^2.0.0-beta.31",
|
||||
"@freesewing/plugin-flip": "^2.0.0-beta.31",
|
||||
"@freesewing/utils": "^2.0.0-beta.31",
|
||||
"@svgr/rollup": "^2.4.1",
|
||||
"cross-env": "^5.1.4",
|
||||
"gh-pages": "^1.2.0",
|
||||
"react-scripts": "^3.0.0",
|
||||
"webpack": "4.29.6",
|
||||
"rollup": "^0.64.1",
|
||||
"rollup-plugin-babel": "^4.0.1",
|
||||
"rollup-plugin-babel-minify": "^7.0.0",
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
"rollup-plugin-json": "^3.1.0",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^1.6.2",
|
||||
"rollup-plugin-url": "^1.4.0",
|
||||
"@material-ui/core": "4.0.1",
|
||||
"@material-ui/icons": "4.0.1",
|
||||
"@material-ui/lab": "^v4.0.0-alpha.14",
|
||||
"react-intl": "2.8.0",
|
||||
"prop-types": "15.7.2"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package.json"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"tag": "beta"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0",
|
||||
"npm": ">=5"
|
||||
}
|
||||
}
|
59
packages/theo/rollup.config.js
Normal file
59
packages/theo/rollup.config.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
import babel from "rollup-plugin-babel";
|
||||
import resolve from "rollup-plugin-node-resolve";
|
||||
import commonjs from "rollup-plugin-commonjs";
|
||||
import json from "rollup-plugin-json";
|
||||
import minify from "rollup-plugin-babel-minify";
|
||||
import yaml from "rollup-plugin-yaml";
|
||||
import url from "rollup-plugin-url";
|
||||
import postcss from "rollup-plugin-postcss";
|
||||
import svgr from "@svgr/rollup";
|
||||
import peerDepsExternal from "rollup-plugin-peer-deps-external";
|
||||
import {
|
||||
name,
|
||||
version,
|
||||
description,
|
||||
author,
|
||||
license,
|
||||
main,
|
||||
module
|
||||
} from "./package.json";
|
||||
|
||||
const output = [
|
||||
{
|
||||
file: main,
|
||||
format: "cjs",
|
||||
sourcemap: true
|
||||
}
|
||||
];
|
||||
if (typeof module !== "undefined")
|
||||
output.push({
|
||||
file: module,
|
||||
format: "es",
|
||||
sourcemap: true
|
||||
});
|
||||
|
||||
export default {
|
||||
input: "src/index.js",
|
||||
output,
|
||||
plugins: [
|
||||
peerDepsExternal(),
|
||||
resolve({ modulesOnly: true }),
|
||||
url(),
|
||||
commonjs(),
|
||||
json(),
|
||||
yaml(),
|
||||
svgr(),
|
||||
postcss({
|
||||
modules: true
|
||||
}),
|
||||
babel({
|
||||
exclude: "node_modules/**",
|
||||
plugins: ["@babel/plugin-proposal-object-rest-spread"]
|
||||
}),
|
||||
minify({
|
||||
comments: false,
|
||||
sourceMap: true,
|
||||
banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||
})
|
||||
]
|
||||
};
|
97
packages/theo/src/back-inner-pocket-bag.js
Normal file
97
packages/theo/src/back-inner-pocket-bag.js
Normal file
|
@ -0,0 +1,97 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
macro,
|
||||
measurements,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
let width = measurements.hipsCircumference * 0.16;
|
||||
let height = width * 1.43;
|
||||
|
||||
points.topRight = new Point(width / 2, 0);
|
||||
points.topLeft = points.topRight.flipX();
|
||||
points.bottomRight = new Point(width / 2, height);
|
||||
points.bottomLeft = points.bottomRight.flipX();
|
||||
points.weltLeft = new Point(
|
||||
points.topLeft.x + 15,
|
||||
points.topLeft.y + width / 3
|
||||
);
|
||||
points.weltRight = new Point(
|
||||
points.topRight.x - 15,
|
||||
points.topRight.y + width / 3
|
||||
);
|
||||
|
||||
macro("round", {
|
||||
from: points.topLeft,
|
||||
to: points.bottomRight,
|
||||
via: points.bottomLeft,
|
||||
radius: width / 12,
|
||||
prefix: "left"
|
||||
});
|
||||
macro("round", {
|
||||
from: points.bottomLeft,
|
||||
to: points.topRight,
|
||||
via: points.bottomRight,
|
||||
radius: width / 12,
|
||||
prefix: "right"
|
||||
});
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.leftStart)
|
||||
.curve(points.leftCp1, points.leftCp2, points.leftEnd)
|
||||
.line(points.rightStart)
|
||||
.curve(points.rightCp1, points.rightCp2, points.rightEnd)
|
||||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.attr("class", "lining");
|
||||
paths.welt = new Path()
|
||||
.move(points.weltLeft)
|
||||
.line(points.weltRight)
|
||||
.attr("class", "lining dashed");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "lining sa");
|
||||
points.title = new Point(0, height / 2);
|
||||
macro("title", { at: points.title, title: "backInnerPocketBag", nr: 10 });
|
||||
points.grainlineTop = new Point(width / -3, 0);
|
||||
points.grainlineBottom = new Point(width / -3, height);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["weltLeft", "weltRight"]
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points.weltLeft,
|
||||
to: points.weltRight,
|
||||
y: points.weltLeft.y + 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.leftStart,
|
||||
to: points.rightEnd,
|
||||
y: points.leftEnd.y + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.rightStart,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
44
packages/theo/src/back-outer-pocket-bag.js
Normal file
44
packages/theo/src/back-outer-pocket-bag.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
macro,
|
||||
measurements,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
// Make bag 2cm longer
|
||||
points.topRight = points.topRight.shift(90, 20);
|
||||
points.topLeft = points.topLeft.shift(90, 20);
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.leftStart)
|
||||
.curve(points.leftCp1, points.leftCp2, points.leftEnd)
|
||||
.line(points.rightStart)
|
||||
.curve(points.rightCp1, points.rightCp2, points.rightEnd)
|
||||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.attr("class", "lining");
|
||||
paths.welt = new Path()
|
||||
.move(points.weltLeft)
|
||||
.line(points.weltRight)
|
||||
.attr("class", "lining dashed");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "lining sa");
|
||||
macro("title", { at: points.title, title: "backInnerPocketBag", nr: 11 });
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
80
packages/theo/src/back-pocket-facing.js
Normal file
80
packages/theo/src/back-pocket-facing.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
macro,
|
||||
measurements,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
let width = measurements.hipsCircumference * 0.16;
|
||||
let height = width / 2;
|
||||
|
||||
points.topRight = new Point(width / 2, 0);
|
||||
points.topLeft = points.topRight.flipX();
|
||||
points.bottomRight = new Point(width / 2, height);
|
||||
points.bottomLeft = points.bottomRight.flipX();
|
||||
points.weltLeft = new Point(
|
||||
points.topLeft.x + 15,
|
||||
points.topLeft.y + height / 2
|
||||
);
|
||||
points.weltRight = new Point(
|
||||
points.topRight.x - 15,
|
||||
points.topRight.y + height / 2
|
||||
);
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
.line(points.bottomRight)
|
||||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
paths.welt = new Path()
|
||||
.move(points.weltLeft)
|
||||
.line(points.weltRight)
|
||||
.attr("class", "fabric dashed");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5);
|
||||
macro("title", { at: points.title, title: "backPocketFacing", nr: 12 });
|
||||
points.grainlineTop = points.topLeft.shiftFractionTowards(
|
||||
points.topRight,
|
||||
0.2
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.bottomLeft.y
|
||||
);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["weltLeft", "weltRight"]
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points.bottomLeft,
|
||||
to: points.bottomRight,
|
||||
y: points.bottomLeft.y + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.bottomRight,
|
||||
to: points.topRight,
|
||||
x: points.bottomRight.x + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
32
packages/theo/src/back-pocket-interfacing.js
Normal file
32
packages/theo/src/back-pocket-interfacing.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
macro,
|
||||
measurements,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
paths.seam.attributes.set("class", "interfacing");
|
||||
paths.welt.attributes.set("class", "interfacing dashed");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "backPocketInterfacing",
|
||||
nr: 13
|
||||
});
|
||||
macro("grainline", false);
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
467
packages/theo/src/back.js
Normal file
467
packages/theo/src/back.js
Normal file
|
@ -0,0 +1,467 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
utils,
|
||||
units,
|
||||
measurements,
|
||||
snippets,
|
||||
Snippet
|
||||
} = part.shorthand();
|
||||
|
||||
const calculateSlashCorner = () => {
|
||||
points[901] = utils.beamsIntersect(
|
||||
points[20],
|
||||
points[19],
|
||||
points[26],
|
||||
points[4]
|
||||
);
|
||||
points[902] = points[901].clone();
|
||||
const step = -0.1;
|
||||
let i = 0;
|
||||
while (points[901].dist(points[902]) < 25) {
|
||||
i++;
|
||||
points[902] = points[901].rotate(i * step, points[26]);
|
||||
}
|
||||
|
||||
return i * step;
|
||||
};
|
||||
|
||||
// Store
|
||||
store.set("lengthBonus", measurements.inseam * options.lengthBonus);
|
||||
store.set(
|
||||
"backReduction",
|
||||
(measurements.hipsCircumference / -4) * options.wedge
|
||||
);
|
||||
store.set(
|
||||
"legWidth",
|
||||
(measurements.kneeCircumference * (1 + options.legWidth)) / 2
|
||||
);
|
||||
store.set("backRise", measurements.hipsCircumference * options.backRise);
|
||||
|
||||
// Points
|
||||
points[0] = new Point(0, 0);
|
||||
points[1] = new Point(0, measurements.seatDepth - options.waistbandWidth);
|
||||
points[2] = new Point(
|
||||
0,
|
||||
points[1].y + measurements.inseam + store.get("lengthBonus")
|
||||
);
|
||||
points[201] = points[2].shift(-90, 10);
|
||||
points[202] = new Point(store.get("legWidth") / 4, points[201].y);
|
||||
points[203] = points[202].flipX();
|
||||
points[3] = new Point(0, points[1].y + measurements.inseam / 2 + 50);
|
||||
points[4] = new Point(0, points[1].y - measurements.seatDepth / 4);
|
||||
points[5] = new Point(10 - measurements.seatCircumference / 8, points[1].y);
|
||||
points[9] = new Point(
|
||||
points[5].x -
|
||||
measurements.seatCircumference / 16 -
|
||||
5 +
|
||||
store.get("backReduction"),
|
||||
points[5].y
|
||||
);
|
||||
points[16] = new Point(
|
||||
points[5].x - points[1].dx(points[5]) / 4,
|
||||
points[5].y
|
||||
);
|
||||
points[1601] = points[16].shift(135, 45);
|
||||
points[1602] = points[1601].shift(45, 25);
|
||||
points[1603] = points[1601].shift(-135, 45);
|
||||
points[17] = new Point(points[16].x, points[4].y);
|
||||
points[18] = new Point(points[16].x, 0);
|
||||
points[19] = new Point(
|
||||
points[16].x,
|
||||
points[16].y + points[16].dy(points[18]) / 2
|
||||
);
|
||||
points[20] = new Point(points[18].x + 20, points[18].y);
|
||||
points[1901] = points[20].shiftOutwards(points[19], 25);
|
||||
points[21] = points[19].shiftOutwards(points[20], 10);
|
||||
points[22] = new Point(
|
||||
points[9].x + points[5].dx(points[9]) / 2 - 5 + store.get("backReduction"),
|
||||
points[9].y
|
||||
);
|
||||
points[23] = new Point(points[22].x, points[22].y + 5);
|
||||
points[24] = new Point(
|
||||
points[20].x + measurements.hipsCircumference / 4 + 45,
|
||||
points[20].y
|
||||
);
|
||||
points[25] = points[21].shiftFractionTowards(points[24], 0.5);
|
||||
points[2501] = points[25].shiftTowards(points[24], 120);
|
||||
points[2502] = points[2501].rotate(-90, points[25]);
|
||||
points[2503] = points[25].shiftTowards(points[24], 12.5);
|
||||
points[2504] = points[25].shiftTowards(points[21], 12.5);
|
||||
points[26] = new Point(
|
||||
points[17].x + measurements.seatCircumference / 4 + 30,
|
||||
points[17].y
|
||||
);
|
||||
points[2601] = points[24].shiftFractionTowards(points[26], 1, 4);
|
||||
points[27] = new Point(
|
||||
points[2].x + store.get("legWidth") / 2 + 20,
|
||||
points[2].y
|
||||
);
|
||||
points[2701] = new Point(points[27].x, points[27].y - 50);
|
||||
points[2702] = points[2701].flipX();
|
||||
points[28] = points[27].flipX();
|
||||
points[29] = new Point(
|
||||
points[3].x + store.get("legWidth") / 2 + 15 + 20,
|
||||
points[3].y
|
||||
);
|
||||
points[2901] = points[27].shiftFractionTowards(points[29], 1.6);
|
||||
points[30] = points[29].flipX();
|
||||
points[3001] = points[28].shiftFractionTowards(points[30], 1.6);
|
||||
|
||||
// Slash and rotate around point 26
|
||||
let corner = calculateSlashCorner();
|
||||
const rotateThese = [24, 2501, 2502, 2503, 2504, 25, 21, 20, 19, 1901, 2601];
|
||||
for (let id of rotateThese) {
|
||||
let newId = "90" + id;
|
||||
points[newId] = points[id].rotate(corner, points[26]);
|
||||
}
|
||||
|
||||
// These need to be moved 1cm to the left as per instructions after slash
|
||||
points[901601] = points[1601].shift(180, 10);
|
||||
points[901602] = points[1602].shift(180, 10);
|
||||
points[901603] = points[1603].shift(180, 10);
|
||||
// Add endpoint for pleat line
|
||||
points[900] = utils.beamsIntersect(
|
||||
points[9021],
|
||||
points[9024],
|
||||
points[0],
|
||||
points[1]
|
||||
);
|
||||
|
||||
// Points without seam allowance
|
||||
points[-21] = points[9021].shiftTowards(points[902504], 10);
|
||||
points[-2101] = points[-21].shift(points[9020].angle(points[9021]), -10);
|
||||
points[-24] = points[9024].shiftTowards(points[9021], 10);
|
||||
points[-2104] = points[-24].shift(points[9024].angle(points[26]), 10);
|
||||
points[-2501] = points[902504].shiftTowards(points[902502], 10);
|
||||
points[-2502] = points[902503].shiftTowards(points[902502], 10);
|
||||
points[-2503] = points[902504].shiftTowards(points[902502], 60);
|
||||
points[-2504] = points[902503].shiftTowards(points[902502], 60);
|
||||
points[-26] = points[26].shift(points[9024].angle(points[9021]), 10);
|
||||
points[-2601] = points[-2104].shiftFractionTowards(points[-26], 1.4);
|
||||
points[-2901] = points[2901].shift(points[2901].angle(points[29]) - 90, 10);
|
||||
points[-29] = points[29].shift(points[2901].angle(points[29]) - 90, 10);
|
||||
points[-2701] = points[2701].shift(180, 10);
|
||||
|
||||
points[-27] = new Path()
|
||||
.move(points[27])
|
||||
._curve(points[202], points[201])
|
||||
.shiftAlong(10);
|
||||
points[-28] = points[-27].flipX();
|
||||
points[-2702] = points[-2701].flipX();
|
||||
points[-30] = points[-29].flipX();
|
||||
points[-3001] = points[3001].shift(points[30].angle(points[3001]) + 90, -10);
|
||||
points[-23] = new Path()
|
||||
.move(points[23])
|
||||
._curve(points[901603], points[901601])
|
||||
.shiftAlong(10);
|
||||
points[-2301] = new Path()
|
||||
.move(points[-23])
|
||||
._curve(points[-3001], points[-30])
|
||||
.shiftAlong(10);
|
||||
points[-900] = new Point(points[900].x, points[900].y + 10);
|
||||
points[-901603] = points[901603].shift(
|
||||
points[901603].angle(points[901601]) + 90,
|
||||
-10
|
||||
);
|
||||
points[-901601] = points[901601].shift(
|
||||
points[901603].angle(points[901601]) + 90,
|
||||
-10
|
||||
);
|
||||
points[-901602] = points[901602].shift(
|
||||
points[901603].angle(points[901601]) + 90,
|
||||
-10
|
||||
);
|
||||
points[-901901] = points[901901].shift(
|
||||
points[901601].angle(points[9019]) + 90,
|
||||
-10
|
||||
);
|
||||
points[-9019] = points[9019].shift(
|
||||
points[901901].angle(points[9019]) + 90,
|
||||
-10
|
||||
);
|
||||
|
||||
// Extra SA at back seam
|
||||
points[9021] = points[-21].shift(points[-2501].angle(points[-2101]), 40);
|
||||
|
||||
// Extra SA at hem
|
||||
points[-2710] = points[-27].shift(-90, 60);
|
||||
points[-2810] = points[-2710].flipX();
|
||||
points[-20110] = points[201].shift(-90, 60);
|
||||
points[-20210] = points[202].shift(-90, 60);
|
||||
points[-20310] = points[203].shift(-90, 60);
|
||||
|
||||
// Raise waistband
|
||||
points[66601] = points[-2101].shiftTowards(
|
||||
points[-21],
|
||||
store.get("backRise")
|
||||
);
|
||||
|
||||
// Original dart without raise
|
||||
points[66602] = utils.beamsIntersect(
|
||||
points[66601],
|
||||
points[-2104],
|
||||
points[902502],
|
||||
points[-2501]
|
||||
);
|
||||
points[66603] = utils.beamsIntersect(
|
||||
points[66601],
|
||||
points[-2104],
|
||||
points[902502],
|
||||
points[-2502]
|
||||
);
|
||||
points[66605] = points[-2101].shiftTowards(
|
||||
points[-21],
|
||||
store.get("backRise") + 10
|
||||
);
|
||||
points[66606] = new Point(
|
||||
points[66602].x + points[66601].dx(points[66605]),
|
||||
points[66602].y + points[66601].dy(points[66605])
|
||||
);
|
||||
points[66607] = utils.beamsIntersect(
|
||||
points[66606],
|
||||
points[66605],
|
||||
points[901601],
|
||||
points[9021]
|
||||
);
|
||||
|
||||
// Construct the back dart with raise
|
||||
points.dartTop = points[66601].shiftFractionTowards(points[-2104], 0.5);
|
||||
points.dartTip = points.dartTop.shift(
|
||||
points[-2104].angle(points[66601]) + 90,
|
||||
points.dartTop.dist(points[902502])
|
||||
);
|
||||
points.dartTopLeft = points.dartTop.shiftTowards(
|
||||
points[66601],
|
||||
points[66602].dist(points[66603]) / 2
|
||||
);
|
||||
points.dartTopRight = points.dartTop.shiftTowards(
|
||||
points[-2104],
|
||||
points[66602].dist(points[66603]) / 2
|
||||
);
|
||||
|
||||
// Reconstruct back pocket with raise
|
||||
points.pocketCenterLeft = points.dartTopLeft.shiftTowards(points.dartTip, 60);
|
||||
points.pocketCenterRight = points.dartTopRight.shiftTowards(
|
||||
points.dartTip,
|
||||
60
|
||||
);
|
||||
points.pocketEdgeLeft = points.pocketCenterLeft.shift(
|
||||
points.pocketCenterLeft.angle(points.dartTip) - 90,
|
||||
70
|
||||
);
|
||||
points.pocketEdgeRight = points.pocketCenterRight.shift(
|
||||
points.pocketCenterRight.angle(points.dartTip) + 90,
|
||||
70
|
||||
);
|
||||
|
||||
// Extend back pleat to include rise
|
||||
points[-900] = utils.beamsIntersect(
|
||||
points[900],
|
||||
points[-900],
|
||||
points[66601],
|
||||
points[66602]
|
||||
);
|
||||
|
||||
// Paths
|
||||
// This is the original Aldrich path, which includes seam allowance
|
||||
paths.aldrich = new Path()
|
||||
.move(points[23])
|
||||
._curve(points[901603], points[901601])
|
||||
.curve(points[901602], points[901901], points[9019])
|
||||
.line(points[9021])
|
||||
.line(points[902504])
|
||||
.line(points[902502])
|
||||
.line(points[902503])
|
||||
.line(points[9024])
|
||||
.line(points[26])
|
||||
.curve(points[902601], points[2901], points[29])
|
||||
.curve(points[29], points[2701], points[27])
|
||||
.curve(points[27], points[202], points[201])
|
||||
.curve_(points[203], points[28])
|
||||
.curve_(points[2702], points[30])
|
||||
.curve_(points[3001], points[23])
|
||||
.close();
|
||||
paths.aldrich.render = false;
|
||||
|
||||
// This is the path we use, no seam allowance
|
||||
paths.hemBase = new Path()
|
||||
.move(points[-27])
|
||||
._curve(points[202], points[201])
|
||||
.curve_(points[203], points[-28]);
|
||||
paths.saBase1 = new Path()
|
||||
.move(points[-28])
|
||||
.curve_(points[-2702], points[-30])
|
||||
.curve_(points[-3001], points[-2301])
|
||||
._curve(points[-901603], points[-901601])
|
||||
.curve(points[-901602], points[-901901], points[-9019])
|
||||
.line(points[66601])
|
||||
.line(points.dartTopLeft);
|
||||
paths.saBase2 = new Path()
|
||||
.move(points.dartTopRight)
|
||||
.line(points[-2104])
|
||||
.line(points[-26])
|
||||
.curve(points[-2601], points[-2901], points[-29])
|
||||
.curve(points[-29], points[-2701], points[-27]);
|
||||
paths.seam = paths.saBase1
|
||||
.clone()
|
||||
.line(points.dartTip)
|
||||
.line(points.dartTopRight)
|
||||
.join(paths.saBase2)
|
||||
.join(paths.hemBase)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
paths.hemBase.render = false;
|
||||
paths.saBase1.render = false;
|
||||
paths.saBase2.render = false;
|
||||
|
||||
// Store length of the inseam and side seam
|
||||
store.set(
|
||||
"backInseamLength",
|
||||
new Path()
|
||||
.move(points[-2301])
|
||||
.curve_(points[-3001], points[-30])
|
||||
.length() +
|
||||
new Path()
|
||||
.move(points[30])
|
||||
._curve(points[-2702], points[-28])
|
||||
.length()
|
||||
);
|
||||
store.set(
|
||||
"backSideseamLength",
|
||||
points[-2104].dist(points[-26]) +
|
||||
new Path()
|
||||
.move(points[-26])
|
||||
.curve(points[-2601], points[-2901], points[-29])
|
||||
.length() +
|
||||
new Path()
|
||||
.move(points[-29])
|
||||
._curve(points[-2701], points[-27])
|
||||
.length()
|
||||
);
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
paths.sa = paths.saBase1
|
||||
.offset(-1 * sa)
|
||||
.join(paths.saBase2.offset(-1 * sa))
|
||||
.join(paths.hemBase.offset(-3 * sa))
|
||||
.close()
|
||||
.attr("class", "fabric sa");
|
||||
}
|
||||
paths.pocket = new Path()
|
||||
.move(points.pocketEdgeLeft)
|
||||
.line(points.pocketCenterLeft)
|
||||
.move(points.pocketCenterRight)
|
||||
.line(points.pocketEdgeRight)
|
||||
.attr("class", "fabric dashed");
|
||||
|
||||
points.grainlineTop = new Point(0, points[-2104].y);
|
||||
points.grainlineBottom = points[2].clone();
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = new Point(0, points[-2301].y);
|
||||
macro("title", { at: points.title, title: "back", nr: 1 });
|
||||
points.logo = points.title.shift(-90, 70);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
points.scalebox = points.logo.shift(-90, 70);
|
||||
macro("scalebox", { at: points.scalebox });
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["pocketEdgeLeft", "pocketEdgeRight"]
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("ld", {
|
||||
from: points[66601],
|
||||
to: points.dartTopLeft,
|
||||
d: sa + 15
|
||||
});
|
||||
macro("ld", {
|
||||
from: points.dartTopLeft,
|
||||
to: points.dartTopRight,
|
||||
d: sa + 15
|
||||
});
|
||||
macro("ld", {
|
||||
from: points[66601],
|
||||
to: points[-2104],
|
||||
d: sa + 30
|
||||
});
|
||||
macro("ld", {
|
||||
from: points.pocketEdgeLeft,
|
||||
to: points.pocketCenterLeft,
|
||||
d: 15
|
||||
});
|
||||
macro("ld", {
|
||||
from: points.pocketCenterRight,
|
||||
to: points.pocketEdgeRight,
|
||||
d: 15
|
||||
});
|
||||
macro("ld", {
|
||||
from: points.dartTip,
|
||||
to: points.dartTop,
|
||||
d: 30
|
||||
});
|
||||
macro("ld", {
|
||||
from: points.dartTip,
|
||||
to: points.pocketCenterRight,
|
||||
d: -15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-2301],
|
||||
to: points[66601],
|
||||
y: points[66601].y - sa - 45
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[66601],
|
||||
to: points[-2104],
|
||||
y: points[66601].y - sa - 45
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-2301],
|
||||
to: points[-2104],
|
||||
y: points[66601].y - sa - 60
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[-2301],
|
||||
to: points[66601],
|
||||
x: points[-2301].x - sa - 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[201],
|
||||
to: points[-2301],
|
||||
x: points[-2301].x - sa - 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[201],
|
||||
to: points[66601],
|
||||
x: points[-2301].x - sa - 30
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-28],
|
||||
to: points[-27],
|
||||
y: points[201].y + 3 * sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[-27],
|
||||
to: points[-2104],
|
||||
x: points[-2104].x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
60
packages/theo/src/belt-loop.js
Normal file
60
packages/theo/src/belt-loop.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
options,
|
||||
measurements,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro
|
||||
} = part.shorthand();
|
||||
|
||||
let height = options.waistbandWidth + 30;
|
||||
let width = (height - 30) / 2;
|
||||
|
||||
points.topRight = new Point(width / 2, 0);
|
||||
points.topLeft = points.topRight.flipX();
|
||||
points.bottomRight = new Point(width / 2, height);
|
||||
points.bottomLeft = points.bottomRight.flipX();
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
.line(points.bottomRight)
|
||||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
points.title = new Point(0, height / 2);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "beltLoop",
|
||||
nr: 14,
|
||||
scale: 0.4
|
||||
});
|
||||
points.grainlineTop = points.topLeft.shiftFractionTowards(
|
||||
points.topRight,
|
||||
0.5
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.bottomLeft.y
|
||||
);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
86
packages/theo/src/fly-piece.js
Normal file
86
packages/theo/src/fly-piece.js
Normal file
|
@ -0,0 +1,86 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
snippets,
|
||||
Point,
|
||||
macro,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
// Clean up paths from paperless dimensions
|
||||
for (let id in paths) delete paths[id];
|
||||
|
||||
// We need to split the crotch curve at the bottom of the fly
|
||||
paths.fly = new Path()
|
||||
.move(points[-501])
|
||||
.curve(points[-502], points["-6cp"], points[-6])
|
||||
.split(points[43])
|
||||
.pop();
|
||||
paths.fly.render = false;
|
||||
|
||||
// We need to split the waist curve at the edge of the fly
|
||||
let waist = new Path()
|
||||
.move(points[-100101])
|
||||
.curve_(points[-1002], points[-1102]);
|
||||
points.splitWaist = waist.shiftAlong(points[-100101].dist(points[-40]));
|
||||
paths.waist = waist.split(points.splitWaist).shift();
|
||||
paths.waist.render = false;
|
||||
|
||||
paths.seam = paths.waist
|
||||
.clone()
|
||||
.line(points[41])
|
||||
.curve(points[45], points[44], points[43])
|
||||
.join(paths.fly)
|
||||
.line(points[-100101])
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(sa * -1).attr("class", "fabric sa");
|
||||
points.title = points[9019].clone();
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "flyPiece",
|
||||
nr: 6,
|
||||
scale: 0.7
|
||||
});
|
||||
points.grainlineTop = points[-100101].shiftFractionTowards(
|
||||
points.splitWaist,
|
||||
0.3
|
||||
);
|
||||
points.grainlineBottom = new Point(points.grainlineTop.x, points[41].y);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
delete paths.pocket;
|
||||
delete paths.lining;
|
||||
delete snippets.logo;
|
||||
macro("scalebox", false);
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[-100101],
|
||||
to: points.splitWaist,
|
||||
y: points.splitWaist.y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.flyPretipX,
|
||||
to: points.splitWaist,
|
||||
y: points.splitWaist.y - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.flyPretipX,
|
||||
to: points.splitWaist,
|
||||
x: points.splitWaist.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
59
packages/theo/src/fly-shield.js
Normal file
59
packages/theo/src/fly-shield.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
macro,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
// Add points to make shift not impact curves
|
||||
points.leftTop = points[-100101].shift(180, 20);
|
||||
points.new43 = points[43].shift(180, 20);
|
||||
|
||||
// New path
|
||||
paths.seam = new Path()
|
||||
.move(points.leftTop)
|
||||
.join(paths.waist)
|
||||
.line(points[41])
|
||||
.curve(points[45], points[44], points[43])
|
||||
.line(points.new43)
|
||||
.join(paths.fly.translate(-20, 0))
|
||||
.line(points.leftTop)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(sa * -1).attr("class", "fabric sa");
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "flyShield",
|
||||
nr: 7,
|
||||
scale: 0.7
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points.leftTop,
|
||||
to: points.splitWaist,
|
||||
y: points.splitWaist.y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.new43,
|
||||
to: points.splitWaist,
|
||||
y: points.splitWaist.y - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.new43,
|
||||
to: points.splitWaist,
|
||||
x: points.splitWaist.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
109
packages/theo/src/front-pocket-bag.js
Normal file
109
packages/theo/src/front-pocket-bag.js
Normal file
|
@ -0,0 +1,109 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
snippets,
|
||||
Snippet
|
||||
} = part.shorthand();
|
||||
// Clean up paths from paperless dimensions
|
||||
for (let id in paths) delete paths[id];
|
||||
|
||||
// Additional points
|
||||
points[810] = new Point(points[60].x, points[-1102].y + 300);
|
||||
points[811] = new Point(points[-8].x, points[810].y);
|
||||
points[812] = new Point(points[0].x, points[810].y);
|
||||
points[813] = points[-100101].shiftTowards(points[-6], 70);
|
||||
points[814] = points[813].shift(0, 40);
|
||||
points[815] = new Point(points[0].x, points[814].y);
|
||||
points[816] = new Point(points[-40].x - sa, points[-40].y - sa);
|
||||
points[817] = points[813].shift(0, 30);
|
||||
points[818] = new Point(points[814].x - sa, points[814].y + sa);
|
||||
|
||||
// Paths
|
||||
paths.seam = new Path()
|
||||
.move(points[-100101])
|
||||
.curve_(points[-1002], points[-1102])
|
||||
._curve(points[-801], points[-8])
|
||||
.curve(points[-802], points[811], points[810])
|
||||
.curve(points[812], points[815], points[814])
|
||||
.line(points[813])
|
||||
.line(points[-100101])
|
||||
.close()
|
||||
.attr("class", "lining");
|
||||
|
||||
paths.flyEdge = new Path()
|
||||
.move(points[-40])
|
||||
.line(points[814])
|
||||
.attr("class", "lining lashed");
|
||||
|
||||
paths.pocket = new Path()
|
||||
.move(points[60])
|
||||
.line(points[61])
|
||||
.attr("class", "lining lashed");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(-1 * sa).attr("class", "lining sa");
|
||||
paths.flyEdeSa = new Path()
|
||||
.move(points[816])
|
||||
.line(points[818])
|
||||
.attr("class", "lining sa");
|
||||
}
|
||||
points.title = points.dartTip.clone();
|
||||
macro("title", { at: points.title, title: "frontPocketBag", nr: 9 });
|
||||
points.grainlineTop = points[60].clone();
|
||||
points.grainlineBottom = new Point(points.grainlineTop.x, points[810].y);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.logo = new Point(points[60].x, points[61].y);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
delete paths.fly;
|
||||
delete paths.lining;
|
||||
macro("scalebox", false);
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[813],
|
||||
to: points[-8],
|
||||
y: points.grainlineBottom.y + sa + 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-40],
|
||||
to: points[-8],
|
||||
y: points[-1102].y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-100101],
|
||||
to: points[-8],
|
||||
y: points[-1102].y - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.grainlineBottom,
|
||||
to: points[-1102],
|
||||
x: points[-8].x + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.grainlineBottom,
|
||||
to: points[813],
|
||||
x: points[813].x - sa - 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.grainlineBottom,
|
||||
to: points[-100101],
|
||||
x: points[813].x - sa - 30
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
295
packages/theo/src/front.js
Normal file
295
packages/theo/src/front.js
Normal file
|
@ -0,0 +1,295 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
utils,
|
||||
units,
|
||||
measurements
|
||||
} = part.shorthand();
|
||||
// Clean up paths from paperless dimensions
|
||||
for (let id in paths) delete paths[id];
|
||||
|
||||
points[1] = new Point(
|
||||
points[0].x,
|
||||
measurements.seatDepth - options.waistbandWidth + 10
|
||||
);
|
||||
points[2] = new Point(
|
||||
points[0].x,
|
||||
points[1].y + measurements.inseam + store.get("lengthBonus")
|
||||
);
|
||||
points[3] = new Point(
|
||||
points[0].x,
|
||||
points[1].y + measurements.inseam / 2 + 50
|
||||
);
|
||||
points[4] = new Point(points[0].x, points[1].y - measurements.seatDepth / 4);
|
||||
points[5] = new Point(
|
||||
points[0].x - measurements.seatCircumference / 8 + 10,
|
||||
points[1].y
|
||||
);
|
||||
points[501] = points[5].shift(135, 30);
|
||||
points[502] = points[501].shift(45, 30);
|
||||
points[503] = points[501].shift(-135, 30);
|
||||
points[6] = new Point(points[5].x, points[4].y);
|
||||
points[7] = new Point(points[5].x, points[0].y);
|
||||
points[8] = new Point(
|
||||
points[6].x + measurements.seatCircumference / 4 + 20,
|
||||
points[6].y
|
||||
);
|
||||
points[801] = new Point(
|
||||
points[8].x,
|
||||
points[8].y - measurements.seatDepth / 4
|
||||
);
|
||||
points[802] = new Point(
|
||||
points[8].x,
|
||||
points[8].y + measurements.seatDepth / 4
|
||||
);
|
||||
points[9] = new Point(
|
||||
points[5].x -
|
||||
measurements.seatCircumference / 16 -
|
||||
5 +
|
||||
store.get("backReduction"),
|
||||
points[5].y
|
||||
);
|
||||
points[10] = new Point(points[7].x + 10, points[7].y);
|
||||
points[1001] = points[10].shiftTowards(points[6], 10);
|
||||
points[1002] = new Point(points[0].x, points[1001].y);
|
||||
points[11] = new Point(
|
||||
points[10].x + measurements.hipsCircumference / 4 + 25,
|
||||
points[10].y
|
||||
);
|
||||
points[12] = new Point(points[2].x + store.get("legWidth") / 2, points[2].y);
|
||||
points[1201] = new Point(points[12].x, points[12].y - 50);
|
||||
points[13] = points[12].flipX();
|
||||
points[1301] = points[1201].flipX();
|
||||
points[14] = new Point(
|
||||
points[3].x + store.get("legWidth") / 2 + 15,
|
||||
points[3].y
|
||||
);
|
||||
points[1401] = points[12].shiftOutwards(
|
||||
points[14],
|
||||
points[1].dy(points[3]) / 2
|
||||
);
|
||||
points[1402] = points[1401].flipX();
|
||||
|
||||
points[15] = points[14].flipX();
|
||||
points[40] = new Path()
|
||||
.move(points[1001])
|
||||
.curve_(points[1002], points[11])
|
||||
.shiftAlong(50);
|
||||
points[41] = new Point(
|
||||
points[40].x + points[1001].dx(points[6]),
|
||||
points[40].y + points[1001].dy(points[6])
|
||||
);
|
||||
let tmp = new Path().move(points[6])._curve(points[502], points[501]);
|
||||
points[42] = tmp.shiftAlong(tmp.length() / 2);
|
||||
points[43] = points[42].shift(-35, 10);
|
||||
points["43beam"] = points[42].shift(-35, 40); // We use this to find curve intersection later
|
||||
points[44] = points[43].shift(0, 20);
|
||||
points[45] = points[40].shiftOutwards(points[41], 20);
|
||||
|
||||
points[-1001] = new Path()
|
||||
.move(points[1001])
|
||||
.curve_(points[1002], points[11])
|
||||
.shiftAlong(10);
|
||||
points[-100101] = points[-1001].shift(points[1001].angle(points[6]), 10);
|
||||
points[-1002] = points[1002].shift(90, -10);
|
||||
points[-11] = new Path()
|
||||
.move(points[11])
|
||||
._curve(points[801], points[8])
|
||||
.shiftAlong(10);
|
||||
points[-1101] = new Path()
|
||||
.move(points[11])
|
||||
._curve(points[1002], points[1001])
|
||||
.shiftAlong(10);
|
||||
points[-1102] = new Point(
|
||||
points[-1101].x + points[11].dx(points[-11]),
|
||||
points[-1101].y + points[11].dy(points[-11])
|
||||
);
|
||||
points[-801] = points[801].shift(0, -10);
|
||||
points[-8] = points[8].shift(0, -10);
|
||||
points[-802] = points[802].shift(0, -10);
|
||||
points[-1401] = points[1401].shift(points[1401].angle(points[14]) + 90, -10);
|
||||
points[-14] = points[14].shift(points[1401].angle(points[14]) + 90, -10);
|
||||
points[-1201] = points[1201].shift(0, -10);
|
||||
points[-12] = points[12].shift(0, -10);
|
||||
points[-13] = points[13].shift(0, 10);
|
||||
points[-1301] = points[1301].shift(0, 10);
|
||||
points[-15] = points[-14].flipX();
|
||||
points[-1402] = points[-1401].flipX();
|
||||
points[-901] = new Path()
|
||||
.move(points[9])
|
||||
._curve(points[503], points[501])
|
||||
.shiftAlong(10);
|
||||
points[-902] = new Path()
|
||||
.move(points[9])
|
||||
._curve(points[1402], points[15])
|
||||
.shiftAlong(10);
|
||||
points[-9] = new Point(
|
||||
points[-902].x + points[9].dx(points[-901]),
|
||||
points[-902].y + points[9].dy(points[-901])
|
||||
);
|
||||
points[-501] = points[501].shift(points[503].angle(points[502]) - 90, 10);
|
||||
points[-502] = points[502].shift(points[503].angle(points[502]) - 90, 10);
|
||||
points[-503] = points[503].shift(points[503].angle(points[502]) - 90, 10);
|
||||
points[-6] = points[6].shift(points[6].angle(points[1001]) - 90, 10);
|
||||
points[-40] = points[40].shiftTowards(points[41], 10);
|
||||
|
||||
// Smooth fly curve a bit at -6
|
||||
points["-6cp"] = points[-100101].shiftOutwards(
|
||||
points[-6],
|
||||
points[-6].dist(points[-502]) / 2
|
||||
);
|
||||
|
||||
// Make sure fly ends on curve
|
||||
points.flyPretipX = utils.lineIntersectsCurve(
|
||||
points[42],
|
||||
points["43beam"],
|
||||
points[-501],
|
||||
points[-502],
|
||||
points["-6cp"],
|
||||
points[-6]
|
||||
);
|
||||
points[43] = points.flyPretipX.clone();
|
||||
|
||||
// Slant pocket
|
||||
points[60] = new Path()
|
||||
.move(points[-1102])
|
||||
._curve(points[-1002], points[-100101])
|
||||
.shiftAlong(50);
|
||||
let curve = new Path().move(points[-1102])._curve(points[-801], points[-8]);
|
||||
let len = curve.length();
|
||||
if (len >= 190) points[61] = curve.shiftAlong(190);
|
||||
else
|
||||
points[61] = new Path()
|
||||
.move(points[-8])
|
||||
.curve(points[-802], points[-1401], points[-14])
|
||||
.shiftAlong(190 - len);
|
||||
|
||||
// Paths
|
||||
// This is the original Aldrich path, which includes seam allowance
|
||||
paths.aldrich = new Path()
|
||||
.move(points[9])
|
||||
._curve(points[503], points[501])
|
||||
.curve_(points[502], points[6])
|
||||
.line(points[1001])
|
||||
.curve_(points[1002], points[11])
|
||||
._curve(points[801], points[8])
|
||||
.curve(points[802], points[1401], points[14])
|
||||
._curve(points[1201], points[12])
|
||||
.line(points[13])
|
||||
.curve_(points[1301], points[15])
|
||||
.curve_(points[1402], points[9])
|
||||
.close();
|
||||
|
||||
// This is the path we use, no seam allowance
|
||||
paths.hemBase = new Path().move(points[-12]).line(points[-13]);
|
||||
paths.saBase = new Path()
|
||||
.move(points[-13])
|
||||
.curve_(points[-1301], points[-15])
|
||||
.curve_(points[-1402], points[-9])
|
||||
._curve(points[-503], points[-501])
|
||||
.curve(points[-502], points["-6cp"], points[-6])
|
||||
.line(points[-100101])
|
||||
.curve_(points[-1002], points[-1102])
|
||||
._curve(points[-801], points[-8])
|
||||
.curve(points[-802], points[-1401], points[-14])
|
||||
._curve(points[-1201], points[-12]);
|
||||
|
||||
paths.seam = paths.hemBase
|
||||
.clone()
|
||||
.join(paths.saBase)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
|
||||
paths.aldrich.render = false;
|
||||
paths.hemBase.render = false;
|
||||
paths.saBase.render = false;
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
paths.sa = paths.hemBase
|
||||
.offset(-3 * sa)
|
||||
.join(paths.saBase.offset(-1 * sa))
|
||||
.close()
|
||||
.attr("class", "fabric sa");
|
||||
}
|
||||
paths.fly = new Path()
|
||||
.move(points[43])
|
||||
.curve(points[44], points[45], points[41])
|
||||
.line(points[-40])
|
||||
.attr("class", "fabric dashed");
|
||||
paths.pocket = new Path()
|
||||
.move(points[60])
|
||||
.line(points[61])
|
||||
.attr("class", "fabric dashed");
|
||||
paths.lining = new Path()
|
||||
.move(points[-14])
|
||||
.line(points[-15])
|
||||
.attr("class", "lining dashed");
|
||||
macro("title", { at: points.title, title: "front", nr: 2 });
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [60, 61, 43]
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[-9],
|
||||
to: points[-100101],
|
||||
y: points[-1102].y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-100101],
|
||||
to: points[-1102],
|
||||
y: points[-1102].y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-9],
|
||||
to: points[-1102],
|
||||
y: points[-1102].y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-9],
|
||||
to: points[-8],
|
||||
y: points[-1102].y - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[-9],
|
||||
to: points[-100101],
|
||||
x: points[-9].x - sa - 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[-9],
|
||||
to: points[-1102],
|
||||
x: points[-9].x - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[-13],
|
||||
to: points[-9],
|
||||
x: points[-9].x - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[-12],
|
||||
to: points[-1102],
|
||||
x: points[-8].x + sa + 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points[-13],
|
||||
to: points[-12],
|
||||
y: points[-12].y + 3 * sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
63
packages/theo/src/index.js
Normal file
63
packages/theo/src/index.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
import freesewing from "@freesewing/core";
|
||||
import plugins from "@freesewing/plugin-bundle";
|
||||
import config from "../config";
|
||||
// Parts
|
||||
import draftBack from "./back";
|
||||
import draftFront from "./front";
|
||||
import draftWaistbandInterfacingLeft from "./waistband-interfacing-left";
|
||||
import draftWaistbandInterfacingRight from "./waistband-interfacing-right";
|
||||
import draftWaistbandLeft from "./waistband-left";
|
||||
import draftWaistbandRight from "./waistband-right";
|
||||
import draftWaistbandLiningLeft from "./waistband-lining-left";
|
||||
import draftWaistbandLiningRight from "./waistband-lining-right";
|
||||
import draftFlyPiece from "./fly-piece";
|
||||
import draftFlyShield from "./fly-shield";
|
||||
import draftSidePiece from "./side-piece";
|
||||
import draftFrontPocketBag from "./front-pocket-bag";
|
||||
import draftBackInnerPocketBag from "./back-inner-pocket-bag";
|
||||
import draftBackOuterPocketBag from "./back-outer-pocket-bag";
|
||||
import draftBackPocketFacing from "./back-pocket-facing";
|
||||
import draftBackPocketInterfacing from "./back-pocket-interfacing";
|
||||
import draftBeltLoop from "./belt-loop";
|
||||
|
||||
// Create design
|
||||
const Pattern = new freesewing.Design(config, plugins);
|
||||
|
||||
// Attach draft methods to prototype
|
||||
let methods = [
|
||||
draftBack,
|
||||
draftFront,
|
||||
draftWaistbandInterfacingLeft,
|
||||
draftWaistbandInterfacingRight,
|
||||
draftWaistbandLiningLeft,
|
||||
draftWaistbandLiningRight,
|
||||
draftWaistbandLeft,
|
||||
draftWaistbandRight
|
||||
];
|
||||
|
||||
Pattern.prototype.draftBack = part => draftBack(part);
|
||||
Pattern.prototype.draftFront = part => draftFront(part);
|
||||
Pattern.prototype.draftWaistbandInterfacingLeft = part =>
|
||||
draftWaistbandInterfacingLeft(part);
|
||||
Pattern.prototype.draftWaistbandInterfacingRight = part =>
|
||||
draftWaistbandInterfacingRight(part);
|
||||
Pattern.prototype.draftWaistbandLiningLeft = part =>
|
||||
draftWaistbandLiningLeft(part);
|
||||
Pattern.prototype.draftWaistbandLiningRight = part =>
|
||||
draftWaistbandLiningRight(part);
|
||||
Pattern.prototype.draftWaistbandLeft = part => draftWaistbandLeft(part);
|
||||
Pattern.prototype.draftWaistbandRight = part => draftWaistbandRight(part);
|
||||
Pattern.prototype.draftFlyPiece = part => draftFlyPiece(part);
|
||||
Pattern.prototype.draftFlyShield = part => draftFlyShield(part);
|
||||
Pattern.prototype.draftSidePiece = part => draftSidePiece(part);
|
||||
Pattern.prototype.draftFrontPocketBag = part => draftFrontPocketBag(part);
|
||||
Pattern.prototype.draftBackInnerPocketBag = part =>
|
||||
draftBackInnerPocketBag(part);
|
||||
Pattern.prototype.draftBackOuterPocketBag = part =>
|
||||
draftBackOuterPocketBag(part);
|
||||
Pattern.prototype.draftBackPocketFacing = part => draftBackPocketFacing(part);
|
||||
Pattern.prototype.draftBackPocketInterfacing = part =>
|
||||
draftBackPocketInterfacing(part);
|
||||
Pattern.prototype.draftBeltLoop = part => draftBeltLoop(part);
|
||||
|
||||
export default Pattern;
|
109
packages/theo/src/side-piece.js
Normal file
109
packages/theo/src/side-piece.js
Normal file
|
@ -0,0 +1,109 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
macro,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
snippets
|
||||
} = part.shorthand();
|
||||
// Clean up paths from paperless dimensions
|
||||
for (let id in paths) delete paths[id];
|
||||
delete snippets.logo;
|
||||
|
||||
// Add points
|
||||
points.topLeft = new Path()
|
||||
.move(points[-1102])
|
||||
._curve(points[-1002], points[-100101])
|
||||
.shiftAlong(100);
|
||||
points.bottomLeft = points[61].shift(180, 50);
|
||||
|
||||
// Split waist curve
|
||||
paths.waist = new Path()
|
||||
.move(points[-1102])
|
||||
._curve(points[-1002], points[-100101])
|
||||
.split(points.topLeft)
|
||||
.shift();
|
||||
paths.waist.render = false;
|
||||
|
||||
// Split side curve
|
||||
paths.side = new Path()
|
||||
.move(points[-8])
|
||||
.curve(points[-802], points[-1401], points[-14])
|
||||
.split(points[61])
|
||||
.shift()
|
||||
.reverse();
|
||||
paths.side.render = false;
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
.line(points[61])
|
||||
.join(paths.side)
|
||||
.curve_(points[-801], points[-1102])
|
||||
.join(paths.waist)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
paths.pocket = new Path()
|
||||
.move(points[60])
|
||||
.line(points[61])
|
||||
.attr("class", "fabric stroke-sm lashed");
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
||||
macro("scalebox", false);
|
||||
delete paths.fly;
|
||||
delete paths.lining;
|
||||
points.grainlineTop = points[60].clone();
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.bottomLeft.y
|
||||
);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = points[-801].shift(180, 40);
|
||||
macro("title", { at: points.title, title: "sidePiece", nr: 8 });
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points[-1102],
|
||||
y: points[-1102].y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points[-8],
|
||||
y: points[-1102].y - sa - 30
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.bottomLeft,
|
||||
to: points[61],
|
||||
y: points.bottomLeft.y + sa + 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.bottomLeft,
|
||||
to: points[-8],
|
||||
y: points.bottomLeft.y + sa + 30
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.bottomLeft,
|
||||
to: points.topLeft,
|
||||
x: points.topLeft.x - sa - 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.bottomLeft,
|
||||
to: points[-1102],
|
||||
x: points.topLeft.x - sa - 30
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
62
packages/theo/src/waistband-interfacing-left.js
Normal file
62
packages/theo/src/waistband-interfacing-left.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
measurements,
|
||||
macro,
|
||||
snippets,
|
||||
Snippet
|
||||
} = part.shorthand();
|
||||
|
||||
points[0] = new Point(0, 0);
|
||||
points[2] = new Point(
|
||||
options.waistbandWidth,
|
||||
measurements.hipsCircumference / 2 + 60
|
||||
);
|
||||
points[1] = new Point(points[2].x, points[0].y);
|
||||
points[3] = new Point(points[0].x, points[2].y);
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points[0])
|
||||
.line(points[1])
|
||||
.line(points[2])
|
||||
.line(points[3])
|
||||
.line(points[0])
|
||||
.close()
|
||||
.attr("class", "interfacing");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
points.title = points[0].shiftFractionTowards(points[2], 0.5);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "waistbandInterfacingLeft",
|
||||
nr: "3a",
|
||||
scale: 0.5,
|
||||
rotation: -90
|
||||
});
|
||||
points.logo = new Point(points[2].x / 2, 45);
|
||||
snippets.logo = new Snippet("logo", points.logo).attr("data-scale", 0.7);
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[3],
|
||||
to: points[2],
|
||||
y: points[2].y + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[2],
|
||||
to: points[1],
|
||||
x: points[2].x + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
62
packages/theo/src/waistband-interfacing-right.js
Normal file
62
packages/theo/src/waistband-interfacing-right.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
measurements,
|
||||
macro,
|
||||
snippets,
|
||||
Snippet
|
||||
} = part.shorthand();
|
||||
|
||||
points[0] = new Point(0, 0);
|
||||
points[2] = new Point(
|
||||
options.waistbandWidth,
|
||||
measurements.hipsCircumference / 2 + 40
|
||||
);
|
||||
points[1] = new Point(points[2].x, points[0].y);
|
||||
points[3] = new Point(points[0].x, points[2].y);
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points[0])
|
||||
.line(points[1])
|
||||
.line(points[2])
|
||||
.line(points[3])
|
||||
.line(points[0])
|
||||
.close()
|
||||
.attr("class", "interfacing");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
points.title = points[0].shiftFractionTowards(points[2], 0.5);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "waistbandInterfacingRight",
|
||||
nr: "3b",
|
||||
scale: 0.5,
|
||||
rotation: -90
|
||||
});
|
||||
points.logo = new Point(points[2].x / 2, 45);
|
||||
snippets.logo = new Snippet("logo", points.logo).attr("data-scale", 0.7);
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[3],
|
||||
to: points[2],
|
||||
y: points[2].y + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[2],
|
||||
to: points[1],
|
||||
x: points[2].x + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
48
packages/theo/src/waistband-left.js
Normal file
48
packages/theo/src/waistband-left.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
macro,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
paths.seam.attributes.set("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(-1 * sa).attr("class", "fabric sa");
|
||||
points.title = points[0].shiftFractionTowards(points[2], 0.5);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "waistbandLeft",
|
||||
nr: "4a",
|
||||
scale: 0.5,
|
||||
rotation: -90
|
||||
});
|
||||
points.grainlineTop = new Point(points[2].x / 2, 0);
|
||||
points.grainlineBottom = new Point(points[2].x / 2, points[2].y, 0);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[3],
|
||||
to: points[2],
|
||||
y: points[2].y + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[2],
|
||||
to: points[1],
|
||||
x: points[2].x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
63
packages/theo/src/waistband-lining-left.js
Normal file
63
packages/theo/src/waistband-lining-left.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
snippets,
|
||||
Snippet,
|
||||
macro,
|
||||
points,
|
||||
paths,
|
||||
Path,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
points[0] = points[0].shift(180, 80);
|
||||
points[3] = points[3].shift(180, 80);
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points[0])
|
||||
.line(points[1])
|
||||
.line(points[2])
|
||||
.line(points[3])
|
||||
.line(points[0])
|
||||
.close()
|
||||
.attr("class", "lining");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(-1 * sa).attr("class", "lining sa");
|
||||
points.title = points[0].shiftFractionTowards(points[2], 0.5);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "waistbandLiningLeft",
|
||||
nr: "5a",
|
||||
scale: 0.5,
|
||||
rotation: -90
|
||||
});
|
||||
points.logo = points.title.shift(90, 70);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
points.grainlineTop = new Point(points[2].x / 2, 0);
|
||||
points.grainlineBottom = new Point(points[2].x / 2, points[2].y, 0);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[3],
|
||||
to: points[2],
|
||||
y: points[2].y + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[2],
|
||||
to: points[1],
|
||||
x: points[2].x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
63
packages/theo/src/waistband-lining-right.js
Normal file
63
packages/theo/src/waistband-lining-right.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
macro,
|
||||
snippets,
|
||||
Snippet,
|
||||
points,
|
||||
paths,
|
||||
Path,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
points[0] = points[0].shift(180, 80);
|
||||
points[3] = points[3].shift(180, 80);
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points[0])
|
||||
.line(points[1])
|
||||
.line(points[2])
|
||||
.line(points[3])
|
||||
.line(points[0])
|
||||
.close()
|
||||
.attr("class", "lining");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(-1 * sa).attr("class", "lining sa");
|
||||
points.title = points[0].shiftFractionTowards(points[2], 0.5);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "waistbandLiningRight",
|
||||
nr: "5b",
|
||||
scale: 0.5,
|
||||
rotation: -90
|
||||
});
|
||||
points.logo = points.title.shift(90, 70);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
points.grainlineTop = new Point(points[2].x / 2, 0);
|
||||
points.grainlineBottom = new Point(points[2].x / 2, points[2].y, 0);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[3],
|
||||
to: points[2],
|
||||
y: points[2].y + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[2],
|
||||
to: points[1],
|
||||
x: points[2].x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
48
packages/theo/src/waistband-right.js
Normal file
48
packages/theo/src/waistband-right.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
macro,
|
||||
paths,
|
||||
complete,
|
||||
sa,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
|
||||
paths.seam.attributes.set("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) paths.sa = paths.seam.offset(-1 * sa).attr("class", "fabric sa");
|
||||
points.title = points[0].shiftFractionTowards(points[2], 0.5);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
title: "waistbandRight",
|
||||
nr: "4b",
|
||||
scale: 0.5,
|
||||
rotation: -90
|
||||
});
|
||||
points.grainlineTop = new Point(points[2].x / 2, 0);
|
||||
points.grainlineBottom = new Point(points[2].x / 2, points[2].y, 0);
|
||||
macro("grainline", {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points[3],
|
||||
to: points[2],
|
||||
y: points[2].y + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points[2],
|
||||
to: points[1],
|
||||
x: points[2].x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue