1
0
Fork 0

sparkles: Back part

This commit is contained in:
Joost De Cock 2018-12-21 18:19:21 +01:00
parent 7581a6c0fb
commit 58729a32b0
14 changed files with 7025 additions and 1 deletions

3
packages/simon/.babelrc Normal file
View file

@ -0,0 +1,3 @@
{
"plugins": ["transform-object-rest-spread"]
}

View 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

63
packages/simon/.gitignore vendored Normal file
View file

@ -0,0 +1,63 @@
*.php
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

View file

@ -0,0 +1,2 @@
src
.editorconfig

21
packages/simon/LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -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>&nbsp;<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/simon"><img src="https://badgen.net/npm/v/@freesewing/simon" alt="Version"></a>
<a href="https://www.npmjs.com/package/@freesewing/simon"><img src="https://badgen.net/npm/license/@freesewing/simon" 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>
# simon
Port of the freesewing Simon Shirt pattern to nodejs
Simon is a [freesewing](https://github.com/freesewing/freesewing) pattern
for a button-down shirt.
See [freesewing.org/patterns/simon](https://freesewing.org/patterns/simon)
for more info and examples.
## Install
```
npm i --save @freesewing/simon
```

View file

@ -0,0 +1,149 @@
const yesNo = ["yes", "no"];
export default {
name: "simon",
measurements: [
"bicepsCircumference",
"centerBackNeckToWaist",
"chestCircumference",
"naturalWaist",
"naturalWaistToHip",
"neckCircumference",
"shoulderSlope",
"shoulderToShoulder",
"hipsCircumference",
"shoulderToElbow",
"shoulderToWrist",
"wristCircumference",
],
dependencies: {
frontBase: "base",
backBase: "base",
back: "backBase",
},
inject: {
frontBase: "base",
backBase: "base",
back: "backBase",
},
hide: [
"base",
"frontBase",
"backBase"
],
options: {
// Constants
collarFactor: 5,
minimalDartShaping: 5,
brianFitSleeve: true,
// Toggles
// Lists
extraTopButton: {
list: ["yes", "no"],
dflt: "yes"
},
splitYoke: {
list: ["yes", "no"],
dflt: "no"
},
barrelcuffNarrowButton: {
list: ["yes", "no"],
dflt: "yes"
},
hemStyle: {
list: ["straight", "baseball", "slashed"],
dflt: "straight"
},
buttonPlacketType: {
list: ['cutOn', 'seperate'],
dflt: 'cutOn'
},
buttonPlacketStyle: {
list: ['classic', 'seamless'],
dflt: 'classic'
},
buttonholePlacketType: {
list: ['cutOn', 'seperate'],
dflt: 'cutOn'
},
buttonholePlacketStyle: {
list: ['classic', 'seamless'],
dflt: 'seamless'
},
cuffStyle: {
list: [
"roundedBarrelCuff",
"angledBarrelCuff",
"straightBarrelCuff",
"roundedFrenchcuff",
"angledFrenchCuff",
"straightFrenchCuff"
],
dflt: "angledBarrelCuff"
},
// Counters
buttons: { count: 7, min: 4, max: 12 },
cuffButtonRows: { count: 1, min: 1, max: 2 },
// Angles
collarAngle: { deg: 85, min: 60, max: 130 },
// Millimeter
buttonPlacketWidth: { mm: 20, min: 10, max: 30 },
buttonholePlacketWidth: { mm: 35, min: 20, max: 45 },
buttonholePlacketFoldWidth: { mm: 6, min: 3, max: 10 },
collarStandWidth: { mm: 35, min: 15, max: 60 },
sleevePlacketWidth: { mm: 25, min: 15, max: 35 },
// Percentages
acrossBackFactor: { pct: 97, min: 93, max: 100 },
armholeDepthFactor: { pct: 60, min: 50, max: 70 },
backNeckCutout: { pct: 5, min: 2, max: 8 },
bicepsEase: { pct: 15, min: 0, max: 50 },
buttonFreeLength: { pct: 15, min: 0, max: 50 },
chestEase: { pct: 8, min: -4, max: 20 },
collarBend: { pct: 5, min: 0, max: 10 },
collarEase: { pct: 3.5, min: 0, max: 10 },
collarFlare: { pct: 3, min: 0, max: 6 },
collarGap: { pct: 3, min: 0, max: 6 },
collarRoll: { pct: 3, min: 0, max: 6 },
collarStandBend: { pct: 5, min: 0, max: 10 },
collarStandCurve: { pct: 5, min: 0, max: 10 },
cuffDrape: { pct: 10, min: 0, max: 20 },
cuffEase: { pct: 20, min: 0, max: 200 },
cuffLength: { pct: 5, min: 3, max: 10 },
frontArmholeDeeper: { pct: 0.5, min: 0, max: 1.5 },
hemCurve: { pct: 75, min: 25, max: 100 },
hipsEase: { pct: 8, min: -4, max: 20 },
hipsFlare: { pct: 3, min: 0, max: 5 },
lengthBonus: { pct: 0, min: -4, max: 60 },
shoulderEase: { pct: 0, min: -2, max: 6 },
shoulderSlopeReduction: { pct: 0, min: 0, max: 8 },
sleevecapEase: { pct: 1, min: 0, max: 10 },
sleevecapBackFactorX: { pct: 60, min: 35, max: 65 },
sleevecapBackFactorY: { pct: 33, min: 35, max: 65 },
sleevecapFrontFactorX: { pct: 55, min: 35, max: 65 },
sleevecapFrontFactorY: { pct: 33, min: 35, max: 65 },
sleevecapQ1Offset: { pct: 3, min: 0, max: 7 },
sleevecapQ2Offset: { pct: 5.5, min: 0, max: 7 },
sleevecapQ3Offset: { pct: 4.5, min: 0, max: 7 },
sleevecapQ4Offset: { pct: 1, min: 0, max: 7 },
sleevecapQ1Spread1: { pct: 6, min: 4, max: 20 },
sleevecapQ1Spread2: { pct: 15, min: 4, max: 20 },
sleevecapQ2Spread1: { pct: 15, min: 4, max: 20 },
sleevecapQ2Spread2: { pct: 10, min: 4, max: 20 },
sleevecapQ3Spread1: { pct: 10, min: 4, max: 20 },
sleevecapQ3Spread2: { pct: 8, min: 4, max: 20 },
sleevecapQ4Spread1: { pct: 7, min: 4, max: 20 },
sleevecapQ4Spread2: { pct: 7, min: 4, max: 20 },
sleeveWidthGuarantee: { pct: 90, min: 25, max: 100 },
sleeveLengthBonus: { pct: 0, min:-40, max: 10 },
sleevePlacketLength: { pct: 25, min: 15, max: 35 },
waistEase: { pct: 8, min: -4, max: 20 },
yokeDart: { pct: 0, min: 0, max: 15 },
}
};

133
packages/simon/index.html Normal file
View file

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simon</title>
<style>
.two {
display: inline-block;
max-width: 95%;
margin: auto;
}
</style>
</head>
<body>
<div id="svg"></div>
<div id="svg1" class="two"></div>
<div id="svg2" class="two"></div>
<!-- <script type="text/javascript" src="node_modules/freesewing/dist/browser.js"></script> -->
<script type="text/javascript" src="../../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="../../plugins/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="../../plugins/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="../../plugins/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>
let settings = {
"complete": true,
"idPrefix": "fs-",
"locale": "en",
"units": "imperial",
"margin": 2.38125,
"options": {
"brianFitSleeve": true,
"brianFitCollar": true,
"collarFactor": 4.8,
"acrossBackFactor": 0.97,
"armholeDepthFactor": 0.6,
"backNeckCutout": 0.05,
"bicepsEase": 0.15,
"chestEase": 0.08,
"collarEase": 0.035,
"cuffEase": 0.2,
"frontArmholeDeeper": 0.005,
"lengthBonus": 0,
"shoulderEase": 0,
"shoulderSlopeReduction": 0,
"sleevecapEase": 0.01,
"sleevecapBackFactorX": 0.6,
"sleevecapBackFactorY": 0.33,
"sleevecapFrontFactorX": 0.55,
"sleevecapFrontFactorY": 0.33,
"sleevecapQ1Offset": 0.03,
"sleevecapQ2Offset": 0.055,
"sleevecapQ3Offset": 0.045,
"sleevecapQ4Offset": 0.01,
"sleevecapQ1Spread1": 0.06,
"sleevecapQ1Spread2": 0.15,
"sleevecapQ2Spread1": 0.15,
"sleevecapQ2Spread2": 0.1,
"sleevecapQ3Spread1": 0.1,
"sleevecapQ3Spread2": 0.08,
"sleevecapQ4Spread1": 0.07,
"sleevecapQ4Spread2": 0.07,
"sleeveWidthGuarantee": 0.9,
"sleeveLengthBonus": 0
},
"embed": true,
"sa": 0,
"paperless": false,
"measurements": {
"bicepsCircumference": 335,
"centerBackNeckToWaist": 520,
"chestCircumference": 1080,
"hipsCircumference": 990,
"naturalWaist": 925,
"naturalWaistToHip": 145,
"neckCircumference": 420,
"shoulderSlope": 55,
"shoulderToElbow": 410,
"shoulderToShoulder": 465,
"shoulderToWrist": 680,
"wristCircumference": 190,
"seatCircumference": 1080,
"inseam": 910,
"seatDepth": 200,
"hipsToUpperLeg": 220,
"upperLegCircumference": 630,
"headCircumference": 590,
"naturalWaistToFloor": 1310,
"naturalWaistToSeat": 280
}
};
let settings1 = { ...settings };
var pattern1 = new freesewing.patterns.simon(settings1);
pattern1.with(freesewing.plugins.theme);
pattern1.with(freesewing.plugins.designer);
pattern1.settings.options.yokeDart = 0.15;
pattern1.settings.options.lengthBonus = 0.1;
pattern1.settings.options.hemStyle = "baseball";
pattern1.settings.sa = 10;
pattern1.draft();
console.log(pattern1);
document.getElementById("svg1").innerHTML = pattern1.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>

6245
packages/simon/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,89 @@
{
"version": "0.1.0",
"name": "@freesewing/simon",
"description": "Freesewing pattern for a button down shirt",
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
"license": "MIT",
"homepage": "https://github.com/freesewing/simon#readme",
"repository": "github:freesewing/simon",
"bugs": {
"url": "https://github.com/freesewing/simon/issues"
},
"keywords": [
"freesewing",
"pattern",
"sewing",
"womenswear",
"jumper",
"hoodie"
],
"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": "nodemon -w src --exec npm run browserbuild",
"browserbuild": "rollup -c rollup.js -o dist/browser.js -f iife -m true -n freesewing_patterns_simon --footer 'freesewing.patterns.simon = freesewing_patterns_simon;'",
"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/brian": "^0.20",
"@freesewing/plugin-bundle": "^0.6.0",
"freesewing": "^0.24"
},
"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.6.0",
"@freesewing/plugin-debug": "0.1.0",
"@freesewing/plugin-designer": "0.10",
"@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/simon/rollup.js Normal file
View 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"
}
}
};

168
packages/simon/src/back.js Normal file
View file

@ -0,0 +1,168 @@
import { calculateReduction } from "./shared";
export default part => {
// prettier-ignore
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
// Populare store with data we need
calculateReduction(part);
store.set("backArmholeLength", new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
.length());
// Waist shaping
let reduce = store.get('waistReduction');
if(reduce/4 > options.minimalDartShaping) {
// Add darts in the back
points.waist = points.waist.shift(180, reduce/8);
points.dartCenter = points.cbWaist.shiftFractionTowards(points.waist, 0.6);
points.dartTop = points.dartCenter.shift(90, points.armhole.dy(points.waist) * 0.75);
points.dartBottom = points.dartCenter.shift(-90, measurements.naturalWaistToHip * 0.75);
points.dartCenterIn = points.dartCenter.shift(180, reduce/8);
points.dartCenterOut = points.dartCenter.shift(0, reduce/8);
points.dartCenterInCp1 = points.dartCenterIn.shift(90, points.dartTop.dy(points.dartCenter) * 0.2);
points.dartCenterInCp2 = points.dartCenterIn.shift(90, points.dartBottom.dy(points.dartCenter) * 0.2);
points.dartCenterOutCp1 = points.dartCenterOut.shift(90, points.dartBottom.dy(points.dartCenter) * 0.2);
points.dartCenterOutCp2 = points.dartCenterOut.shift(90, points.dartTop.dy(points.dartCenter) * 0.2);
paths.dart = new Path()
.move(points.dartTop)
._curve(points.dartCenterInCp1, points.dartCenterIn)
.curve_(points.dartCenterInCp2, points.dartBottom)
._curve(points.dartCenterOutCp1, points.dartCenterOut)
.curve_(points.dartCenterOutCp2, points.dartTop)
.close()
.attr('class', 'fabric');
} else {
// No darts in the back
points.waist = points.waist.shift(180, reduce/4);
}
points.waistCp1 = points.waist.shift(-90, measurements.naturalWaistToHip * 0.5);
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist)/2);
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips)/4);
// Yoke dart
paths.armhole = new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.attr("class", "stroke-xxl");
paths.armhole.render = false;
if(options.yokeDart > 0) {
points.tmp1 = points.armholePitch.shift(-90, points.armholePitch.dy(points.armhole) * options.yokeDart);
points.tmp2 = points.tmp1.shift(180,50);
points.tmp3 = points.tmp1.shift(0,50);
points.yokeDartEdge = utils.lineIntersectsCurve(
points.tmp2,
points.tmp3,
points.armholePitch,
points.armholePitchCp1,
points.armholeHollowCp2,
points.armholeHollow
);
points.yokeDartTip = points.armholePitch.shift(180, points.armholePitch.x * 0.4);
points.yokeDartTipCp1 = points.armholePitch.shiftFractionTowards(points.yokeDartTip, 0.4);
paths.armhole = paths.armhole.split(points.yokeDartEdge)[0];
paths.armhole._curve(points.yokeDartTipCp1, points.yokeDartTip)
// FIXME: Must adapt sleeve to compensate for this dart.
// Perhaps by reducing sleevecap ease?
}
// Cut off at yoke
points.cbYoke = new Point(0, points.armholePitch.y);
// Draft hem
switch(options.hemStyle) {
case "baseball":
points.bballStart = points.cbHem.shiftFractionTowards(points.hem, 0.5);
points.bballEnd = points.hem.shiftFractionTowards(points.hips, options.hemCurve);
points.bballCp1 = points.bballStart.shiftFractionTowards(points.hem, 0.5);
points.bballCp2 = new Point(points.bballCp1.x, points.bballEnd.y);
paths.saBase = new Path()
.move(points.bballEnd)
.line(points.hips)
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole)
.join(paths.armhole)
.line(points.cbYoke)
.attr("class", "stroke-xxl");
paths.hemBase = new Path()
.move(points.cbHem)
.line(points.bballStart)
.curve(points.bballCp1, points.bballCp2, points.bballEnd);
break;
case "slashed":
macro("round", {
from: points.hips,
to: points.cbHem,
via: points.hem,
radius: points.hips.dist(points.hem) * options.hemCurve,
prefix: "slash",
});
paths.saBase = new Path()
.move(points.hips)
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole)
.join(paths.armhole)
.line(points.cbYoke)
.attr("class", "stroke-xxl");
paths.hemBase = new Path()
.move(points.cbHem)
.line(points.slashEnd)
.curve(points.slashCp2, points.slashCp1, points.slashStart);
break;
default:
paths.saBase = new Path()
.move(points.hem)
.line(points.hips)
.curve(points.hipsCp2, points.waistCp1, points.waist)
.curve_(points.waistCp2, points.armhole)
.join(paths.armhole)
.line(points.cbYoke)
.attr("class", "stroke-xxl");
paths.hemBase = new Path()
.move(points.cbHem)
.line(points.hem);
}
// Paths
paths.saBase.render = false;
paths.hemBase.render = false;
paths.seam = paths.hemBase.join(paths.saBase).close().attr('class', 'fabric');
// Complete pattern?
if (complete) {
delete snippets.armholePitchNotch;
macro("cutonfold", {
from: points.cbYoke,
to: points.cbHem,
grainline: true
});
points.title = new Point(points.armhole.x/4, points.armhole.y);
macro("title", { at: points.title, nr: 3, title: "back" });
points.logo = points.title.shift(-90, 70);
snippets.logo = new Snippet("logo", points.logo);
if(sa) {
paths.sa = paths.saBase.offset(sa).attr('class', 'fabric sa');
paths.hemSa = paths.hemBase.offset(sa*3).attr('class', 'fabric sa');
paths.saConnect = new Path()
.move(points.cbHem)
.line(paths.hemSa.start())
.move(paths.hemSa.end())
.line(paths.sa.start())
.move(paths.sa.end())
.line(points.cbYoke)
.attr('class', 'fabric sa');
}
}
// Paperless?
if (paperless) {
}
return part;
};

