1
0
Fork 0
freesewing/designs/simone/src/index.mjs

61 lines
1.5 KiB
JavaScript
Raw Normal View History

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
const Simone = new freesewing.Design(config, [plugins, flipPlugin, buttonPlugin, bustPlugin])
2019-09-25 18:02:05 +02:00
// Attach draft methods to prototype
Simone.prototype.draftBase = function (part) {
2019-09-25 18:02:05 +02:00
return new Brian(this.settings).draftBase(part)
}
Simone.prototype.draftFrontBase = function (part) {
2019-09-25 18:02:05 +02:00
return new Brian(this.settings).draftFront(part)
}
Simone.prototype.draftBackBase = function (part) {
2019-09-25 18:02:05 +02:00
return new Brian(this.settings).draftBack(part)
}
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) {
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)
}
}
Simone.prototype.draftFbaFront = draftFbaFront
2019-09-25 18:02:05 +02:00
// Named exports
export { config, Simone }
// Default export
export default Simone