1
0
Fork 0
freesewing/designs/simon/src/cuff-barrel-rounded.mjs

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-09-04 15:55:34 +02:00
import { draftBarrelCuff, decorateBarrelCuff, paperlessBarrelCuff } from './shared.mjs'
2018-12-27 13:08:30 +01:00
2022-09-11 16:54:43 +02:00
export const draftRoundedBarrelCuff = ({
store,
sa,
points,
Path,
paths,
complete,
paperless,
macro,
part,
}) => {
2019-08-03 15:03:33 +02:00
draftBarrelCuff(part)
const height = store.get('cuffHeight')
2019-08-03 15:03:33 +02:00
macro('round', {
2018-12-27 13:08:30 +01:00
from: points.topRight,
to: points.bottomLeft,
via: points.topLeft,
radius: height / 3,
2021-04-24 10:16:31 +02:00
prefix: 'topLeftRound',
2019-08-03 15:03:33 +02:00
})
macro('round', {
2018-12-27 13:08:30 +01:00
from: points.bottomRight,
to: points.topLeft,
via: points.topRight,
radius: height / 3,
2021-04-24 10:16:31 +02:00
prefix: 'topRightRound',
2019-08-03 15:03:33 +02:00
})
points.leftAngleBottom = points.topLeft.shift(-90, height / 3)
points.rightAngleTop = points.topRight.shift(180, height / 3)
points.rightAngleBottom = points.topRight.shift(-90, height / 3)
2018-12-27 13:08:30 +01:00
paths.seam = new Path()
.move(points.topLeftRoundEnd)
.line(points.bottomLeft)
.line(points.bottomRight)
.line(points.topRightRoundStart)
2019-08-03 15:03:33 +02:00
.curve(points.topRightRoundCp1, points.topRightRoundCp2, points.topRightRoundEnd)
2018-12-27 13:08:30 +01:00
.line(points.topLeftRoundStart)
2019-08-03 15:03:33 +02:00
.curve(points.topLeftRoundCp1, points.topLeftRoundCp2, points.topLeftRoundEnd)
2018-12-27 13:08:30 +01:00
.close()
2019-08-03 15:03:33 +02:00
.attr('class', 'fabric')
2018-12-27 13:08:30 +01:00
// Complete pattern?
if (complete) {
2019-08-03 15:03:33 +02:00
decorateBarrelCuff(part)
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
2018-12-27 13:08:30 +01:00
}
// Paperless?
if (paperless) {
2019-08-03 15:03:33 +02:00
paperlessBarrelCuff(part)
macro('vd', {
2018-12-27 13:42:55 +01:00
from: points.topRightRoundStart,
to: points.topRightRoundEnd,
2021-04-24 10:16:31 +02:00
x: points.topRightRoundStart.x + 15 + sa,
2019-08-03 15:03:33 +02:00
})
2018-12-27 13:08:30 +01:00
}
2019-08-03 15:03:33 +02:00
return part
}