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

160 lines
4 KiB
JavaScript
Raw Normal View History

2022-09-05 16:13:41 +02:00
import { backPoints } from './backpoints.mjs'
2022-06-19 23:23:10 +00:00
2022-09-11 16:05:55 +02:00
function nobleBackInside({
sa,
points,
Path,
paths,
Snippet,
snippets,
options,
complete,
paperless,
macro,
part,
}) {
2022-09-05 16:13:41 +02:00
if (options.dartPosition != 'shoulder') {
2022-09-18 17:01:19 +02:00
paths.insideSeam = paths.seam.clone().unhide()
2022-06-21 02:09:57 +00:00
} else {
// Hide Bella paths
2022-09-18 17:01:19 +02:00
for (let key of Object.keys(paths)) paths[key].hide()
2022-06-21 02:09:57 +00:00
for (let i in snippets) delete snippets[i]
paths.insideSeam = new Path()
.move(points.cbNeck)
.curve_(points.cbNeckCp2, points.waistCenter)
.line(points.dartBottomLeft)
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
.line(points.hps)
._curve(points.cbNeckCp1, points.cbNeck)
.close()
.attr('class', 'fabric')
}
2022-06-19 23:23:10 +00:00
if (complete) {
2022-06-20 20:54:07 +00:00
snippets.dartTip = new Snippet('notch', points.dartTip)
2022-06-19 23:23:10 +00:00
macro('title', {
at: points.titleAnchor,
nr: 3,
2022-09-05 16:13:41 +02:00
title: options.dartPosition != 'shoulder' ? 'Back' : 'Inside Back',
2022-06-19 23:23:10 +00:00
})
2022-09-05 16:13:41 +02:00
macro('grainline', {
2022-06-19 23:23:10 +00:00
from: points.grainlineFrom,
to: points.grainlineTo,
})
if (sa) paths.sa = paths.insideSeam.offset(sa).attr('class', 'fabric sa')
2022-06-20 20:54:07 +00:00
2022-09-05 16:13:41 +02:00
if (paperless) {
if (options.dartPosition == 'shoulder') {
2022-06-21 02:09:57 +00:00
points.shoulderPoint = points.shoulderDart.clone()
} else {
points.shoulderPoint = points.shoulder.clone()
}
2022-06-20 20:54:07 +00:00
macro('hd', {
from: points.waistCenter,
2022-06-21 02:09:57 +00:00
to: points.shoulderPoint,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 15,
2022-06-20 20:54:07 +00:00
})
macro('hd', {
from: points.waistCenter,
to: points.dartTip,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 25,
2022-06-20 20:54:07 +00:00
})
macro('hd', {
from: points.waistCenter,
to: points.dartBottomLeft,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 35,
2022-06-20 20:54:07 +00:00
})
macro('hd', {
from: points.cbNeck,
to: points.dartBottomLeft,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 45,
2022-06-20 20:54:07 +00:00
})
macro('hd', {
from: points.cbNeck,
to: points.hps,
2022-09-05 16:13:41 +02:00
y: points.hps.y - sa - 15,
2022-06-20 20:54:07 +00:00
})
macro('hd', {
from: points.hps,
2022-06-21 02:09:57 +00:00
to: points.shoulderPoint,
2022-09-05 16:13:41 +02:00
y: points.hps.y - sa - 15,
2022-06-20 20:54:07 +00:00
})
2022-09-05 16:13:41 +02:00
if (options.dartPosition != 'shoulder') {
2022-06-21 02:09:57 +00:00
macro('hd', {
from: points.dartTip,
to: points.waistSide,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 25,
2022-06-21 02:09:57 +00:00
})
macro('hd', {
from: points.dartBottomRight,
to: points.waistSide,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 35,
2022-06-21 02:09:57 +00:00
})
macro('hd', {
from: points.dartBottomRight,
to: points.armhole,
2022-09-05 16:13:41 +02:00
y: points.waistCenter.y + sa + 45,
2022-06-21 02:09:57 +00:00
})
}
let extraOffset = 0
2022-09-05 16:13:41 +02:00
if (options.dartPosition != 'shoulder') {
2022-06-21 02:09:57 +00:00
macro('vd', {
from: points.shoulderPoint,
to: points.waistSide,
2022-09-05 16:13:41 +02:00
x: points.shoulderPoint.x + sa + 25,
2022-06-21 02:09:57 +00:00
})
macro('vd', {
from: points.armhole,
to: points.waistSide,
2022-09-05 16:13:41 +02:00
x: points.shoulderPoint.x + sa + 15,
2022-06-21 02:09:57 +00:00
})
extraOffset = 10
}
2022-06-20 20:54:07 +00:00
macro('vd', {
2022-06-21 02:09:57 +00:00
from: points.shoulderPoint,
2022-06-20 20:54:07 +00:00
to: points.dartTip,
2022-09-05 16:13:41 +02:00
x: points.shoulderPoint.x + sa + 15,
2022-06-20 20:54:07 +00:00
})
macro('vd', {
2022-06-21 02:09:57 +00:00
from: points.shoulderPoint,
2022-06-20 20:54:07 +00:00
to: points.dartBottomLeft,
2022-09-05 16:13:41 +02:00
x: points.shoulderPoint.x + sa + 25 + extraOffset,
2022-06-20 20:54:07 +00:00
})
macro('vd', {
2022-06-21 02:09:57 +00:00
from: points.shoulderPoint,
2022-06-20 20:54:07 +00:00
to: points.waistCenter,
2022-09-05 16:13:41 +02:00
x: points.shoulderPoint.x + sa + 35 + extraOffset,
2022-06-20 20:54:07 +00:00
})
macro('vd', {
from: points.hps,
to: points.waistCenter,
2022-09-05 16:13:41 +02:00
x: points.shoulderPoint.x + sa + 45 + extraOffset,
2022-06-20 20:54:07 +00:00
})
macro('vd', {
from: points.waistCenter,
to: points.cbNeck,
2022-09-05 16:13:41 +02:00
x: points.cbNeck.x - sa - 15,
2022-06-20 20:54:07 +00:00
})
macro('vd', {
from: points.waistCenter,
to: points.hps,
2022-09-05 16:13:41 +02:00
x: points.cbNeck.x - sa - 25,
2022-06-20 20:54:07 +00:00
})
}
2022-06-19 23:23:10 +00:00
}
2022-07-10 16:09:59 +02:00
2022-06-19 23:23:10 +00:00
return part
}
2022-09-05 16:13:41 +02:00
export const backInside = {
name: 'noble.backInside',
from: backPoints,
draft: nobleBackInside,
}