feat(theo): When when we are likely to run into crotch trouble
This commit is contained in:
parent
ee027a75ad
commit
f7659d7e59
1 changed files with 24 additions and 3 deletions
|
@ -12,9 +12,16 @@ export default function (part) {
|
||||||
macro,
|
macro,
|
||||||
utils,
|
utils,
|
||||||
measurements,
|
measurements,
|
||||||
snippets
|
snippets,
|
||||||
|
raise
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
||||||
|
// Let's warn about some common issues
|
||||||
|
if ((measurements.crotchDepth - measurements.waistToHips) / measurements.hips < 0.15)
|
||||||
|
raise.warning(
|
||||||
|
'There is little vertical space to draw the cross seam. Perhaps double-check the seath depth and waist to hips measurements'
|
||||||
|
)
|
||||||
|
|
||||||
// Clean up inheritedpaths & snippets
|
// Clean up inheritedpaths & snippets
|
||||||
for (let id in paths) delete paths[id]
|
for (let id in paths) delete paths[id]
|
||||||
for (let id in snippets) delete snippets[id]
|
for (let id in snippets) delete snippets[id]
|
||||||
|
@ -109,7 +116,7 @@ export default function (part) {
|
||||||
points['-6cp'] = points[-100101].shiftOutwards(points[-6], points[-6].dist(points[-502]) / 2)
|
points['-6cp'] = points[-100101].shiftOutwards(points[-6], points[-6].dist(points[-502]) / 2)
|
||||||
|
|
||||||
// Make sure fly ends on curve
|
// Make sure fly ends on curve
|
||||||
points.flyPretipX = utils.lineIntersectsCurve(
|
let pretipX = utils.lineIntersectsCurve(
|
||||||
points[42],
|
points[42],
|
||||||
points['43beam'],
|
points['43beam'],
|
||||||
points[-501],
|
points[-501],
|
||||||
|
@ -119,7 +126,21 @@ export default function (part) {
|
||||||
)
|
)
|
||||||
// If we found mulitple points, that's not a great sign.
|
// If we found mulitple points, that's not a great sign.
|
||||||
// But at least we need a point instead of an array things we break
|
// But at least we need a point instead of an array things we break
|
||||||
if (Array.isArray(points.flyPretipX)) points.flyPretipX = points.flyPretipX.pop()
|
if (Array.isArray(points.flyPretipX)) points.flyPretipX = pretipX.pop()
|
||||||
|
// If we found no points then we're screwed
|
||||||
|
if (points.flyPreTip) points.flyPretipX = pretipX
|
||||||
|
else {
|
||||||
|
raise.warning(`
|
||||||
|
Unable to determine fly end
|
||||||
|
|
||||||
|
We improvised to prevent the pattern from falling apart.
|
||||||
|
But this is almost certainly going to be a bad pattern since we're in uncharted territory.
|
||||||
|
`)
|
||||||
|
points.flyPretipX = new Path()
|
||||||
|
.move(points[-6])
|
||||||
|
.curve(points['-6cp'], points[-502], points[-501])
|
||||||
|
.shiftFractionAlong(0.75)
|
||||||
|
}
|
||||||
|
|
||||||
points[43] = points.flyPretipX.clone()
|
points[43] = points.flyPretipX.clone()
|
||||||
// Slant pocket
|
// Slant pocket
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue