tada: Initial commit
This commit is contained in:
parent
339c6b2ac5
commit
4ad4c68f2a
22 changed files with 8421 additions and 2 deletions
3
packages/cathrin/.babelrc
Normal file
3
packages/cathrin/.babelrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"plugins": ["transform-object-rest-spread"]
|
||||
}
|
13
packages/cathrin/.editorconfig
Normal file
13
packages/cathrin/.editorconfig
Normal file
|
@ -0,0 +1,13 @@
|
|||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
62
packages/cathrin/.gitignore
vendored
Normal file
62
packages/cathrin/.gitignore
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
dist
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# next.js build output
|
||||
.next
|
2
packages/cathrin/.npmignore
Normal file
2
packages/cathrin/.npmignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
src
|
||||
.editorconfig
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 freesewing
|
||||
Copyright (c) 2018 Joost De Cock
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,2 +1,27 @@
|
|||
<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>
|
||||
</p>
|
||||
<h4 align="center"><em> <a title="Go to freesewing.org" href="https://freesewing.org/">freesewing</a></em>
|
||||
<br><sup>a library for made-to-measure sewing patterns</sup>
|
||||
</h4>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@freesewing/cathrin"><img src="https://badgen.net/npm/v/@freesewing/cathrin" alt="Version"></a>
|
||||
<a href="https://www.npmjs.com/package/@freesewing/cathrin"><img src="https://badgen.net/npm/license/@freesewing/cathrin" alt="License"></a>
|
||||
<a href="https://gitter.im/freesewing/freesewing"><img src="https://badgen.net/badge/chat/on%20Gitter/cyan" alt="Chat on Gitter"></a>
|
||||
<a href="https://freesewing.org/patrons/join"><img src="https://badgen.net/badge/become/a%20Patron/FF5B77" alt="Become a Patron"></a>
|
||||
</p>
|
||||
|
||||
# cathrin
|
||||
A free sewing pattern for an underbust corset or waist trainer
|
||||
|
||||
Cathrin is a [freesewing](https://github.com/freesewing/freesewing) pattern
|
||||
for an underbust corset, aka a waist trainer.
|
||||
|
||||
See [freesewing.org/patterns/cathrin](https://freesewing.org/patterns/cathrin)
|
||||
for more info and examples.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm i --save @freesewing/cathrin
|
||||
```
|
||||
|
||||
|
|
26
packages/cathrin/config/config.js
Normal file
26
packages/cathrin/config/config.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
export default {
|
||||
name: "cathrin",
|
||||
measurements: [
|
||||
"underbust",
|
||||
"naturalWaist",
|
||||
"hipsCircumference",
|
||||
"naturalWaistToUnderbust",
|
||||
"naturalWaistToHip"
|
||||
],
|
||||
options: {
|
||||
// Lists
|
||||
panels: {
|
||||
list: [11, 13],
|
||||
dflt: 13
|
||||
},
|
||||
|
||||
// Percentages
|
||||
waistReduction: { pct: 10, min: 2, max: 20 },
|
||||
backOpening: { pct: 4, min: 3, max: 10 },
|
||||
backRise: { pct: 15, min: 1, max: 25 },
|
||||
backDrop: { pct: 2, min: 0, max: 5 },
|
||||
frontRise: { pct: 4, min: 0, max: 8 },
|
||||
frontDrop: { pct: 5, min: 0, max: 10 },
|
||||
hipRise: { pct: 5, min: 0, max: 15 },
|
||||
}
|
||||
};
|
75
packages/cathrin/index.html
Normal file
75
packages/cathrin/index.html
Normal file
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cathrin</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="svg"></div>
|
||||
<script type="text/javascript" src="node_modules/freesewing/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-bundle/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-theme/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-designer/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-debug/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-validate/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/plugin-i18n/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/models/dist/browser.js"></script>
|
||||
<script type="text/javascript" src="node_modules/@freesewing/antman/dist/browser.js"></script>
|
||||
<script>
|
||||
var pattern = freesewing.patterns.cathrin
|
||||
.with(freesewing.plugins.debug)
|
||||
.with(freesewing.plugins.theme)
|
||||
// .with(freesewing.plugins.designer)
|
||||
.with(freesewing.plugins.validate)
|
||||
.with(freesewing.plugins.i18n)
|
||||
;
|
||||
pattern.settings.locale = 'nl';
|
||||
pattern.settings.paperless = true;
|
||||
pattern.settings.measurements = {
|
||||
underbust: 720,
|
||||
naturalWaist: 640,
|
||||
hipsCircumference: 800,
|
||||
naturalWaistToUnderbust: 100,
|
||||
naturalWaistToHip: 160
|
||||
}
|
||||
pattern.settings.margin = 2;
|
||||
pattern.settings.sa = 10;
|
||||
pattern.settings.units = 'metric';
|
||||
pattern.settings.sample = {
|
||||
type: 'models',
|
||||
focus: 'manSize34',
|
||||
models: freesewing.models.men
|
||||
}
|
||||
|
||||
pattern.options.panels = 13;
|
||||
//pattern.settings.only = ['panels'];
|
||||
//pattern.sampleOption('panels');
|
||||
//pattern.sampleMeasurement('shoulderSlope');
|
||||
//pattern.sampleModels(freesewing.models.men, 'manSize34');
|
||||
//pattern.sample();
|
||||
pattern.draft();
|
||||
document.getElementById("svg").innerHTML = pattern.render();
|
||||
|
||||
function pointHover(evt) {
|
||||
var point = evt.target;
|
||||
var id = point.id;
|
||||
var cx = point.getAttribute('x');
|
||||
var cy = point.getAttribute('y');
|
||||
var name = point.getAttribute('data-point');
|
||||
var part = point.getAttribute('data-part');
|
||||
console.log(name+' ('+cx+', '+cy+') @ '+part);
|
||||
var scale = 2;
|
||||
cx = cx-scale*cx;
|
||||
cy = cy-scale*cy;
|
||||
point.setAttribute("transform", 'matrix('+scale+', 0, 0, '+scale+', '+cx+', '+cy+')');
|
||||
pointUnhover(id);
|
||||
}
|
||||
function pointUnhover(id) {
|
||||
setTimeout(function(){
|
||||
document.getElementById(id).removeAttribute("transform", '');
|
||||
}, 500);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
7158
packages/cathrin/package-lock.json
generated
Normal file
7158
packages/cathrin/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
88
packages/cathrin/package.json
Normal file
88
packages/cathrin/package.json
Normal file
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"version": "0.0.1",
|
||||
"name": "@freesewing/cathrin",
|
||||
"description": "Freesewing pattern for a underbust corset / waist trainer",
|
||||
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/freesewing/cathrin#readme",
|
||||
"repository": "github:freesewing/cathrin",
|
||||
"bugs": {
|
||||
"url": "https://github.com/freesewing/cathrin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"freesewing",
|
||||
"pattern",
|
||||
"sewing",
|
||||
"womenswear",
|
||||
"corset",
|
||||
"underbust"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"unpkg": "dist/browser.js",
|
||||
"scripts": {
|
||||
"precommit": "npm run pretty && lint-staged",
|
||||
"patch": "npm version patch -m ':bookmark: v%s' && npm run build",
|
||||
"minor": "npm version minor -m ':bookmark: v%s' && npm run build",
|
||||
"major": "npm version major -m ':bookmark: v%s' && npm run build",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"clean": "rimraf dist",
|
||||
"pretty": "npx prettier --write \"src/*.js\"",
|
||||
"lint": "eslint --fix \"src/*.js\"",
|
||||
"watch": "npx webpack --watch",
|
||||
"browserbuild": "rollup -c rollup.js -o dist/browser.js -f iife -m true -n freesewing_patterns_cathrin --footer 'freesewing.patterns.cathrin = freesewing_patterns_cathrin;'",
|
||||
"nodebuild": "rollup -c rollup.js -o dist/index.js -f cjs -m true",
|
||||
"modulebuild": "rollup -c rollup.js -o dist/index.mjs -f es -m true",
|
||||
"build": "npm run clean && npm run browserbuild && npm run nodebuild && npm run modulebuild"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,json}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/plugin-bundle": "0.3.0",
|
||||
"freesewing": "0.16.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.56",
|
||||
"@babel/preset-env": "7.0.0-beta.56",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-loader": "^8.0.0-beta.4",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"@freesewing/antman": "0.2.0",
|
||||
"@freesewing/models": "0.4.0",
|
||||
"@freesewing/plugin-debug": "0.1.0",
|
||||
"@freesewing/plugin-designer": "0.7.2",
|
||||
"@freesewing/plugin-theme": "0.13.2",
|
||||
"@freesewing/plugin-validate": "0.2.0",
|
||||
"@freesewing/plugin-i18n": "0.0.1",
|
||||
"eslint": "5.3.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"husky": "^0.14.3",
|
||||
"lint-staged": "^7.2.0",
|
||||
"prettier": "1.14.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"rollup-plugin-babel": "^3.0.7",
|
||||
"rollup-plugin-commonjs": "9.1.3",
|
||||
"rollup-plugin-filesize": "^4.0.1",
|
||||
"rollup-plugin-json": "^3.0.0",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-terser": "^1.0.1"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package-lock.json",
|
||||
"package.json"
|
||||
]
|
||||
}
|
33
packages/cathrin/rollup.js
Normal file
33
packages/cathrin/rollup.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { terser } from "rollup-plugin-terser";
|
||||
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 path from "path";
|
||||
import { name, version, description, author, license } from "./package.json";
|
||||
|
||||
export default {
|
||||
input: "src/index.js",
|
||||
plugins: [
|
||||
resolve({
|
||||
browser: true
|
||||
}),
|
||||
json(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: "node_modules/**"
|
||||
}),
|
||||
terser({
|
||||
output: {
|
||||
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||
}
|
||||
})
|
||||
],
|
||||
external: ["freesewing", "@freesewing/plugin-bundle"],
|
||||
output: {
|
||||
globals: {
|
||||
freesewing: "freesewing",
|
||||
"@freesewing/plugin-bundle": "freesewing.plugins.bundle"
|
||||
}
|
||||
}
|
||||
};
|
107
packages/cathrin/src/base.js
Normal file
107
packages/cathrin/src/base.js
Normal file
|
@ -0,0 +1,107 @@
|
|||
var base = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {measurements, options, store, points, snippets, paths, Point, Snippet, Path, utils, final, debug } = part.shorthand();
|
||||
|
||||
// Where to divide our corset into panels
|
||||
if (options.panels === 11) store.set('gaps', [0.15,0.275,0.4,0.6,0.75]);
|
||||
else store.set('gaps', [0.2,0.35,0.5,0.65,0.8]);
|
||||
|
||||
// Absolute values for some options
|
||||
store.set('waistReduction', measurements.naturalWaist * options.waistReduction);
|
||||
debug('Waist reduction is', utils.units(store.get('waistReduction')));
|
||||
store.set('backOpening', measurements.underbust * options.backOpening);
|
||||
debug('Back opening is', utils.units(store.get('backOpening')));
|
||||
let len = measurements.naturalWaistToUnderbust + measurements.naturalWaistToHip;
|
||||
for(let option of ['backRise', 'backDrop', 'frontRise', 'frontDrop', 'hipRise'])
|
||||
store.set(option, len * options[option]);
|
||||
store.set('length', len);
|
||||
|
||||
/**
|
||||
* How much should we take in the corset at waist and bust
|
||||
*
|
||||
* I assume that the hips are larger than the underbust.
|
||||
* Can I be sure? Maybe not, but a larger underbust than hip
|
||||
* measurements seems very rare to say the least.
|
||||
*/
|
||||
store.set('width', 0.5 * (
|
||||
measurements.hipsCircumference -
|
||||
store.get('backOpening')
|
||||
));
|
||||
store.set('waistIntake', 0.5 * (
|
||||
measurements.hipsCircumference -
|
||||
measurements.naturalWaist +
|
||||
store.get('waistReduction')
|
||||
));
|
||||
store.set('bustIntake', 0.5 * (
|
||||
measurements.hipsCircumference -
|
||||
measurements.underbust
|
||||
));
|
||||
|
||||
// Basic box (CB = Center back, CF = Center front)
|
||||
let wid = store.get('width');
|
||||
points.underbustCF = new Point(0,0);
|
||||
points.hipsCF = new Point(0, len);
|
||||
points.hipsCB = new Point(wid, len);
|
||||
points.underbustCB = new Point(wid , 0);
|
||||
points.topSide = points.underbustCF.shiftFractionTowards(points.underbustCB, 0.5);
|
||||
points.bottomSide = points.hipsCF.shiftFractionTowards(points.hipsCB, 0.5);
|
||||
points.waistCF = points.underbustCF.shift(-90, measurements.naturalWaistToUnderbust);
|
||||
points.waistCB = new Point(points.hipsCB.x, points.waistCF.y);
|
||||
|
||||
// frontRise
|
||||
points.topCF = points.underbustCF.shift(90, store.get('frontRise'));
|
||||
points.frontRiseStart = points.underbustCF.shift(0, wid * 0.15);
|
||||
points.frontRiseStartCp2 = points.underbustCF.shift(0, wid * 0.11);
|
||||
points.topCFCp1 = points.topCF.shift(0, wid * 0.11);
|
||||
|
||||
// frontDrop
|
||||
points.bottomCF = points.hipsCF.shift(-90, store.get('frontDrop'));
|
||||
points.bottomCFCp2 = points.bottomCF.shift(0, wid * 0.11);
|
||||
|
||||
// hipRise
|
||||
points.hipRise = points.bottomSide.shift(90, store.get('hipRise'));
|
||||
points.hipRiseCp1 = points.hipRise.shift(180, wid * 0.3);
|
||||
points.hipRiseCp2 = points.hipRise.shift(0, wid * 0.2);
|
||||
|
||||
// backDrop
|
||||
points.backDrop = points.hipsCB.shift(-90, store.get('backDrop'));
|
||||
points.backDropCp1 = points.backDrop.shift(180, wid * 0.3);
|
||||
|
||||
// backRise
|
||||
points.backRise = points.underbustCB.shift(90, store.get('backRise'));
|
||||
points.backRiseCp1 = points.backRise.shift(180, wid * 0.4);
|
||||
points.topSideCp1 = points.topSide.shift(0, wid * 0.2);
|
||||
|
||||
// Paths
|
||||
paths.help1 = new Path()
|
||||
.move(points.underbustCF)
|
||||
.line(points.hipsCF)
|
||||
.line(points.hipsCB)
|
||||
.line(points.underbustCB)
|
||||
.close();
|
||||
paths.help2 = new Path()
|
||||
.move(points.topSide)
|
||||
.line(points.bottomSide)
|
||||
.line(points.waistCF)
|
||||
.line(points.waistCB);
|
||||
paths.help1.render = false;
|
||||
paths.help2.render = false;
|
||||
|
||||
paths.outline = new Path()
|
||||
.move(points.bottomCF)
|
||||
.curve(points.bottomCFCp2, points.hipRiseCp1, points.hipRise)
|
||||
.curve(points.hipRiseCp2, points.backDropCp1, points.backDrop)
|
||||
.line(points.backRise)
|
||||
.curve(points.backRiseCp1, points.topSideCp1, points.topSide)
|
||||
.line(points.frontRiseStart)
|
||||
.curve(points.frontRiseStartCp2, points.topCFCp1, points.topCF)
|
||||
.line(points.bottomCF)
|
||||
.close();
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default base;
|
19
packages/cathrin/src/corset.js
Normal file
19
packages/cathrin/src/corset.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
var corset = {
|
||||
draft: function(part) {
|
||||
// prettier-ignore
|
||||
let {store, sa, Point, points, Path, paths, Snippet, snippets, options, measurements, final, paperless, macro} = part.shorthand();
|
||||
|
||||
|
||||
// Final?
|
||||
if (final) {
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default corset;
|
59
packages/cathrin/src/index.js
Normal file
59
packages/cathrin/src/index.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
import freesewing from "freesewing";
|
||||
import pluginBundle from "@freesewing/plugin-bundle";
|
||||
|
||||
import config from "../config/config";
|
||||
import { version } from "../package.json";
|
||||
|
||||
import base from "./base";
|
||||
import panels from "./panels";
|
||||
|
||||
import panel1 from "./panel1";
|
||||
import panel2 from "./panel2";
|
||||
import panel3 from "./panel3";
|
||||
import panel4 from "./panel4";
|
||||
import panel5 from "./panel5";
|
||||
import panel6 from "./panel6";
|
||||
|
||||
//import corset from "./corset";
|
||||
|
||||
var pattern = new freesewing.Pattern({ version: version, ...config })
|
||||
.with(pluginBundle);
|
||||
|
||||
pattern.draft = function() {
|
||||
this.parts.base = this.draftBase(new pattern.Part());
|
||||
if (!this.needs("base", true)) this.parts.base.render = false;
|
||||
|
||||
if(this.needs("panels")) this.parts.panels = this.draftPanels(new pattern.Part().copy(this.parts.base));
|
||||
if (!this.needs("panels", true)) this.parts.panels.render = false;
|
||||
|
||||
if (this.needs("panel1"))
|
||||
this.parts.panel1 = this.draftPanel1(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel2"))
|
||||
this.parts.panel2 = this.draftPanel2(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel3"))
|
||||
this.parts.panel3 = this.draftPanel3(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel4"))
|
||||
this.parts.panel4 = this.draftPanel4(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel5"))
|
||||
this.parts.panel5 = this.draftPanel5(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
if (this.needs("panel6"))
|
||||
this.parts.panel6 = this.draftPanel6(new pattern.Part().copy(this.parts.panels));
|
||||
|
||||
return pattern;
|
||||
};
|
||||
|
||||
pattern.draftBase = part => base.draft(part);
|
||||
pattern.draftPanels = part => panels.draft(part);
|
||||
pattern.draftPanel1 = part => panel1.draft(part);
|
||||
pattern.draftPanel2 = part => panel2.draft(part);
|
||||
pattern.draftPanel3 = part => panel3.draft(part);
|
||||
pattern.draftPanel4 = part => panel4.draft(part);
|
||||
pattern.draftPanel5 = part => panel5.draft(part);
|
||||
pattern.draftPanel6 = part => panel6.draft(part);
|
||||
|
||||
export default pattern;
|
76
packages/cathrin/src/panel1.js
Normal file
76
packages/cathrin/src/panel1.js
Normal file
|
@ -0,0 +1,76 @@
|
|||
import panel1ab from './panel1ab';
|
||||
|
||||
var panel1 = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, Path, options, final, paperless } = part.shorthand();
|
||||
|
||||
delete paths.outline;
|
||||
delete paths.panel2;
|
||||
delete paths.panel3;
|
||||
delete paths.panel4;
|
||||
delete paths.panel5;
|
||||
delete paths.panel6;
|
||||
|
||||
if (options.panels === 13) return panel1ab.draft(part);
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
macro('cutonfold', {
|
||||
to: points.bottomCF,
|
||||
from: points.topCF,
|
||||
grainline: true
|
||||
});
|
||||
points.title = points.waistCF.shiftFractionTowards(points.underbustGap1Left, 0.5);
|
||||
macro('title', {
|
||||
nr: 1,
|
||||
title: '',
|
||||
at: points.title
|
||||
});
|
||||
if(sa) paths.sa = paths.panel1.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('vd', {
|
||||
from: points.bottomCF,
|
||||
to: points.waistCF,
|
||||
x: points.topCF.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistCF,
|
||||
to: points.topCF,
|
||||
x: points.topCF.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap1,
|
||||
to: points.waistGap1Left,
|
||||
x: points.hipsGap1.x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap1Left,
|
||||
to: points.underbustGap1Left,
|
||||
x: points.hipsGap1.x + sa + 15
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.bottomCF,
|
||||
to: points.hipsGap1,
|
||||
y: points.bottomCF.y + sa + 15
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.topCF,
|
||||
to: points.underbustGap1Left,
|
||||
y: points.topCF.y - sa - 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistCF,
|
||||
to: points.waistGap1Left
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel1;
|
151
packages/cathrin/src/panel1ab.js
Normal file
151
packages/cathrin/src/panel1ab.js
Normal file
|
@ -0,0 +1,151 @@
|
|||
var panel1ab = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, utils, sa, points, paths, Point, Path, options, final, paperless } = part.shorthand();
|
||||
|
||||
let top = new Path()
|
||||
.move(points.underbustGap1Left)
|
||||
.curve(points.frontRiseStartCp2, points.topCFCp1, points.topCF);
|
||||
points.topABsplit = top.shiftFractionAlong(0.3);
|
||||
let bottom = new Path()
|
||||
.move(points.bottomCF)
|
||||
.curve(paths.panel1.ops[1].cp1, paths.panel1.ops[1].cp2, paths.panel1.ops[1].to);
|
||||
points.bottomABsplit = bottom.shiftFractionAlong(0.3);
|
||||
|
||||
paths.panel1a = bottom.split(points.bottomABsplit)[0]
|
||||
.line(points.topABsplit)
|
||||
.join(top.split(points.topABsplit)[1])
|
||||
.line(points.bottomCF)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
paths.panel1b = bottom.split(points.bottomABsplit)[1]
|
||||
.curve(points.hipsGap1Cp, points.waistGap1LeftCp1, points.waistGap1Left)
|
||||
.curve(points.waistGap1LeftCp2, points.underbustGap1LeftCp, points.underbustGap1Left)
|
||||
.join(top.split(points.topABsplit)[0])
|
||||
.line(points.bottomABsplit)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
let translation = 5;
|
||||
if (sa) translation = 2*sa + 5;
|
||||
paths.panel1b = paths.panel1b.translate(translation,0);
|
||||
delete paths.panel1;
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
if (sa) {
|
||||
paths.saA = paths.panel1a.offset(sa).attr('class', 'fabric sa');
|
||||
paths.saB = paths.panel1b.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
macro('cutonfold', {
|
||||
to: points.bottomCF,
|
||||
from: points.topCF,
|
||||
grainline: true
|
||||
});
|
||||
macro('grainline', {
|
||||
to: points.topABsplit.translate(translation, 0),
|
||||
from: new Point(
|
||||
points.topABsplit.translate(translation, 0).x,
|
||||
points.hipsGap1.translate(translation, 0).y
|
||||
)
|
||||
});
|
||||
points.midwayAB = points.topABsplit.shiftFractionTowards(points.bottomABsplit, 0.5);
|
||||
points.titleA = points.underbustCF.shiftFractionTowards(points.midwayAB, 0.5);
|
||||
macro('title', {
|
||||
nr: '1a',
|
||||
prefix: 'panel1a',
|
||||
at: points.titleA
|
||||
});
|
||||
points.titleB = points.hipsGap1.translate(translation, 0).shiftFractionTowards(points.midwayAB, 0.5);
|
||||
macro('title', {
|
||||
nr: '1b',
|
||||
prefix: 'panel1b',
|
||||
at: points.titleB
|
||||
});
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
// 1a
|
||||
macro('vd', {
|
||||
from: points.bottomCF,
|
||||
to: points.waistCF,
|
||||
x: points.topCF.x - sa - 30
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistCF,
|
||||
to: points.topCF,
|
||||
x: points.topCF.x - sa - 30
|
||||
});
|
||||
points.waistAB = utils.beamsIntersect(
|
||||
points.topABsplit,
|
||||
points.bottomABsplit,
|
||||
points.waistCF,
|
||||
points.waistGap1
|
||||
);
|
||||
macro('vd', {
|
||||
from: points.bottomABsplit,
|
||||
to: points.waistAB,
|
||||
x: points.topCF.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistAB,
|
||||
to: points.topABsplit,
|
||||
x: points.topCF.x - sa - 15
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.bottomCF,
|
||||
to: points.bottomABsplit,
|
||||
y: points.bottomCF.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistCF,
|
||||
to: points.waistAB,
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.topCF,
|
||||
to: points.topABsplit,
|
||||
y: points.topCF.y - sa - 15
|
||||
});
|
||||
// 1b
|
||||
macro('vd', {
|
||||
from: points.hipsGap1.translate(translation, 0),
|
||||
to: points.waistGap1Left.translate(translation, 0),
|
||||
x: points.underbustGap1Left.translate(translation, 0).x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap1Left.translate(translation, 0),
|
||||
to: points.underbustGap1Left.translate(translation, 0),
|
||||
x: points.underbustGap1Left.translate(translation, 0).x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.bottomABsplit.translate(translation, 0),
|
||||
to: points.waistAB.translate(translation, 0),
|
||||
x: points.underbustGap1Left.translate(translation, 0).x + sa + 30
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistAB.translate(translation, 0),
|
||||
to: points.topABsplit.translate(translation, 0),
|
||||
x: points.underbustGap1Left.translate(translation, 0).x + sa + 30
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.bottomABsplit.translate(translation, 0),
|
||||
to: points.hipsGap1.translate(translation, 0),
|
||||
y: points.bottomABsplit.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistAB.translate(translation, 0),
|
||||
to: points.waistGap1Left.translate(translation, 0)
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.topABsplit.translate(translation, 0),
|
||||
to: points.underbustGap1Left.translate(translation, 0),
|
||||
y: points.topABsplit.y - sa - 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel1ab;
|
79
packages/cathrin/src/panel2.js
Normal file
79
packages/cathrin/src/panel2.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
var panel2 = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, final, paperless } = part.shorthand();
|
||||
|
||||
delete paths.outline;
|
||||
delete paths.panel1;
|
||||
delete paths.panel3;
|
||||
delete paths.panel4;
|
||||
delete paths.panel5;
|
||||
delete paths.panel6;
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
points.grainlineTop = new Point(
|
||||
points.waistGap1Right.shiftFractionTowards(points.waistGap2Left, 0.5).x,
|
||||
points.underbustGap1Right.y
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.hipsGap2.y
|
||||
);
|
||||
macro('grainline', {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = points.grainlineTop.shift(-90, points.grainlineTop.dy(points.waistGap2Left)/2);
|
||||
macro('title', {
|
||||
nr: 2,
|
||||
title: '',
|
||||
at: points.title
|
||||
});
|
||||
if(sa) paths.sa = paths.panel2.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.hipsGap1,
|
||||
to: points.hipsGap2,
|
||||
y: points.hipsGap1.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistGap1Right,
|
||||
to: points.waistGap2Left
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.underbustGap1Right,
|
||||
to: points.underbustGap2Left,
|
||||
y: points.underbustGap1Right.y - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap1,
|
||||
to: points.waistGap1Right,
|
||||
x: points.hipsGap1.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap1Right,
|
||||
to: points.underbustGap1Right,
|
||||
x: points.hipsGap1.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap2,
|
||||
to: points.waistGap1Right,
|
||||
x: points.hipsGap2.x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap1Right,
|
||||
to: points.underbustGap2Left,
|
||||
x: points.hipsGap2.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel2;
|
79
packages/cathrin/src/panel3.js
Normal file
79
packages/cathrin/src/panel3.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
var panel3 = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, final, paperless } = part.shorthand();
|
||||
|
||||
delete paths.outline;
|
||||
delete paths.panel1;
|
||||
delete paths.panel2;
|
||||
delete paths.panel4;
|
||||
delete paths.panel5;
|
||||
delete paths.panel6;
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
points.grainlineTop = new Point(
|
||||
points.waistGap2Right.shiftFractionTowards(points.waistGap3Left, 0.5).x,
|
||||
points.underbustGap2Right.y
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.hipsGap3.y
|
||||
);
|
||||
macro('grainline', {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = points.grainlineTop.shift(-90, points.grainlineTop.dy(points.waistGap3Left)/2);
|
||||
macro('title', {
|
||||
nr: 3,
|
||||
title: '',
|
||||
at: points.title
|
||||
});
|
||||
if(sa) paths.sa = paths.panel3.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.hipsGap2,
|
||||
to: points.hipsGap3,
|
||||
y: points.hipsGap2.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistGap2Right,
|
||||
to: points.waistGap3Left
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.underbustGap2Right,
|
||||
to: points.underbustGap3Left,
|
||||
y: points.underbustGap2Right.y - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap2,
|
||||
to: points.waistGap2Right,
|
||||
x: points.hipsGap2.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap2Right,
|
||||
to: points.underbustGap2Right,
|
||||
x: points.hipsGap2.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap3,
|
||||
to: points.waistGap2Right,
|
||||
x: points.hipsGap3.x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap2Right,
|
||||
to: points.underbustGap3Left,
|
||||
x: points.hipsGap3.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel3;
|
82
packages/cathrin/src/panel4.js
Normal file
82
packages/cathrin/src/panel4.js
Normal file
|
@ -0,0 +1,82 @@
|
|||
var panel4 = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, sa, snippets, Snippet, points, paths, Point, final, paperless } = part.shorthand();
|
||||
|
||||
delete paths.outline;
|
||||
delete paths.panel1;
|
||||
delete paths.panel2;
|
||||
delete paths.panel3;
|
||||
delete paths.panel5;
|
||||
delete paths.panel6;
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
points.grainlineTop = new Point(
|
||||
points.waistGap3Right.shiftFractionTowards(points.waistGap4Left, 0.5).x,
|
||||
points.underbustGap3Right.y
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.hipsGap4.y
|
||||
);
|
||||
macro('grainline', {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = points.grainlineTop.shift(-90, points.grainlineTop.dy(points.waistGap4Left)/2);
|
||||
macro('title', {
|
||||
nr: 4,
|
||||
title: '',
|
||||
at: points.title
|
||||
});
|
||||
points.logo = points.grainlineTop.shiftFractionTowards(points.grainlineBottom, 0.8);
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.8);
|
||||
|
||||
if(sa) paths.sa = paths.panel4.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.hipsGap3,
|
||||
to: points.hipsGap4,
|
||||
y: points.hipsGap3.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistGap3Right,
|
||||
to: points.waistGap4Left
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.underbustGap3Right,
|
||||
to: points.underbustGap4Left,
|
||||
y: points.underbustGap4Left.y - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap3,
|
||||
to: points.waistGap3Right,
|
||||
x: points.hipsGap3.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap3Right,
|
||||
to: points.underbustGap3Right,
|
||||
x: points.hipsGap3.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap4,
|
||||
to: points.waistGap3Right,
|
||||
x: points.hipsGap4.x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap3Right,
|
||||
to: points.underbustGap4Left,
|
||||
x: points.hipsGap4.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel4;
|
79
packages/cathrin/src/panel5.js
Normal file
79
packages/cathrin/src/panel5.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
var panel5 = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, final, paperless } = part.shorthand();
|
||||
|
||||
delete paths.outline;
|
||||
delete paths.panel1;
|
||||
delete paths.panel2;
|
||||
delete paths.panel3;
|
||||
delete paths.panel4;
|
||||
delete paths.panel6;
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
points.grainlineTop = new Point(
|
||||
points.waistGap4Right.shiftFractionTowards(points.waistGap5Left, 0.5).x,
|
||||
points.underbustGap4Right.y
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.hipsGap5.y
|
||||
);
|
||||
macro('grainline', {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = points.grainlineTop.shift(-90, points.grainlineTop.dy(points.waistGap5Left)/2);
|
||||
macro('title', {
|
||||
nr: 5,
|
||||
title: '',
|
||||
at: points.title
|
||||
});
|
||||
if(sa) paths.sa = paths.panel5.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.hipsGap4,
|
||||
to: points.hipsGap5,
|
||||
y: points.hipsGap4.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistGap4Right,
|
||||
to: points.waistGap5Left
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.underbustGap4Right,
|
||||
to: points.underbustGap5Left,
|
||||
y: points.underbustGap5Left.y - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap4,
|
||||
to: points.waistGap4Right,
|
||||
x: points.hipsGap4.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap4Right,
|
||||
to: points.underbustGap4Right,
|
||||
x: points.hipsGap4.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap5,
|
||||
to: points.waistGap4Right,
|
||||
x: points.hipsGap5.x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap4Right,
|
||||
to: points.underbustGap5Left,
|
||||
x: points.hipsGap5.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel5;
|
87
packages/cathrin/src/panel6.js
Normal file
87
packages/cathrin/src/panel6.js
Normal file
|
@ -0,0 +1,87 @@
|
|||
var panel6 = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {macro, sa, points, paths, Point, final, paperless } = part.shorthand();
|
||||
|
||||
delete paths.outline;
|
||||
delete paths.panel1;
|
||||
delete paths.panel2;
|
||||
delete paths.panel3;
|
||||
delete paths.panel4;
|
||||
delete paths.panel5;
|
||||
|
||||
// Final?
|
||||
if(final) {
|
||||
points.grainlineTop = new Point(
|
||||
points.waistGap5Right.shiftFractionTowards(points.waistCB, 0.5).x,
|
||||
points.underbustGap5Right.y
|
||||
);
|
||||
points.grainlineBottom = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.hipsGap5.y
|
||||
);
|
||||
macro('grainline', {
|
||||
from: points.grainlineBottom,
|
||||
to: points.grainlineTop
|
||||
});
|
||||
points.title = points.grainlineTop.shift(-90, points.grainlineTop.dy(points.waistGap5Right)/2);
|
||||
macro('title', {
|
||||
nr: 6,
|
||||
title: '',
|
||||
at: points.title
|
||||
});
|
||||
points.scalebox = new Point(
|
||||
points.grainlineTop.x,
|
||||
points.hipsGap5.y - 55
|
||||
);
|
||||
macro('scalebox', {
|
||||
at: points.scalebox,
|
||||
rotate: 90
|
||||
});
|
||||
if(sa) paths.sa = paths.panel6.offset(sa).attr('class', 'fabric sa');
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.hipsGap5,
|
||||
to: points.backDrop,
|
||||
y: points.backDrop.y + sa + 15
|
||||
});
|
||||
macro('ld', {
|
||||
from: points.waistGap5Right,
|
||||
to: points.waistCB
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.underbustGap5Right,
|
||||
to: points.backRise,
|
||||
y: points.backRise.y - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.hipsGap5,
|
||||
to: points.waistGap5Right,
|
||||
x: points.hipsGap5.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistGap5Right,
|
||||
to: points.underbustGap5Right,
|
||||
x: points.hipsGap5.x - sa - 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.backDrop,
|
||||
to: points.waistCB,
|
||||
x: points.backDrop.x + sa + 15
|
||||
});
|
||||
macro('vd', {
|
||||
from: points.waistCB,
|
||||
to: points.backRise,
|
||||
x: points.backDrop.x + sa + 15
|
||||
});
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panel6;
|
116
packages/cathrin/src/panels.js
Normal file
116
packages/cathrin/src/panels.js
Normal file
|
@ -0,0 +1,116 @@
|
|||
var panels = {
|
||||
draft: function(part) {
|
||||
|
||||
// prettier-ignore
|
||||
let {measurements, options, store, points, snippets, paths, Point, Snippet, Path, utils, final, debug } = part.shorthand();
|
||||
let count = 1;
|
||||
let bottom = new Path()
|
||||
.move(points.bottomCF)
|
||||
.curve(points.bottomCFCp2, points.hipRiseCp1, points.hipRise)
|
||||
.curve(points.hipRiseCp2, points.backDropCp1, points.backDrop)
|
||||
.attr('class', 'lashed various stroke-xl');
|
||||
for (let gap of store.get('gaps')) {
|
||||
// Underbust
|
||||
points[`underbustGap${count}`] = new Point(store.get('width') * gap, 0);
|
||||
points[`underbustGap${count}Right`] = points[`underbustGap${count}`].shift(0, store.get('bustIntake') * 0.1);
|
||||
points[`underbustGap${count}Left`] = points[`underbustGap${count}`].shift(180, store.get('bustIntake') * 0.1);
|
||||
points[`underbustGap${count}RightCp`] = points[`underbustGap${count}Right`].shift(-90, measurements.naturalWaistToUnderbust * 0.15);
|
||||
points[`underbustGap${count}LeftCp`] = points[`underbustGap${count}Left`].shift(-90, measurements.naturalWaistToUnderbust * 0.15);
|
||||
|
||||
// Waist
|
||||
points[`waistGap${count}`] = new Point(store.get('width') * gap, points.waistCF.y);
|
||||
points[`waistGap${count}Right`] = points[`waistGap${count}`].shift(0, store.get('waistIntake') * 0.1);
|
||||
points[`waistGap${count}Left`] = points[`waistGap${count}`].shift(180, store.get('waistIntake') * 0.1);
|
||||
points[`waistGap${count}RightCp1`] = points[`waistGap${count}Right`].shift(90, measurements.naturalWaistToUnderbust * 0.2);
|
||||
points[`waistGap${count}LeftCp2`] = points[`waistGap${count}Left`].shift(90, measurements.naturalWaistToUnderbust * 0.2);
|
||||
points[`waistGap${count}RightCp2`] = points[`waistGap${count}Right`].shift(-90, measurements.naturalWaistToHip * 0.2);
|
||||
points[`waistGap${count}LeftCp1`] = points[`waistGap${count}Left`].shift(-90, measurements.naturalWaistToHip * 0.2);
|
||||
|
||||
// Hips
|
||||
points[`hipsGap${count}`] = new Point(store.get('width') * gap, points.hipsCF.y);
|
||||
points[`hipsGap${count}`] = bottom.intersectsX(points[`waistGap${count}`].x).pop();
|
||||
points[`hipsGap${count}Cp`] = points[`hipsGap${count}`].shiftFractionTowards(points[`waistGap${count}`], 0.2);
|
||||
|
||||
count++;
|
||||
}
|
||||
// Paths
|
||||
paths.panel1 = bottom
|
||||
.split(points.hipsGap1)[0]
|
||||
.curve(points.hipsGap1Cp, points.waistGap1LeftCp1, points.waistGap1Left)
|
||||
.curve(points.waistGap1LeftCp2, points.underbustGap1LeftCp, points.underbustGap1Left)
|
||||
.curve(points.frontRiseStartCp2, points.topCFCp1, points.topCF)
|
||||
.line(points.bottomCF)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
paths.panel2 = bottom
|
||||
.split(points.hipsGap2)[0]
|
||||
.split(points.hipsGap1)[1]
|
||||
.curve(points.hipsGap2Cp, points.waistGap2LeftCp1, points.waistGap2Left)
|
||||
.curve(points.waistGap2LeftCp2, points.underbustGap2LeftCp, points.underbustGap2Left)
|
||||
.line(points.underbustGap1Right)
|
||||
.curve(points.underbustGap1RightCp, points.waistGap1RightCp1, points.waistGap1Right)
|
||||
.curve(points.waistGap1RightCp2, points.hipsGap1Cp, points.hipsGap1)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
let panel3 = new Path()
|
||||
.move(points.bottomCF)
|
||||
.curve(points.bottomCFCp2, points.hipRiseCp1, points.hipRise)
|
||||
.split(points.hipsGap2)[1];
|
||||
if (options.panels === 11) panel3 = panel3.split(points.hipsGap3)[0];
|
||||
paths.panel3 = panel3
|
||||
.curve(points.hipsGap3Cp, points.waistGap3LeftCp1, points.waistGap3Left)
|
||||
.curve(points.waistGap3LeftCp2, points.underbustGap3LeftCp, points.underbustGap3Left)
|
||||
.line(points.underbustGap2Right)
|
||||
.curve(points.underbustGap2RightCp, points.waistGap2RightCp1, points.waistGap2Right)
|
||||
.curve(points.waistGap2RightCp2, points.hipsGap2Cp, points.hipsGap2)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
let topBack = new Path()
|
||||
.move(points.backRise)
|
||||
.curve(points.backRiseCp1, points.topSideCp1, points.topSide);
|
||||
points.underbustGap4Left = topBack.intersectsX(points.underbustGap4Left.x).pop();
|
||||
paths.panel4 = new Path()
|
||||
.move(points.hipRise)
|
||||
.curve(points.hipRiseCp2, points.backDropCp1, points.backDrop)
|
||||
.split(points.hipsGap4)[0]
|
||||
.curve(points.hipsGap4Cp, points.waistGap4LeftCp1, points.waistGap4Left)
|
||||
.curve(points.waistGap4LeftCp2, points.underbustGap4LeftCp, points.underbustGap4Left)
|
||||
.join(topBack.split(points.underbustGap4Left)[1]);
|
||||
if(options.panels === 11) paths.panel4.line(points.underbustGap3Right);
|
||||
paths.panel4
|
||||
.curve(points.underbustGap3RightCp, points.waistGap3RightCp1, points.waistGap3Right)
|
||||
.curve(points.waistGap3RightCp2, points.hipsGap3Cp, points.hipsGap3)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
points.underbustGap4Right = topBack.intersectsX(points.underbustGap4Right.x).pop();
|
||||
points.underbustGap5Left = topBack.intersectsX(points.underbustGap5Left.x).pop();
|
||||
let top5 = topBack
|
||||
.split(points.underbustGap5Left)[1]
|
||||
.split(points.underbustGap4Right)[0];
|
||||
paths.panel5 = bottom
|
||||
.split(points.hipsGap5)[0]
|
||||
.split(points.hipsGap4)[1]
|
||||
.curve(points.hipsGap5Cp, points.waistGap5LeftCp1, points.waistGap5Left)
|
||||
.curve(points.waistGap5LeftCp2, points.underbustGap5LeftCp, points.underbustGap5Left)
|
||||
.curve(top5.ops[1].cp1, top5.ops[1].cp2, top5.ops[1].to)
|
||||
.curve(points.underbustGap4RightCp, points.waistGap4RightCp1, points.waistGap4Right)
|
||||
.curve(points.waistGap4RightCp2, points.hipsGap4Cp, points.hipsGap4)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
points.underbustGap5Right = topBack.intersectsX(points.underbustGap5Right.x).pop();
|
||||
paths.panel6 = bottom
|
||||
.split(points.hipsGap5)[1]
|
||||
.line(points.backRise)
|
||||
.join(topBack.split(points.underbustGap5Right)[0])
|
||||
.curve(points.underbustGap5RightCp, points.waistGap5RightCp1, points.waistGap5Right)
|
||||
.curve(points.waistGap5RightCp2, points.hipsGap5Cp, points.hipsGap5)
|
||||
.close()
|
||||
.attr('class', 'fabric');
|
||||
|
||||
paths.outline.render = false;
|
||||
|
||||
return part;
|
||||
}
|
||||
};
|
||||
|
||||
export default panels;
|
Loading…
Add table
Add a link
Reference in a new issue