2019-08-03 15:03:33 +02:00
|
|
|
import * as shared from './shared'
|
2018-08-03 17:44:55 +02:00
|
|
|
|
2020-04-18 16:09:04 +02:00
|
|
|
export default (part) => {
|
2019-05-10 13:14:31 +02:00
|
|
|
let {
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
options,
|
|
|
|
measurements,
|
|
|
|
complete,
|
|
|
|
paperless,
|
2021-04-24 10:16:31 +02:00
|
|
|
macro,
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Cut arm a bit deeper at the front
|
2020-06-30 15:13:28 +02:00
|
|
|
let deeper = measurements.chest * options.frontArmholeDeeper
|
2019-08-03 15:03:33 +02:00
|
|
|
points.armholePitchCp1.x -= deeper
|
|
|
|
points.armholePitch.x -= deeper
|
|
|
|
points.armholePitchCp2.x -= deeper
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Rename cb (center back) to cf (center front)
|
2019-08-03 15:03:33 +02:00
|
|
|
for (let key of ['Shoulder', 'Armhole', 'Waist', 'Hips', 'Hem']) {
|
|
|
|
points[`cf${key}`] = new Point(points[`cb${key}`].x, points[`cb${key}`].y)
|
|
|
|
delete points[`cb${key}`]
|
2018-12-17 14:42:28 +01:00
|
|
|
}
|
|
|
|
// Front neckline points
|
2019-08-03 15:03:33 +02:00
|
|
|
points.neckCp2 = new Point(points.neckCp2Front.x, points.neckCp2Front.y)
|
2018-08-06 16:19:12 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Seamline
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.saBase = shared.saBase('front', points, Path)
|
2020-04-18 16:09:04 +02:00
|
|
|
paths.saBase.render = false
|
2018-12-17 14:42:28 +01:00
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.cfNeck)
|
2018-12-21 12:55:50 +01:00
|
|
|
.line(points.cfHem)
|
2018-12-17 14:42:28 +01:00
|
|
|
.join(paths.saBase)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Store lengths to fit sleeve
|
2019-08-03 15:03:33 +02:00
|
|
|
store.set('frontArmholeLength', shared.armholeLength(points, Path))
|
|
|
|
store.set('frontShoulderToArmholePitch', shared.shoulderToArmholePitch(points, Path))
|
2018-08-05 15:53:09 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('cutonfold', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.cfHips,
|
2021-04-24 10:16:31 +02:00
|
|
|
grainline: true,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('title', { at: points.title, nr: 1, title: 'front' })
|
|
|
|
snippets.armholePitchNotch = new Snippet('notch', points.armholePitch)
|
2021-01-31 09:22:15 +01:00
|
|
|
paths.waist = new Path().move(points.cfWaist).line(points.waist).attr('class', 'help')
|
2018-12-17 14:42:28 +01:00
|
|
|
if (sa) {
|
|
|
|
paths.sa = paths.saBase
|
|
|
|
.offset(sa)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric sa')
|
2018-12-17 14:42:28 +01:00
|
|
|
.line(points.cfNeck)
|
2019-08-03 15:03:33 +02:00
|
|
|
.move(points.cfHips)
|
|
|
|
paths.sa.line(paths.sa.start())
|
2018-08-05 15:53:09 +02:00
|
|
|
}
|
2018-12-17 14:42:28 +01:00
|
|
|
}
|
2018-08-03 17:44:55 +02:00
|
|
|
|
2018-12-17 14:42:28 +01:00
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
shared.dimensions(macro, points, Path, sa)
|
|
|
|
macro('hd', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cfHips,
|
|
|
|
to: points.hips,
|
2021-05-24 10:28:25 +02:00
|
|
|
y: points.hem.y + sa + 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2021-05-24 10:28:25 +02:00
|
|
|
from: points.cfHem,
|
2021-01-11 19:50:25 +01:00
|
|
|
to: points.cfWaist,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.cfHips.x - sa - 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2021-01-11 19:50:25 +01:00
|
|
|
macro('vd', {
|
2021-05-24 10:28:25 +02:00
|
|
|
from: points.cfHem,
|
2021-01-11 19:50:25 +01:00
|
|
|
to: points.cfNeck,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.cfHips.x - sa - 30,
|
2021-01-11 19:50:25 +01:00
|
|
|
})
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.neck,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.neck.y - sa - 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-17 14:42:28 +01:00
|
|
|
from: points.cfNeck,
|
|
|
|
to: points.shoulder,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.neck.y - sa - 30,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-08-03 17:44:55 +02:00
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
|
|
|
}
|