2019-04-29 09:01:51 +02:00
|
|
|
import freesewing from "@freesewing/core";
|
2018-12-21 18:19:21 +01:00
|
|
|
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-29 12:28:09 +01:00
|
|
|
import config from "../config";
|
2018-12-21 18:19:21 +01:00
|
|
|
// 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-24 15:53:34 +01:00
|
|
|
import draftCollar from "./collar";
|
2018-12-24 17:35:06 +01:00
|
|
|
import draftSleevePlacketUnderlap from "./sleeveplacket-underlap";
|
|
|
|
import draftSleevePlacketOverlap from "./sleeveplacket-overlap";
|
2018-12-27 13:08:30 +01:00
|
|
|
import draftCuff from "./cuff";
|
2018-12-21 18:19:21 +01:00
|
|
|
|
2019-02-16 11:41:53 +01:00
|
|
|
// Create design
|
2019-05-02 14:33:34 +02:00
|
|
|
const Pattern = new freesewing.Design(config, [
|
2019-02-16 11:41:53 +01:00
|
|
|
plugins,
|
|
|
|
flipPlugin,
|
|
|
|
buttonPlugin
|
|
|
|
]);
|
2018-12-21 18:19:21 +01:00
|
|
|
|
2019-02-16 11:41:53 +01:00
|
|
|
// Attach draft methods to prototype
|
2019-05-02 14:33:34 +02:00
|
|
|
Pattern.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
|
|
|
};
|
2019-05-02 14:33:34 +02:00
|
|
|
Pattern.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
|
|
|
};
|
2019-05-02 14:33:34 +02:00
|
|
|
Pattern.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
|
|
|
};
|
2019-05-02 14:33:34 +02:00
|
|
|
Pattern.prototype.draftSleeveBase = function(part) {
|
2018-12-23 17:25:53 +01:00
|
|
|
let brian = new Brian(this.settings);
|
|
|
|
return brian.draftSleeve(brian.draftSleevecap(part));
|
|
|
|
};
|
2019-05-02 14:33:34 +02:00
|
|
|
Pattern.prototype.draftBack = draftBack;
|
|
|
|
Pattern.prototype.draftFront = draftFront;
|
|
|
|
Pattern.prototype.draftFrontRight = draftFrontRight;
|
|
|
|
Pattern.prototype.draftButtonPlacket = draftButtonPlacket;
|
|
|
|
Pattern.prototype.draftFrontLeft = draftFrontLeft;
|
|
|
|
Pattern.prototype.draftButtonholePlacket = draftButtonholePlacket;
|
|
|
|
Pattern.prototype.draftYoke = draftYoke;
|
|
|
|
Pattern.prototype.draftSleeve = draftSleeve;
|
|
|
|
Pattern.prototype.draftCollarStand = draftCollarStand;
|
|
|
|
Pattern.prototype.draftCollar = draftCollar;
|
|
|
|
Pattern.prototype.draftSleevePlacketUnderlap = draftSleevePlacketUnderlap;
|
|
|
|
Pattern.prototype.draftSleevePlacketOverlap = draftSleevePlacketOverlap;
|
|
|
|
Pattern.prototype.draftCuff = draftCuff;
|
2018-12-21 18:19:21 +01:00
|
|
|
|
2019-05-02 14:33:34 +02:00
|
|
|
export default Pattern;
|