1
0
Fork 0

Integrated Penelope and Waralee patterns, plus 2.1 prep

Penelope and Waralee are two new patterns by @woutervdub
This integrates them in our monorepo, including the translations
in the i18n package and the package info in the pattern-info pattern

This commit also includes a minor tweak to our core package.
Previously, you had to instantiate a pattern to get its config,
but that is no longer the case. The default export (the constructor)
now has a config property you can access without instantiating the pattern.

All of these changes will trigger a new minor release when we merge them
into master. Specifically v2.1
This commit is contained in:
Joost De Cock 2019-09-21 19:42:53 +02:00
parent 6fe5177377
commit 261da52c3b
58 changed files with 12190 additions and 2088 deletions

View file

@ -125,34 +125,6 @@ mui-theme:
"@material-ui/core": "^4.0.1"
"react": "^16.8"
"react-dom": "^16.8"
pattern-info:
peer:
"@freesewing/core": "^{{version}}"
"@freesewing/plugin-bundle": "^{{version}}"
patterns:
_:
"@freesewing/aaron": "^{{version}}"
"@freesewing/benjamin": "^{{version}}"
"@freesewing/bent": "^{{version}}"
"@freesewing/brian": "^{{version}}"
"@freesewing/bruce": "^{{version}}"
"@freesewing/carlita": "^{{version}}"
"@freesewing/carlton": "^{{version}}"
"@freesewing/cathrin": "^{{version}}"
"@freesewing/florent": "^{{version}}"
"@freesewing/huey": "^{{version}}"
"@freesewing/hugo": "^{{version}}"
"@freesewing/jaeger": "^{{version}}"
"@freesewing/shin": "^{{version}}"
"@freesewing/simon": "^{{version}}"
"@freesewing/sven": "^{{version}}"
"@freesewing/tamiko": "^{{version}}"
"@freesewing/trayvon": "^{{version}}"
"@freesewing/wahid": "^{{version}}"
peer:
"@freesewing/core": "^{{version}}"
"@freesewing/plugin-bundle": "^{{version}}"
"@freesewing/plugin-buttons": "^{{version}}"
plugin-bundle:
_:
"@freesewing/plugin-cutonfold": "^{{version}}"

View file

@ -18,8 +18,8 @@ i18n: "Translations for the FreeSewing project"
jaeger: "A FreeSewing pattern for a sport coat style jacket"
models: "Body measurements data for a range of default sizes"
mui-theme: "A Material-UI theme for FreeSewing web UIs"
patterns: "An umbrella package for all FreeSewing patterns"
pattern-info: "Information about available freesewing patterns"
penelope: "A FreeSewing pattern for a pencil skirt"
plugin-banner: "A FreeSewing plugin to repeat text on a path"
plugin-bundle: "An umbrella package of 8 essential FreeSewing build-time plugins"
plugin-bust: "A FreeSewing plugin that helps with bust-adjusting menswear patterns"
@ -51,3 +51,4 @@ 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"
wahid: "A FreeSewing pattern for a classic fitted waistcoat"
waralee: "A FreeSewing pattern for wrap pants"

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -14,5 +14,8 @@ export default function Design(config, plugins = false) {
pattern.prototype = Object.create(Pattern.prototype)
pattern.prototype.constructor = pattern
// Make config available without need to instantiate pattern
pattern.config = config
return pattern
}

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -18,6 +18,8 @@ import florent from './florent.yml'
import theo from './theo.yml'
import sandy from './sandy.yml'
import shin from './shin.yml'
import penelope from './penelope.yml'
import waralee from './waralee.yml'
import { options as optionList } from '@freesewing/pattern-info'
import shared from '../../../shared-options.yml'
@ -41,7 +43,9 @@ let patterns = {
florent,
theo,
sandy,
shin
shin,
penelope,
waralee
}
let options = {}

View file

@ -61,3 +61,7 @@ trayvon:
wahid:
description: Wahid is a classic fitted waistcoat.
title: Wahid waistcoat
waralee:
description: Waralee are wrap pants
title: Waralee wrap pants

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -30,10 +30,7 @@
"start": "rollup -c -w",
"prepare": "node src/prebuild.js"
},
"peerDependencies": {
"@freesewing/core": "^2.0.3",
"@freesewing/plugin-bundle": "^2.0.3"
},
"peerDependencies": {},
"dependencies": {},
"devDependencies": {},
"files": [

View file

@ -0,0 +1,3 @@
import aaron from '@freesewing/aaron'
console.log(aaron.config)

View file

@ -18,6 +18,7 @@ export const list = [
'huey',
'hugo',
'jaeger',
'penelope',
'sandy',
'shin',
'simon',
@ -25,7 +26,8 @@ export const list = [
'tamiko',
'theo',
'trayvon',
'wahid'
'wahid',
'waralee'
]
export const withoutBreasts = [
@ -39,6 +41,7 @@ export const withoutBreasts = [
'huey',
'hugo',
'jaeger',
'penelope',
'sandy',
'shin',
'simon',
@ -46,7 +49,8 @@ export const withoutBreasts = [
'tamiko',
'theo',
'trayvon',
'wahid'
'wahid',
'waralee'
]
export const withBreasts = ['cathrin', 'carlita']

View file

@ -1,7 +1,52 @@
const path = require('path')
const fse = require('fs-extra')
const patterns = require('@freesewing/patterns')
const aaron = require('@freesewing/aaron').config
const benjamin = require('@freesewing/benjamin').config
const bent = require('@freesewing/bent').config
const brian = require('@freesewing/brian').config
const bruce = require('@freesewing/bruce').config
const carlita = require('@freesewing/carlita').config
const carlton = require('@freesewing/carlton').config
const cathrin = require('@freesewing/cathrin').config
const florent = require('@freesewing/florent').config
const huey = require('@freesewing/huey').config
const hugo = require('@freesewing/hugo').config
const jaeger = require('@freesewing/jaeger').config
const penelope = require('@freesewing/penelope').config
const sandy = require('@freesewing/sandy').config
const shin = require('@freesewing/shin').config
const simon = require('@freesewing/simon').config
const sven = require('@freesewing/sven').config
const tamiko = require('@freesewing/tamiko').config
const theo = require('@freesewing/theo').config
const trayvon = require('@freesewing/trayvon').config
const wahid = require('@freesewing/wahid').config
const waralee = require('@freesewing/waralee').config
const patterns = {
aaron,
benjamin,
bent,
brian,
bruce,
carlita,
carlton,
cathrin,
florent,
huey,
hugo,
jaeger,
penelope,
sandy,
shin,
simon,
sven,
tamiko,
theo,
trayvon,
wahid,
waralee
}
const patternOptions = config => {
let all = []
let groups = config.optionGroups
@ -47,27 +92,25 @@ const patternParts = config => {
return Object.keys(parts)
}
let options = {}
let optionGroups = {}
let parts = {}
let measurements = {}
let versions = {}
let info = {}
const options = {}
const optionGroups = {}
const parts = {}
const measurements = {}
const versions = {}
const info = {}
for (let pattern of Object.keys(patterns)) {
let instance = new patterns[pattern]()
let p = pattern.toLowerCase()
options[p] = patternOptions(instance.config)
optionGroups[p] = instance.config.optionGroups
parts[p] = patternParts(instance.config)
measurements[p] = instance.config.measurements
versions[p] = instance.config.version
info[p] = {
design: instance.config.design,
code: instance.config.code,
department: instance.config.department,
type: instance.config.type,
difficulty: instance.config.difficulty,
tags: instance.config.tags
options[pattern] = patternOptions(patterns[pattern])
optionGroups[pattern] = patterns[pattern].optionGroups
parts[pattern] = patternParts(patterns[pattern])
measurements[pattern] = patterns[pattern].measurements
versions[pattern] = patterns[pattern].version
info[pattern] = {
design: patterns[pattern].design,
code: patterns[pattern].code,
department: patterns[pattern].department,
type: patterns[pattern].type,
difficulty: patterns[pattern].difficulty,
tags: patterns[pattern].tags
}
}

View file

@ -1,36 +0,0 @@
# Change log for: @freesewing/patterns
## Unreleased
**Note:** Version bump only for package patterns
## 2.0.4 (2019-09-27)
**Note:** Version bump only for package patterns
## 2.0.3 (2019-09-15)
**Note:** Version bump only for package patterns
## 2.0.2 (2019-09-06)
**Note:** Version bump only for package patterns
## 2.0.1 (2019-09-01)
**Note:** Version bump only for package patterns
## 2.0.0 (2019-08-25)
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.

View file

@ -1,152 +0,0 @@
<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">An open source platform for made-to-measure sewing patterns</p>
<p align='center'><a
href="https://www.npmjs.com/package/@freesewing/patterns"
title="@freesewing/patterns on NPM"
><img src="https://img.shields.io/npm/v/@freesewing/patterns.svg"
alt="@freesewing/patterns on NPM"/>
</a><a
href="https://opensource.org/licenses/MIT"
title="License: MIT"
><img src="https://img.shields.io/npm/l/@freesewing/patterns.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%3Apatterns"
title="Open issues tagged pkg:patterns"
><img src="https://img.shields.io/github/issues/freesewing/freesewing/pkg:patterns.svg?label=Issues"
alt="Open issues tagged pkg:patterns"/>
</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/chat"
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/patterns
An umbrella package for all FreeSewing patterns
## Included patterns
### Blocks
Blocks or slopers are basic patterns shapes that you can extend into fully detailed patterns.
- [brian](https://github.com/freesewing/brian) : A basic body block for menswear, and the basis for many of our menswear patterns.
- [bent](https://github.com/freesewing/bent) : A version of [brian](https://github.com/freesewing/brian) with a two-part sleeve, and the and the basis of our menswear coat and jacket patterns.
### Menswear
- [aaron](https://github.com/freesewing/aaron) : A tank top or A-shirt
- [bruce](https://github.com/freesewing/bruce) : Boxer briefs
- [carlton](https://github.com/freesewing/carlton) : A long coat, perfect for Sherlock Holmes cosplay
- [huey](https://github.com/freesewing/huey) : A zip-up hoodie
- [hugo](https://github.com/freesewing/hugo) : A hooded sweatshirt with raglan sleeves
- [jaeger](https://github.com/freesewing/jaeger) : A sportscoat
- [simon](https://github.com/freesewing/simon) : A versatile button-down shirt
- [sven](https://github.com/freesewing/sven) : A straightforward sweater
- [wahid](https://github.com/freesewing/wahid) : A classic waistcoat
### Womenswear
- [cathrin](https://github.com/freesewing/cathrin) : An underbust corset or waist trainer
- [tamiko](https://github.com/freesewing/tamiko) : A zero-waste top
### Accessories
- [trayvon](https://github.com/freesewing/trayvon) : A (neck) tie
> #### Note: menswear/womenswear has nothing to do with gender
>
> Freesewing is gender-neutral. When we use the terms **menswear** or **womenswear**
> we are not talking about clothes for men or women. It is merely a category of clothing
> much like **accessories** or **shoes** are categories.
>
> The category gives you an idea what to expect, and is there to help you find things.
> It is not a limitation, or even a suggestion, of what you can or should wear or make.
>
> Wear whatever you want, and be proud of the things you make.
## Usage
This package has 2 exports:
- `patterns` : (the default export) An object holding pattern constructors
- `patternList` : An array of pattern names
## 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/chat)
- 🐦 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/freesewing/chat) 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).

View file

@ -1,50 +0,0 @@
## Included patterns
### Blocks
Blocks or slopers are basic patterns shapes that you can extend into fully detailed patterns.
- [brian](https://github.com/freesewing/brian) : A basic body block for menswear, and the basis for many of our menswear patterns.
- [bent](https://github.com/freesewing/bent) : A version of [brian](https://github.com/freesewing/brian) with a two-part sleeve, and the and the basis of our menswear coat and jacket patterns.
### Menswear
- [aaron](https://github.com/freesewing/aaron) : A tank top or A-shirt
- [bruce](https://github.com/freesewing/bruce) : Boxer briefs
- [carlton](https://github.com/freesewing/carlton) : A long coat, perfect for Sherlock Holmes cosplay
- [huey](https://github.com/freesewing/huey) : A zip-up hoodie
- [hugo](https://github.com/freesewing/hugo) : A hooded sweatshirt with raglan sleeves
- [jaeger](https://github.com/freesewing/jaeger) : A sportscoat
- [simon](https://github.com/freesewing/simon) : A versatile button-down shirt
- [sven](https://github.com/freesewing/sven) : A straightforward sweater
- [wahid](https://github.com/freesewing/wahid) : A classic waistcoat
### Womenswear
- [cathrin](https://github.com/freesewing/cathrin) : An underbust corset or waist trainer
- [tamiko](https://github.com/freesewing/tamiko) : A zero-waste top
### Accessories
- [trayvon](https://github.com/freesewing/trayvon) : A (neck) tie
> #### Note: menswear/womenswear has nothing to do with gender
>
> Freesewing is gender-neutral. When we use the terms **menswear** or **womenswear**
> we are not talking about clothes for men or women. It is merely a category of clothing
> much like **accessories** or **shoes** are categories.
>
> The category gives you an idea what to expect, and is there to help you find things.
> It is not a limitation, or even a suggestion, of what you can or should wear or make.
>
> Wear whatever you want, and be proud of the things you make.
## Usage
This package has 2 exports:
- `patterns` : (the default export) An object holding pattern constructors
- `patternList` : An array of pattern names

View file

@ -1,73 +0,0 @@
{
"name": "@freesewing/patterns",
"version": "2.0.3",
"description": "An umbrella package for all FreeSewing patterns",
"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",
"bundle",
"design",
"diy",
"fashion",
"sewing",
"sewing pattern",
"parametric design",
"made to measure"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"clean": "rimraf dist",
"build": "npm run clean && rollup -c",
"test": "echo \"patterns: 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"
},
"peerDependencies": {
"@freesewing/core": "^2.0.3",
"@freesewing/plugin-bundle": "^2.0.3",
"@freesewing/plugin-buttons": "^2.0.3"
},
"dependencies": {
"@freesewing/aaron": "^2.0.3",
"@freesewing/benjamin": "^2.0.3",
"@freesewing/bent": "^2.0.3",
"@freesewing/brian": "^2.0.3",
"@freesewing/bruce": "^2.0.3",
"@freesewing/carlita": "^2.0.3",
"@freesewing/carlton": "^2.0.3",
"@freesewing/cathrin": "^2.0.3",
"@freesewing/florent": "^2.0.3",
"@freesewing/huey": "^2.0.3",
"@freesewing/hugo": "^2.0.3",
"@freesewing/jaeger": "^2.0.3",
"@freesewing/shin": "^2.0.3",
"@freesewing/simon": "^2.0.3",
"@freesewing/sven": "^2.0.3",
"@freesewing/tamiko": "^2.0.3",
"@freesewing/trayvon": "^2.0.3",
"@freesewing/wahid": "^2.0.3"
},
"devDependencies": {},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "latest"
},
"engines": {
"node": ">=8.0.0",
"npm": ">=5"
}
}

View file

@ -1,49 +0,0 @@
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 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 }),
commonjs(),
json(),
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 */`
})
]
};

View file

@ -1,20 +0,0 @@
export { default as Aaron } from '@freesewing/aaron'
export { default as Benjamin } from '@freesewing/benjamin'
export { default as Bent } from '@freesewing/bent'
export { default as Brian } from '@freesewing/brian'
export { default as Bruce } from '@freesewing/bruce'
export { default as Carlita } from '@freesewing/carlita'
export { default as Carlton } from '@freesewing/carlton'
export { default as Cathrin } from '@freesewing/cathrin'
export { default as Florent } from '@freesewing/florent'
export { default as Huey } from '@freesewing/huey'
export { default as Hugo } from '@freesewing/hugo'
export { default as Jaeger } from '@freesewing/jaeger'
export { default as Sandy } from '@freesewing/sandy'
export { default as Shin } from '@freesewing/shin'
export { default as Simon } from '@freesewing/simon'
export { default as Sven } from '@freesewing/sven'
export { default as Tamiko } from '@freesewing/tamiko'
export { default as Theo } from '@freesewing/theo'
export { default as Trayvon } from '@freesewing/trayvon'
export { default as Wahid } from '@freesewing/wahid'

View file

@ -1,31 +1,102 @@
# penelope
<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">An open source platform for made-to-measure sewing patterns</p>
<p align='center'><a
href="https://www.npmjs.com/package/@freesewing/penelope"
title="@freesewing/penelope on NPM"
><img src="https://img.shields.io/npm/v/@freesewing/penelope.svg"
alt="@freesewing/penelope on NPM"/>
</a><a
href="https://opensource.org/licenses/MIT"
title="License: MIT"
><img src="https://img.shields.io/npm/l/@freesewing/penelope.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%3Apenelope"
title="Open issues tagged pkg:penelope"
><img src="https://img.shields.io/github/issues/freesewing/freesewing/pkg:penelope.svg?label=Issues"
alt="Open issues tagged pkg:penelope"/>
</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/chat"
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>
> Pencil Skirt
# @freesewing/penelope
[![NPM](https://img.shields.io/npm/v/penelope.svg)](https://www.npmjs.com/package/penelope) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
A FreeSewing pattern for a pencil skirt
## Install
## 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 install --save penelope
npm init freesewing-pattern
```
## Usage
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).
```jsx
import React, { Component } from 'react'
If you're a maker, checkout [freesewing.org](https://freesewing/) where you can generate
our sewing patterns adapted to your measurements.
import MyComponent from 'penelope'
## Support FreeSewing: Become a patron 🥰
class Example extends Component {
render () {
return (
<MyComponent />
)
}
}
```
FreeSewing is an open source project run by a community,
and financially supported by our patrons.
## License
If you feel what we do is worthwhile, you too
should [become a patron](https://freesewing.org/patrons/join).
© [woutervdub](https://github.com/woutervdub)
## Links 👩‍💻
- 💻 Makers website: [freesewing.org](https://freesewing.org)
- 💻 Developers website: [freesewing.dev](https://freesewing.org)
- 💬 Chat: [gitter.im/freesewing](https://gitter.im/freesewing/chat)
- 🐦 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/freesewing/chat) 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).

View file

@ -1,59 +1,57 @@
import { version } from "../package.json";
import { version } from '../package.json'
// ?? 🤔 ?? --> https://en.freesewing.dev/packages/core/config
export default {
name: "penelope",
name: 'penelope',
version,
design: "woutervdub",
code: "woutervdub",
department: "womenswear",
type: "pattern",
design: 'Wouter Van Wageningen',
code: 'Wouter Van Wageningen',
department: 'womenswear',
type: 'pattern',
difficulty: 3,
tags: [
"freesewing",
"design",
"diy",
"fashion",
"made to measure",
"parametric design",
"pattern",
"sewing",
"sewing pattern"
'freesewing',
'design',
'diy',
'fashion',
'made to measure',
'parametric design',
'pattern',
'sewing',
'sewing pattern'
],
optionGroups: {
fit: [
"lengthBonus",
"hem",
"backVent",
"backVentLength",
"waistBand",
"waistBandWidth",
"zipperLocation",
"nrOfDarts",
"hemBonus"
'lengthBonus',
'hem',
'backVent',
'backVentLength',
'waistBand',
'waistBandWidth',
'zipperLocation',
'nrOfDarts',
'hemBonus'
],
advanced: [
"seatEase",
"waistEase",
/*"waistSideSeamRaise",*/
"backDartDepthFactor",
"frontDartDepthFactor",
"dartToSideSeamFactor"
'seatEase',
'waistEase',
'backDartDepthFactor',
'frontDartDepthFactor',
'dartToSideSeamFactor'
]
},
measurements: [
"naturalWaist",
/*"hipsCircumference",*/
"seatCircumference",
"naturalWaistToHip",
"naturalWaistToSeat",
"naturalWaistToKnee"
'naturalWaist',
'seatCircumference',
'naturalWaistToHip',
'naturalWaistToSeat',
'naturalWaistToKnee'
],
dependencies: {},
inject: {},
hide: [],
parts: ["front", "back", "waistband"],
parts: ['front', 'back', 'waistband'],
options: {
dartMaximumDifference: 300,
dartMinimumDifference: 180,
@ -64,7 +62,7 @@ export default {
dartBackControl3: 4,
curvePlacement: 2.4,
dart2offset: 32,
dart2factor: 0.80,
dart2factor: 0.8,
hipCurveDividerDown: 40,
hipCurveDividerUp: 3,
sideSeamShiftPercentage: 0.006,
@ -78,14 +76,13 @@ export default {
backVentLength: { pct: 40, min: 5, max: 70 },
waistBand: { bool: true },
waistBandWidth: { mm: 50, min: 10, max: 200 },
zipperLocation: { dflt: "backSeam", list: ["backSeam", "sideSeam"] },
zipperLocation: { dflt: 'backSeam', list: ['backSeam', 'sideSeam'] },
nrOfDarts: { count: 2, min: 1, max: 2 },
seatEase: { mm: 5, min: 0, max: 15 },
waistEase: { mm: 5, min: 0, max: 15 },
/*waistSideSeamRaise: { pct: 0, min: 0, max: 10 },*/
backDartDepthFactor: { pct: 50, min: 35, max: 70 },
frontDartDepthFactor: { pct: 45, min: 30, max: 65 },
dartToSideSeamFactor: { pct: 50, min: 30, max: 70 }
}
};
}

View file

@ -1,29 +1,30 @@
{
"name": "penelope-example",
"homepage": "https://woutervdub.github.io/penelope",
"homepage": "https://freesewing.github.io/penelope",
"version": "0.0.0",
"private": true,
"dependencies": {
"@freesewing/components": "beta",
"@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": "beta",
"@material-ui/core": "^4.0.1",
"@material-ui/icons": "^4.0.1",
"@material-ui/lab": "^v4.0.0-alpha.14",
"axios": "^0.19.0",
"pattern": "file:..",
"prismjs": "1.16.0",
"react": "^16.8",
"react-dom": "^16.8",
"react-scripts": "^3.0.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.4.0",
"@material-ui/icons": "^4.2.1",
"@material-ui/lab": "^v4.0.0-alpha.25",
"pattern": "link:..",
"prismjs": "1.17.1",
"react": "^16.9",
"react-dom": "^16.9",
"react-scripts": "^3.1.1",
"file-saver": "^2.0.2",
"typeface-roboto-condensed": "latest"
},
"scripts": {
@ -42,6 +43,6 @@
"not op_mini all"
],
"devDependencies": {
"babel-plugin-prismjs": "1.0.2"
"babel-plugin-prismjs": "1.1.1"
}
}

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,11 +1,11 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import * as serviceWorker from './serviceWorker'
ReactDOM.render(<App />, document.getElementById("root"));
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();
serviceWorker.unregister()

View file

@ -9,46 +9,44 @@
// This link also includes instructions on opting out of this behavior.
const isLocalhost = Boolean(
window.location.hostname === "localhost" ||
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === "[::1]" ||
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}$/
)
);
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) {
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);
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;
return
}
window.addEventListener("load", () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
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);
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"
);
});
'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);
registerValidSW(swUrl, config)
}
});
})
}
}
@ -57,38 +55,38 @@ function registerValidSW(swUrl, config) {
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
const installingWorker = registration.installing
installingWorker.onstatechange = () => {
if (installingWorker.state === "installed") {
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.");
console.log('New content is available; please refresh.')
// Execute callback
if (config.onUpdate) {
config.onUpdate(registration);
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.");
console.log('Content is cached for offline use.')
// Execute callback
if (config.onSuccess) {
config.onSuccess(registration);
config.onSuccess(registration)
}
}
}
};
};
}
}
})
.catch(error => {
console.error("Error during service worker registration:", error);
});
console.error('Error during service worker registration:', error)
})
}
function checkValidServiceWorker(swUrl, config) {
@ -98,30 +96,28 @@ function checkValidServiceWorker(swUrl, config) {
// 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
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();
});
});
window.location.reload()
})
})
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
registerValidSW(swUrl, config)
}
})
.catch(() => {
console.log(
"No internet connection found. App is running in offline mode."
);
});
console.log('No internet connection found. App is running in offline mode.')
})
}
export function unregister() {
if ("serviceWorker" in navigator) {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
registration.unregister()
})
}
}

View file

@ -1,57 +1,64 @@
{
"name": "penelope",
"version": "0.0.1",
"description": "Pencil Skirt",
"author": "woutervdub",
"name": "@freesewing/penelope",
"version": "2.0.3",
"description": "A FreeSewing pattern for a pencil skirt",
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",
"repository": "github:freesewing/freesewing",
"license": "MIT",
"repository": "woutervdub/penelope",
"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.es.js",
"jsnext:main": "dist/index.es.js",
"engines": {
"node": ">=8",
"npm": ">=5"
},
"module": "dist/index.mjs",
"scripts": {
"test": "cross-env CI=1 react-scripts test --env=jsdom",
"test:watch": "react-scripts test --env=jsdom",
"build": "rollup -c",
"clean": "rimraf dist",
"build": "npm run clean && rollup -c",
"test": "echo \"penelope: 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",
"prepare": "npm run build",
"predeploy": "cd example && npm install && npm run build",
"deploy": "gh-pages -d example/build"
"netlify": "echo \"Not configured yet\""
},
"peerDependencies": {
"@freesewing/core": "^2.0.3",
"@freesewing/plugin-bundle": "^2.0.3"
},
"dependencies": {},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@freesewing/components": "^2.0.0-beta.9-2",
"@freesewing/core": "^2.0.0-beta.32",
"@freesewing/css-theme": "beta",
"@freesewing/i18n": "beta",
"@freesewing/mui-theme": "beta",
"@freesewing/patterns": "beta",
"@freesewing/plugin-bundle": "^2.0.0-beta.32",
"@freesewing/plugin-bust": "beta",
"@freesewing/plugin-buttons": "beta",
"@freesewing/plugin-debug": "beta",
"@freesewing/plugin-designer": "beta",
"@freesewing/plugin-flip": "beta",
"@freesewing/utils": "beta",
"@material-ui/core": "^3.9.3",
"@material-ui/icons": "^3.0.2",
"@material-ui/lab": "^3.0.0-alpha.30",
"@svgr/rollup": "^2.4.1",
"babel-eslint": "10.0.1",
"babel-jest": "24.7.1",
"cross-env": "^5.1.4",
"eslint": "^5.16.0",
"gh-pages": "^1.2.0",
"jest": "24.7.1",
"prop-types": "15.7.2",
"react": "^16.8",
"react-dom": "^16.8",
"react-intl": "2.8.0",
"@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.3",
"@freesewing/css-theme": "^2.0.3",
"@freesewing/i18n": "^2.0.3",
"@freesewing/mui-theme": "^2.0.3",
"@freesewing/plugin-bust": "^2.0.3",
"@freesewing/plugin-buttons": "^2.0.3",
"@freesewing/plugin-flip": "^2.0.3",
"@freesewing/utils": "^2.0.3",
"@svgr/rollup": "^2.4.1",
"cross-env": "^5.1.4",
"gh-pages": "^1.2.0",
"react-scripts": "^3.0.0",
"rollup": "^0.68.2",
"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",
@ -60,15 +67,23 @@
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-postcss": "^1.6.2",
"rollup-plugin-url": "^1.4.0",
"webpack": "4.29.6"
"@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"
},
"dependencies": {
"@freesewing/examples": "^2.0.0-beta.32",
"@freesewing/pattern-info": "^2.0.0-beta.32",
"@freesewing/rendertest": "^2.0.0-beta.32",
"@freesewing/tutorial": "^2.0.0-beta.32",
"axios": "^0.19.0",
"prismjs": "^1.16.0",
"typescript": "^3.5.3"
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "latest"
},
"engines": {
"node": ">=8.0.0",
"npm": ">=5"
}
}

View file

@ -1,4 +1,4 @@
import { BuildMainShape } from "./shape";
import { BuildMainShape } from './shape'
export default function(part) {
let {
@ -15,43 +15,36 @@ export default function(part) {
sa,
paperless,
macro
} = part.shorthand();
} = part.shorthand()
BuildMainShape(part, false);
BuildMainShape(part, false)
if (options.backVent == true) {
// I don't care what you're trying to create, the vent will not go higher than your hips.
let backVentLength = Math.min(
store.get("skirtLength") - measurements.naturalWaistToHip,
options.backVentLength * store.get("skirtLength")
);
console.log({
backVentLength: backVentLength,
skirtLength: store.get("skirtLength"),
OptionsBackVentLength: options.backVentLength
});
store.get('skirtLength') - measurements.naturalWaistToHip,
options.backVentLength * store.get('skirtLength')
)
points.vLeg = points.lLeg.shift(180, options.backVentWidth);
points.vHem = points.lHem.shift(180, options.backVentWidth);
points.vTop = points.vLeg.shift(90, backVentLength);
points.lVent = points.vTop
.shift(0, options.backVentWidth)
.shift(90, options.backVentWidth);
points.vLeg = points.lLeg.shift(180, options.backVentWidth)
points.vHem = points.lHem.shift(180, options.backVentWidth)
points.vTop = points.vLeg.shift(90, backVentLength)
points.lVent = points.vTop.shift(0, options.backVentWidth).shift(90, options.backVentWidth)
paths.vent = new Path()
.move(points.lVent)
.line(points.vTop)
.line(points.vLeg)
.line(points.vHem)
.setRender(false);
.setRender(false)
paths.leftSide = new Path()
.move(points.lWaist)
.line(points.lVent)
.join(paths.vent)
.setRender(false);
.setRender(false)
paths.hem = paths.hem.line(points.vLeg);
paths.hem = paths.hem.line(points.vLeg)
}
paths.seam = paths.leftSide
@ -59,37 +52,33 @@ export default function(part) {
.join(paths.bottom)
.join(paths.sideSeam)
.join(paths.waist)
.attr("class", "fabric");
.attr('class', 'fabric')
// Complete?
if (complete) {
macro("grainline", {
macro('grainline', {
from: points.grainlineTop,
to: points.grainlineBottom
});
})
snippets.logo = new Snippet("logo", points.logoAnchor);
snippets.logo = new Snippet('logo', points.logoAnchor)
if (options.backVent == false && options.zipperLocation != "backSeam") {
macro("cutonfold", {
if (options.backVent == false && options.zipperLocation != 'backSeam') {
macro('cutonfold', {
from: points.lWaist,
to: points.lLeg,
margin: 5,
offset: 10
});
macro("title", {
at: points.titleAnchor,
title: "1x " + "cutOnFold" + " " + "fromFabric"
});
} else {
macro("title", {
at: points.titleAnchor,
title: "2x " + "fromFabric"
});
})
}
macro('title', {
nr: 2,
at: points.titleAnchor,
title: 'back'
})
if (sa) {
if (options.backVent || options.zipperLocation == "backSeam") {
if (options.backVent || options.zipperLocation == 'backSeam') {
paths.sa = paths.leftSide
.clone()
.join(paths.bottom)
@ -98,7 +87,7 @@ export default function(part) {
.line(points.lWaist)
.close()
.offset(sa)
.attr("class", "fabric sa");
.attr('class', 'fabric sa')
} else {
paths.sa = new Path()
.move(points.lHem)
@ -109,42 +98,42 @@ export default function(part) {
.offset(sa)
)
.line(points.lWaist)
.attr("class", "fabric sa");
.attr('class', 'fabric sa')
}
}
}
if (paperless) {
if (options.backVent) {
macro("hd", {
macro('hd', {
from: points.vHem,
to: points.rHem,
y: points.rHem.y - options.paperlessOffset
});
macro("hd", {
y: points.rHem.y - options.paperlessOffset - sa
})
macro('hd', {
from: points.vTop,
to: points.lVent,
y: points.vTop.y
});
})
macro("vd", {
macro('vd', {
from: points.lSeat,
to: points.lVent,
x: points.lWaist.x - options.paperlessOffset
});
macro("vd", {
x: points.lWaist.x - options.paperlessOffset - sa
})
macro('vd', {
from: points.lVent,
to: points.vTop,
x: points.lVent.x
});
})
} else {
macro("hd", {
macro('hd', {
from: points.lHem,
to: points.rHem,
y: points.rHem.y - options.paperlessOffset
});
y: points.rHem.y - options.paperlessOffset - sa
})
}
}
return part;
return part
}

View file

@ -1,4 +1,4 @@
import { BuildMainShape } from "./shape";
import { BuildMainShape } from './shape'
export default function(part) {
let {
@ -15,78 +15,39 @@ export default function(part) {
sa,
paperless,
macro
} = part.shorthand();
} = part.shorthand()
BuildMainShape(part, true);
BuildMainShape(part, true)
paths.seam = paths.leftSide
.clone()
.join(paths.bottom)
.join(paths.sideSeam)
.join(paths.waist)
.attr("class", "fabric");
.attr('class', 'fabric')
// Complete?
if (complete) {
macro("cutonfold", {
macro('cutonfold', {
from: points.lWaist,
to: points.lLeg,
margin: 5,
offset: 10
});
macro("title", {
})
macro('title', {
nr: 1,
at: points.titleAnchor,
title: "1x " + "cutOnFold" + " " + "fromFabric"
});
/*
let so = {
from: points.lWaist,
to: points.lLeg,
margin: 5,
offset: -10,
prefix: ''
};
points["cutonfoldFrom" + so.prefix] = so.from.shiftFractionTowards(
so.to,
so.margin / 100
);
points["cutonfoldTo" + so.prefix] = so.to.shiftFractionTowards(
so.from,
so.margin / 100
);
points["cutonfoldVia1" + so.prefix] = points["cutonfoldFrom" + so.prefix]
.shiftTowards(so.from, so.offset)
.rotate(-90, points["cutonfoldFrom" + so.prefix]);
points["cutonfoldVia2" + so.prefix] = points["cutonfoldTo" + so.prefix]
.shiftTowards(so.to, so.offset)
.rotate(90, points["cutonfoldTo" + so.prefix]);
let text = so.grainline ? "cutOnFoldAndGrainline" : "cutOnFold";
paths["cutonfold" + so.prefix] = new this.Path()
.move(points["cutonfoldFrom" + so.prefix])
.line(points["cutonfoldVia1" + so.prefix])
.line(points["cutonfoldVia2" + so.prefix])
.line(points["cutonfoldTo" + so.prefix])
.attr("class", "note")
.attr("marker-start", "url(#cutonfoldFrom)")
.attr("marker-end", "url(#cutonfoldTo)")
.attr("data-text", text)
.attr("data-text-class", "center fill-note");
*/
macro("title", {
at: points.titleAnchor,
title: "1x " + "cutOnFold" + " " + "fromFabric"
});
macro("grainline", {
title: 'front'
})
macro('grainline', {
from: points.grainlineTop,
to: points.grainlineBottom
});
})
points.scaleBox = points.logoAnchor.shift(270, 100);
macro("scalebox", { at: points.scaleBox });
points.scaleBox = points.logoAnchor.shift(270, 100)
macro('scalebox', { at: points.scaleBox })
snippets.logo = new Snippet("logo", points.logoAnchor);
snippets.logo = new Snippet('logo', points.logoAnchor)
if (sa) {
paths.sa = new Path()
@ -98,17 +59,17 @@ export default function(part) {
.offset(sa)
)
.line(points.lWaist)
.attr("class", "fabric sa");
.attr('class', 'fabric sa')
}
if (paperless) {
macro("hd", {
macro('hd', {
from: points.lHem,
to: points.rHem,
y: points.rHem.y - options.paperlessOffset
});
})
}
}
return part;
return part
}

View file

@ -1,380 +1,326 @@
import { addDartToCurve, dartCalc } from "./utils";
function BuildMainShape(part, frontPart) {
let {
options,
measurements,
Point,
Path,
points,
paths,
/*Snippet,*/
/*snippets,*/
store,
/*complete,*/
/*sa,*/
paperless,
macro
} = part.shorthand();
let skirtLength =
(measurements.naturalWaistToKnee * (1+ options.lengthBonus)); // + options.hem;
store.set("skirtLength", skirtLength);
let waistEase = options.waistEase;
let seatEase = options.seatEase;
let dartDepthFactor = frontPart
? options.frontDartDepthFactor
: options.backDartDepthFactor;
let waist = measurements.naturalWaist;
let seat =
measurements.seatCircumference > waist
? measurements.seatCircumference
: waist;
/*let hip =
measurements.hipsCircumference > waist
? measurements.hipsCircumference
: waist;*/
dartCalc(options, seat, seatEase, waist, waistEase);
let nrOfDarts = options.nrOfDarts;
let dartSize = options.frontDartSize;
if (frontPart == false) {
dartSize = options.backDartSize;
}
if (dartSize <= 0) {
nrOfDarts = 0;
}
store.set("nrOfDarts", nrOfDarts);
store.set("dartSize", dartSize);
let sideSeamShift =
(frontPart ? -1 : 1) * options.sideSeamShiftPercentage * seat;
seat += seatEase;
waist += waistEase;
let sideSeam = seat / 4 + sideSeamShift;
//let hipSeam = hip / 4 + sideSeamShift;
points.lWaist = new Point(0, 0);
points.lLeg = new Point(0, skirtLength);
points.rWaistOriginal = new Point(sideSeam, 0);
points.rLeg = new Point(
sideSeam + (options.hemBonus * seat) / 10,
skirtLength
);
points.lSeat = new Point(0, measurements.naturalWaistToSeat);
points.rSeat = new Point(sideSeam, measurements.naturalWaistToSeat);
points.rWaistCPdown = new Point(
sideSeam,
measurements.naturalWaistToSeat / 3
);
points.rSeatCPup = new Point(
sideSeam,
(measurements.naturalWaistToSeat / 3) * 2
);
points.rSeatCPdown = points.rSeat.shift(
270,
((measurements.naturalWaistToSeat - measurements.naturalWaistToHip) *
Math.abs((options.hemBonus * seat) / 10)) /
options.hipCurveDividerDown
);
//$p->newPoint('pH', $sideSeam, $model->m('naturalWaistToHip') -$this->o('waistSideSeamRise'));
let waistFactor = 0.99;
let sideFactor = 0.97;
let wdelta = 1;
let sdelta = 1;
let iteration = 0;
let waistCurve = null;
let waistPath = null;
let waistPathSA = null;
let waistLength = 0;
let sideSeamPath = null;
let sideSeamLength = 0;
let curve1 = null;
let curve2 = null;
do {
if (wdelta < -1) {
waistFactor *= 0.9995;
} else if (wdelta > 1) {
waistFactor *= 1.01;
}
if (sdelta < -1) {
sideFactor *= 0.995;
} else if (sdelta > 1) {
sideFactor *= 1.01;
}
points.rWaistTemp1 = points.lWaist.shift(0, (waist / 4) * waistFactor);
points.rWaistTemp2 = points.rWaistTemp1.shift(0, dartSize * nrOfDarts);
points.rWaist = points.rWaistTemp2.shift(90, 16 * sideFactor);
points.lWaistCP = points.lWaist.shift(0, seat / 12);
points.rWaistCPleft = points.rWaist.shift(
points.rWaist.angle(points.rWaistCPdown) - 90,
waist / 16
);
/*
console.log(
"rWaist: (" +
points.rWaist.x.toString() +
"," +
points.rWaist.y.toString() +
") [" +
iteration.toString() +
"]"
);
*/
waistCurve = new Path()
.move(points.lWaist)
.curve(points.lWaistCP, points.rWaistCPleft, points.rWaist)
.setRender(false);
if (nrOfDarts > 0) {
curve1 = addDartToCurve(
part,
waistCurve,
seat / 4 / options.curvePlacement,
dartSize,
measurements.naturalWaistToSeat * dartDepthFactor
);
waistLength = curve1.left.length();
points.dart1Start = curve1.dart.start();
points.dart1Middle = curve1.dart.ops[1].to;
points.dart1End = curve1.dart.end();
if (nrOfDarts > 1) {
curve2 = addDartToCurve(
part,
curve1.right,
options.dart2offset,
dartSize,
measurements.naturalWaistToSeat *
dartDepthFactor *
options.dart2factor
);
waistLength += curve2.left.length();
waistLength += curve2.right.length();
waistPath = curve1.left.join(
curve1.dart.join(curve2.left.join(curve2.dart.join(curve2.right)))
);
waistPathSA = curve1.left.join(curve2.left.join(curve2.right));
points.dart2Start = curve2.dart.start();
points.dart2Middle = curve2.dart.ops[1].to;
points.dart2End = curve2.dart.end();
} else {
waistLength += curve1.right.length();
waistPath = curve1.left.join(curve1.dart.join(curve1.right));
waistPathSA = curve1.left.join(curve1.right);
}
} else {
waistLength = waistCurve.length();
waistPath = waistCurve;
waistPathSA = waistCurve.clone();
}
sideSeamPath = new Path()
.move(points.rLeg)
//.line(points.rSeat)
.curve(points.rLeg, points.rSeatCPdown, points.rSeat)
.curve(points.rSeatCPup, points.rWaistCPdown, points.rWaist);
//console.log(sideSeamPath);
wdelta = waist / 4 - waistLength;
if (frontPart) {
sdelta = 0;
} else {
sideSeamLength = sideSeamPath.length();
sdelta = store.get("sideSeamLength") - sideSeamLength;
}
} while ((Math.abs(wdelta) > 1 || Math.abs(sdelta) > 1) && iteration++ < 100);
paths.waist1 = waistCurve.translate(0, 10).attr("class", "lining dashed");
if (iteration >= 100) {
throw "Too many iterations trying to make it fit!";
}
if (frontPart) {
sideSeamLength = sideSeamPath.length();
store.set("sideSeamLength", sideSeamLength);
}
points.lHem = points.lLeg;
points.rHem = points.rLeg;
paths.hem = new Path()
.move(points.lLeg)
.line(points.rLeg)
.attr("class", "fabric stroke-sm")
.setRender(false);
if (options.hem > 0) {
// Create the inverse of the curve from the leg to the waist
// Then split it at the hem level
points.lHem = points.lLeg.shift(270, options.hem);
let rInverseSeat = points.rSeat.shift(
270,
(points.rLeg.y - points.rSeat.y) * 2
);
let rInverseSeatCP = rInverseSeat.shift(
90,
points.rSeatCPdown.y - points.rSeat.y
);
let rInversePath = new Path()
.move(rInverseSeat)
.curve(rInverseSeatCP, points.rLeg, points.rLeg);
points.rHem = rInversePath.intersectsY(points.lHem.y)[0];
let sideSeamHemPath = rInversePath.split(points.rHem)[1];
sideSeamPath = sideSeamHemPath.join(sideSeamPath);
paths.hem.setRender(true);
}
paths.leftSide = new Path()
.move(points.lWaist)
.line(points.lHem)
.setRender(false);
paths.bottom = new Path()
.move(points.lHem)
.line(points.rHem)
.setRender(false);
paths.sideSeam = sideSeamPath.setRender(false);
// Turn the path in the other direction, to comply with the counter-clockwise guideline
paths.waist = waistPath.reverse().setRender(false);
paths.waistSA = waistPathSA.reverse().setRender(false);
points.titleAnchor = new Point(
measurements.naturalWaist / 6,
measurements.naturalWaistToSeat
);
points.logoAnchor = points.titleAnchor.shift(270, 75);
points.grainlineTop = points.lWaist.shift(0, 50).shift(270, 50);
points.grainlineBottom = points.lLeg.shift(0, 50).shift(90, 50);
if (paperless) {
macro("hd", {
from: points.lSeat,
to: points.rSeat,
y: points.rSeat.y
});
macro("vd", {
from: points.lWaist,
to: points.rWaist,
x: points.rWaist.x + options.paperlessOffset
});
macro("vd", {
from: points.lWaist,
to: points.lLeg,
x: points.lLeg.x + options.paperlessOffset
});
if (options.hem > 0) {
macro("vd", {
from: points.lLeg,
to: points.lHem,
x: points.lLeg.x + options.paperlessOffset
});
}
if (store.get("nrOfDarts") > 0) {
macro("hd", {
from: points.lWaist,
to: points.dart1Middle,
y: points.dart1Middle.y
});
macro("hd", {
from: points.lWaist,
to: points.dart1Start,
y: points.dart1Start.y - options.paperlessOffset
});
macro("hd", {
from: points.dart1Start,
to: points.dart1End,
y: points.dart1End.y - options.paperlessOffset
});
if (store.get("nrOfDarts") > 1) {
macro("hd", {
from: points.lWaist,
to: points.dart2Middle,
y: points.dart2Middle.y
});
macro("hd", {
from: points.dart1End,
to: points.dart2Start,
y: points.dart2Start.y - options.paperlessOffset
});
macro("hd", {
from: points.dart2Start,
to: points.dart2End,
y: points.dart2End.y - options.paperlessOffset
});
macro("hd", {
from: points.dart2End,
to: points.rWaist,
y: points.rWaist.y - options.paperlessOffset
});
macro("vd", {
from: points.lWaist,
to: points.dart2Middle,
x: points.lWaist.x - options.paperlessOffset
});
macro("vd", {
from: points.dart2Middle,
to: points.dart1Middle,
x: points.lWaist.x - options.paperlessOffset
});
macro("vd", {
from: points.dart1Middle,
to: points.lSeat,
x: points.lWaist.x - options.paperlessOffset
});
} else {
macro("vd", {
from: points.lWaist,
to: points.dart1Middle,
x: points.lWaist.x - options.paperlessOffset
});
macro("hd", {
from: points.dart1End,
to: points.rWaist,
y: points.rWaist.y - options.paperlessOffset
});
macro("vd", {
from: points.dart1Middle,
to: points.lSeat,
x: points.lWaist.x - options.paperlessOffset
});
}
} else {
macro("hd", {
from: points.lWaist,
to: points.rWaist,
y: points.rWaist.y - options.paperlessOffset
});
macro("vd", {
from: points.lWaist,
to: points.lSeat,
x: points.lWaist.x - options.paperlessOffset
});
}
}
}
export { BuildMainShape };
import { addDartToCurve, dartCalc } from './utils'
function BuildMainShape(part, frontPart) {
let {
sa,
options,
measurements,
Point,
Path,
points,
paths,
store,
paperless,
macro
} = part.shorthand()
let skirtLength = measurements.naturalWaistToKnee * (1 + options.lengthBonus) // + options.hem;
store.set('skirtLength', skirtLength)
let waistEase = options.waistEase
let seatEase = options.seatEase
let dartDepthFactor = frontPart ? options.frontDartDepthFactor : options.backDartDepthFactor
let waist = measurements.naturalWaist
let seat = measurements.seatCircumference > waist ? measurements.seatCircumference : waist
dartCalc(options, seat, seatEase, waist, waistEase)
let nrOfDarts = options.nrOfDarts
let dartSize = options.frontDartSize
if (frontPart == false) {
dartSize = options.backDartSize
}
if (dartSize <= 0) {
nrOfDarts = 0
}
store.set('nrOfDarts', nrOfDarts)
store.set('dartSize', dartSize)
let sideSeamShift = (frontPart ? -1 : 1) * options.sideSeamShiftPercentage * seat
seat += seatEase
waist += waistEase
let sideSeam = seat / 4 + sideSeamShift
points.lWaist = new Point(0, 0)
points.lLeg = new Point(0, skirtLength)
points.rWaistOriginal = new Point(sideSeam, 0)
points.rLeg = new Point(sideSeam + (options.hemBonus * seat) / 10, skirtLength)
points.lSeat = new Point(0, measurements.naturalWaistToSeat)
points.rSeat = new Point(sideSeam, measurements.naturalWaistToSeat)
points.rWaistCPdown = new Point(sideSeam, measurements.naturalWaistToSeat / 3)
points.rSeatCPup = new Point(sideSeam, (measurements.naturalWaistToSeat / 3) * 2)
points.rSeatCPdown = points.rSeat.shift(
270,
((measurements.naturalWaistToSeat - measurements.naturalWaistToHip) *
Math.abs((options.hemBonus * seat) / 10)) /
options.hipCurveDividerDown
)
//$p->newPoint('pH', $sideSeam, $model->m('naturalWaistToHip') -$this->o('waistSideSeamRise'));
let waistFactor = 0.99
let sideFactor = 0.97
let wdelta = 1
let sdelta = 1
let iteration = 0
let waistCurve = null
let waistPath = null
let waistPathSA = null
let waistLength = 0
let sideSeamPath = null
let sideSeamLength = 0
let curve1 = null
let curve2 = null
do {
if (wdelta < -1) {
waistFactor *= 0.9995
} else if (wdelta > 1) {
waistFactor *= 1.01
}
if (sdelta < -1) {
sideFactor *= 0.995
} else if (sdelta > 1) {
sideFactor *= 1.01
}
points.rWaistTemp1 = points.lWaist.shift(0, (waist / 4) * waistFactor)
points.rWaistTemp2 = points.rWaistTemp1.shift(0, dartSize * nrOfDarts)
points.rWaist = points.rWaistTemp2.shift(90, 16 * sideFactor)
points.lWaistCP = points.lWaist.shift(0, seat / 12)
points.rWaistCPleft = points.rWaist.shift(
points.rWaist.angle(points.rWaistCPdown) - 90,
waist / 16
)
waistCurve = new Path()
.move(points.lWaist)
.curve(points.lWaistCP, points.rWaistCPleft, points.rWaist)
.setRender(false)
if (nrOfDarts > 0) {
curve1 = addDartToCurve(
part,
waistCurve,
seat / 4 / options.curvePlacement,
dartSize,
measurements.naturalWaistToSeat * dartDepthFactor
)
waistLength = curve1.left.length()
points.dart1Start = curve1.dart.start()
points.dart1Middle = curve1.dart.ops[1].to
points.dart1End = curve1.dart.end()
if (nrOfDarts > 1) {
curve2 = addDartToCurve(
part,
curve1.right,
options.dart2offset,
dartSize,
measurements.naturalWaistToSeat * dartDepthFactor * options.dart2factor
)
waistLength += curve2.left.length()
waistLength += curve2.right.length()
waistPath = curve1.left.join(
curve1.dart.join(curve2.left.join(curve2.dart.join(curve2.right)))
)
waistPathSA = curve1.left.join(curve2.left.join(curve2.right))
points.dart2Start = curve2.dart.start()
points.dart2Middle = curve2.dart.ops[1].to
points.dart2End = curve2.dart.end()
} else {
waistLength += curve1.right.length()
waistPath = curve1.left.join(curve1.dart.join(curve1.right))
waistPathSA = curve1.left.join(curve1.right)
}
} else {
waistLength = waistCurve.length()
waistPath = waistCurve
waistPathSA = waistCurve.clone()
}
sideSeamPath = new Path()
.move(points.rLeg)
.curve(points.rLeg, points.rSeatCPdown, points.rSeat)
.curve(points.rSeatCPup, points.rWaistCPdown, points.rWaist)
wdelta = waist / 4 - waistLength
if (frontPart) sdelta = 0
else {
sideSeamLength = sideSeamPath.length()
sdelta = store.get('sideSeamLength') - sideSeamLength
}
} while ((Math.abs(wdelta) > 1 || Math.abs(sdelta) > 1) && iteration++ < 100)
paths.waist1 = waistCurve.translate(0, 10).attr('class', 'lining dashed')
if (iteration >= 100) {
throw 'Too many iterations trying to make it fit!'
}
if (frontPart) {
sideSeamLength = sideSeamPath.length()
store.set('sideSeamLength', sideSeamLength)
}
points.lHem = points.lLeg
points.rHem = points.rLeg
paths.hem = new Path()
.move(points.lLeg)
.line(points.rLeg)
.attr('class', 'fabric stroke-sm')
.setRender(false)
if (options.hem > 0) {
// Create the inverse of the curve from the leg to the waist
// Then split it at the hem level
points.lHem = points.lLeg.shift(270, options.hem)
let rInverseSeat = points.rSeat.shift(270, (points.rLeg.y - points.rSeat.y) * 2)
let rInverseSeatCP = rInverseSeat.shift(90, points.rSeatCPdown.y - points.rSeat.y)
let rInversePath = new Path().move(rInverseSeat).curve(rInverseSeatCP, points.rLeg, points.rLeg)
points.rHem = rInversePath.intersectsY(points.lHem.y)[0]
let sideSeamHemPath = rInversePath.split(points.rHem)[1]
sideSeamPath = sideSeamHemPath.join(sideSeamPath)
paths.hem.setRender(true)
}
paths.leftSide = new Path()
.move(points.lWaist)
.line(points.lHem)
.setRender(false)
paths.bottom = new Path()
.move(points.lHem)
.line(points.rHem)
.setRender(false)
paths.sideSeam = sideSeamPath.setRender(false)
// Turn the path in the other direction, to comply with the counter-clockwise guideline
paths.waist = waistPath.reverse().setRender(false)
paths.waistSA = waistPathSA.reverse().setRender(false)
points.titleAnchor = new Point(measurements.naturalWaist / 6, measurements.naturalWaistToSeat)
points.logoAnchor = points.titleAnchor.shift(270, 75)
points.grainlineTop = points.lWaist.shift(0, 50).shift(270, 50)
points.grainlineBottom = points.lLeg.shift(0, 50).shift(90, 50)
if (paperless) {
macro('hd', {
from: points.lSeat,
to: points.rSeat,
y: points.rSeat.y
})
macro('vd', {
from: points.lWaist,
to: points.rWaist,
x: points.rWaist.x + options.paperlessOffset + sa
})
macro('vd', {
from: points.lWaist,
to: points.lLeg,
x: points.lLeg.x + options.paperlessOffset + sa
})
if (options.hem > 0) {
macro('vd', {
from: points.lLeg,
to: points.lHem,
x: points.lLeg.x + options.paperlessOffset + sa
})
}
if (store.get('nrOfDarts') > 0) {
macro('hd', {
from: points.lWaist,
to: points.dart1Middle,
y: points.dart1Middle.y
})
macro('hd', {
from: points.lWaist,
to: points.dart1Start,
y: points.dart1Start.y - options.paperlessOffset - sa
})
macro('hd', {
from: points.dart1Start,
to: points.dart1End,
y: points.dart1End.y - options.paperlessOffset - sa
})
if (store.get('nrOfDarts') > 1) {
macro('hd', {
from: points.lWaist,
to: points.dart2Middle,
y: points.dart2Middle.y
})
macro('hd', {
from: points.dart1End,
to: points.dart2Start,
y: points.dart2Start.y - options.paperlessOffset - sa
})
macro('hd', {
from: points.dart2Start,
to: points.dart2End,
y: points.dart2End.y - options.paperlessOffset - sa
})
macro('hd', {
from: points.dart2End,
to: points.rWaist,
y: points.rWaist.y - options.paperlessOffset - sa
})
macro('vd', {
from: points.lWaist,
to: points.dart2Middle,
x: points.lWaist.x - options.paperlessOffset - sa
})
macro('vd', {
from: points.dart2Middle,
to: points.dart1Middle,
x: points.lWaist.x - options.paperlessOffset - sa
})
macro('vd', {
from: points.dart1Middle,
to: points.lSeat,
x: points.lWaist.x - options.paperlessOffset - sa
})
} else {
macro('vd', {
from: points.lWaist,
to: points.dart1Middle,
x: points.lWaist.x - options.paperlessOffset - sa
})
macro('hd', {
from: points.dart1End,
to: points.rWaist,
y: points.rWaist.y - options.paperlessOffset - sa
})
macro('vd', {
from: points.dart1Middle,
to: points.lSeat,
x: points.lWaist.x - options.paperlessOffset - sa
})
}
} else {
macro('hd', {
from: points.lWaist,
to: points.rWaist,
y: points.rWaist.y - options.paperlessOffset - sa
})
macro('vd', {
from: points.lWaist,
to: points.lSeat,
x: points.lWaist.x - options.paperlessOffset - sa
})
}
}
}
export { BuildMainShape }

View file

@ -1,88 +1,86 @@
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand();
let waistEase = options.waistEase;
let waist = measurements.naturalWaist;
waist += waistEase;
points.TL = new Point(0, 0);
points.BL = new Point(0, waist / 2 + options.waistBandOverlap);
points.TR = new Point(options.waistBandWidth, 0);
points.BR = new Point(
options.waistBandWidth,
waist / 2 + options.waistBandOverlap
);
points.titleAnchor = new Point(options.waistBandWidth / 2, waist / 6);
points.logoAnchor = new Point(options.waistBandWidth / 2, waist / 3);
paths.outline = new Path()
.move(points.TL)
.line(points.BL)
.line(points.BR)
.line(points.TR)
.line(points.TL)
.close()
.attr("class", "fabric");
// Complete?
if (complete) {
macro("cutonfold", {
from: points.TR,
to: points.TL,
margin: 15,
offset: 15,
grainline: true
});
snippets.logo = new Snippet("logo", points.logoAnchor);
macro("title", {
at: points.titleAnchor,
title: "1x " + "fromFabric"
});
if (sa) {
paths.sa = new Path()
.move(points.TL)
.join(
new Path()
.move(points.TL)
.line(points.BL)
.line(points.BR)
.line(points.TR)
.offset(sa)
)
.line(points.TR)
.attr("class", "fabric sa");
}
}
if (paperless) {
macro("vd", {
from: points.TL,
to: points.BL,
x: points.TL.x + options.paperlessOffset
});
macro("hd", {
from: points.BL,
to: points.BR,
y: points.BR.y - options.paperlessOffset
});
}
return part;
}
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand()
let waistEase = options.waistEase
let waist = measurements.naturalWaist
waist += waistEase
points.TL = new Point(0, 0)
points.BL = new Point(0, waist / 2 + options.waistBandOverlap)
points.TR = new Point(options.waistBandWidth, 0)
points.BR = new Point(options.waistBandWidth, waist / 2 + options.waistBandOverlap)
points.titleAnchor = new Point(options.waistBandWidth / 2, waist / 6)
points.logoAnchor = new Point(options.waistBandWidth / 2, waist / 3)
paths.outline = new Path()
.move(points.TL)
.line(points.BL)
.line(points.BR)
.line(points.TR)
.line(points.TL)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
macro('cutonfold', {
from: points.TR,
to: points.TL,
margin: 15,
offset: 15,
grainline: true
})
snippets.logo = new Snippet('logo', points.logoAnchor)
macro('title', {
nr: 3,
at: points.titleAnchor,
title: 'waistband'
})
if (sa) {
paths.sa = new Path()
.move(points.TL)
.join(
new Path()
.move(points.TL)
.line(points.BL)
.line(points.BR)
.line(points.TR)
.offset(sa)
)
.line(points.TR)
.attr('class', 'fabric sa')
}
}
if (paperless) {
macro('vd', {
from: points.TL,
to: points.BL,
x: points.TL.x + options.paperlessOffset
})
macro('hd', {
from: points.BL,
to: points.BR,
y: points.BR.y - options.paperlessOffset
})
}
return part
}

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -49,6 +49,13 @@ function useBackend(baseURL, timeout = 10000) {
backend.removeRecipe = (handle, token) => api.delete('/recipes/' + handle, auth(token)) // Remove recipe
backend.saveRecipe = (handle, data, token) => api.put('/recipes/' + handle, data, auth(token)) // Update recipe
// Admin
backend.adminSearch = (query, token) => api.post('/admin/search', { query }, auth(token)) // Search users as admin
backend.adminSetPatronStatus = (data, token) => api.put('/admin/patron', data, auth(token)) // Set patron status for a user
backend.adminSetRole = (data, token) => api.put('/admin/role', data, auth(token)) // Set role for a user
backend.adminUnfreeze = (data, token) => api.put('/admin/unfreeze', data, auth(token)) // Unfreeze a user account
backend.adminImpersonate = (data, token) => api.post('/admin/impersonate', data, auth(token)) // Impersonate a user
return backend
}

