sparkles: Added sleevecapTopFactor options
This commit is contained in:
parent
5196e4ef20
commit
e0775b5dd4
5 changed files with 86 additions and 79 deletions
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue