2018-12-21 18:19:21 +01:00
|
|
|
import freesewing from "freesewing";
|
|
|
|
import Brian from "@freesewing/brian";
|
2018-12-22 15:15:49 +01:00
|
|
|
import plugins from "@freesewing/plugin-bundle";
|
|
|
|
import flipPlugin from "@freesewing/plugin-flip";
|
|
|
|
import buttonPlugin from "@freesewing/plugin-buttons";
|
2018-12-21 18:19:21 +01:00
|
|
|
import config from "../config/config";
|
|
|
|
// Parts
|
|
|
|
import draftBack from "./back";
|
2018-12-21 19:38:05 +01:00
|
|
|
import draftFront from "./front";
|
2018-12-22 15:15:49 +01:00
|
|
|
import draftFrontRight from "./frontright";
|
2018-12-22 17:30:12 +01:00
|
|
|
import draftButtonPlacket from "./buttonplacket";
|
2018-12-23 12:13:37 +01:00
|
|
|
import draftFrontLeft from "./frontleft";
|
2018-12-23 13:57:40 +01:00
|
|
|
import draftButtonholePlacket from "./buttonholeplacket";
|
2018-12-23 14:54:34 +01:00
|
|
|
import draftYoke from "./yoke";
|
2018-12-23 17:25:53 +01:00
|
|
|
import draftSleeve from "./sleeve";
|
2018-12-24 14:17:55 +01:00
|
|
|
import draftCollarStand from "./collarstand";
|
2018-12-21 18:19:21 +01:00
|
|
|
|
2018-12-22 15:15:49 +01:00
|
|
|
// Constructor
|
|
|
|
const Simon = function(settings) {
|
|
|
|
freesewing.Pattern.call(this, config);
|
|
|
|
this.use(plugins)
|
|
|
|
.use(flipPlugin)
|
|
|
|
.use(buttonPlugin)
|
|
|
|
.apply(settings);
|
2018-12-21 18:19:21 +01:00
|
|
|
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
|
2018-12-22 15:15:49 +01:00
|
|
|
// Set up inheritance
|
2018-12-21 18:19:21 +01:00
|
|
|
Simon.prototype = Object.create(freesewing.Pattern.prototype);
|
|
|
|
Simon.prototype.constructor = Simon;
|
|
|
|
|
|
|
|
// Attach per-part draft methods to prototype
|
2018-12-22 15:15:49 +01:00
|
|
|
Simon.prototype.draftBase = function(part) {
|
2018-12-21 18:19:21 +01:00
|
|
|
return new Brian(this.settings).draftBase(part);
|
2018-12-22 15:15:49 +01:00
|
|
|
};
|
|
|
|
Simon.prototype.draftFrontBase = function(part) {
|
2018-12-21 18:19:21 +01:00
|
|
|
return new Brian(this.settings).draftFront(part);
|
2018-12-22 15:15:49 +01:00
|
|
|
};
|
|
|
|
Simon.prototype.draftBackBase = function(part) {
|
2018-12-21 18:19:21 +01:00
|
|
|
return new Brian(this.settings).draftBack(part);
|
2018-12-22 15:15:49 +01:00
|
|
|
};
|
2018-12-23 17:25:53 +01:00
|
|
|
Simon.prototype.draftSleeveBase = function(part) {
|
|
|
|
let brian = new Brian(this.settings);
|
|
|
|
return brian.draftSleeve(brian.draftSleevecap(part));
|
|
|
|
};
|
2018-12-21 18:19:21 +01:00
|
|
|
Simon.prototype.draftBack = draftBack;
|
2018-12-21 19:38:05 +01:00
|
|
|
Simon.prototype.draftFront = draftFront;
|
2018-12-22 15:15:49 +01:00
|
|
|
Simon.prototype.draftFrontRight = draftFrontRight;
|
2018-12-22 17:30:12 +01:00
|
|
|
Simon.prototype.draftButtonPlacket = draftButtonPlacket;
|
2018-12-23 12:13:37 +01:00
|
|
|
Simon.prototype.draftFrontLeft = draftFrontLeft;
|
2018-12-23 13:57:40 +01:00
|
|
|
Simon.prototype.draftButtonholePlacket = draftButtonholePlacket;
|
2018-12-23 14:54:34 +01:00
|
|
|
Simon.prototype.draftYoke = draftYoke;
|
2018-12-23 17:25:53 +01:00
|
|
|
Simon.prototype.draftSleeve = draftSleeve;
|
2018-12-24 14:17:55 +01:00
|
|
|
Simon.prototype.draftCollarStand = draftCollarStand;
|
2018-12-21 18:19:21 +01:00
|
|
|
|
|
|
|
export default Simon;
|