View file

@ -1,22 +1,15 @@
import React from "react";
import freesewing from "@freesewing/core";
import Workbench from "@freesewing/components/Workbench";
import "typeface-roboto-condensed";
import "@freesewing/css-theme";
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";
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"
/>
);
};
let instance = new Pattern()
let config = instance.config
return <Workbench freesewing={freesewing} Pattern={Pattern} config={config} userLanguage="en" />
}
export default App;
export default App

View file

@ -1,48 +1,43 @@
import { version } from "../package.json";
import { version } from '../package.json'
// ?? 🤔 ?? --> https://en.freesewing.dev/packages/core/config
export default {
name: "waralee",
version: "0.0.1",
design: "woutervdub",
code: "woutervdub",
department: "menswear",
type: "pattern",
name: 'waralee',
version,
design: 'Wouter Van Wageningen',
code: 'Wouter Van Wageningen',
department: 'menswear',
type: 'pattern',
difficulty: 3,
tags: [
"freesewing",
"design",
"diy",
"fashion",
"made to measure",
"parametric design",
"pattern",
"sewing",
"sewing pattern"
'freesewing',
'design',
'diy',
'fashion',
'made to measure',
'parametric design',
'pattern',
'sewing',
'sewing pattern'
],
optionGroups: {
fit: ["legShortening", "waistOverlap", "backRaise"],
fit: ['legShortening', 'waistOverlap', 'backRaise'],
advanced: [
"crotchFront",
"crotchBack",
"crotchFactorBackHor",
"crotchFactorBackVer",
"crotchFactorFrontHor",
"crotchFactorFrontVer",
"waistRaise"
'crotchFront',
'crotchBack',
'crotchFactorBackHor',
'crotchFactorBackVer',
'crotchFactorFrontHor',
'crotchFactorFrontVer',
'waistRaise'
]
},
measurements: [
"hipsCircumference",
"seatCircumference",
"inseam",
"seatDepth"
],
measurements: ['seatCircumference', 'inseam', 'seatDepth'],
dependencies: {},
inject: { pants: "pantsproto", mini: "pantsproto" },
inject: { pants: 'pantsproto', mini: 'pantsproto' },
hide: [],
parts: ["cutout", "pocket", "backPocket", "facings"],
parts: ['cutout', 'pocket', 'backPocket', 'facings'],
options: {
minimizer: 5,
frontPocketVerticalOffset: 0.07,
@ -68,4 +63,4 @@ export default {
legShortening: { pct: 25, min: -10, max: 50 },
backRaise: { pct: 10, min: 0, max: 25 }
}
};
}

