1
0
Fork 0

sparkles: Button placket

This commit is contained in:
Joost De Cock 2018-12-22 17:30:12 +01:00
parent 275a1611f9
commit 467e88f45a
13 changed files with 254 additions and 173 deletions

View file

@ -1,10 +1,10 @@
export const calculateReduction = function(part) {
let { store, measurements, options } = part.shorthand();
if(store.get('reduction') === true) return;
if (store.get("reduction") === true) return;
let chest = measurements.chestCircumference * (1+ options.chestEase);
let waist = measurements.naturalWaist * (1+ options.waistEase);
let hips = measurements.hipsCircumference * (1+ options.hipsEase);
let chest = measurements.chestCircumference * (1 + options.chestEase);
let waist = measurements.naturalWaist * (1 + options.waistEase);
let hips = measurements.hipsCircumference * (1 + options.hipsEase);
let waistReduction = chest - waist;
let hipsReduction = chest - hips;
@ -14,5 +14,21 @@ export const calculateReduction = function(part) {
store.set("waistReduction", waistReduction);
store.set("hipsReduction", hipsReduction);
store.set("reduction", true);
}
};
export const addButtons = function(part) {
let { points, options, snippets, Snippet } = part.shorthand();
let len = points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength);
for (let i = 1; i <= options.buttons; i++) {
points["button" + i] = points.cfNeck.shift(
-90,
(len / options.buttons) * i
);
snippets["button" + i] = new Snippet("button", points["button" + i]);
}
if (options.extraTopButton === "yes")
snippets.topButton = new Snippet(
"button",
points.cfNeck.shift(-90, len / options.buttons / 2)
);
};