2023-11-17 07:28:12 +00:00
|
|
|
import { pctBasedOn } from '@freesewing/core'
|
2023-11-20 05:46:10 +00:00
|
|
|
import { shape } from './shape.mjs'
|
2023-11-17 07:28:12 +00:00
|
|
|
|
2023-11-11 00:59:09 +00:00
|
|
|
export const leg = {
|
|
|
|
name: 'lumira.leg',
|
2023-11-20 05:46:10 +00:00
|
|
|
from: shape,
|
2023-11-11 00:59:09 +00:00
|
|
|
draft: ({
|
|
|
|
measurements,
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
complete,
|
|
|
|
options,
|
|
|
|
macro,
|
|
|
|
utils,
|
|
|
|
part,
|
|
|
|
}) => {
|
2023-11-26 02:54:19 +00:00
|
|
|
// paths.center = new Path().move(points.centerWaist).line(points.centerAnkle)
|
|
|
|
|
|
|
|
if (options.frontBulge || options.cyclingChamois) {
|
|
|
|
snippets.front = new Snippet('notch', paths.front.shiftFractionAlong(0.5))
|
|
|
|
}
|
2023-11-15 07:13:05 +00:00
|
|
|
|
|
|
|
paths.front = new Path()
|
2023-11-24 18:57:55 +00:00
|
|
|
.move(points.frontWaistband)
|
2023-11-20 05:46:10 +00:00
|
|
|
.join(paths.front)
|
2023-11-26 02:54:19 +00:00
|
|
|
._curve(points.frontKneeCp2, points.frontKnee)
|
|
|
|
.curve_(points.frontKneeCp1, points.frontAnkle)
|
2023-11-20 05:46:10 +00:00
|
|
|
.hide()
|
2023-11-17 07:28:12 +00:00
|
|
|
paths.back = new Path()
|
2023-11-24 18:57:55 +00:00
|
|
|
.move(points.backWaistband)
|
|
|
|
.join(paths.back)
|
2023-11-20 05:46:10 +00:00
|
|
|
.join(paths.backCircle)
|
|
|
|
.join(paths.backGusset)
|
2023-11-26 02:54:19 +00:00
|
|
|
._curve(points.backKneeCp2, points.backKnee)
|
|
|
|
.curve_(points.backKneeCp1, points.backAnkle)
|
2023-11-17 07:28:12 +00:00
|
|
|
.hide()
|
2023-11-11 00:59:09 +00:00
|
|
|
|
2023-11-20 05:46:10 +00:00
|
|
|
paths.seam = new Path()
|
2023-11-24 18:57:55 +00:00
|
|
|
.move(points.backWaistband)
|
2023-11-20 05:46:10 +00:00
|
|
|
.join(paths.back)
|
|
|
|
.join(paths.ankle)
|
|
|
|
.join(paths.front.reverse())
|
|
|
|
.join(paths.waist)
|
|
|
|
.close()
|
|
|
|
|
|
|
|
if (sa) {
|
|
|
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
|
|
|
}
|
2023-11-17 07:28:12 +00:00
|
|
|
|
2023-11-26 02:54:19 +00:00
|
|
|
snippets.circle1 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.25))
|
|
|
|
snippets.circle2 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.5))
|
|
|
|
snippets.circle3 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.75))
|
|
|
|
snippets.circle4 = new Snippet('notch', points.backCircleGusset)
|
|
|
|
snippets.circle5 = new Snippet('notch', points.frontGusset)
|
|
|
|
|
2023-11-20 05:46:10 +00:00
|
|
|
console.log({ w: measurements.waist / 2, len: points.backWaist.dist(points.frontWaist) })
|
2023-11-17 07:28:12 +00:00
|
|
|
|
2023-11-11 00:59:09 +00:00
|
|
|
return part
|
|
|
|
},
|
|
|
|
}
|