1
0
Fork 0
freesewing/packages/huey/src/index.js

44 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-03-03 16:04:24 +01:00
import freesewing from "freesewing";
import plugins from "@freesewing/plugin-bundle";
import Brian from "@freesewing/brian";
import config from "../config";
// Parts
import draftBack from "./back";
import draftFront from "./front";
import draftSleeve from "./sleeve";
import draftPocket from "./pocket";
import draftHood from "./hood";
import draftWaistband from "./waistband";
import draftCuff from "./cuff";
// Create new design
const Huey = new freesewing.Design(config, plugins);
// Attach draft methods from Brian to prototype
Huey.prototype.draftBase = function(part) {
return new Brian(this.settings).draftBase(part);
};
Huey.prototype.draftFrontBlock = function(part) {
return new Brian(this.settings).draftFront(part);
};
Huey.prototype.draftBackBlock = function(part) {
return new Brian(this.settings).draftBack(part);
};
Huey.prototype.draftSleevecap = function(part) {
return new Brian(this.settings).draftSleevecap(part);
};
Huey.prototype.draftSleeveBlock = function(part) {
return new Brian(this.settings).draftSleeve(part);
};
// Attach own draft methods to prototype
Huey.prototype.draftBack = draftBack;
Huey.prototype.draftFront = draftFront;
Huey.prototype.draftSleeve = draftSleeve;
Huey.prototype.draftPocket = draftPocket;
Huey.prototype.draftHood = draftHood;
Huey.prototype.draftWaistband = draftWaistband;
Huey.prototype.draftCuff = draftCuff;
export default Huey;