File diff suppressed because it is too large Load diff

View file

@ -1,76 +1,72 @@
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand();
let pocketDepth = options.backPocketDepth;
points.topLeft = new Point(0, 0);
points.bottomLeft = points.topLeft.shift(
270,
(pocketDepth + 30) * 2 +
options.backPocketVerticalOffset * measurements.seatDepth
);
points.topRight = points.topLeft.shift(
0,
options.backPocketSize * measurements.seatDepth + 24
);
points.bottomRight = points.topRight.shift(
270,
(pocketDepth + 30) * 2 +
options.backPocketVerticalOffset * measurements.seatDepth
);
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottomLeft)
.line(points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr("class", "fabric");
// Complete?
if (complete) {
points.title = points.topLeft.shift(270, 75).shift(0, 50);
macro("title", {
at: points.title,
title: "2x " + "fromFabric"
});
points.logo = points.title.shift(270, 75);
snippets.logo = new Snippet("logo", points.logo);
points.text = points.logo
.shift(-90, 25)
.attr("data-text", "Waralee")
.attr("data-text-class", "center");
}
// Paperless?
if (paperless) {
macro("hd", {
from: points.topLeft,
to: points.topRight,
y: points.topLeft.y + 15
});
macro("vd", {
from: points.topLeft,
to: points.bottomLeft,
x: points.topLeft.x + 15
});
}
return part;
}
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand()
let pocketDepth = options.backPocketDepth
points.topLeft = new Point(0, 0)
points.bottomLeft = points.topLeft.shift(
270,
(pocketDepth + 30) * 2 + options.backPocketVerticalOffset * measurements.seatDepth
)
points.topRight = points.topLeft.shift(0, options.backPocketSize * measurements.seatDepth + 24)
points.bottomRight = points.topRight.shift(
270,
(pocketDepth + 30) * 2 + options.backPocketVerticalOffset * measurements.seatDepth
)
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottomLeft)
.line(points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
points.title = points.topLeft.shift(270, 75).shift(0, 50)
macro('title', {
nr: 4,
at: points.title,
title: 'backPocket'
})
points.logo = points.title.shift(270, 75)
snippets.logo = new Snippet('logo', points.logo)
points.text = points.logo
.shift(-90, 25)
.attr('data-text', 'Waralee')
.attr('data-text-class', 'center')
}
// Paperless?
if (paperless) {
macro('hd', {
from: points.topLeft,
to: points.topRight,
y: points.topLeft.y + 15
})
macro('vd', {
from: points.topLeft,
to: points.bottomLeft,
x: points.topLeft.x + 15
})
}
return part
}

