sparkles: Finalized pocket
This commit is contained in:
parent
1e9c7b36c0
commit
2efe9ee89c
2 changed files with 63 additions and 9 deletions
|
@ -127,6 +127,7 @@ export default {
|
||||||
frontPocketPlacement: { pct: 75, min: 65, max: 85 },
|
frontPocketPlacement: { pct: 75, min: 65, max: 85 },
|
||||||
frontPocketWidth: { pct: 68, min: 55, max: 75 },
|
frontPocketWidth: { pct: 68, min: 55, max: 75 },
|
||||||
frontPocketDepth: { pct: 110, min: 80, max: 130 },
|
frontPocketDepth: { pct: 110, min: 80, max: 130 },
|
||||||
|
frontPocketRadius: { pct: 10, min: 0, max: 50 },
|
||||||
|
|
||||||
lapelStart: { pct: 10, min: 0, max: 35 },
|
lapelStart: { pct: 10, min: 0, max: 35 },
|
||||||
lapelReduction: { pct: 5, min: 0, max: 10 },
|
lapelReduction: { pct: 5, min: 0, max: 10 },
|
||||||
|
|
|
@ -18,7 +18,37 @@ export default function(part) {
|
||||||
points.edgeLeft.y
|
points.edgeLeft.y
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Round the pocket
|
||||||
|
if (options.frontPocketRadius > 0) {
|
||||||
|
macro("round", {
|
||||||
|
from: points.topLeft,
|
||||||
|
to: points.bottomRight,
|
||||||
|
via: points.bottomLeft,
|
||||||
|
radius: width * options.frontPocketRadius,
|
||||||
|
prefix: "left"
|
||||||
|
});
|
||||||
|
macro("round", {
|
||||||
|
from: points.bottomLeft,
|
||||||
|
to: points.topRight,
|
||||||
|
via: points.bottomRight,
|
||||||
|
radius: width * options.frontPocketRadius,
|
||||||
|
prefix: "right"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Paths
|
// Paths
|
||||||
|
if (options.frontPocketRadius > 0) {
|
||||||
|
paths.seam = new Path()
|
||||||
|
.move(points.edgeLeft)
|
||||||
|
.line(points.leftStart)
|
||||||
|
.curve(points.leftCp1, points.leftCp2, points.leftEnd)
|
||||||
|
.line(points.rightStart)
|
||||||
|
.curve(points.rightCp1, points.rightCp2, points.rightEnd)
|
||||||
|
.line(points.edgeRight)
|
||||||
|
.line(points.edgeLeft)
|
||||||
|
.close()
|
||||||
|
.attr("class", "fabric");
|
||||||
|
} else {
|
||||||
paths.seam = new Path()
|
paths.seam = new Path()
|
||||||
.move(points.edgeLeft)
|
.move(points.edgeLeft)
|
||||||
.line(points.bottomLeft)
|
.line(points.bottomLeft)
|
||||||
|
@ -27,11 +57,34 @@ export default function(part) {
|
||||||
.line(points.edgeLeft)
|
.line(points.edgeLeft)
|
||||||
.close()
|
.close()
|
||||||
.attr("class", "fabric");
|
.attr("class", "fabric");
|
||||||
|
}
|
||||||
paths.fold = new Path()
|
paths.fold = new Path()
|
||||||
.move(points.topLeft)
|
.move(points.topLeft)
|
||||||
.line(points.topRight)
|
.line(points.topRight)
|
||||||
.attr("class", "fabric dashed");
|
.attr("class", "fabric dashed");
|
||||||
|
|
||||||
|
if (complete) {
|
||||||
|
// Title
|
||||||
|
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5);
|
||||||
|
macro("title", {
|
||||||
|
at: points.title,
|
||||||
|
nr: 9,
|
||||||
|
title: "pocket"
|
||||||
|
});
|
||||||
|
|
||||||
|
// Instructions
|
||||||
|
paths.fold
|
||||||
|
.attr("data-text", "foldOverAlongThisLine")
|
||||||
|
.attr("data-text-class", "center");
|
||||||
|
|
||||||
|
// Grainline
|
||||||
|
macro("grainline", {
|
||||||
|
from: points.bottomLeft.shift(0 ,10),
|
||||||
|
to: points.edgeLeft.shift(0 ,10)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
||||||
|
}
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue