🚧 Benjamin WIP
This commit is contained in:
parent
7542e2f6b9
commit
f96ccc95e7
3 changed files with 328 additions and 311 deletions
|
@ -17,27 +17,38 @@ export default {
|
||||||
dependencies: {},
|
dependencies: {},
|
||||||
inject: {},
|
inject: {},
|
||||||
hide: [],
|
hide: [],
|
||||||
parts: ["front"],
|
parts: ["base"],
|
||||||
options: {
|
options: {
|
||||||
|
transitionLength: 0.7, // 70% of bandLength
|
||||||
|
bandLength: {
|
||||||
|
pct: 17,
|
||||||
|
min: 15,
|
||||||
|
max: 20
|
||||||
|
},
|
||||||
|
ribbonWidth: {
|
||||||
|
pct: 6,
|
||||||
|
min: 4,
|
||||||
|
max: 8
|
||||||
|
},
|
||||||
tipWidth: {
|
tipWidth: {
|
||||||
mm: 65,
|
pct: 15,
|
||||||
min: 24,
|
min: 5,
|
||||||
max: 80
|
max: 20
|
||||||
},
|
},
|
||||||
knotWidth: {
|
knotWidth: {
|
||||||
mm: 30,
|
pct: 7,
|
||||||
min: 24,
|
min: 6,
|
||||||
max: 40
|
max: 9
|
||||||
},
|
},
|
||||||
bowLength: {
|
bowLength: {
|
||||||
mm: 120,
|
pct: 28,
|
||||||
min: 100,
|
min: 23,
|
||||||
max: 140
|
max: 33
|
||||||
},
|
},
|
||||||
collarEase: {
|
collarEase: {
|
||||||
mm: 15,
|
pct: 3,
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 15
|
max: 6
|
||||||
},
|
},
|
||||||
bowStyle: {
|
bowStyle: {
|
||||||
dflt: "butterfly",
|
dflt: "butterfly",
|
||||||
|
@ -47,9 +58,6 @@ export default {
|
||||||
dflt: "straight",
|
dflt: "straight",
|
||||||
list: ["straight", "pointed", "rounded"]
|
list: ["straight", "pointed", "rounded"]
|
||||||
},
|
},
|
||||||
adjustmentRibbon: {
|
adjustmentRibbon: { bool: false }
|
||||||
dflt: "0",
|
|
||||||
list: ["0", "1"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,75 +24,84 @@ export default function(part) {
|
||||||
macro
|
macro
|
||||||
} = part.shorthand();
|
} = part.shorthand();
|
||||||
|
|
||||||
// Remove from here
|
if (options.bowStyle === "square") options.tipWidth = options.knotWidth;
|
||||||
//options.bowStyle = 'butterfly';
|
|
||||||
//options.bowStyle = 'square';
|
|
||||||
//options.bowStyle = 'widesquare';
|
|
||||||
//options.bowStyle = 'diamond';
|
|
||||||
//options.endStyle = 'straight' ;
|
|
||||||
//options.endStyle = 'rounded' ;
|
|
||||||
//options.endStyle = 'pointed' ;
|
|
||||||
|
|
||||||
//final = true;
|
for (let option of [
|
||||||
//paperless = true;
|
"ribbonWidth",
|
||||||
//sa = 10;
|
"bandLength",
|
||||||
// Remove to here
|
"tipWidth",
|
||||||
|
"knotWidth",
|
||||||
|
"bowLength",
|
||||||
|
"collarEase"
|
||||||
|
])
|
||||||
|
store.set(option, measurements.neckCircumference * options[option]);
|
||||||
|
|
||||||
if (options.bowStyle == "square") options.tipWidth = options.knotWidth;
|
// For easy access
|
||||||
|
const knot = store.get("knotWidth");
|
||||||
|
const ribbon = store.get("ribbonWidth");
|
||||||
|
const tip = store.get("tipWidth");
|
||||||
|
const band = store.get("bandLength");
|
||||||
|
const transition = band * options.transitionLength;
|
||||||
|
const bow = store.get("bowLength");
|
||||||
|
|
||||||
let backWidth = 24;
|
// Points
|
||||||
let bandLength = 70;
|
points.bandTopLeft = new Point(0, ribbon / -2);
|
||||||
let transitionLength = 50;
|
points.bandBottomLeft = points.bandTopLeft.flipY();
|
||||||
let halfBackWidth = backWidth / 2;
|
points.bandTopRight = points.bandTopLeft.shift(0, band);
|
||||||
let halfTipWidth = options.tipWidth / 2;
|
points.bandBottomRight = points.bandTopRight.flipY();
|
||||||
let halfBowLength = options.bowLength / 2;
|
|
||||||
let halfKnotWidth = options.knotWidth / 2;
|
|
||||||
|
|
||||||
console.log(options.bowStyle);
|
points.transitionTopRight = new Point(band + transition, knot / -2);
|
||||||
console.log(options.knotWidth);
|
points.transitionBottomRight = points.transitionTopRight.flipY();
|
||||||
|
|
||||||
|
points.tip1Top = new Point(band + transition + 0.5 * bow, tip / -2);
|
||||||
|
points.tip1Bottom = points.tip1Top.flipY();
|
||||||
|
points.tip2Top = new Point(band + transition + 1.5 * bow, tip / -2);
|
||||||
|
points.tip2Bottom = points.tip2Top.flipY();
|
||||||
|
points.knotTop = new Point(band + transition + bow, knot / -2);
|
||||||
|
points.knotBottom = points.knotTop.flipY();
|
||||||
|
|
||||||
|
if (options.endStyle === "pointed" || options.endStyle === "rounded") {
|
||||||
|
points.tip = new Point(points.tip2Bottom.x + points.tip2Bottom.y, 0);
|
||||||
|
} else points.tip = new Point(points.tip2Bottom.x, 0);
|
||||||
|
|
||||||
|
if (options.bowStyle === "diamond" || options.bowStyle === "butterfly") {
|
||||||
|
const cpl = options.bowStyle === "diamond" ? bow / 10 : bow / 4;
|
||||||
|
|
||||||
|
points.transitionBottomRightCp1 = points.bandBottomRight.shiftOutwards(
|
||||||
|
points.transitionBottomRight,
|
||||||
|
cpl
|
||||||
|
);
|
||||||
|
points.transitionTopRightCp2 = points.transitionBottomRightCp1.flipY();
|
||||||
|
points.tip1TopCp2 = points.tip1Top.shift(180, cpl);
|
||||||
|
points.tip1TopCp1 = points.tip1Top.shift(0, cpl);
|
||||||
|
points.tip1BottomCp1 = points.tip1Bottom.shift(180, cpl);
|
||||||
|
points.tip1BottomCp2 = points.tip1Bottom.shift(0, cpl);
|
||||||
|
points.knotTopCp2 = points.knotTop.shift(180, cpl);
|
||||||
|
points.knotTopCp1 = points.knotTop.shift(0, cpl);
|
||||||
|
points.knotBottomCp2 = points.knotBottom.shift(0, cpl);
|
||||||
|
points.knotBottomCp1 = points.knotBottom.shift(180, cpl);
|
||||||
|
points.tip2TopCp2 = points.tip2Top.shift(180, cpl);
|
||||||
|
points.tip2BottomCp1 = points.tip2Bottom.shift(180, cpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
paths.test = new Path()
|
||||||
|
.move(points.bandTopLeft)
|
||||||
|
.line(points.bandTopRight)
|
||||||
|
.line(points.transitionTopRight)
|
||||||
|
.line(points.tip2Top)
|
||||||
|
.line(points.tip)
|
||||||
|
.line(points.tip2Bottom)
|
||||||
|
.line(points.transitionBottomRight)
|
||||||
|
.line(points.bandBottomRight)
|
||||||
|
.line(points.bandBottomLeft)
|
||||||
|
.line(points.bandTopLeft)
|
||||||
|
.close();
|
||||||
|
|
||||||
|
return part;
|
||||||
|
|
||||||
let butterfly =
|
let butterfly =
|
||||||
options.bowStyle == "butterfly" || options.bowStyle == "diamond";
|
options.bowStyle == "butterfly" || options.bowStyle == "diamond";
|
||||||
|
//const bcAdjust = options.bowStyle == "diamond" ? 10 : hhbl - 5;
|
||||||
let tipAdjustment = 0;
|
|
||||||
switch (options.endStyle) {
|
|
||||||
case "pointed":
|
|
||||||
tipAdjustment = halfTipWidth / 1.3;
|
|
||||||
break;
|
|
||||||
case "rounded":
|
|
||||||
tipAdjustment = halfTipWidth;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let hhbl /*halfHalfBowLength */ = halfBowLength / 2;
|
|
||||||
let bcAdjust = options.bowStyle == "diamond" ? 10 : hhbl - 5;
|
|
||||||
|
|
||||||
let tieStart = new Path();
|
|
||||||
let tieLowKnot = new Path();
|
|
||||||
let tieTip = new Path();
|
|
||||||
let tieTopKnot = new Path();
|
|
||||||
let tieEnd = new Path();
|
|
||||||
|
|
||||||
points.Origin = new Point(0, 0);
|
|
||||||
|
|
||||||
points.LowBandEdge = points.Origin.shift(-90, halfBackWidth);
|
|
||||||
points.LowKnotEdge = points.Origin.shift(-90, halfKnotWidth);
|
|
||||||
points.LowTipEdge = points.Origin.shift(-90, halfTipWidth);
|
|
||||||
|
|
||||||
points.LowBandStart = points.LowBandEdge.clone();
|
|
||||||
points.LowBandEnd = points.LowBandEdge.shift(0, bandLength);
|
|
||||||
points.LowTransitionEnd = points.LowKnotEdge.shift(
|
|
||||||
0,
|
|
||||||
bandLength + transitionLength
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(points["LowBandEdge"].x);
|
|
||||||
|
|
||||||
tieStart
|
|
||||||
.move(points.Origin)
|
|
||||||
.line(points.LowBandStart)
|
|
||||||
.line(points.LowBandEnd)
|
|
||||||
.line(points.LowTransitionEnd);
|
|
||||||
|
|
||||||
points.LowTip = points.LowTipEdge.shift(
|
points.LowTip = points.LowTipEdge.shift(
|
||||||
0,
|
0,
|
|
@ -2,12 +2,12 @@ import freesewing from "@freesewing/core";
|
||||||
import plugins from "@freesewing/plugin-bundle";
|
import plugins from "@freesewing/plugin-bundle";
|
||||||
import config from "../config";
|
import config from "../config";
|
||||||
// Parts
|
// Parts
|
||||||
import draftFront from "./front";
|
import draftBase from "./base";
|
||||||
|
|
||||||
// Create new design
|
// Create new design
|
||||||
const benjamin = new freesewing.Design(config, plugins);
|
const benjamin = new freesewing.Design(config, plugins);
|
||||||
|
|
||||||
// Attach draft methods to prototype
|
// Attach draft methods to prototype
|
||||||
benjamin.prototype.draftFront = draftFront;
|
benjamin.prototype.draftBase = draftBase;
|
||||||
|
|
||||||
export default benjamin;
|
export default benjamin;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue