1
0
Fork 0
freesewing/packages/simon/src/cuff-barrel-angled.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { draftBarrelCuff, decorateBarrelCuff, paperlessBarrelCuff } from './shared'
2018-12-27 13:08:30 +01:00
export default part => {
2019-08-03 15:03:33 +02:00
let { store, sa, points, Path, paths, complete, paperless, macro } = part.shorthand()
2018-12-27 13:08:30 +01:00
2019-08-03 15:03:33 +02:00
draftBarrelCuff(part)
let height = store.get('cuffHeight')
2018-12-27 13:08:30 +01:00
2019-08-03 15:03:33 +02:00
points.leftAngleTop = points.topLeft.shift(0, height / 3)
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.leftAngleBottom)
.line(points.bottomLeft)
.line(points.bottomRight)
.line(points.rightAngleBottom)
.line(points.rightAngleTop)
.line(points.leftAngleTop)
.line(points.leftAngleBottom)
.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)
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.rightAngleBottom,
to: points.rightAngleTop,
x: points.rightAngleBottom.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
}