1
0
Fork 0

sparkles: Added sleevecapTopFactor options

This commit is contained in:
Joost De Cock 2019-02-24 08:49:30 +01:00
parent 5196e4ef20
commit e0775b5dd4
5 changed files with 86 additions and 79 deletions

View file

@ -1,70 +0,0 @@
import { version } from "../package.json";
export default {
name: "brian",
version: version,
measurements: [
"bicepsCircumference",
"centerBackNeckToWaist",
"chestCircumference",
"naturalWaistToHip",
"neckCircumference",
"shoulderSlope",
"shoulderToShoulder",
"shoulderToWrist",
"wristCircumference"
],
dependencies: {
back: "base",
front: "back",
sleevecap: "front",
sleeve: "sleevecap"
},
inject: {
back: "base",
front: "back",
sleeve: "sleevecap"
},
hide: [
"base",
"sleevecap"
],
options: {
// Constants
brianFitSleeve: true,
brianFitCollar: true,
collarFactor: 4.8,
// Percentages
acrossBackFactor: { pct: 97, min: 93, max: 100 },
armholeDepthFactor: { pct: 60, min: 50, max: 70 },
backNeckCutout: { pct: 5, min: 2, max: 8 },
bicepsEase: { pct: 15, min: 0, max: 50 },
chestEase: { pct: 8, min: -4, max: 20 },
collarEase: { pct: 3.5, min: 0, max: 10 },
cuffEase: { pct: 20, min: 0, max: 200 },
frontArmholeDeeper: { pct: 0.5, min: 0, max: 1.5 },
lengthBonus: { pct: 0, min: -4, max: 60 },
shoulderEase: { pct: 0, min: -2, max: 6 },
shoulderSlopeReduction: { pct: 0, min: 0, max: 8 },
sleevecapEase: { pct: 1, min: 0, max: 10 },
sleevecapBackFactorX: { pct: 60, min: 35, max: 65 },
sleevecapBackFactorY: { pct: 33, min: 35, max: 65 },
sleevecapFrontFactorX: { pct: 55, min: 35, max: 65 },
sleevecapFrontFactorY: { pct: 33, min: 35, max: 65 },
sleevecapQ1Offset: { pct: 3, min: 0, max: 7 },
sleevecapQ2Offset: { pct: 5.5, min: 0, max: 7 },
sleevecapQ3Offset: { pct: 4.5, min: 0, max: 7 },
sleevecapQ4Offset: { pct: 1, min: 0, max: 7 },
sleevecapQ1Spread1: { pct: 6, min: 4, max: 20 },
sleevecapQ1Spread2: { pct: 15, min: 4, max: 20 },
sleevecapQ2Spread1: { pct: 15, min: 4, max: 20 },
sleevecapQ2Spread2: { pct: 10, min: 4, max: 20 },
sleevecapQ3Spread1: { pct: 10, min: 4, max: 20 },
sleevecapQ3Spread2: { pct: 8, min: 4, max: 20 },
sleevecapQ4Spread1: { pct: 7, min: 4, max: 20 },
sleevecapQ4Spread2: { pct: 7, min: 4, max: 20 },
sleeveWidthGuarantee: { pct: 90, min: 25, max: 100 },
sleeveLengthBonus: { pct: 0, min:-40, max: 10 },
}
};

View file

@ -0,0 +1,69 @@
import { version } from "../package.json";
export default {
name: "brian",
version: version,
measurements: [
"bicepsCircumference",
"centerBackNeckToWaist",
"chestCircumference",
"naturalWaistToHip",
"neckCircumference",
"shoulderSlope",
"shoulderToShoulder",
"shoulderToWrist",
"wristCircumference"
],
dependencies: {
back: "base",
front: "back",
sleevecap: "front",
sleeve: "sleevecap"
},
inject: {
back: "base",
front: "back",
sleeve: "sleevecap"
},
hide: ["base", "sleevecap"],
options: {
// Constants
brianFitSleeve: true,
brianFitCollar: true,
collarFactor: 4.8,
// Percentages
acrossBackFactor: { pct: 97, min: 93, max: 100 },
armholeDepthFactor: { pct: 60, min: 50, max: 70 },
backNeckCutout: { pct: 5, min: 2, max: 8 },
bicepsEase: { pct: 15, min: 0, max: 50 },
chestEase: { pct: 8, min: -4, max: 20 },
collarEase: { pct: 3.5, min: 0, max: 10 },
cuffEase: { pct: 20, min: 0, max: 200 },
frontArmholeDeeper: { pct: 0.5, min: 0, max: 1.5 },
lengthBonus: { pct: 0, min: -4, max: 60 },
shoulderEase: { pct: 0, min: -2, max: 6 },
shoulderSlopeReduction: { pct: 0, min: 0, max: 8 },
sleevecapEase: { pct: 1, min: 0, max: 10 },
sleevecapTopFactorX: { pct: 50, min: 25, max: 75 },
sleevecapTopFactorY: { pct: 100, min: 35, max: 165 },
sleevecapBackFactorX: { pct: 60, min: 35, max: 65 },
sleevecapBackFactorY: { pct: 33, min: 35, max: 65 },
sleevecapFrontFactorX: { pct: 55, min: 35, max: 65 },
sleevecapFrontFactorY: { pct: 33, min: 35, max: 65 },
sleevecapQ1Offset: { pct: 3, min: 0, max: 7 },
sleevecapQ2Offset: { pct: 5.5, min: 0, max: 7 },
sleevecapQ3Offset: { pct: 4.5, min: 0, max: 7 },
sleevecapQ4Offset: { pct: 1, min: 0, max: 7 },
sleevecapQ1Spread1: { pct: 6, min: 4, max: 20 },
sleevecapQ1Spread2: { pct: 15, min: 4, max: 20 },
sleevecapQ2Spread1: { pct: 15, min: 4, max: 20 },
sleevecapQ2Spread2: { pct: 10, min: 4, max: 20 },
sleevecapQ3Spread1: { pct: 10, min: 4, max: 20 },
sleevecapQ3Spread2: { pct: 8, min: 4, max: 20 },
sleevecapQ4Spread1: { pct: 7, min: 4, max: 20 },
sleevecapQ4Spread2: { pct: 7, min: 4, max: 20 },
sleeveWidthGuarantee: { pct: 90, min: 25, max: 100 },
sleeveLengthBonus: { pct: 0, min: -40, max: 10 }
}
};

View file

@ -148,11 +148,12 @@ let settings1 = { ...settings};
}
var pattern1 = new freesewing.patterns.brian(settings1);
pattern1.use(freesewing.plugins.theme);
//pattern1.use(freesewing.plugins.designer);
pattern1.use(freesewing.plugins.designer);
pattern1.settings.options.lengthBonus =0.1;
//pattern1.settings.only="base";
//pattern1.settings.layout=false;
pattern1.sampleOption("chestEase");
pattern1.sampleOption("sleevecapTopFactorX");
//pattern1.draft();
console.log(pattern1);
document.getElementById("svg1").innerHTML = pattern1.render();

View file

@ -1,6 +1,6 @@
import freesewing from "freesewing";
import plugins from "@freesewing/plugin-bundle";
import config from "../config/config";
import config from "../config";
// Parts
import draftBase from "./base";
import draftBack from "./back";

View file

@ -1,5 +1,3 @@
import freesewing from "freesewing";
/** Calculates the differece between actual and optimal sleevecap length
* Positive values mean sleevecap is longer than armhole
*/
@ -22,10 +20,11 @@ function draftSleevecap(part, run) {
points.centerBiceps = new Point(0, 0);
points.centerCap = points.centerBiceps.shift(
90,
measurements.bicepsCircumference *
(1 + options.bicepsEase) *
options.armholeDepthFactor *
store.get("sleeveFactor")
options.sleevecapTopFactorY *
(measurements.bicepsCircumference *
(1 + options.bicepsEase) *
options.armholeDepthFactor *
store.get("sleeveFactor"))
);
// Left and right biceps points, limit impact of sleeveFactor to 25%
@ -38,6 +37,14 @@ function draftSleevecap(part, run) {
);
points.bicepsRight = points.bicepsLeft.flipX(points.centerBiceps);
// Adapt sleeve center axis
points.capLeft = new Point(points.bicepsLeft.x, points.centerCap.y);
points.capRight = points.capLeft.flipX();
points.centerCap = points.capLeft.shiftFractionTowards(
points.capRight,
options.sleevecapTopFactorX
);
// Pitch points
let width = points.bicepsRight.x;
let height = points.centerCap.y;