1
0
Fork 0
freesewing/packages/simon/src/frontright-seamless.js

68 lines
1.8 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { addButtons } from './shared'
2018-12-22 17:30:12 +01:00
export default part => {
2019-08-03 15:03:33 +02:00
let { sa, Point, points, Path, paths, complete, paperless, macro, options } = part.shorthand()
2018-12-22 17:30:12 +01:00
2019-08-03 15:03:33 +02:00
let width = options.buttonPlacketWidth
points.placketTopFold1 = points.cfNeck.shift(0, width / 2)
points.placketTopFold2 = points.cfNeck.shift(0, width * 1.5)
points.placketTopEdge = points.cfNeck.shift(0, width * 2.5)
points.placketBottomFold1 = points.cfHem.shift(0, width / 2)
points.placketBottomFold2 = points.cfHem.shift(0, width * 1.5)
points.placketBottomEdge = points.cfHem.shift(0, width * 2.5)
2018-12-22 17:30:12 +01:00
paths.seam
.line(points.placketTopEdge)
.line(points.placketBottomEdge)
.line(points.cfHem)
2019-08-03 15:03:33 +02:00
.close()
2018-12-22 17:30:12 +01:00
// Complete pattern?
if (complete) {
// Placket help lines
paths.frontCenter = new Path()
.move(points.cfNeck)
.line(points.cfHem)
2019-08-03 15:03:33 +02:00
.attr('class', 'help')
2018-12-22 17:30:12 +01:00
paths.placketFold1 = new Path()
.move(points.placketTopFold1)
.line(points.placketBottomFold1)
2019-08-03 15:03:33 +02:00
.attr('class', 'dotted')
2018-12-22 17:30:12 +01:00
paths.placketFold2 = new Path()
.move(points.placketTopFold2)
.line(points.placketBottomFold2)
2019-08-03 15:03:33 +02:00
.attr('class', 'dotted')
macro('sprinkle', {
snippet: 'notch',
2018-12-22 17:30:12 +01:00
on: [
2019-08-03 15:03:33 +02:00
'placketTopFold1',
'placketTopFold2',
'placketBottomFold1',
'placketBottomFold2',
'cfNeck',
'cfHem'
2018-12-22 17:30:12 +01:00
]
2019-08-03 15:03:33 +02:00
})
2018-12-22 17:30:12 +01:00
// Buttons
2019-08-03 15:03:33 +02:00
addButtons(part)
2018-12-22 17:30:12 +01:00
// Title
2019-08-03 15:03:33 +02:00
macro('title', { at: points.title, nr: 1, title: 'frontRight' })
2018-12-22 17:30:12 +01:00
if (sa) {
paths.saFromArmhole
.line(new Point(points.placketTopEdge.x, points.placketTopEdge.y - sa))
.line(points.placketTopEdge)
.move(points.placketBottomEdge)
.line(points.placketBottomEdge.shift(-90, sa * 3))
2019-08-03 15:03:33 +02:00
.line(paths.hemSa.start())
2018-12-22 17:30:12 +01:00
}
}
// Paperless?
if (paperless) {
}
2019-08-03 15:03:33 +02:00
return part
}