1
0
Fork 0
freesewing/packages/benjamin/src/bow3.js

61 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-01-31 09:22:15 +01:00
export default function (part) {
2019-10-01 12:43:10 -07:00
let {
options,
Point,
points,
Path,
paths,
complete,
macro,
sa,
store,
2021-04-24 10:16:31 +02:00
paperless,
2019-10-01 12:43:10 -07:00
} = part.shorthand()
2019-07-08 15:54:19 +02:00
2019-10-01 12:43:10 -07:00
if (!options.adjustmentRibbon) {
2019-08-03 15:03:33 +02:00
part.render = false
return part
2019-07-08 15:54:19 +02:00
}
2019-10-01 12:43:10 -07:00
points.bandBottomLeft = points.bandBottomLeft.shift(180, 290)
points.bandTopLeft = points.bandBottomLeft.flipY()
points.grainlineStart = new Point(-290, 0)
macro('grainline', {
from: points.grainlineStart,
2021-04-24 10:16:31 +02:00
to: points.tip.shift(180, 20),
2019-10-01 12:43:10 -07:00
})
paths.seam = new Path()
.move(points.bandTopLeft)
.line(points.bandBottomLeft)
.join(paths.bow)
.line(points.bandTopLeft)
.close()
.attr('class', 'fabric')
.setRender(true)
2019-07-08 15:54:19 +02:00
if (complete) {
2019-10-01 12:43:10 -07:00
// Paperless?
if (paperless) {
macro('hd', {
from: points.bandBottomLeft,
to: points.tip2Bottom,
2021-04-24 10:16:31 +02:00
y: store.get('baseY'),
2019-10-01 12:43:10 -07:00
})
}
if (sa) {
2021-01-31 09:22:15 +01:00
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa').setRender(true)
2019-10-01 12:43:10 -07:00
}
2019-08-03 15:03:33 +02:00
macro('title', {
2019-07-08 15:54:19 +02:00
at: points.titleAnchor,
nr: 3,
2019-08-03 15:03:33 +02:00
title: 'bowTie',
2021-04-24 10:16:31 +02:00
scale: store.get('tipWidth') / 75,
2019-08-03 15:03:33 +02:00
})
2019-07-08 15:54:19 +02:00
}
2019-08-03 15:03:33 +02:00
return part
2019-07-08 15:54:19 +02:00
}