sparkles: Spit up front right based on settings
This commit is contained in:
parent
f72ddf53cb
commit
275a1611f9
14 changed files with 2343 additions and 1928 deletions
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"plugins": ["transform-object-rest-spread"]
|
||||
}
|
71
packages/simon/:w
Normal file
71
packages/simon/:w
Normal file
|
@ -0,0 +1,71 @@
|
|||
|
||||
export default part => {
|
||||
// prettier-ignore
|
||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
if(options.buttonHoleType === "seperate") {
|
||||
|
||||
} else {
|
||||
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width/-2, points.cfNeck.y+20),
|
||||
new Point(width/-2, points.cfNeck.y-20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width/2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width/2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width/2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.line(points.cfHem)
|
||||
.close();
|
||||
|
||||
}
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
paths.placketInnerFold = new Path()
|
||||
.move(points.placketTopIn)
|
||||
.line(points.placketBottomIn)
|
||||
.attr("class", "dotted");
|
||||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["placketTopIn", "placketTopOut", "cfNeck", "placketBottomIn", "placketBottomOut", "cfHem"]
|
||||
});
|
||||
|
||||
let len = points.cfNeck.dist(points.cfHips) * ( 1 - options.buttonFreeLength );
|
||||
for (let i=1; i<=options.buttons; i++) {
|
||||
points["button"+i] = points.cfNeck.shift(-90, len / options.buttons * i);
|
||||
snippets["button"+i] = new Snippet("button", points["button"+i]);
|
||||
}
|
||||
|
||||
if(sa) {
|
||||
paths.saFromArmhole
|
||||
.line(new Point(points.placketTopEdge.x + sa, points.placketTopEdge.y - sa))
|
||||
.line(new Point(points.placketBottomEdge.x + sa, points.placketBottomEdge.y + sa*3))
|
||||
.line(paths.hemSa.start());
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
|
@ -1,7 +1,8 @@
|
|||
const yesNo = ["yes", "no"];
|
||||
import { version } from "../package.json";
|
||||
|
||||
export default {
|
||||
name: "simon",
|
||||
version,
|
||||
measurements: [
|
||||
"bicepsCircumference",
|
||||
"centerBackNeckToWaist",
|
||||
|
@ -14,25 +15,23 @@ export default {
|
|||
"hipsCircumference",
|
||||
"shoulderToElbow",
|
||||
"shoulderToWrist",
|
||||
"wristCircumference",
|
||||
"wristCircumference"
|
||||
],
|
||||
dependencies: {
|
||||
frontBase: "base",
|
||||
backBase: "base",
|
||||
back: "backBase",
|
||||
front: "frontBase",
|
||||
frontRight: "front"
|
||||
},
|
||||
inject: {
|
||||
frontBase: "base",
|
||||
backBase: "base",
|
||||
back: "backBase",
|
||||
front: "frontBase",
|
||||
frontRight: "front"
|
||||
},
|
||||
hide: [
|
||||
"base",
|
||||
"frontBase",
|
||||
"backBase"
|
||||
],
|
||||
hide: ["base", "frontBase", "backBase"],
|
||||
options: {
|
||||
// Constants
|
||||
collarFactor: 5,
|
||||
|
@ -41,7 +40,6 @@ export default {
|
|||
|
||||
// Toggles
|
||||
|
||||
|
||||
// Lists
|
||||
extraTopButton: {
|
||||
list: ["yes", "no"],
|
||||
|
@ -60,20 +58,20 @@ export default {
|
|||
dflt: "straight"
|
||||
},
|
||||
buttonPlacketType: {
|
||||
list: ['cutOn', 'seperate'],
|
||||
dflt: 'cutOn'
|
||||
list: ["cutOn", "seperate"],
|
||||
dflt: "cutOn"
|
||||
},
|
||||
buttonPlacketStyle: {
|
||||
list: ['classic', 'seamless'],
|
||||
dflt: 'classic'
|
||||
list: ["classic", "seamless"],
|
||||
dflt: "classic"
|
||||
},
|
||||
buttonholePlacketType: {
|
||||
list: ['cutOn', 'seperate'],
|
||||
dflt: 'cutOn'
|
||||
list: ["cutOn", "seperate"],
|
||||
dflt: "cutOn"
|
||||
},
|
||||
buttonholePlacketStyle: {
|
||||
list: ['classic', 'seamless'],
|
||||
dflt: 'seamless'
|
||||
list: ["classic", "seamless"],
|
||||
dflt: "seamless"
|
||||
},
|
||||
cuffStyle: {
|
||||
list: [
|
||||
|
@ -106,7 +104,7 @@ export default {
|
|||
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 },
|
||||
buttonFreeLength: { pct: 2, min: 0, max: 15 },
|
||||
chestEase: { pct: 8, min: -4, max: 20 },
|
||||
collarBend: { pct: 5, min: 0, max: 10 },
|
||||
collarEase: { pct: 3.5, min: 0, max: 10 },
|
||||
|
@ -146,6 +144,6 @@ export default {
|
|||
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 },
|
||||
yokeDart: { pct: 0, min: 0, max: 15 }
|
||||
}
|
||||
};
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<!-- <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="node_modules/@freesewing/plugin-sprinkle/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>
|
||||
|
@ -26,6 +27,7 @@
|
|||
<!-- <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-flip/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>
|
||||
|
@ -99,14 +101,17 @@
|
|||
};
|
||||
let settings1 = { ...settings };
|
||||
var pattern1 = new freesewing.patterns.simon(settings1);
|
||||
pattern1.with(freesewing.plugins.theme);
|
||||
pattern1.with(freesewing.plugins.designer);
|
||||
pattern1.with(freesewing.plugins.debug);
|
||||
pattern1.use(freesewing.plugins.theme);
|
||||
pattern1.use(freesewing.plugins.designer);
|
||||
pattern1.use(freesewing.plugins.flip);
|
||||
pattern1.use(freesewing.plugins.debug);
|
||||
pattern1.settings.options.yokeDart = 0.15;
|
||||
pattern1.settings.options.lengthBonus = 0.1;
|
||||
pattern1.settings.options.hemStyle = "basebal";
|
||||
pattern1.settings.options.hemStyle = "slashed";
|
||||
pattern1.settings.options.buttonPlacketType = "seperate";
|
||||
pattern1.settings.options.collarEase = 0.1;
|
||||
pattern1.settings.sa = 10;
|
||||
pattern1.settings.only = "frontRight";
|
||||
pattern1.draft();
|
||||
console.log(pattern1);
|
||||
document.getElementById("svg1").innerHTML = pattern1.render();
|
||||
|
|
3731
packages/simon/package-lock.json
generated
3731
packages/simon/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -47,18 +47,19 @@
|
|||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/brian": "^0.20.1",
|
||||
"@freesewing/plugin-bundle": "^0.6.0",
|
||||
"freesewing": "^0.24"
|
||||
"@freesewing/brian": "^0.22.0",
|
||||
"@freesewing/plugin-bundle": "^0.7.0",
|
||||
"@freesewing/plugin-buttons": "0.1.0",
|
||||
"@freesewing/plugin-flip": "0.1.0",
|
||||
"freesewing": "^0.26.1"
|
||||
},
|
||||
"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/core": "^7.2.2",
|
||||
"@babel/preset-env": "^7.2.3",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.2.0",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"@freesewing/antman": "0.2.0",
|
||||
"@freesewing/models": "0.6.0",
|
||||
"@freesewing/plugin-debug": "0.5.2",
|
||||
|
@ -66,19 +67,20 @@
|
|||
"@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",
|
||||
"eslint": "5.10.0",
|
||||
"eslint-config-prettier": "^3.3.0",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"husky": "^1.2.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"prettier": "1.15.3",
|
||||
"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"
|
||||
"rollup": "^0.68.1",
|
||||
"rollup-plugin-babel": "^4.1.0",
|
||||
"rollup-plugin-commonjs": "9.2.0",
|
||||
"rollup-plugin-filesize": "^5.0.1",
|
||||
"rollup-plugin-json": "^3.1.0",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-terser": "^3.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
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";
|
||||
|
@ -13,7 +12,6 @@ export default {
|
|||
browser: true
|
||||
}),
|
||||
json(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: "node_modules/**"
|
||||
}),
|
||||
|
|
|
@ -1,29 +1,34 @@
|
|||
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();
|
||||
|
||||
const collarDelta = () => paths.collar.length() * 2 + store.get("backCollarLength") - store.get("collarLength");
|
||||
|
||||
// Populare store with data we need
|
||||
calculateReduction(part);
|
||||
store.set("frontArmholeLength", new Path()
|
||||
store.set(
|
||||
"frontArmholeLength",
|
||||
new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
||||
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve(
|
||||
points.armholeHollowCp2,
|
||||
points.armholePitchCp1,
|
||||
points.armholePitch
|
||||
)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.length());
|
||||
store.set("collarLength", measurements.neckCircumference * (1+options.collarEase));
|
||||
|
||||
.length()
|
||||
);
|
||||
|
||||
// Waist shaping
|
||||
let reduce = store.get('waistReduction');
|
||||
let reduce = store.get("waistReduction");
|
||||
if (reduce / 4 > options.minimalDartShaping) reduce = reduce / 8;
|
||||
else reduce = reduce / 4;
|
||||
points.waist = points.waist.shift(180, reduce);
|
||||
points.waistCp1 = points.waist.shift(-90, measurements.naturalWaistToHip * 0.5);
|
||||
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);
|
||||
|
||||
|
@ -42,7 +47,10 @@ export default part => {
|
|||
switch (options.hemStyle) {
|
||||
case "baseball":
|
||||
points.bballStart = points.cfHem.shiftFractionTowards(points.hem, 0.5);
|
||||
points.bballEnd = points.hem.shiftFractionTowards(points.hips, options.hemCurve);
|
||||
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()
|
||||
|
@ -61,11 +69,9 @@ export default part => {
|
|||
to: points.cfHem,
|
||||
via: points.hem,
|
||||
radius: points.hips.dist(points.hem) * options.hemCurve,
|
||||
prefix: "slash",
|
||||
prefix: "slash"
|
||||
});
|
||||
paths.saBase = new Path()
|
||||
.move(points.hips)
|
||||
.join(paths.saBaseFromHips);
|
||||
paths.saBase = new Path().move(points.hips).join(paths.saBaseFromHips);
|
||||
paths.hemBase = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.slashEnd)
|
||||
|
@ -84,7 +90,10 @@ export default part => {
|
|||
paths.saBaseFromHips.render = false;
|
||||
paths.saBaseFromArmhole.render = false;
|
||||
paths.hemBase.render = false;
|
||||
paths.seam = paths.hemBase.join(paths.saBase).join(paths.saBaseFromArmhole).close().attr('class', 'fabric');
|
||||
paths.seam = paths.hemBase
|
||||
.join(paths.saBase)
|
||||
.join(paths.saBaseFromArmhole)
|
||||
.attr("class", "fabric");
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -94,21 +103,33 @@ export default part => {
|
|||
to: points.cfNeck.shift(0, 45)
|
||||
});
|
||||
macro("title", { at: points.title, nr: "X", title: "front" });
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [
|
||||
"waist",
|
||||
"armholePitch",
|
||||
"shoulder",
|
||||
"neck",
|
||||
"hips",
|
||||
"cfHips",
|
||||
"cfWaist",
|
||||
"armhole",
|
||||
"cfArmhole"
|
||||
]
|
||||
});
|
||||
|
||||
if (sa) {
|
||||
paths.saFrench = paths.saBase.offset(sa*2).attr('class', 'fabric sa');
|
||||
paths.saFromArmhole = paths.saBaseFromArmhole.offset(sa).attr('class', 'fabric sa');
|
||||
paths.hemSa = paths.hemBase.offset(sa*3).attr('class', 'fabric sa');
|
||||
paths.saFrench = paths.saBase.offset(sa * 2).attr("class", "fabric sa");
|
||||
paths.saFromArmhole = paths.saBaseFromArmhole
|
||||
.offset(sa)
|
||||
.attr("class", "fabric sa");
|
||||
paths.hemSa = paths.hemBase.offset(sa * 3).attr("class", "fabric sa");
|
||||
paths.saConnect = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(paths.hemSa.start())
|
||||
.move(paths.hemSa.end())
|
||||
.line(paths.saFrench.start())
|
||||
.move(paths.saFrench.end())
|
||||
.line(paths.saFromArmhole.start())
|
||||
.move(paths.saFromArmhole.end())
|
||||
.line(points.cfNeck)
|
||||
.attr('class', 'fabric sa');
|
||||
.attr("class", "fabric sa");
|
||||
delete paths.sa;
|
||||
}
|
||||
}
|
||||
|
|
95
packages/simon/src/frontright-classic-cuton.js
Normal file
95
packages/simon/src/frontright-classic-cuton.js
Normal file
|
@ -0,0 +1,95 @@
|
|||
export default part => {
|
||||
// prettier-ignore
|
||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
if (options.buttonHoleType === "seperate") {
|
||||
} else {
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.line(points.cfHem)
|
||||
.close();
|
||||
}
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Placket help lines
|
||||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
paths.placketInnerFold = new Path()
|
||||
.move(points.placketTopIn)
|
||||
.line(points.placketBottomIn)
|
||||
.attr("class", "dotted");
|
||||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [
|
||||
"placketTopIn",
|
||||
"placketTopOut",
|
||||
"cfNeck",
|
||||
"placketBottomIn",
|
||||
"placketBottomOut",
|
||||
"cfHem"
|
||||
]
|
||||
});
|
||||
|
||||
// Buttons
|
||||
let len =
|
||||
points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength);
|
||||
for (let i = 1; i <= options.buttons; i++) {
|
||||
points["button" + i] = points.cfNeck.shift(
|
||||
-90,
|
||||
(len / options.buttons) * i
|
||||
);
|
||||
snippets["button" + i] = new Snippet("button", points["button" + i]);
|
||||
}
|
||||
if (options.extraTopButton === "yes")
|
||||
snippets.topButton = new Snippet(
|
||||
"button",
|
||||
points.cfNeck.shift(-90, len / options.buttons / 2)
|
||||
);
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 1, title: "frontRight" });
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
.line(
|
||||
new Point(points.placketTopEdge.x + sa, points.placketTopEdge.y - sa)
|
||||
)
|
||||
.line(
|
||||
new Point(
|
||||
points.placketBottomEdge.x + sa,
|
||||
points.placketBottomEdge.y + sa * 3
|
||||
)
|
||||
)
|
||||
.line(paths.hemSa.start());
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
35
packages/simon/src/frontright-classic-seperate.js
Normal file
35
packages/simon/src/frontright-classic-seperate.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
export default part => {
|
||||
// prettier-ignore
|
||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
if (options.buttonHoleType === "seperate") {
|
||||
} else {
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
paths.seam = paths.seam.split(points.placketTopIn)[0];
|
||||
paths.seam.ops[0].to = points.placketBottomIn;
|
||||
paths.seam.close().attr("class", "fabric");
|
||||
}
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 1, title: "rightFront" });
|
||||
|
||||
if (sa) paths.saFromArmhole.line(paths.hemSa.start());
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
47
packages/simon/src/frontright-seamless-cuton.js
Normal file
47
packages/simon/src/frontright-seamless-cuton.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
export default part => {
|
||||
// prettier-ignore
|
||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
if (options.buttonHoleType === "seperate") {
|
||||
} else {
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
|
||||
paths.placketInnerFold = new Path()
|
||||
.move(points.placketTopIn)
|
||||
.line(points.placketBottomIn)
|
||||
.attr("class", "help");
|
||||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "help");
|
||||
|
||||
paths.tmp = new Path()
|
||||
.move(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge);
|
||||
}
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
47
packages/simon/src/frontright-seamless-seperate.js
Normal file
47
packages/simon/src/frontright-seamless-seperate.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
export default part => {
|
||||
// prettier-ignore
|
||||
let {store, measurements, utils, sa, Point, points, Path, paths, Snippet, snippets, complete, paperless, macro, options} = part.shorthand();
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
if (options.buttonHoleType === "seperate") {
|
||||
} else {
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
points.cfNeck,
|
||||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
|
||||
paths.placketInnerFold = new Path()
|
||||
.move(points.placketTopIn)
|
||||
.line(points.placketBottomIn)
|
||||
.attr("class", "help");
|
||||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "help");
|
||||
|
||||
paths.tmp = new Path()
|
||||
.move(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge);
|
||||
}
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
17
packages/simon/src/frontright.js
Normal file
17
packages/simon/src/frontright.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import frontRightClassicSeperate from "./frontright-classic-seperate";
|
||||
import frontRightClassicCuton from "./frontright-classic-cuton";
|
||||
import frontRightSeamlessSeperate from "./frontright-seamless-seperate";
|
||||
import frontRightSeamlessCuton from "./frontright-seamless-cuton";
|
||||
|
||||
export default part => {
|
||||
let { macro, options } = part.shorthand();
|
||||
macro("flip");
|
||||
|
||||
return options.buttonPlacketStyle === "seamless"
|
||||
? options.buttonPlacketType === "seperate"
|
||||
? frontRightSeamlessSeperate(part)
|
||||
: frontRightSeamlessCuton(part)
|
||||
: options.buttonPlacketType === "seperate"
|
||||
? frontRightClassicSeperate(part)
|
||||
: frontRightClassicCuton(part);
|
||||
};
|
|
@ -1,18 +1,16 @@
|
|||
import freesewing from "freesewing";
|
||||
import Brian from "@freesewing/brian";
|
||||
import pluginBundle from "@freesewing/plugin-bundle";
|
||||
import plugins from "@freesewing/plugin-bundle";
|
||||
import flipPlugin from "@freesewing/plugin-flip";
|
||||
import buttonPlugin from "@freesewing/plugin-buttons";
|
||||
import config from "../config/config";
|
||||
import { version } from "../package.json";
|
||||
// Parts
|
||||
import draftBack from "./back";
|
||||
import draftFront from "./front";
|
||||
import draftFrontRight from "./frontright";
|
||||
//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."
|
||||
|
@ -28,33 +26,34 @@ import draftFront from "./front";
|
|||
// 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);
|
||||
// Constructor
|
||||
const Simon = function(settings) {
|
||||
freesewing.Pattern.call(this, config);
|
||||
this.use(plugins)
|
||||
.use(flipPlugin)
|
||||
.use(buttonPlugin)
|
||||
.apply(settings);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// Inheritance boilerplate
|
||||
// Set up inheritance
|
||||
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;
|
||||
Simon.prototype.draftFront = draftFront;
|
||||
|
||||
|
||||
Simon.prototype.draftFrontRight = draftFrontRight;
|
||||
|
||||
//Brian.prototype.draftFront = draftFront;
|
||||
//Brian.prototype.draftSleevecap = draftSleevecap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue