1
0
Fork 0
freesewing/designs/tristan/src/backinside.mjs

125 lines
3.6 KiB
JavaScript
Raw Normal View History

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-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-01 02:25:39 +00:00
paths.seam = new Path()
2023-10-22 18:58:54 +00:00
.move(points.strapInside)
.join(paths.cut)
.line(points.dartBottomLeft)
.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)
2023-10-22 18:58:54 +00:00
.close()
.attr('class', 'fabric')
2023-10-19 15:24:06 +00:00
2023-11-01 02:25:39 +00:00
points.titleAnchor = points.dartBottomLeft.shiftFractionTowards(
lacing ? points.lacingCut : points.cbCut,
0.75
)
macro('title', {
at: points.titleAnchor,
nr: 3,
title: 'backInside',
})
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
2023-11-01 02:25:39 +00:00
if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
}
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
},
}