1
0
Fork 0

construction: Changed point names according to best practices

This commit is contained in:
Joost De Cock 2018-08-10 17:44:29 +02:00
parent 5b9600b6fc
commit adab3bce3d
3 changed files with 22 additions and 30 deletions

View file

@ -77,27 +77,27 @@ var base = {
points.armholePitch points.armholePitch
); );
points.armholeHollow = points._tmp1.shiftFractionTowards(points._tmp3, 0.5); points.armholeHollow = points._tmp1.shiftFractionTowards(points._tmp3, 0.5);
points.armholeCp1 = points.armhole.shift( points.armholeCp2 = points.armhole.shift(
180, 180,
points._tmp1.dx(points.armhole) / 4 points._tmp1.dx(points.armhole) / 4
); );
points.armholeCp2 = points.armholeHollow.shift( points.armholeHollowCp1 = points.armholeHollow.shift(
-45, -45,
points.armholeHollow.dy(points.armhole) / 2 points.armholeHollow.dy(points.armhole) / 2
); );
points.armholeHollowCp1 = points.armholeHollow.shift( points.armholeHollowCp2 = points.armholeHollow.shift(
135, 135,
points.armholePitch.dx(points.armholeHollow) points.armholePitch.dx(points.armholeHollow)
); );
points.armholeHollowCp2 = points.armholePitch.shift( points.armholePitchCp1 = points.armholePitch.shift(
-90, -90,
points.armholePitch.dy(points.armholeHollow) / 2 points.armholePitch.dy(points.armholeHollow) / 2
); );
points.armholePitchCp1 = points.armholePitch.shift( points.armholePitchCp2 = points.armholePitch.shift(
90, 90,
points.shoulder.dy(points.armholePitch) / 2 points.shoulder.dy(points.armholePitch) / 2
); );
points.armholePitchCp2 = points.shoulder points.shoulderCp1 = points.shoulder
.shiftTowards(points.neck, points.shoulder.dy(points.armholePitch) / 5) .shiftTowards(points.neck, points.shoulder.dy(points.armholePitch) / 5)
.rotate(90, points.shoulder); .rotate(90, points.shoulder);
@ -105,7 +105,7 @@ var base = {
points._tmp4 = points.neck points._tmp4 = points.neck
.shiftTowards(points.shoulder, 10) .shiftTowards(points.shoulder, 10)
.rotate(-90, points.neck); .rotate(-90, points.neck);
points.neckCp1 = freesewing.utils.beamCrossesY( points.neckCp2 = freesewing.utils.beamCrossesY(
points.neck, points.neck,
points._tmp4, points._tmp4,
points.cbNeck.y points.cbNeck.y

View file

@ -11,9 +11,9 @@ var front = {
// Cut arm a bit deeper at the front // Cut arm a bit deeper at the front
let deeper = measurements.chestCircumference * options.frontArmholeDeeper; let deeper = measurements.chestCircumference * options.frontArmholeDeeper;
points.armholeHollowCp2.x -= deeper;
points.armholePitch.x -= deeper;
points.armholePitchCp1.x -= deeper; points.armholePitchCp1.x -= deeper;
points.armholePitch.x -= deeper;
points.armholePitchCp2.x -= deeper;
// Rename cb (center back) to cf (center front) // Rename cb (center back) to cf (center front)
for (let key of ["Neck", "Shoulder", "Armhole", "Waist", "Hips"]) { for (let key of ["Neck", "Shoulder", "Armhole", "Waist", "Hips"]) {

View file

@ -10,18 +10,14 @@ export function seamLine(side, points, Path) {
path path
.line(points.hips) .line(points.hips)
.line(points.armhole) .line(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow) .curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve( .curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
points.armholeHollowCp1, .curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
points.armholeHollowCp2,
points.armholePitch
)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder)
.line(points.neck); .line(points.neck);
if (side === "back") { if (side === "back") {
path.curve(points.neckCp1, points.cbNeck, points.cbNeck); path.curve(points.neckCp2, points.cbNeck, points.cbNeck);
} else { } else {
path.curve(points.neckCp1, points.neckCp2, points.cfNeck); path.curve(points.neckCp2, points.cfNeck, points.cfNeck);
} }
path.close().attr("class", "fabric"); path.close().attr("class", "fabric");
@ -31,20 +27,16 @@ export function seamLine(side, points, Path) {
export function armholeLength(points, Path) { export function armholeLength(points, Path) {
return new Path() return new Path()
.move(points.armhole) .move(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow) .curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve( .curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
points.armholeHollowCp1, .curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
points.armholeHollowCp2,
points.armholePitch
)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder)
.length(); .length();
} }
export function shoulderToArmholePitch(points, Path) { export function shoulderToArmholePitch(points, Path) {
return new Path() return new Path()
.move(points.armholePitch) .move(points.armholePitch)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder) .curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
.length(); .length();
} }
@ -52,19 +44,19 @@ export function dimensions(macro, points, Path, sa) {
macro("pd", { macro("pd", {
path: new Path() path: new Path()
.move(points.armhole) .move(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow) .curve(points.armholeCp1, points.armholeCp1, points.armholeHollow)
.curve( .curve(
points.armholeHollowCp1, points.armholeHollowCp1,
points.armholeHollowCp2, points.armholeHollowCp1,
points.armholePitch points.armholePitch
) )
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder), .curve(points.shoulderCp1, points.shoulderCp1, points.shoulder),
d: sa + 15 d: sa + 15
}); });
macro("pd", { macro("pd", {
path: new Path() path: new Path()
.move(points.armholePitch) .move(points.armholePitch)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder), .curve(points.shoulderCp1, points.shoulderCp1, points.shoulder),
d: -15 d: -15
}); });
macro("vd", { macro("vd", {