1
0
Fork 0
freesewing/packages/trayvon/src/fabrictail.js

45 lines
1 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { calculateHelpers, draftTieShape, seamAllowance, tieShapeDimensions } from './shared'
2019-02-15 09:44:09 +01:00
2021-01-31 09:22:15 +01:00
export default (part) => {
2019-08-03 15:03:33 +02:00
let { Path, complete, macro, options, paths, points, paperless, sa, store } = part.shorthand()
2019-02-15 09:44:09 +01:00
2019-08-03 15:03:33 +02:00
calculateHelpers(part)
draftTieShape(part, store.get('backTip') * 2.5, options.knotWidth * 2.5, true)
paths.seam.attributes.add('class', 'fabric')
2019-02-15 09:44:09 +01:00
// Complete pattern?
if (complete) {
2019-08-03 15:03:33 +02:00
macro('title', {
2019-02-15 09:44:09 +01:00
at: points.title,
nr: 4,
2019-08-03 15:03:33 +02:00
title: 'fabricTail',
2021-04-24 10:16:31 +02:00
rotation: -90,
2019-08-03 15:03:33 +02:00
})
2019-02-15 09:44:09 +01:00
2019-08-03 15:03:33 +02:00
if (sa) seamAllowance(part, 'fabric')
2019-02-15 09:44:09 +01:00
}
// Paperless?
if (paperless) {
2019-08-03 15:03:33 +02:00
tieShapeDimensions(part)
macro('ld', {
2019-02-15 09:44:09 +01:00
from: points.tip,
to: points.notch1,
2021-04-24 10:16:31 +02:00
d: options.tipWidth / -2.5,
2019-08-03 15:03:33 +02:00
})
macro('ld', {
2019-02-15 09:44:09 +01:00
from: points.notch2,
to: points.tip,
2021-04-24 10:16:31 +02:00
d: options.tipWidth / -2.5,
2019-08-03 15:03:33 +02:00
})
2019-02-15 09:44:09 +01:00
paths.n45 = new Path()
.move(points.midLeft)
.line(points.midRight)
2019-08-03 15:03:33 +02:00
.attr('class', 'hidden')
.attr('data-text', '45°')
.attr('data-text-class', 'center')
2019-02-15 09:44:09 +01:00
}
2019-08-03 15:03:33 +02:00
return part
}