1
0
Fork 0
freesewing/designs/yuri/src/sleeve.mjs

76 lines
1.8 KiB
JavaScript
Raw Normal View History

import { sleeve as brianSleeve } from '@freesewing/brian'
import { hidePresets } from '@freesewing/core'
2022-09-15 13:49:55 +02:00
function yuriSleeve({ Point, Path, points, paths, complete, sa, paperless, macro, part }) {
2021-07-25 19:56:42 +02:00
// Clear paths from Brian, but keep sleevecap
for (let p of Object.keys(paths)) {
if (p !== 'sleevecap') delete paths[p]
}
// Paths
paths.saBase = new Path()
.move(points.wristRight)
.line(points.bicepsRight)
.join(paths.sleevecap)
.line(points.wristLeft)
2022-09-18 17:01:19 +02:00
.setClass('various stroke-xxl')
.hide()
2021-07-25 19:56:42 +02:00
paths.hemBase = new Path()
.move(points.wristLeft)
.line(points.wristRight)
2022-09-18 17:01:19 +02:00
.setClass('various stroke-xxl')
.hide()
2021-07-25 19:56:42 +02:00
2022-09-18 17:01:19 +02:00
paths.seam = paths.saBase.join(paths.hemBase).close().setClass('fabric')
2021-07-25 19:56:42 +02:00
// Complete?
if (complete) {
macro('grainline', {
from: new Point(0, points.wristLeft.y),
to: new Point(0, points.backPitch.y),
})
if (sa) {
paths.sa = paths.saBase
.clone()
.offset(sa)
.join(paths.hemBase.offset(3 * sa))
.close()
2021-07-25 19:56:42 +02:00
paths.sa.attr('class', 'fabric sa')
}
}
// Paperless?
if (paperless) {
const hemSa = 3 * sa
2021-07-25 19:56:42 +02:00
macro('hd', {
from: points.wristLeft,
to: points.wristRight,
y: points.wristLeft.y + hemSa + 15,
})
macro('hd', {
from: points.bicepsLeft,
to: points.bicepsRight,
y: points.sleeveTip.y - sa - 15,
})
macro('vd', {
from: points.wristLeft,
to: points.bicepsLeft,
x: points.bicepsLeft.x - sa - 15,
})
macro('vd', {
from: points.wristLeft,
to: points.sleeveTip,
x: points.bicepsLeft.x - sa - 30,
})
}
return part
}
export const sleeve = {
name: 'yuri.sleeve',
from: brianSleeve,
hide: hidePresets.HIDE_TREE,
draft: yuriSleeve,
}