1
0
Fork 0
freesewing/packages/brian/src/back.js

76 lines
1.6 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import * as shared from './shared'
2018-07-24 10:16:31 +00:00
export default part => {
let {
store,
sa,
points,
Path,
paths,
Snippet,
snippets,
complete,
paperless,
macro
2019-08-03 15:03:33 +02:00
} = part.shorthand()
2018-08-03 17:44:55 +02:00
// Seamline
2019-08-03 15:03:33 +02:00
paths.saBase = shared.saBase('back', points, Path)
paths.seam = new Path()
.move(points.cbNeck)
.line(points.cbHips)
.join(paths.saBase)
2019-08-03 15:03:33 +02:00
.attr('class', 'fabric')
2018-08-06 16:19:12 +02:00
// Store lengths to fit sleeve
2019-08-03 15:03:33 +02:00
store.set('backArmholeLength', shared.armholeLength(points, Path))
store.set('backShoulderToArmholePitch', shared.shoulderToArmholePitch(points, Path))
2018-07-19 14:43:27 +00:00
// Complete pattern?
if (complete) {
2019-08-03 15:03:33 +02:00
macro('cutonfold', {
from: points.cbNeck,
to: points.cbHips,
grainline: true
2019-08-03 15:03:33 +02:00
})
2018-08-06 16:19:12 +02:00
2019-08-03 15:03:33 +02:00
macro('title', { at: points.title, nr: 2, title: 'back' })
snippets.armholePitchNotch = new Snippet('bnotch', points.armholePitch)
if (sa) {
paths.sa = paths.saBase
.offset(sa)
2019-08-03 15:03:33 +02:00
.attr('class', 'fabric sa')
.line(points.cbNeck)
2019-08-03 15:03:33 +02:00
.move(points.cbHips)
paths.sa.line(paths.sa.start())
2018-07-19 14:43:27 +00:00
}
}
2018-08-03 17:44:55 +02:00
// Paperless?
if (paperless) {
2019-08-03 15:03:33 +02:00
shared.dimensions(macro, points, Path, sa)
macro('hd', {
from: points.cbHips,
to: points.hips,
y: points.hips.y + sa + 15
2019-08-03 15:03:33 +02:00
})
macro('vd', {
from: points.cbHips,
to: points.cbNeck,
x: points.cbHips.x - sa - 15
2019-08-03 15:03:33 +02:00
})
macro('hd', {
from: points.cbNeck,
to: points.neck,
y: points.neck.y - sa - 15
2019-08-03 15:03:33 +02:00
})
macro('hd', {
from: points.cbNeck,
to: points.shoulder,
y: points.neck.y - sa - 30
2019-08-03 15:03:33 +02:00
})
}
2019-08-03 15:03:33 +02:00
return part
}