1
0
Fork 0
freesewing/packages/brian/index.ts

33 lines
953 B
TypeScript
Raw Normal View History

2018-07-11 12:42:55 +00:00
import FS from 'freesewing'
import * as patternConfig from './config/config'
2018-07-11 12:42:55 +00:00
import { manSize40 as model} from '@freesewing/models'
import { DraftConfig } from './lib/types'
import Pattern from 'freesewing/lib/pattern'
2018-07-10 12:21:17 +00:00
2018-07-11 12:42:55 +00:00
/** This would come in from whoever is consuming this module */
const config = {
mode: 'draft',
units: 'metric',
2018-07-11 12:42:55 +00:00
measurements: model,
sa: 10,
theme: 'default'
}
2018-07-10 12:21:17 +00:00
2018-07-11 12:42:55 +00:00
var brian = new FS.pattern(patternConfig);
var back = brian.parts.backBlock;
2018-07-10 12:21:17 +00:00
2018-07-11 12:42:55 +00:00
brian.draft = function(config: DraftConfig): void {
back.draft(config, brian);
}
back.draft = function (config: DraftConfig, pattern: Pattern){
back.points.cbNeck = new FS.point(0, pattern.o('backNeckCutout'));
back.points.cbArmhole = new FS.point(0, back.points.cbNeck.y + ( model.shoulderSlope - pattern.o('shoulderSlopeReduction') ) / 2);
console.log(back.points);
}
// Calling this here for now so we see something happening
brian.draft(config);
2018-07-10 12:21:17 +00:00
2018-07-11 12:42:55 +00:00
export default brian;