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-20 05:46:10 +00:00
|
|
|
paths.center = new Path().move(points.centerWaist).line(points.centerAnkle)
|
2023-11-15 07:13:05 +00:00
|
|
|
|
|
|
|
paths.front = new Path()
|
|
|
|
.move(points.frontWaist)
|
2023-11-20 05:46:10 +00:00
|
|
|
.join(paths.front)
|
2023-11-17 07:28:12 +00:00
|
|
|
.line(points.frontKnee)
|
|
|
|
.line(points.frontAnkle)
|
2023-11-20 05:46:10 +00:00
|
|
|
.hide()
|
2023-11-17 07:28:12 +00:00
|
|
|
paths.back = new Path()
|
|
|
|
.move(points.backWaist)
|
2023-11-20 05:46:10 +00:00
|
|
|
.join(paths.backTop)
|
|
|
|
.join(paths.backCircle)
|
|
|
|
.join(paths.backGusset)
|
2023-11-17 07:28:12 +00:00
|
|
|
.line(points.backKnee)
|
|
|
|
.line(points.backAnkle)
|
|
|
|
.hide()
|
2023-11-11 00:59:09 +00:00
|
|
|
|
2023-11-21 05:58:27 +00:00
|
|
|
// if (options.frontBulge) {
|
|
|
|
// const gussetWidth = store.get('gussetWidth')
|
|
|
|
// paths.front = paths.front.offset(gussetWidth)
|
|
|
|
// points.
|
|
|
|
// }
|
|
|
|
|
2023-11-20 05:46:10 +00:00
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.backWaist)
|
|
|
|
.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-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
|
|
|
|
},
|
|
|
|
}
|