2018-07-26 10:03:19 +00:00
|
|
|
import freesewing from "freesewing";
|
2018-08-05 13:57:24 +02:00
|
|
|
import pluginCutonfold from "@freesewing/plugin-cutonfold";
|
2018-08-10 18:51:44 +02:00
|
|
|
import pluginGrainline from "@freesewing/plugin-grainline";
|
2018-08-05 13:57:24 +02:00
|
|
|
import pluginDimension from "@freesewing/plugin-dimension";
|
|
|
|
import pluginLogo from "@freesewing/plugin-logo";
|
|
|
|
import pluginTitle from "@freesewing/plugin-title";
|
|
|
|
|
2018-07-26 10:03:19 +00:00
|
|
|
import config from "../config/config";
|
2018-08-05 13:57:24 +02:00
|
|
|
import { version } from "../package.json";
|
|
|
|
|
2018-08-05 16:32:19 +02:00
|
|
|
import base from "./base";
|
2018-07-24 10:16:31 +00:00
|
|
|
import back from "./back";
|
2018-08-03 17:44:55 +02:00
|
|
|
import front from "./front";
|
2018-08-06 16:19:12 +02:00
|
|
|
import sleeve from "./sleeve";
|
2018-07-26 13:43:45 +00:00
|
|
|
|
2018-08-05 18:34:32 +02:00
|
|
|
var pattern = new freesewing.Pattern({ version: version, ...config })
|
2018-08-05 13:57:24 +02:00
|
|
|
.with(pluginCutonfold)
|
2018-08-10 18:51:44 +02:00
|
|
|
.with(pluginGrainline)
|
2018-08-05 13:57:24 +02:00
|
|
|
.with(pluginDimension)
|
|
|
|
.with(pluginLogo)
|
|
|
|
.with(pluginTitle);
|
2018-07-15 18:57:27 +02:00
|
|
|
|
2018-07-26 10:03:19 +00:00
|
|
|
pattern.draft = function() {
|
2018-08-10 17:11:48 +02:00
|
|
|
pattern.parts.base = this.draftBase();
|
|
|
|
pattern.parts.back = this.draftBack();
|
|
|
|
pattern.parts.front = this.draftFront();
|
|
|
|
pattern.parts.sleeve = this.draftSleeve();
|
2018-08-10 16:36:08 +02:00
|
|
|
|
2018-07-26 10:03:19 +00:00
|
|
|
return pattern;
|
2018-07-24 10:16:31 +00:00
|
|
|
};
|
2018-07-15 18:57:27 +02:00
|
|
|
|
2018-08-11 11:52:49 +02:00
|
|
|
pattern.draftBase = function(pattern = false) {
|
|
|
|
if (pattern === false) pattern = this;
|
|
|
|
return base.draft(pattern);
|
2018-08-10 17:11:48 +02:00
|
|
|
};
|
|
|
|
|
2018-08-11 11:52:49 +02:00
|
|
|
pattern.draftBack = function(pattern = false) {
|
|
|
|
if (pattern === false) pattern = this;
|
|
|
|
return back.draft(pattern);
|
2018-08-10 17:11:48 +02:00
|
|
|
};
|
|
|
|
|
2018-08-11 11:52:49 +02:00
|
|
|
pattern.draftFront = function(pattern = false) {
|
|
|
|
if (pattern === false) pattern = this;
|
|
|
|
return front.draft(pattern);
|
2018-08-10 17:11:48 +02:00
|
|
|
};
|
|
|
|
|
2018-08-11 11:52:49 +02:00
|
|
|
pattern.draftSleeve = function(pattern = false) {
|
|
|
|
if (pattern === false) pattern = this;
|
|
|
|
return sleeve.draft(pattern);
|
2018-08-10 17:11:48 +02:00
|
|
|
};
|
2018-07-26 23:30:43 +02:00
|
|
|
export default pattern;
|