2018-12-23 17:25:53 +01:00
|
|
|
export default part => {
|
2019-08-03 15:03:33 +02:00
|
|
|
part.paths = {} // This removed paperless dimensions from brian block
|
2018-12-29 15:01:46 +01:00
|
|
|
for (let pid of [
|
2019-08-03 15:03:33 +02:00
|
|
|
'__scaleboxLead',
|
|
|
|
'__scaleboxMetric',
|
|
|
|
'__scaleboxImperial',
|
|
|
|
'__scaleboxText',
|
|
|
|
'__scaleboxTitle',
|
|
|
|
'__scaleboxLink'
|
2018-12-29 15:01:46 +01:00
|
|
|
])
|
2019-08-03 15:03:33 +02:00
|
|
|
delete part.points[pid]
|
2018-12-27 15:04:32 +01:00
|
|
|
let {
|
|
|
|
measurements,
|
|
|
|
sa,
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
complete,
|
|
|
|
paperless,
|
|
|
|
macro,
|
|
|
|
options
|
2019-08-03 15:03:33 +02:00
|
|
|
} = part.shorthand()
|
2018-12-23 17:25:53 +01:00
|
|
|
|
|
|
|
// Sleeve width depends on cuff style
|
2019-08-03 15:03:33 +02:00
|
|
|
let width = measurements.wristCircumference * (1 + options.cuffEase + options.cuffOverlap)
|
2018-12-23 17:25:53 +01:00
|
|
|
if (
|
2020-01-07 14:57:41 +01:00
|
|
|
options.cuffStyle === 'straightFrenchCuff' ||
|
|
|
|
options.cuffStyle === 'roundedFrenchCuff' ||
|
2019-08-03 15:03:33 +02:00
|
|
|
options.cuffStyle === 'angledFrenchCuff'
|
2018-12-23 17:25:53 +01:00
|
|
|
)
|
2019-08-03 15:03:33 +02:00
|
|
|
width = measurements.wristCircumference * (1 + options.cuffEase + options.cuffOverlap * 1.5)
|
|
|
|
points.wristRight.x = width / 2
|
|
|
|
points.wristLeft.x = width / -2
|
|
|
|
let cuffLength = measurements.shoulderToWrist * options.cuffLength
|
|
|
|
points.wristRight = points.wristRight.shift(90, cuffLength)
|
|
|
|
points.wristLeft = points.wristLeft.shift(90, cuffLength)
|
2018-12-23 17:25:53 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
points.cuffMid = new Point(0, points.wristLeft.y)
|
|
|
|
points.cuffLeftMid = points.cuffMid.shiftFractionTowards(points.wristLeft, 0.5)
|
|
|
|
points.cuffRightMid = points.cuffMid.shiftFractionTowards(points.wristRight, 0.5)
|
|
|
|
points.cuffLeftCusp = points.cuffLeftMid.shift(90, width / 50)
|
|
|
|
points.cuffRightCusp = points.cuffRightMid.shift(-90, width / 50)
|
|
|
|
points.cuffLeftCuspCp1 = points.cuffLeftCusp.shift(180, width / 10)
|
|
|
|
points.cuffLeftCuspCp2 = points.cuffLeftCusp.shift(0, width / 10)
|
|
|
|
points.cuffRightCuspCp1 = points.cuffRightCusp.shift(180, width / 10)
|
|
|
|
points.cuffRightCuspCp2 = points.cuffRightCusp.shift(0, width / 10)
|
2018-12-23 17:25:53 +01:00
|
|
|
|
2018-12-27 16:42:27 +01:00
|
|
|
// Cuff pleats
|
2019-08-03 15:03:33 +02:00
|
|
|
let drape = options.cuffDrape * measurements.shoulderToWrist
|
|
|
|
let pleats = 0
|
|
|
|
let pleatLength = measurements.shoulderToWrist * 0.15
|
2018-12-27 16:42:27 +01:00
|
|
|
if (drape > 0) {
|
|
|
|
let shiftRight = [
|
2019-08-03 15:03:33 +02:00
|
|
|
'cuffRightCuspCp1',
|
|
|
|
'cuffRightCusp',
|
|
|
|
'cuffRightCuspCp2',
|
|
|
|
'wristRight',
|
|
|
|
'cuffRightMid'
|
|
|
|
]
|
|
|
|
let shiftLeft = ['cuffLeftCuspCp1', 'cuffLeftCusp', 'cuffLeftCuspCp2', 'wristLeft']
|
|
|
|
if (drape > 20) pleats = 2
|
|
|
|
else pleats = 1
|
|
|
|
for (let id of shiftRight) points[id] = points[id].shift(0, drape / (2 * pleats))
|
|
|
|
for (let id of shiftLeft) points[id] = points[id].shift(180, drape / (2 * pleats))
|
|
|
|
points.cuffPleat1Fold = points.cuffMid.shift(0, drape / (2 * pleats))
|
|
|
|
points.cuffPleat1Edge = points.cuffMid.shift(0, drape / pleats)
|
|
|
|
points.cuffMidTop = points.cuffMid.shift(90, pleatLength)
|
|
|
|
points.cuffPleat1FoldTop = points.cuffPleat1Fold.shift(90, pleatLength)
|
|
|
|
points.cuffPleat1EdgeTop = points.cuffPleat1Edge.shift(90, pleatLength)
|
2018-12-27 16:42:27 +01:00
|
|
|
if (pleats === 2) {
|
2019-08-03 15:03:33 +02:00
|
|
|
let moreRight = ['cuffRightCuspCp2', 'wristRight']
|
|
|
|
let shift = shiftRight.concat(shiftLeft)
|
2018-12-27 16:42:27 +01:00
|
|
|
for (let id of shift) {
|
2019-08-03 15:03:33 +02:00
|
|
|
if (moreRight.indexOf(id) === -1) points[id] = points[id].shift(180, drape / 4)
|
|
|
|
else points[id] = points[id].shift(0, drape / 4)
|
2018-12-27 16:42:27 +01:00
|
|
|
}
|
2019-08-03 15:03:33 +02:00
|
|
|
points.cuffPleat2Fold = points.cuffRightCusp.shift(0, drape / 4)
|
|
|
|
points.cuffPleat2Edge = points.cuffRightCusp.shift(0, drape / 2)
|
|
|
|
points.cuffPleat2FoldTop = points.cuffPleat2Fold.shift(90, pleatLength)
|
|
|
|
points.cuffPleat2EdgeTop = points.cuffPleat2Edge.shift(90, pleatLength)
|
|
|
|
points.cuffPleat2Top = points.cuffRightCusp.shift(90, pleatLength)
|
2018-12-27 16:42:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-23 17:25:53 +01:00
|
|
|
paths.frenchBase = new Path()
|
|
|
|
.move(points.wristRight)
|
|
|
|
.line(points.bicepsRight)
|
|
|
|
._curve(points.capQ1Cp1, points.capQ1)
|
|
|
|
.curve(points.capQ1Cp2, points.capQ2Cp1, points.capQ2)
|
|
|
|
.curve(points.capQ2Cp2, points.capQ3Cp1, points.capQ3)
|
|
|
|
.curve(points.capQ3Cp2, points.capQ4Cp1, points.capQ4)
|
2019-08-03 15:03:33 +02:00
|
|
|
.curve_(points.capQ4Cp2, points.bicepsLeft)
|
|
|
|
paths.frenchBase.render = false
|
2018-12-23 17:25:53 +01:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.saBase = new Path().move(points.bicepsLeft).line(points.wristLeft)
|
|
|
|
paths.saBase.render = false
|
2018-12-23 17:25:53 +01:00
|
|
|
|
|
|
|
paths.cuffBase = new Path()
|
|
|
|
.move(points.wristLeft)
|
2019-08-03 15:03:33 +02:00
|
|
|
._curve(points.cuffLeftCuspCp1, points.cuffLeftCusp)
|
2018-12-27 16:42:27 +01:00
|
|
|
if (pleats > 0) {
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.cuffBase.curve_(points.cuffLeftCuspCp2, points.cuffMid).line(points.cuffPleat1Edge)
|
2018-12-27 16:42:27 +01:00
|
|
|
}
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.cuffBase._curve(points.cuffRightCuspCp1, points.cuffRightCusp)
|
|
|
|
if (pleats === 2) paths.cuffBase.line(points.cuffPleat2Edge)
|
|
|
|
paths.cuffBase.curve_(points.cuffRightCuspCp2, points.wristRight)
|
|
|
|
paths.cuffBase.render = false
|
2018-12-23 17:25:53 +01:00
|
|
|
|
|
|
|
paths.seam = paths.frenchBase
|
|
|
|
.clone()
|
|
|
|
.line(points.wristLeft)
|
|
|
|
.join(paths.cuffBase)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2018-12-23 17:25:53 +01:00
|
|
|
|
|
|
|
// Complete pattern?
|
|
|
|
if (complete) {
|
2018-12-27 16:42:27 +01:00
|
|
|
points.placketEnd = points.cuffLeftCusp.shift(
|
|
|
|
90,
|
|
|
|
options.sleevePlacketLength * measurements.shoulderToWrist
|
2019-08-03 15:03:33 +02:00
|
|
|
)
|
2018-12-27 16:42:27 +01:00
|
|
|
paths.placketCut = new Path()
|
|
|
|
.move(points.cuffLeftCusp)
|
|
|
|
.line(points.placketEnd)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric')
|
2018-12-27 16:42:27 +01:00
|
|
|
if (pleats > 0) {
|
|
|
|
paths.pleats = new Path()
|
|
|
|
.move(points.cuffMid)
|
|
|
|
.line(points.cuffMidTop)
|
|
|
|
.move(points.cuffPleat1Fold)
|
|
|
|
.line(points.cuffPleat1FoldTop)
|
|
|
|
.move(points.cuffPleat1Edge)
|
2019-08-03 15:03:33 +02:00
|
|
|
.line(points.cuffPleat1EdgeTop)
|
2018-12-27 16:42:27 +01:00
|
|
|
if (pleats === 2) {
|
|
|
|
paths.pleats
|
|
|
|
.move(points.cuffRightCusp)
|
|
|
|
.line(points.cuffPleat2Top)
|
|
|
|
.move(points.cuffPleat2Fold)
|
|
|
|
.line(points.cuffPleat2FoldTop)
|
|
|
|
.move(points.cuffPleat2Edge)
|
2019-08-03 15:03:33 +02:00
|
|
|
.line(points.cuffPleat2EdgeTop)
|
2018-12-27 16:42:27 +01:00
|
|
|
}
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.pleats.attr('class', 'dotted')
|
2018-12-27 16:42:27 +01:00
|
|
|
}
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('title', { at: points.centerBiceps, nr: 5, title: 'sleeve' })
|
|
|
|
macro('grainline', { from: points.cuffMid, to: points.sleeveTip })
|
2018-12-23 17:25:53 +01:00
|
|
|
|
|
|
|
if (sa) {
|
2019-08-03 15:03:33 +02:00
|
|
|
paths.sa = paths.frenchBase.offset(sa * 2)
|
|
|
|
paths.frenchSa = paths.sa.clone()
|
2018-12-28 15:42:53 +01:00
|
|
|
paths.sa = paths.sa
|
2018-12-23 17:25:53 +01:00
|
|
|
.join(paths.saBase.offset(sa))
|
|
|
|
.join(paths.cuffBase.offset(sa))
|
|
|
|
.close()
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric sa')
|
|
|
|
macro('banner', {
|
|
|
|
path: 'frenchSa',
|
|
|
|
text: ['frenchSean', ': 2x', 'seamAllowance']
|
|
|
|
})
|
2018-12-23 17:25:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Paperless?
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.backNotch,
|
|
|
|
to: points.sleeveTip,
|
|
|
|
y: points.sleeveTip.y - 15 - sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.sleeveTip,
|
|
|
|
to: points.frontNotch,
|
|
|
|
y: points.sleeveTip.y - 15 - sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.bicepsLeft,
|
|
|
|
to: points.sleeveTip,
|
|
|
|
y: points.sleeveTip.y - 30 - sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.sleeveTip,
|
|
|
|
to: points.bicepsRight,
|
|
|
|
y: points.sleeveTip.y - 30 - sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.bicepsLeft,
|
|
|
|
to: points.bicepsRight,
|
|
|
|
y: points.sleeveTip.y - 45 - sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('pd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
path: new Path()
|
|
|
|
.move(points.bicepsRight)
|
|
|
|
._curve(points.capQ1Cp1, points.capQ1)
|
|
|
|
.curve(points.capQ1Cp2, points.capQ2Cp1, points.capQ2)
|
|
|
|
.curve(points.capQ2Cp2, points.capQ3Cp1, points.capQ3)
|
|
|
|
.curve(points.capQ3Cp2, points.capQ4Cp1, points.capQ4)
|
|
|
|
.curve_(points.capQ4Cp2, points.bicepsLeft)
|
|
|
|
.reverse(),
|
|
|
|
d: 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.wristRight,
|
|
|
|
to: points.bicepsRight,
|
|
|
|
x: points.bicepsRight.x + 15 + sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.bicepsRight,
|
|
|
|
to: points.frontNotch,
|
|
|
|
x: points.bicepsRight.x + 15 + sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.bicepsRight,
|
|
|
|
to: points.sleeveTip,
|
|
|
|
x: points.bicepsRight.x + 30 + sa * 2
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.bicepsLeft,
|
|
|
|
to: points.backNotch,
|
|
|
|
x: points.bicepsLeft.x - 15 - sa
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.cuffLeftCusp,
|
|
|
|
to: points.placketEnd,
|
|
|
|
x: points.placketEnd.x - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.wristLeft,
|
|
|
|
to: points.wristRight,
|
|
|
|
y: points.wristLeft.y + 15 + sa
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-12-27 16:42:27 +01:00
|
|
|
if (pleats > 0) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.cuffMidTop,
|
|
|
|
to: points.cuffPleat1EdgeTop,
|
|
|
|
y: points.cuffMidTop.y - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-12-27 16:42:27 +01:00
|
|
|
if (pleats === 2) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('hd', {
|
2018-12-27 16:42:27 +01:00
|
|
|
from: points.cuffPleat2Top,
|
|
|
|
to: points.cuffPleat2EdgeTop,
|
|
|
|
y: points.cuffPleat2Top.y - 15
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2018-12-27 16:42:27 +01:00
|
|
|
}
|
|
|
|
}
|
2018-12-23 17:25:53 +01:00
|
|
|
}
|
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
|
|
|
}
|