2019-03-25 18:20:15 +01:00
|
|
|
export default function(part) {
|
2019-08-03 15:03:33 +02:00
|
|
|
let {
|
|
|
|
units,
|
|
|
|
paperless,
|
|
|
|
sa,
|
|
|
|
store,
|
|
|
|
complete,
|
|
|
|
points,
|
|
|
|
macro,
|
|
|
|
Point,
|
|
|
|
paths,
|
|
|
|
Path
|
|
|
|
} = part.shorthand()
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
let length = store.get('waistToHem') - store.get('beltWidth') / 2
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
points.cbTop = new Point(0, 0)
|
|
|
|
points.fold1Top = points.cbTop.shift(0, store.get('cbToDart') / 2)
|
|
|
|
points.fold2Top = points.cbTop.shift(0, store.get('cbToDart'))
|
|
|
|
points.fold3Top = points.cbTop.shift(0, store.get('cbToDart') * 2)
|
|
|
|
points.fold4Top = points.fold3Top.shift(0, store.get('cbToDart') / 2)
|
2019-09-17 07:59:24 +02:00
|
|
|
points.fold5Top = points.fold4Top.shift(0, store.get('cbToDart') / 2)
|
|
|
|
points.waistTop = points.fold5Top.shift(0, store.get('dartToSide'))
|
2019-03-25 18:20:15 +01:00
|
|
|
|
|
|
|
// 12cm will do as we're just drawing a rectangle.
|
|
|
|
// But check that lenght > 12cm because doll clothes.
|
2019-08-03 15:03:33 +02:00
|
|
|
let drawnLength = length < 120 ? length : 120
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2019-09-17 07:59:24 +02:00
|
|
|
for (let i of ['cb', 'fold1', 'fold2', 'fold3', 'fold4', 'fold5', 'waist']) {
|
2019-08-03 15:03:33 +02:00
|
|
|
points[i + 'Bottom'] = points[i + 'Top'].shift(-90, drawnLength)
|
|
|
|
if (i === 'cb' || i === 'waist') {
|
|
|
|
points[i + 'MidTop'] = points[i + 'Top'].shift(-90, drawnLength * 0.4)
|
|
|
|
points[i + 'MidBottom'] = points[i + 'Top'].shift(-90, drawnLength * 0.6)
|
2019-03-25 18:20:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.cbTop)
|
|
|
|
.line(points.cbMidTop)
|
|
|
|
.move(points.cbMidBottom)
|
|
|
|
.line(points.cbBottom)
|
|
|
|
.line(points.waistBottom)
|
|
|
|
.line(points.waistMidBottom)
|
|
|
|
.move(points.waistMidTop)
|
|
|
|
.line(points.waistTop)
|
|
|
|
.line(points.cbTop)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2019-03-25 18:20:15 +01:00
|
|
|
|
|
|
|
paths.folds = new Path()
|
|
|
|
.move(points.fold1Top)
|
|
|
|
.line(points.fold1Bottom)
|
|
|
|
.move(points.fold2Top)
|
|
|
|
.line(points.fold2Bottom)
|
|
|
|
.move(points.fold3Top)
|
|
|
|
.line(points.fold3Bottom)
|
|
|
|
.move(points.fold4Top)
|
|
|
|
.line(points.fold4Bottom)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'lashed')
|
2019-03-25 18:20:15 +01:00
|
|
|
|
|
|
|
paths.hint = new Path()
|
|
|
|
.move(points.cbMidTop)
|
|
|
|
.line(points.cbMidBottom)
|
|
|
|
.move(points.waistMidBottom)
|
|
|
|
.line(points.waistMidTop)
|
2019-09-17 07:59:24 +02:00
|
|
|
.move(points.fold5Top)
|
|
|
|
.line(points.fold5Bottom)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric dashed')
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2019-03-30 13:51:23 +01:00
|
|
|
if (complete) {
|
2019-08-03 15:03:33 +02:00
|
|
|
points.title = points.fold4Top.shiftFractionTowards(points.waistBottom, 0.5)
|
|
|
|
macro('title', {
|
2019-03-30 13:51:23 +01:00
|
|
|
at: points.title,
|
|
|
|
nr: 3,
|
2019-08-03 15:03:33 +02:00
|
|
|
title: 'tail'
|
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('grainline', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.fold2Bottom.shift(0, 10),
|
|
|
|
to: points.fold2Top.shift(0, 10)
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
if (sa)
|
|
|
|
paths.sa = paths.seam
|
|
|
|
.offset(sa)
|
|
|
|
.close()
|
|
|
|
.attr('class', 'fabric sa')
|
|
|
|
macro('vd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.fold4Bottom.shift(0, 15),
|
|
|
|
to: points.fold4Top.shift(0, 15),
|
|
|
|
text: units(length)
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.cbBottom,
|
|
|
|
to: points.fold1Bottom,
|
|
|
|
y: points.cbBottom.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.fold1Bottom,
|
|
|
|
to: points.fold2Bottom,
|
|
|
|
y: points.cbBottom.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.fold2Bottom,
|
|
|
|
to: points.fold3Bottom,
|
|
|
|
y: points.cbBottom.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.fold3Bottom,
|
|
|
|
to: points.fold4Bottom,
|
|
|
|
y: points.cbBottom.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.fold4Bottom,
|
2019-09-17 07:59:24 +02:00
|
|
|
to: points.fold5Bottom,
|
|
|
|
y: points.cbBottom.y + sa + 15
|
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: points.fold5Bottom,
|
2019-03-30 13:51:23 +01:00
|
|
|
to: points.waistBottom,
|
|
|
|
y: points.cbBottom.y + sa + 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-03-30 13:51:23 +01:00
|
|
|
from: points.cbBottom,
|
|
|
|
to: points.waistBottom,
|
|
|
|
y: points.cbBottom.y + sa + 30
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
2019-03-25 18:20:15 +01:00
|
|
|
}
|