2019-09-25 18:02:05 +02:00
|
|
|
import freesewing from '@freesewing/core'
|
|
|
|
import Brian from '@freesewing/brian'
|
|
|
|
import Simon from '@freesewing/simon'
|
|
|
|
import plugins from '@freesewing/plugin-bundle'
|
|
|
|
import flipPlugin from '@freesewing/plugin-flip'
|
|
|
|
import buttonPlugin from '@freesewing/plugin-buttons'
|
|
|
|
import bustPlugin from '@freesewing/plugin-bust'
|
|
|
|
import config from '../config'
|
|
|
|
// Parts
|
|
|
|
import draftFbaFront from './fba-front'
|
|
|
|
|
|
|
|
// Create design
|
2022-06-14 13:09:16 +02:00
|
|
|
const Simone = new freesewing.Design(config, [plugins, flipPlugin, buttonPlugin, bustPlugin])
|
2019-09-25 18:02:05 +02:00
|
|
|
|
|
|
|
// Attach draft methods to prototype
|
2022-06-14 13:09:16 +02:00
|
|
|
Simone.prototype.draftBase = function (part) {
|
2019-09-25 18:02:05 +02:00
|
|
|
return new Brian(this.settings).draftBase(part)
|
|
|
|
}
|
2022-06-14 13:09:16 +02:00
|
|
|
Simone.prototype.draftFrontBase = function (part) {
|
2019-09-25 18:02:05 +02:00
|
|
|
return new Brian(this.settings).draftFront(part)
|
|
|
|
}
|
2022-06-14 13:09:16 +02:00
|
|
|
Simone.prototype.draftBackBase = function (part) {
|
2019-09-25 18:02:05 +02:00
|
|
|
return new Brian(this.settings).draftBack(part)
|
|
|
|
}
|
2022-06-14 13:09:16 +02:00
|
|
|
Simone.prototype.draftSleeveBase = function (part) {
|
2019-09-25 18:02:05 +02:00
|
|
|
let brian = new Brian(this.settings)
|
|
|
|
return brian.draftSleeve(brian.draftSleevecap(part))
|
|
|
|
}
|
|
|
|
|
|
|
|
// Attach draft methods from Simon
|
2022-05-21 18:11:01 +02:00
|
|
|
const simonParts = [
|
2019-09-25 18:02:05 +02:00
|
|
|
'Back',
|
|
|
|
'Front',
|
|
|
|
'FrontRight',
|
|
|
|
'ButtonPlacket',
|
|
|
|
'FrontLeft',
|
|
|
|
'ButtonholePlacket',
|
|
|
|
'Yoke',
|
|
|
|
'Sleeve',
|
|
|
|
'CollarStand',
|
|
|
|
'Collar',
|
|
|
|
'SleevePlacketUnderlap',
|
|
|
|
'SleevePlacketOverlap',
|
2021-04-24 10:16:31 +02:00
|
|
|
'Cuff',
|
2019-09-25 18:02:05 +02:00
|
|
|
]
|
|
|
|
|
2022-05-21 18:11:01 +02:00
|
|
|
for (const Part of simonParts) {
|
2022-06-14 13:09:16 +02:00
|
|
|
Simone.prototype[`draft${Part}`] = function (part) {
|
2019-09-25 18:02:05 +02:00
|
|
|
let simon = new Simon(this.settings)
|
|
|
|
return simon[`draft${Part}`](part)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-14 13:09:16 +02:00
|
|
|
Simone.prototype.draftFbaFront = draftFbaFront
|
2019-09-25 18:02:05 +02:00
|
|
|
|
2022-06-14 13:09:16 +02:00
|
|
|
// Named exports
|
|
|
|
export { config, Simone }
|
|
|
|
|
|
|
|
// Default export
|
|
|
|
export default Simone
|