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

76 lines
2.6 KiB
JavaScript
Raw Normal View History

2023-10-22 18:58:54 +00:00
import { backPoints as nobleBackPoints } from '@freesewing/noble'
2023-10-19 15:24:06 +00:00
import { hidePresets } from '@freesewing/core'
2023-10-22 18:58:54 +00:00
import { frontPoints } from './frontpoints.mjs'
2023-10-19 15:24:06 +00:00
export const backPoints = {
2023-10-22 18:58:54 +00:00
name: 'tristan.backPoints',
from: nobleBackPoints,
after: frontPoints,
2023-10-19 15:24:06 +00:00
hide: hidePresets.HIDE_ALL,
2023-10-30 23:55:00 +00:00
// options,
2023-10-22 18:58:54 +00:00
draft: ({ points, Path, paths, options, snippets, log, store, part }) => {
// Hide Noble paths
2023-10-19 15:24:06 +00:00
for (const key of Object.keys(paths)) paths[key].hide()
for (const i in snippets) delete snippets[i]
delete points.bustDartLeft
delete points.bustDartLeftCp
2023-10-22 18:58:54 +00:00
const strapWidth = store.get('strapWidth')
points.strapInside = points.shoulderDart.shiftTowards(points.hps, strapWidth / 2)
points.strapOutside = points.shoulderDart.shiftTowards(points.shoulder, strapWidth / 2)
2023-10-30 23:55:00 +00:00
// points.shoulder = points.strapOutside
2023-10-19 15:24:06 +00:00
2023-10-22 18:58:54 +00:00
points.cbCut = new Path()
.move(points.cbNeck)
.curve_(points.cbNeckCp2, points.waistCenter)
.shiftFractionAlong(options.cutDepthBack)
2023-10-19 15:24:06 +00:00
2023-10-22 18:58:54 +00:00
points.cbCutCp2 = new Path()
.move(points.cbNeck)
.curve_(points.cbNeckCp2, points.waistCenter)
.split(points.cbCut)[1].ops[1].cp2
2023-10-19 15:24:06 +00:00
2023-10-22 18:58:54 +00:00
points.cutSeamInside = new Path()
.move(points.dartBottomLeft)
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
.intersectsY(points.cbCut.y)[0]
points.cutSeamOutside = new Path()
.move(points.shoulderDart)
.curve(points.shoulderDart, points.shoulderDartCpUp, points.dartTip)
.curve(points.shoulderDartCpDown, points.dartRightCp, points.dartBottomRight)
.intersectsY(points.cbCut.y)[0]
points.cbCutCp = points.cbCut.shiftFractionTowards(
points.cutSeamInside,
1 - options.cutRoundnessBack
2023-10-19 15:24:06 +00:00
)
2023-10-22 18:58:54 +00:00
points.strapInsideCp = points.strapInside.shiftFractionTowards(
points.cutSeamInside.shift(
points.cutSeamInside.angle(points.shoulderDart) + 90,
strapWidth / 2
),
1 - options.cutRoundnessBack
2023-10-19 15:24:06 +00:00
)
2023-10-27 04:43:09 +00:00
points.armholeCutCp = points.armhole
.shift(180, options.armholeBackIn * points.armhole.dist(points.dartTip))
.addCircle(4)
2023-10-22 18:58:54 +00:00
2023-10-30 23:55:00 +00:00
points.strapOutsideCp = points.strapOutside.shiftFractionTowards(
points.dartTip.shift(points.dartTip.angle(points.shoulderDart) - 90, strapWidth / 2),
options.armholeFrontDepth
)
2023-10-19 15:24:06 +00:00
2023-10-30 23:55:00 +00:00
store.set('backOutsideWaistLength', points.dartBottomRight.dist(points.waistSide))
store.set('backInsideWaistLength', points.dartBottomLeft.dist(points.waistCenter))
2023-10-19 15:24:06 +00:00
return part
},
}