View file

@ -1,84 +1,85 @@
import { CreateCrotchPoints } from "./util";
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand();
let seatDepth = measurements.seatDepth + (measurements.seatDepth *options.waistRaise );
points.mWaist = new Point(0, 0);
points.mHip = points.mWaist.shift(270, seatDepth);
CreateCrotchPoints(part);
points.mWaist1 = new Point( points.mWaist.x, points.fWaistSide.y );
points.mWaist2 = new Point( points.mWaist.x, points.bWaistSide.y );
paths.seam = new Path()
.move(points.mWaist1)
.line(points.fWaistSide)
.curve(points.fWaistCrotchCP, points.fHipCrotchCP, points.mHip)
.curve(points.bHipCrotchCP, points.bWaistCrotchCP, points.bWaistSide)
.line(points.mWaist2)
.line(points.mWaist1)
.close()
.attr("class", "fabric");
// Complete?
if (complete) {
points.logo = points.mWaist.shift(270, 75);
snippets.logo = new Snippet("logo", points.logo);
points.text = points.logo
.shift(-90, 25)
.attr("data-text", "Waralee")
.attr("data-text-class", "center");
if (sa) {
paths.seamAlternate = new Path()
.move(points.bWaistSide)
.curve(points.bWaistCrotchCP, points.bHipCrotchCP, points.mHip)
.curve(points.fHipCrotchCP, points.fWaistCrotchCP, points.fWaistSide);
paths.sa = paths.seamAlternate.offset(sa).attr("class", "fabric sa");
}
}
// Paperless?
if (paperless) {
macro("hd", {
from: points.fWaistSide,
to: points.mWaist,
y: points.mWaist.y
});
macro("hd", {
from: points.mWaist,
to: points.bWaistSide,
y: points.mWaist.y
});
macro("vd", {
from: points.mWaist1,
to: points.mHip,
x: points.mWaist.x
});
macro("vd", {
from: points.mWaist2,
to: points.mWaist1,
x: points.mWaist.x +15
});
}
return part;
}
import { CreateCrotchPoints } from './util'
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand()
let seatDepth = measurements.seatDepth + measurements.seatDepth * options.waistRaise
points.mWaist = new Point(0, 0)
points.mHip = points.mWaist.shift(270, seatDepth)
CreateCrotchPoints(part)
points.mWaist1 = new Point(points.mWaist.x, points.fWaistSide.y)
points.mWaist2 = new Point(points.mWaist.x, points.bWaistSide.y)
paths.seam = new Path()
.move(points.mWaist1)
.line(points.fWaistSide)
.curve(points.fWaistCrotchCP, points.fHipCrotchCP, points.mHip)
.curve(points.bHipCrotchCP, points.bWaistCrotchCP, points.bWaistSide)
.line(points.mWaist2)
.line(points.mWaist1)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
points.logo = points.mWaist.shift(270, 75)
snippets.logo = new Snippet('logo', points.logo)
points.title = points.logo.shift(-90, 55)
macro('title', {
nr: 2,
at: points.title,
title: 'cutout'
})
if (sa) {
paths.seamAlternate = new Path()
.move(points.bWaistSide)
.curve(points.bWaistCrotchCP, points.bHipCrotchCP, points.mHip)
.curve(points.fHipCrotchCP, points.fWaistCrotchCP, points.fWaistSide)
paths.sa = paths.seamAlternate.offset(sa).attr('class', 'fabric sa')
}
}
// Paperless?
if (paperless) {
macro('hd', {
from: points.fWaistSide,
to: points.mWaist,
y: points.mWaist.y
})
macro('hd', {
from: points.mWaist,
to: points.bWaistSide,
y: points.mWaist.y
})
macro('vd', {
from: points.mWaist1,
to: points.mHip,
x: points.mWaist.x
})
macro('vd', {
from: points.mWaist2,
to: points.mWaist1,
x: points.mWaist.x + 15
})
}
return part
}

View file

@ -1,99 +1,103 @@
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand();
let frontPocketSize = options.frontPocketSize * measurements.seatDepth;
let backPocketSize = options.backPocketSize * measurements.seatDepth;
points.frontTL = new Point(0, 0);
points.frontTR = points.frontTL.shift(0, frontPocketSize + 24);
points.frontBL = points.frontTL.shift(270, frontPocketSize / 2);
points.frontBR = points.frontTR.shift(270, frontPocketSize / 2);
points.backTL = points.frontBL.shift(270, 50);
points.backTR = points.backTL.shift(0, backPocketSize + 24);
points.backBL = points.backTL.shift(270, backPocketSize / 2);
points.backBR = points.backTR.shift(270, backPocketSize / 2);
paths.frontSeam = new Path()
.move(points.frontTL)
.line(points.frontBL)
.line(points.frontBR)
.line(points.frontTR)
.line(points.frontTL)
.close()
.attr("class", "fabric");
paths.backSeam = new Path()
.move(points.backTL)
.line(points.backBL)
.line(points.backBR)
.line(points.backTR)
.line(points.backTL)
.close()
.attr("class", "fabric");
// Complete?
if (complete) {
points.frontTitle = points.frontTL.shift(270, 15).shift(0, 50);
macro("title", {
at: points.frontTitle.shift(0,30),
title: "4x fromFabric"
});
points.frontLogo = points.frontTitle.shift(270, 15);
snippets.frontLogo = new Snippet("logo", points.frontLogo).attr("data-scale", 0.4);
points.frontText = points.frontLogo
.shift(-90, 25)
.attr("data-text", "Waralee")
.attr("data-text-class", "center");
points.backTitle = points.backTL.shift(270, 15).shift(0, 50);
macro("title", {
at: points.backTitle.shift(0,30),
title: "4x fromFabric"
});
points.backLogo = points.backTitle.shift(270, 15);
snippets.backLogo = new Snippet("logo", points.backLogo).attr("data-scale", 0.4);
points.backText = points.backLogo
.shift(-90, 25)
.attr("data-text", "Waralee")
.attr("data-text-class", "center");
}
// Paperless?
if (paperless) {
macro("hd", {
from: points.frontTL,
to: points.frontTR,
y: points.frontTL.y + 15
});
macro("hd", {
from: points.backTL,
to: points.backTR,
y: points.backTL.y + 15
});
macro("vd", {
from: points.frontTL,
to: points.frontBL,
x: points.frontTL.x + 15
});
macro("vd", {
from: points.backTL,
to: points.backBL,
x: points.backTL.x + 15
});
}
return part;
}
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand()
let frontPocketSize = options.frontPocketSize * measurements.seatDepth
let backPocketSize = options.backPocketSize * measurements.seatDepth
points.frontTL = new Point(0, 0)
points.frontTR = points.frontTL.shift(0, frontPocketSize + 24)
points.frontBL = points.frontTL.shift(270, frontPocketSize / 2)
points.frontBR = points.frontTR.shift(270, frontPocketSize / 2)
points.backTL = points.frontBL.shift(270, 50)
points.backTR = points.backTL.shift(0, backPocketSize + 24)
points.backBL = points.backTL.shift(270, backPocketSize / 2)
points.backBR = points.backTR.shift(270, backPocketSize / 2)
paths.frontSeam = new Path()
.move(points.frontTL)
.line(points.frontBL)
.line(points.frontBR)
.line(points.frontTR)
.line(points.frontTL)
.close()
.attr('class', 'fabric')
paths.backSeam = new Path()
.move(points.backTL)
.line(points.backBL)
.line(points.backBR)
.line(points.backTR)
.line(points.backTL)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
points.frontTitle = points.frontTL.shift(270, 15).shift(0, 50)
macro('title', {
nr: 5,
at: points.frontTitle.shift(0, 30),
title: 'frontFacing',
prefix: 'front'
})
points.frontLogo = points.frontTitle.shift(270, 15)
snippets.frontLogo = new Snippet('logo', points.frontLogo).attr('data-scale', 0.4)
points.frontText = points.frontLogo
.shift(-90, 25)
.attr('data-text', 'Waralee')
.attr('data-text-class', 'center')
points.backTitle = points.backTL.shift(270, 15).shift(0, 50)
macro('title', {
nr: 6,
at: points.backTitle.shift(0, 30),
title: 'backFacing',
prefix: 'back'
})
points.backLogo = points.backTitle.shift(270, 15)
snippets.backLogo = new Snippet('logo', points.backLogo).attr('data-scale', 0.4)
points.backText = points.backLogo
.shift(-90, 25)
.attr('data-text', 'Waralee')
.attr('data-text-class', 'center')
}
// Paperless?
if (paperless) {
macro('hd', {
from: points.frontTL,
to: points.frontTR,
y: points.frontTL.y + 15
})
macro('hd', {
from: points.backTL,
to: points.backTR,
y: points.backTL.y + 15
})
macro('vd', {
from: points.frontTL,
to: points.frontBL,
x: points.frontTL.x + 15
})
macro('vd', {
from: points.backTL,
to: points.backBL,
x: points.backTL.x + 15
})
}
return part
}

View file

@ -0,0 +1,101 @@
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand()
let frontPocketSize = options.frontPocketSize * measurements.seatDepth
let backPocketSize = options.backPocketSize * measurements.seatDepth
points.frontTL = new Point(0, 0)
points.frontTR = points.frontTL.shift(0, frontPocketSize + 24)
points.frontBL = points.frontTL.shift(270, frontPocketSize / 2)
points.frontBR = points.frontTR.shift(270, frontPocketSize / 2)
points.backTL = points.frontBL.shift(270, 50)
points.backTR = points.backTL.shift(0, backPocketSize + 24)
points.backBL = points.backTL.shift(270, backPocketSize / 2)
points.backBR = points.backTR.shift(270, backPocketSize / 2)
paths.frontSeam = new Path()
.move(points.frontTL)
.line(points.frontBL)
.line(points.frontBR)
.line(points.frontTR)
.line(points.frontTL)
.close()
.attr('class', 'fabric')
paths.backSeam = new Path()
.move(points.backTL)
.line(points.backBL)
.line(points.backBR)
.line(points.backTR)
.line(points.backTL)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
points.frontTitle = points.frontTL.shift(270, 15).shift(0, 50)
macro('title', {
nr: 5,
at: points.frontTitle.shift(0, 30),
title: '4x fromFabric'
})
points.frontLogo = points.frontTitle.shift(270, 15)
snippets.frontLogo = new Snippet('logo', points.frontLogo).attr('data-scale', 0.4)
points.frontText = points.frontLogo
.shift(-90, 25)
.attr('data-text', 'Waralee')
.attr('data-text-class', 'center')
points.backTitle = points.backTL.shift(270, 15).shift(0, 50)
macro('title', {
nr: 6,
at: points.backTitle.shift(0, 30),
title: '4x fromFabric'
})
points.backLogo = points.backTitle.shift(270, 15)
snippets.backLogo = new Snippet('logo', points.backLogo).attr('data-scale', 0.4)
points.backText = points.backLogo
.shift(-90, 25)
.attr('data-text', 'Waralee')
.attr('data-text-class', 'center')
}
// Paperless?
if (paperless) {
macro('hd', {
from: points.frontTL,
to: points.frontTR,
y: points.frontTL.y + 15
})
macro('hd', {
from: points.backTL,
to: points.backTR,
y: points.backTL.y + 15
})
macro('vd', {
from: points.frontTL,
to: points.frontBL,
x: points.frontTL.x + 15
})
macro('vd', {
from: points.backTL,
to: points.backBL,
x: points.backTL.x + 15
})
}
return part
}

View file

@ -1,4 +1,4 @@
import { CreateCrotchPoints } from "./util";
import { CreateCrotchPoints } from './util'
export default function(part) {
let {
@ -14,135 +14,125 @@ export default function(part) {
sa,
paperless,
macro
} = part.shorthand();
let seatDepth =
measurements.seatDepth + measurements.seatDepth * options.waistRaise;
let circumference = measurements.seatCircumference;
let circumference4 = circumference / 4;
} = part.shorthand()
let seatDepth = measurements.seatDepth + measurements.seatDepth * options.waistRaise
let circumference = measurements.seatCircumference
let circumference4 = circumference / 4
paths.waistFoldBack = paths.waistBack
.offset(-1 * options.waistBand)
.attr("class", "fabric stroke-sm");
.attr('class', 'fabric stroke-sm')
paths.waistFoldFront = paths.waistFront
.offset(-1 * options.waistBand)
.attr("class", "fabric stroke-sm");
paths.frontFold = paths.front
.offset(-1 * options.hem)
.attr("class", "fabric stroke-sm");
paths.legFold = paths.leg
.offset(-1 * options.hem)
.attr("class", "fabric stroke-sm");
paths.backFold = paths.back
.offset(-1 * options.hem)
.attr("class", "fabric stroke-sm");
.attr('class', 'fabric stroke-sm')
paths.frontFold = paths.front.offset(-1 * options.hem).attr('class', 'fabric stroke-sm')
paths.legFold = paths.leg.offset(-1 * options.hem).attr('class', 'fabric stroke-sm')
paths.backFold = paths.back.offset(-1 * options.hem).attr('class', 'fabric stroke-sm')
// Complete?
if (complete) {
points.logo = points.fWaistFront.shift(270, 400);
snippets.logo = new Snippet("logo", points.logo);
points.text = points.logo
.shift(-90, 50)
.attr("data-text", "hello")
.attr("data-text-class", "center");
points.logo = points.fWaistFront.shift(270, 400)
snippets.logo = new Snippet('logo', points.logo)
points.title = points.logo.shift(-90, 50)
macro('title', {
nr: 1,
at: points.title,
title: 'pants'
})
if (sa) {
paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
}
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
}
// Paperless?
if (paperless) {
macro("hd", {
macro('hd', {
from: points.fWaistSide,
to: points.mWaist,
y: points.fWaistSide.y
});
macro("hd", {
})
macro('hd', {
from: points.fWaistFrontOverlap,
to: points.mWaist,
y: points.fWaistSide.y - sa - 15
});
macro("hd", {
})
macro('hd', {
from: points.mWaist,
to: points.bWaistSide,
y: points.bWaistSide.y
});
macro("hd", {
})
macro('hd', {
from: points.mWaist,
to: points.bWaistBack,
y: points.bWaistSide.y - sa - 15
});
macro("hd", {
})
macro('hd', {
from: points.mWaist,
to: points.bWaistBackOverlap,
y: points.bWaistSide.y - sa - 30
});
macro("vd", {
})
macro('vd', {
from: points.mWaist,
to: points.mHip,
x: points.mWaist.x
});
macro("vd", {
})
macro('vd', {
from: points.bWaistSide,
to: points.bWaistBack,
x: points.bWaistSide.x + 15
});
macro("vd", {
})
macro('vd', {
from: points.bWaistBackOverlap,
to: points.bLegBackOverlap,
x: points.bLegBackOverlap.x - 30
});
})
if (options.frontPocket) {
macro("vd", {
macro('vd', {
from: points.fWaistSide,
to: points.frontPocketTop,
x: points.frontPocketTop.x
});
macro("vd", {
})
macro('vd', {
from: points.fWaistSide,
to: points.frontPocketBottom,
x: points.frontPocketBottom.x
});
macro("hd", {
})
macro('hd', {
from: points.frontPocketTop,
to: points.fWaistSide,
y: points.frontPocketTop.y
});
macro("hd", {
})
macro('hd', {
from: points.frontPocketBottom,
to: points.fWaistSide,
y: points.frontPocketBottom.y
});
})
}
if (options.backPocket) {
macro("vd", {
macro('vd', {
from: points.bWaistSide,
to: points.backPocketLeft,
x: points.backPocketLeft.x
});
macro("vd", {
})
macro('vd', {
from: points.bWaistSide,
to: points.backPocketRight,
x: points.backPocketRight.x
});
macro("hd", {
})
macro('hd', {
from: points.bWaistSide,
to: points.backPocketLeft,
y: points.backPocketLeft.y
});
macro("hd", {
})
macro('hd', {
from: points.bWaistSide,
to: points.backPocketRight,
y: points.backPocketRight.y
});
}
})
}
}
return part;
return part
}

View file

@ -1,103 +1,105 @@
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand();
let pocketDepth = measurements.seatDepth * options.frontPocketDepthFactor;
points.topLeft = new Point(0, 0);
points.bottomLeft = points.topLeft.shift(270, pocketDepth);
points.topRight = points.topLeft.shift(0, pocketDepth * (1 / 3));
points.bottomRight = points.topRight.shift(290, pocketDepth *(5/6));
points.bottomLeftCP = points.bottomLeft.shift(0, pocketDepth * (1 / 6));
points.bottomRightCP = points.bottomRight.shift(225, pocketDepth * (1 / 4));
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottomLeft)
.curve(points.bottomLeftCP, points.bottomRightCP, points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr("class", "fabric");
// Complete?
if (complete) {
macro("cutonfold", {
from: points.topLeft,
to: points.bottomLeft,
margin: 5,
offset: 10
});
points.title = points.topLeft.shift(270, 75).shift(0, 50);
macro("title", {
at: points.title,
title: "1x " + "cutOnFold" + " " + "fromFabric"
});
points.logo = points.title.shift(270, 75);
snippets.logo = new Snippet("logo", points.logo);
points.text = points.logo
.shift(-90, 25)
.attr("data-text", "Waralee")
.attr("data-text-class", "center");
if (sa) {
paths.sa = new Path()
.move(points.bottomLeft)
.join( new Path()
.move(points.bottomLeft)
.curve(points.bottomLeftCP, points.bottomRightCP, points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.offset(sa)
)
.line(points.topLeft)
.attr("class", "fabric sa");
}
}
// Paperless?
if (paperless) {
macro("hd", {
from: points.topLeft,
to: points.topRight,
y: points.topLeft.y + 15
});
macro("hd", {
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomRight.y
});
macro("vd", {
from: points.topLeft,
to: points.bottomLeft,
x: points.topLeft.x + 15
});
macro("vd", {
from: points.topRight,
to: points.bottomRight,
x: points.bottomRight.x
});
macro("vd", {
from: points.bottomRight,
to: points.bottomLeft,
x: points.bottomRight.x
});
}
return part;
}
export default function(part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro
} = part.shorthand()
let pocketDepth = measurements.seatDepth * options.frontPocketDepthFactor
points.topLeft = new Point(0, 0)
points.bottomLeft = points.topLeft.shift(270, pocketDepth)
points.topRight = points.topLeft.shift(0, pocketDepth * (1 / 3))
points.bottomRight = points.topRight.shift(290, pocketDepth * (5 / 6))
points.bottomLeftCP = points.bottomLeft.shift(0, pocketDepth * (1 / 6))
points.bottomRightCP = points.bottomRight.shift(225, pocketDepth * (1 / 4))
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottomLeft)
.curve(points.bottomLeftCP, points.bottomRightCP, points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
macro('cutonfold', {
from: points.topLeft,
to: points.bottomLeft,
margin: 5,
offset: 10
})
points.title = points.topLeft.shift(270, 75).shift(0, 50)
macro('title', {
nr: 3,
at: points.title,
title: 'pocket'
})
points.logo = points.title.shift(270, 75)
snippets.logo = new Snippet('logo', points.logo)
points.text = points.logo
.shift(-90, 25)
.attr('data-text', 'Waralee')
.attr('data-text-class', 'center')
if (sa) {
paths.sa = new Path()
.move(points.bottomLeft)
.join(
new Path()
.move(points.bottomLeft)
.curve(points.bottomLeftCP, points.bottomRightCP, points.bottomRight)
.line(points.topRight)
.line(points.topLeft)
.offset(sa)
)
.line(points.topLeft)
.attr('class', 'fabric sa')
}
}
// Paperless?
if (paperless) {
macro('hd', {
from: points.topLeft,
to: points.topRight,
y: points.topLeft.y + 15
})
macro('hd', {
from: points.bottomLeft,
to: points.bottomRight,
y: points.bottomRight.y
})
macro('vd', {
from: points.topLeft,
to: points.bottomLeft,
x: points.topLeft.x + 15
})
macro('vd', {
from: points.topRight,
to: points.bottomRight,
x: points.bottomRight.x
})
macro('vd', {
from: points.bottomRight,
to: points.bottomLeft,
x: points.bottomRight.x
})
}
return part
}