sparkles: Made shoulder slope reduction a percentage option
This commit is contained in:
parent
9d9b912290
commit
a40ba3015d
4 changed files with 94 additions and 32 deletions
|
@ -15,7 +15,6 @@ export default {
|
|||
],
|
||||
options: {
|
||||
// Constants
|
||||
// TODO shoulderSlopeReduction: { val: 0, type: "constant" },
|
||||
collarFactor: { val: 4.8, type: "constant" },
|
||||
|
||||
// Measures
|
||||
|
@ -24,31 +23,32 @@ export default {
|
|||
sleeveLengthBonus: { val: 0, min: -40, max: 80, type: "measure" },
|
||||
|
||||
// Percentages
|
||||
acrossBackFactor: { val: 97, min: 93, max: 100 },
|
||||
armholeDepthFactor: { val: 60, min: 50, max: 70 },
|
||||
backNeckCutout: { val: 5, min: 2, max: 8 },
|
||||
bicepsEase: { val: 15, min: 0, max: 50 },
|
||||
chestEase: { val: 8, min: -4, max: 20 },
|
||||
collarEase: { val: 3.5, min: 0, max: 10 },
|
||||
cuffEase: { val: 20, min: 0, max: 200 },
|
||||
frontArmholeDeeper: { val: 0.5, min: 0, max: 1.5 },
|
||||
sleevecapEase: { val: 1, min: 0, max: 10 },
|
||||
sleevecapBackFactorX: { val: 50, min: 35, max: 65 },
|
||||
sleevecapBackFactorY: { val: 33, min: 35, max: 65 },
|
||||
sleevecapFrontFactorX: { val: 50, min: 35, max: 65 },
|
||||
sleevecapFrontFactorY: { val: 33, min: 35, max: 65 },
|
||||
sleevecapQ1Offset: { val: 5, min: 0, max: 7 },
|
||||
sleevecapQ2Offset: { val: 5.5, min: 0, max: 7 },
|
||||
sleevecapQ3Offset: { val: 4.5, min: 0, max: 7 },
|
||||
sleevecapQ4Offset: { val: 2, min: 0, max: 7 },
|
||||
sleevecapQ1Spread1: { val: 6, min: 4, max: 20 },
|
||||
sleevecapQ1Spread2: { val: 15, min: 4, max: 20 },
|
||||
sleevecapQ2Spread1: { val: 15, min: 4, max: 20 },
|
||||
sleevecapQ2Spread2: { val: 10, min: 4, max: 20 },
|
||||
sleevecapQ3Spread1: { val: 10, min: 4, max: 20 },
|
||||
sleevecapQ3Spread2: { val: 8, min: 4, max: 20 },
|
||||
sleevecapQ4Spread1: { val: 7, min: 4, max: 20 },
|
||||
sleevecapQ4Spread2: { val: 7, min: 4, max: 20 },
|
||||
sleeveWidthGuarantee: { val: 90, min: 25, max: 100 },
|
||||
acrossBackFactor: { val: 97, min: 93, max: 100 },
|
||||
armholeDepthFactor: { val: 60, min: 50, max: 70 },
|
||||
backNeckCutout: { val: 5, min: 2, max: 8 },
|
||||
bicepsEase: { val: 15, min: 0, max: 50 },
|
||||
chestEase: { val: 8, min: -4, max: 20 },
|
||||
collarEase: { val: 3.5, min: 0, max: 10 },
|
||||
cuffEase: { val: 20, min: 0, max: 200 },
|
||||
frontArmholeDeeper: { val: 0.5, min: 0, max: 1.5 },
|
||||
shoulderSlopeReduction: { val: 0, min: 0, max: 8 },
|
||||
sleevecapEase: { val: 1, min: 0, max: 10 },
|
||||
sleevecapBackFactorX: { val: 50, min: 35, max: 65 },
|
||||
sleevecapBackFactorY: { val: 33, min: 35, max: 65 },
|
||||
sleevecapFrontFactorX: { val: 50, min: 35, max: 65 },
|
||||
sleevecapFrontFactorY: { val: 33, min: 35, max: 65 },
|
||||
sleevecapQ1Offset: { val: 5, min: 0, max: 7 },
|
||||
sleevecapQ2Offset: { val: 5.5, min: 0, max: 7 },
|
||||
sleevecapQ3Offset: { val: 4.5, min: 0, max: 7 },
|
||||
sleevecapQ4Offset: { val: 2, min: 0, max: 7 },
|
||||
sleevecapQ1Spread1: { val: 6, min: 4, max: 20 },
|
||||
sleevecapQ1Spread2: { val: 15, min: 4, max: 20 },
|
||||
sleevecapQ2Spread1: { val: 15, min: 4, max: 20 },
|
||||
sleevecapQ2Spread2: { val: 10, min: 4, max: 20 },
|
||||
sleevecapQ3Spread1: { val: 10, min: 4, max: 20 },
|
||||
sleevecapQ3Spread2: { val: 8, min: 4, max: 20 },
|
||||
sleevecapQ4Spread1: { val: 7, min: 4, max: 20 },
|
||||
sleevecapQ4Spread2: { val: 7, min: 4, max: 20 },
|
||||
sleeveWidthGuarantee: { val: 90, min: 25, max: 100 },
|
||||
}
|
||||
};
|
||||
|
|
|
@ -26,15 +26,73 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
console.log('models', freesewing.models);
|
||||
var pattern = freesewing.patterns.brian
|
||||
.with(debug)
|
||||
.with(freesewing.plugins.theme)
|
||||
// .with(freesewing.plugins.designer)
|
||||
/*
|
||||
pattern.on('preSample', function(next) {
|
||||
console.log('preSample hook');
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postSample', function(next) {
|
||||
console.log('postSample hook');
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('preDraft', function(next) {
|
||||
console.log('preDraft hook', JSON.parse(JSON.stringify(this)));
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postDraft', function(next) {
|
||||
console.log('postDraft hook', JSON.parse(JSON.stringify(this)));
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('preRender', function(next) {
|
||||
console.log('preRender hook', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postRender', function(next) {
|
||||
console.log('postRender hook', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('preDraft', function(next) {
|
||||
console.log('%cpreDraft hook', 'color: red', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postDraft', function(next) {
|
||||
console.log('%cpostDraft hook', 'color: red', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('insertText', function(next) {
|
||||
console.log('%cinsertText hook', 'color: red', this.text);
|
||||
this.text = this.text.toUpperCase();
|
||||
next();
|
||||
});
|
||||
*/
|
||||
pattern.on('preDraft', function(next) {
|
||||
console.log('%cpreDraft hook', 'color: red', this);
|
||||
for(let m in this.config.measurements) {
|
||||
let measurement = this.config.measurements[m];
|
||||
if(!this.context.settings.measurements[measurement]) {
|
||||
this.debug('Missing measurement:', measurement);
|
||||
this.debug('All measurements:', this.settings.measurements);
|
||||
throw `Missing measurement: ${measurement}`;
|
||||
}
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.settings.paperless = true;
|
||||
|
||||
pattern.settings.measurements = freesewing.models.manSize36;
|
||||
pattern.settings.measurements = freesewing.models.men.manSize36;
|
||||
|
||||
pattern.settings.sa = 10;
|
||||
pattern.settings.units = 'metric';
|
||||
|
@ -42,9 +100,10 @@ pattern.settings.sample = {
|
|||
type: 'measurement',
|
||||
measurement: 'shoulderToShoulder'
|
||||
}
|
||||
//pattern.sampleOption('chestEase');
|
||||
pattern.debug('debug test from index', 'foo');
|
||||
pattern.sampleOption('shoulderSlopeReduction');
|
||||
//pattern.sampleMeasurement('bicepsCircumference');
|
||||
pattern.sampleModels(freesewing.antmantest);
|
||||
//pattern.sampleModels(freesewing.antmantest);
|
||||
//pattern.draft();
|
||||
document.getElementById("svg").innerHTML = pattern.render();
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@ var base = {
|
|||
);
|
||||
points.cbShoulder = new Point(
|
||||
0,
|
||||
(measurements.shoulderSlope - options.shoulderSlopeReduction) / 2
|
||||
(measurements.shoulderSlope -
|
||||
measurements.shoulderToShoulder * options.shoulderSlopeReduction) /
|
||||
2
|
||||
);
|
||||
points.cbArmhole = new Point(
|
||||
0,
|
||||
|
|
|
@ -23,6 +23,7 @@ pattern.draft = function() {
|
|||
pattern.parts.back = back.draft(pattern);
|
||||
pattern.parts.front = front.draft(pattern);
|
||||
pattern.parts.sleeve = sleeve.draft(pattern);
|
||||
|
||||
return pattern;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue