2021-01-30 16:30:45 +01:00
|
|
|
import freesewing from '@freesewing/core'
|
|
|
|
import Titan from '@freesewing/titan'
|
|
|
|
import plugins from '@freesewing/plugin-bundle'
|
2021-03-13 09:58:17 +01:00
|
|
|
import mirrorPlugin from '@freesewing/plugin-mirror'
|
2021-03-14 18:02:22 +01:00
|
|
|
import buttonsPlugin from '@freesewing/plugin-buttons'
|
2021-04-11 17:15:58 +02:00
|
|
|
import bartackPlugin from '@freesewing/plugin-bartack'
|
2021-01-30 16:30:45 +01:00
|
|
|
import config from '../config'
|
|
|
|
// Parts
|
|
|
|
import draftBack from './back'
|
|
|
|
import draftFront from './front'
|
2021-03-13 09:58:17 +01:00
|
|
|
import draftWaistband from './waistband'
|
2021-04-20 23:22:12 +02:00
|
|
|
import draftWaistbandCurved from './waistband-curved'
|
2021-03-13 09:58:17 +01:00
|
|
|
import draftFrontPocket from './front-pocket'
|
2021-03-14 18:02:22 +01:00
|
|
|
import draftFrontPocketFacing from './front-pocket-facing'
|
2021-03-13 09:58:17 +01:00
|
|
|
import draftBackPocket from './back-pocket'
|
|
|
|
import draftBackPocketFacing from './back-pocket-facing'
|
2021-04-11 17:15:58 +02:00
|
|
|
import draftBackPocketInterfacing from './back-pocket-interfacing'
|
2022-07-03 13:06:17 +02:00
|
|
|
import draftBackPocketWelt from './back-pocket-welt'
|
2021-03-14 18:02:22 +01:00
|
|
|
import draftFlyFacing from './fly-facing'
|
2021-04-11 17:15:58 +02:00
|
|
|
import draftFlyExtension from './fly-extension'
|
|
|
|
import draftBeltLoops from './beltloops'
|
2021-03-09 19:21:50 +01:00
|
|
|
|
2021-01-30 16:30:45 +01:00
|
|
|
// Create design
|
2022-06-14 13:09:08 +02:00
|
|
|
const Charlie = new freesewing.Design(config, [plugins, mirrorPlugin, buttonsPlugin, bartackPlugin])
|
2021-01-30 16:30:45 +01:00
|
|
|
|
|
|
|
// Attach titan draft methods to prototype
|
|
|
|
for (let p of ['Front', 'Back']) {
|
2022-06-14 13:09:08 +02:00
|
|
|
Charlie.prototype[`draftTitan${p}`] = function (part) {
|
2021-01-30 16:30:45 +01:00
|
|
|
return new Titan(this.settings)[`draft${p}`](part)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Attach charlie draft methods to prototype
|
2022-06-14 13:09:08 +02:00
|
|
|
Charlie.prototype.draftBack = (part) => draftBack(part)
|
|
|
|
Charlie.prototype.draftFront = (part) => draftFront(part)
|
|
|
|
Charlie.prototype.draftWaistband = (part) => draftWaistband(part)
|
|
|
|
Charlie.prototype.draftWaistbandCurved = (part) => draftWaistbandCurved(part)
|
|
|
|
Charlie.prototype.draftFrontPocket = (part) => draftFrontPocket(part)
|
|
|
|
Charlie.prototype.draftFrontPocketFacing = (part) => draftFrontPocketFacing(part)
|
|
|
|
Charlie.prototype.draftBackPocket = (part) => draftBackPocket(part)
|
|
|
|
Charlie.prototype.draftBackPocketFacing = (part) => draftBackPocketFacing(part)
|
|
|
|
Charlie.prototype.draftBackPocketInterfacing = (part) => draftBackPocketInterfacing(part)
|
2022-07-03 13:06:17 +02:00
|
|
|
Charlie.prototype.draftBackPocketWelt = (part) => draftBackPocketWelt(part)
|
2022-06-14 13:09:08 +02:00
|
|
|
Charlie.prototype.draftFlyFacing = (part) => draftFlyFacing(part)
|
|
|
|
Charlie.prototype.draftFlyExtension = (part) => draftFlyExtension(part)
|
|
|
|
Charlie.prototype.draftBeltLoops = (part) => draftBeltLoops(part)
|
2021-01-30 16:30:45 +01:00
|
|
|
|
2022-06-14 13:09:08 +02:00
|
|
|
// Named exports
|
|
|
|
export { config, Charlie }
|
|
|
|
|
|
|
|
// Default export
|
|
|
|
export default Charlie
|