2023-10-19 15:24:06 +00:00
|
|
|
import { backPoints } from './backpoints.mjs'
|
|
|
|
|
|
|
|
export const backInside = {
|
2023-10-22 18:58:54 +00:00
|
|
|
name: 'tristan.backInside',
|
2023-10-19 15:24:06 +00:00
|
|
|
from: backPoints,
|
2023-11-10 04:58:16 +00:00
|
|
|
draft: ({ sa, Point, points, Path, paths, Snippet, snippets, options, store, macro, part }) => {
|
2023-11-01 02:25:39 +00:00
|
|
|
const lacing = true == options.lacing && 'back' == options.lacingLocation
|
|
|
|
|
2023-11-11 22:00:08 +00:00
|
|
|
macro('rmtitle')
|
2023-11-10 04:58:16 +00:00
|
|
|
store.cutlist.removeCut()
|
|
|
|
|
2023-10-22 18:58:54 +00:00
|
|
|
paths.cut = new Path()
|
|
|
|
.move(points.strapInside)
|
2023-11-01 02:25:39 +00:00
|
|
|
.curve(points.strapInsideCp, points.cbCutCp, lacing ? points.lacingCut : points.cbCut)
|
|
|
|
|
|
|
|
if (lacing) {
|
|
|
|
paths.cut.line(points.lacingWaist)
|
|
|
|
paths.originalSide = new Path()
|
|
|
|
.move(points.lacingCut)
|
|
|
|
.line(points.cbCut)
|
|
|
|
.curve_(points.cbCutCp2, points.waistCenter)
|
|
|
|
.line(points.lacingWaist)
|
|
|
|
.setClass('note dashed')
|
2023-11-09 05:57:21 +00:00
|
|
|
|
|
|
|
const lacingDistance = points.lacingWaist.y - points.lacingCut.y
|
|
|
|
if (lacingDistance > 15 * 5) {
|
|
|
|
const numberOfEyelets = Math.floor(lacingDistance / 15)
|
|
|
|
const eyeletDistance = lacingDistance / (numberOfEyelets + 1)
|
|
|
|
const pEyelets = new Path().move(points.lacingCut).line(points.lacingWaist).offset(-10)
|
|
|
|
|
|
|
|
for (let i = 1; i <= numberOfEyelets; i++) {
|
|
|
|
points['eyelet' + i] = pEyelets.shiftAlong(i * eyeletDistance)
|
|
|
|
snippets['eyelet' + i] = new Snippet('eyelet', points['eyelet' + i])
|
|
|
|
}
|
|
|
|
}
|
2023-11-01 02:25:39 +00:00
|
|
|
} else {
|
|
|
|
paths.cut.curve_(points.cbCutCp2, points.waistCenter)
|
|
|
|
}
|
2023-10-22 18:58:54 +00:00
|
|
|
|
2023-11-11 22:00:08 +00:00
|
|
|
if (options.hem && !options.peplum) {
|
|
|
|
paths.hem = new Path()
|
|
|
|
.move(lacing ? points.lacingWaist : points.waistCenter)
|
|
|
|
.line(points.waistCenterHem)
|
|
|
|
.line(points.dartBottomLeftHem)
|
|
|
|
.line(points.dartBottomLeft)
|
|
|
|
.hide()
|
|
|
|
paths.hemFold = new Path()
|
|
|
|
.move(points.waistCenter)
|
|
|
|
.line(points.dartBottomLeft)
|
|
|
|
.addClass('note dashed')
|
|
|
|
.addText('hem', 'center note')
|
|
|
|
} else {
|
2024-01-24 02:17:41 +00:00
|
|
|
paths.hem = new Path()
|
|
|
|
.move(lacing ? points.lacingWaist : points.waistCenter)
|
|
|
|
.line(points.dartBottomLeft)
|
|
|
|
.hide()
|
2023-11-11 22:00:08 +00:00
|
|
|
}
|
|
|
|
|
2024-01-24 02:17:41 +00:00
|
|
|
paths.seamSA = new Path()
|
|
|
|
.move(points.dartBottomLeft)
|
2023-10-22 18:58:54 +00:00
|
|
|
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
|
|
|
|
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
|
2023-11-01 02:25:39 +00:00
|
|
|
.line(points.strapInside)
|
2024-01-24 02:17:41 +00:00
|
|
|
.join(paths.cut)
|
|
|
|
|
|
|
|
paths.seam = paths.seamSA.clone().join(paths.hem).close().attr('class', 'fabric')
|
2023-10-19 15:24:06 +00:00
|
|
|
|
2023-11-10 04:58:16 +00:00
|
|
|
points.grainlineFrom = new Point(points.dartBottomLeft.x - 10, points.cbCut.y)
|
|
|
|
points.grainlineTo = new Point(points.dartBottomLeft.x - 10, points.waistSide.y)
|
2023-11-07 02:22:52 +00:00
|
|
|
macro('grainline', {
|
|
|
|
from: points.grainlineFrom,
|
|
|
|
to: points.grainlineTo,
|
|
|
|
})
|
|
|
|
|
2023-11-10 04:58:16 +00:00
|
|
|
store.cutlist.addCut({ cut: 2, from: 'fabric' })
|
2023-11-07 02:22:52 +00:00
|
|
|
|
2024-01-18 03:08:56 +00:00
|
|
|
points.titleAnchor = points.dartBottomLeft.shiftFractionTowards(
|
|
|
|
lacing ? points.lacingCut : points.cbCut,
|
|
|
|
0.75
|
|
|
|
)
|
|
|
|
macro('title', {
|
|
|
|
at: points.titleAnchor,
|
|
|
|
nr: 3,
|
|
|
|
title: 'tristan:backInside',
|
|
|
|
})
|
|
|
|
|
2023-11-01 02:25:39 +00:00
|
|
|
if (sa) {
|
2024-01-24 02:17:41 +00:00
|
|
|
if (options.hem && !options.peplum) {
|
|
|
|
paths.sa = new Path()
|
|
|
|
.move(points.dartBottomLeftHem)
|
|
|
|
.join(
|
|
|
|
new Path()
|
|
|
|
.move(points.dartBottomLeftHem)
|
|
|
|
.line(points.dartBottomLeft)
|
|
|
|
.join(paths.seamSA)
|
|
|
|
.line(points.waistCenterHem)
|
|
|
|
.offset(sa)
|
|
|
|
)
|
|
|
|
.line(points.waistCenterHem)
|
|
|
|
.attr('class', 'fabric sa')
|
|
|
|
} else {
|
|
|
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
|
|
|
}
|
2023-11-01 02:25:39 +00:00
|
|
|
}
|
|
|
|
|
2023-11-07 02:22:52 +00:00
|
|
|
macro('hd', {
|
|
|
|
from: points.cbCut,
|
|
|
|
to: points.strapInside,
|
|
|
|
y: points.strapInside.y - sa - 15,
|
|
|
|
id: 'cutWidth',
|
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: points.cbCut,
|
|
|
|
to: points.shoulderDart,
|
|
|
|
y: points.strapInside.y - sa - 25,
|
|
|
|
id: 'cutToDart',
|
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: lacing ? points.lacingWaist : points.waistCenter,
|
|
|
|
to: points.dartBottomLeft,
|
|
|
|
y: points.waistCenter.y + sa + 15,
|
|
|
|
id: 'waistCenterToSide',
|
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: points.cbCut,
|
|
|
|
to: points.dartBottomLeft,
|
|
|
|
y: points.waistCenter.y + sa + 25,
|
|
|
|
id: 'waistCutToSide',
|
|
|
|
})
|
|
|
|
|
|
|
|
macro('vd', {
|
|
|
|
from: lacing ? points.lacingWaist : points.waistCenter,
|
|
|
|
to: points.cbCut,
|
|
|
|
x: points.cbCut.x - sa - 15,
|
|
|
|
id: 'waistToCut',
|
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: lacing ? points.lacingWaist : points.waistCenter,
|
|
|
|
to: points.strapInside,
|
|
|
|
x: points.cbCut.x - sa - 25,
|
|
|
|
id: 'waistToStrap',
|
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.dartBottomLeft,
|
|
|
|
to: points.shoulderDart,
|
|
|
|
x: points.shoulderDart.x + sa + 15,
|
|
|
|
id: 'dartToDart',
|
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.dartBottomLeft,
|
|
|
|
to: points.strapInside,
|
|
|
|
x: points.shoulderDart.x + sa + 25,
|
|
|
|
id: 'dartToStrap',
|
|
|
|
})
|
|
|
|
|
2023-10-19 15:24:06 +00:00
|
|
|
return part
|
|
|
|
},
|
|
|
|
}
|