1
0
Fork 0
freesewing/designs/bent/src/index.js

35 lines
1 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import freesewing from '@freesewing/core'
import plugins from '@freesewing/plugin-bundle'
2021-06-13 12:35:52 +02:00
import mirrorPlugin from '@freesewing/plugin-mirror'
2019-08-03 15:03:33 +02:00
import Brian from '@freesewing/brian'
import config from '../config'
2019-02-26 17:46:07 +01:00
// Parts
2019-08-03 15:03:33 +02:00
import draftSleeve from './sleeve'
import draftTopSleeve from './topsleeve'
import draftUnderSleeve from './undersleeve'
2019-02-26 17:46:07 +01:00
// Create new design
const Bent = new freesewing.Design(config, [plugins, mirrorPlugin])
2019-02-26 17:46:07 +01:00
// Attach draft methods from Brian to prototype
Bent.prototype.draftBase = function (part) {
2019-08-03 15:03:33 +02:00
return new Brian(this.settings).draftBase(part)
}
Bent.prototype.draftFront = function (part) {
2019-08-03 15:03:33 +02:00
return new Brian(this.settings).draftFront(part)
}
Bent.prototype.draftBack = function (part) {
2019-08-03 15:03:33 +02:00
return new Brian(this.settings).draftBack(part)
}
2019-02-26 17:46:07 +01:00
// Attach own draft methods to prototype
Bent.prototype.draftSleeve = draftSleeve
Bent.prototype.draftTopSleeve = draftTopSleeve
Bent.prototype.draftUnderSleeve = draftUnderSleeve
2019-02-26 17:46:07 +01:00
// Named exports
export { config, Bent }
// Default export
export default Bent