View file

@ -0,0 +1,62 @@
import freesewing from "freesewing";
import Brian from "@freesewing/brian";
import pluginBundle from "@freesewing/plugin-bundle";
import config from "../config/config";
import { version } from "../package.json";
// Parts
import draftBack from "./back";
//import draftFront from "./front";
//import draftSleevecap from "./sleevecap";
//import draftSleeve from "./sleeve";
// backBlock: ".Back block"
// frontBlock: ".Front block"
// sleeveBlock: ".Sleeve block"
// block: ".Block"
// frontAndBackBlock: ".Front and back block"
// frontRight: "Front right"
// frontLeft: "Front left"
// buttonPlacket: "Button placket."
// buttonholePlacket: "Buttonhole placket."
// yoke: "Yoke"
// back: "Back"
// sleeve: "Sleeve"
// collarStand: "Collar stand"
// collar: "Collar"
// undercollar: "Undercollar"
// sleevePlacketUnderlap: "Sleeve placket underlap"
// sleevePlacketOverlap: "Sleeve placket overlap"
// barrelCuff: "Barrel cuff"
// frenchCuff: "French cuff"
// Constructor boilerplate
const Simon = function(settings = false) {
freesewing.Pattern.call(this, { version: version, ...config });
this.with(pluginBundle);
if (settings !== false) this.mergeSettings(settings);
return this;
};
// Inheritance boilerplate
Simon.prototype = Object.create(freesewing.Pattern.prototype);
Simon.prototype.constructor = Simon;
// Attach per-part draft methods to prototype
Simon.prototype.draftBase = function (part) {
return new Brian(this.settings).draftBase(part);
}
Simon.prototype.draftFrontBase = function (part) {
return new Brian(this.settings).draftFront(part);
}
Simon.prototype.draftBackBase = function (part) {
return new Brian(this.settings).draftBack(part);
}
Simon.prototype.draftBack = draftBack;
//Brian.prototype.draftFront = draftFront;
//Brian.prototype.draftSleevecap = draftSleevecap;
//Brian.prototype.draftSleeve = draftSleeve;
export default Simon;

View file

@ -0,0 +1,18 @@
export const calculateReduction = function(part) {
let { store, measurements, options } = part.shorthand();
if(store.get('reduction') === true) return;
let chest = measurements.chestCircumference * (1+ options.chestEase);
let waist = measurements.naturalWaist * (1+ options.waistEase);
let hips = measurements.hipsCircumference * (1+ options.hipsEase);
let waistReduction = chest - waist;
let hipsReduction = chest - hips;
// If your waist > chest, this pattern is not going to work for you as-is.
if (waistReduction < 0) waistReduction = 0;
if (hipsReduction < 0) hipsReduction = 0;
store.set("waistReduction", waistReduction);
store.set("hipsReduction", hipsReduction);
store.set("reduction", true);
}