2019-08-03 15:03:33 +02:00
|
|
|
import { dimensions } from './shared'
|
2018-08-11 16:42:35 +02:00
|
|
|
|
2020-05-24 15:52:58 +02:00
|
|
|
export default function (part) {
|
2019-05-10 13:14:31 +02:00
|
|
|
let {
|
|
|
|
store,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
options,
|
|
|
|
complete,
|
|
|
|
paperless,
|
|
|
|
macro,
|
|
|
|
utils,
|
|
|
|
units
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2018-08-11 16:42:35 +02:00
|
|
|
|
2018-12-19 09:17:42 +01:00
|
|
|
points.strapLeftCp2 = utils.beamsIntersect(
|
|
|
|
points.strapLeft,
|
|
|
|
points.strapCenter.rotate(90, points.strapLeft),
|
|
|
|
points.cbNeck,
|
2019-05-10 13:14:31 +02:00
|
|
|
points.cbNeck.shift(0, 10)
|
2019-08-03 15:03:33 +02:00
|
|
|
)
|
2018-08-27 14:12:14 +02:00
|
|
|
|
2020-05-24 15:52:58 +02:00
|
|
|
points.armholeCp2 = points.armhole.shiftFractionTowards(
|
2019-05-10 13:14:31 +02:00
|
|
|
points.armholeCorner,
|
|
|
|
options.backlineBend
|
2019-08-03 15:03:33 +02:00
|
|
|
)
|
2019-05-10 13:14:31 +02:00
|
|
|
points.strapRightCp1 = points.strapRight.shiftFractionTowards(
|
|
|
|
points.armholeCorner,
|
|
|
|
options.backlineBend
|
2019-08-03 15:03:33 +02:00
|
|
|
)
|
2018-08-27 14:12:14 +02:00
|
|
|
|
2018-12-19 09:17:42 +01:00
|
|
|
// Seamline
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.cbNeck)
|
2018-12-21 13:10:15 +01:00
|
|
|
.line(points.cbHem)
|
|
|
|
.line(points.hem)
|
2020-05-24 15:52:58 +02:00
|
|
|
.curve_(points.waist, points.armhole)
|
2018-12-19 09:17:42 +01:00
|
|
|
.curve(points.armholeCp2, points.strapRightCp1, points.strapRight)
|
|
|
|
.line(points.strapLeft)
|
2020-05-24 15:52:58 +02:00
|
|
|
.line(points.strapLeft)
|
2018-12-19 09:17:42 +01:00
|
|
|
.curve(points.strapLeftCp2, points.cbNeck, points.cbNeck)
|
|
|
|
.close()
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2018-08-27 14:12:14 +02:00
|
|
|
|
2018-12-19 09:17:42 +01:00
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
2019-05-10 13:14:31 +02:00
|
|
|
let neckOpeningLength =
|
|
|
|
new Path()
|
|
|
|
.move(points.strapLeft)
|
|
|
|
.curve(points.strapLeftCp2, points.cbNeck, points.cbNeck)
|
2019-08-03 15:03:33 +02:00
|
|
|
.length() + store.get('frontNeckOpeningLength')
|
2019-05-10 13:14:31 +02:00
|
|
|
let armholeLength =
|
|
|
|
new Path()
|
2020-05-24 15:52:58 +02:00
|
|
|
.move(points.armhole)
|
2019-05-10 13:14:31 +02:00
|
|
|
.curve(points.armholeCp2, points.strapRightCp1, points.strapRight)
|
2019-08-03 15:03:33 +02:00
|
|
|
.length() + store.get('frontArmholeLength')
|
2020-05-24 15:52:58 +02:00
|
|
|
points.bindinAnchor = new Point(points.armhole.x / 4, points.armhole.y)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('data-text', 'cutTwoStripsToFinishTheArmholes')
|
|
|
|
.attr('data-text', ':\n')
|
|
|
|
.attr('data-text', 'width')
|
|
|
|
.attr('data-text', ':')
|
|
|
|
.attr('data-text', units(sa * 6))
|
|
|
|
.attr('data-text', '\n')
|
|
|
|
.attr('data-text', 'length')
|
|
|
|
.attr('data-text', ':')
|
|
|
|
.attr('data-text', units(armholeLength * 0.95 + 2 * sa))
|
|
|
|
.attr('data-text', '\n \n')
|
|
|
|
.attr('data-text', 'cutOneStripToFinishTheNeckOpening')
|
|
|
|
.attr('data-text', ':\n')
|
|
|
|
.attr('data-text', 'width')
|
|
|
|
.attr('data-text', ':')
|
|
|
|
.attr('data-text', units(sa * 6))
|
|
|
|
.attr('data-text', '\n')
|
|
|
|
.attr('data-text', 'length')
|
|
|
|
.attr('data-text', ':')
|
|
|
|
.attr('data-text', units(neckOpeningLength * 0.95 + 2 * sa))
|
|
|
|
.attr('data-text-lineheight', 6)
|
2018-08-11 16:42:35 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('cutonfold', {
|
2018-12-19 09:17:42 +01:00
|
|
|
from: points.cfNeck,
|
2018-12-21 13:10:15 +01:00
|
|
|
to: points.cfHem,
|
2018-12-19 09:17:42 +01:00
|
|
|
grainline: true
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-08-11 16:42:35 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('title', { at: points.title, nr: 2, title: 'back' })
|
|
|
|
points.scaleboxAnchor = points.scalebox = points.title.shift(90, 100)
|
|
|
|
macro('scalebox', { at: points.scalebox })
|
2018-12-19 09:17:42 +01:00
|
|
|
}
|
2018-08-11 16:42:35 +02:00
|
|
|
|
2018-12-19 09:17:42 +01:00
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
dimensions(macro, points, sa)
|
|
|
|
macro('vd', {
|
2018-12-21 13:10:15 +01:00
|
|
|
from: points.cbHem,
|
2018-12-19 09:17:42 +01:00
|
|
|
to: points.cbNeck,
|
2018-12-21 13:10:15 +01:00
|
|
|
x: points.cbHem.x - sa - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-08-11 16:42:35 +02:00
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
2019-05-10 13:14:31 +02:00
|
|
|
}
|