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

207 lines
5.6 KiB
JavaScript
Raw Normal View History

2022-09-05 16:13:41 +02:00
import { frontPoints } from './frontpoints.mjs'
2023-09-28 03:56:24 +00:00
export const frontInside = {
name: 'noble.frontInside',
from: frontPoints,
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, options, macro, part }) => {
delete points.waistDartHem
delete points.waistDartRight
delete points.waistDartRightCp
delete points.waistDartCpBottom
delete points.bustDartBottom
delete points.bustDartCpBottom
delete points.bustDartTip
delete points.bustDartTop
delete points.shoulderDartTipCpDownOutside
delete points.ex
delete points.bustB
delete points.shoulder
delete points.shoulderDartShoulder
delete points.shoulderDartOutside
delete points.pitchMax
delete points.armholeCpTarget
delete points.armholePitch
delete points.armholePitchCp1
delete points.armholePitchCp2
delete points.armhole
delete points.armholeCp2
delete points.bustDartCpTop
delete points.bustSide
delete points.bustDartMiddle
delete points.bustDartEdge
2022-06-20 19:40:41 +00:00
2023-09-28 03:56:24 +00:00
if (options.dartPosition == 'shoulder') {
paths.insideSeam = new Path()
.move(points.cfHem)
.line(points.waistDartLeft)
2022-09-05 16:13:41 +02:00
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
2023-09-28 03:56:24 +00:00
.line(points.shoulderDartInside)
.line(points.hps)
.curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
2022-06-19 23:23:10 +00:00
2023-09-28 03:56:24 +00:00
paths.seam = paths.insideSeam
.join(new Path().move(points.cfNeck).line(points.cfHem))
.close()
.attr('class', 'fabric')
2022-06-19 23:23:10 +00:00
2023-09-28 03:56:24 +00:00
store.set(
'shoulderDartTipNotch',
new Path()
.move(points.waistDartLeft)
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
.length()
)
} else {
paths.insideSeam = new Path()
.move(points.cfHem)
.line(points.waistDartLeft)
2022-09-05 16:13:41 +02:00
.curve(
points.waistDartLeftCp,
points.armholeDartTipCpDownInside,
points.armholeDartTipInside
)
2023-09-28 03:56:24 +00:00
.curve(points.waistCircleInsideCp1, points.armholeCircleInsideCp1, points.armholeDartInside)
.join(paths.armholeInside)
.line(points.hps)
.curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
paths.seam = paths.insideSeam
.join(new Path().move(points.cfNeck).line(points.cfHem))
.close()
.attr('class', 'fabric')
store.set(
'shoulderDartTipNotch',
new Path()
.move(points.waistDartLeft)
.curve(
points.waistDartLeftCp,
points.armholeDartTipCpDownInside,
points.armholeDartTipInside
)
.length()
)
}
2022-06-19 23:23:10 +00:00
2023-09-28 03:56:24 +00:00
macro('cutonfold', {
from: points.cfNeck,
to: points.cfHem,
grainline: true,
})
2022-09-05 16:13:41 +02:00
if (options.dartPosition == 'shoulder') {
2022-06-20 19:40:41 +00:00
snippets.shoulderDartTip = new Snippet('notch', points.shoulderDartTip)
} else {
snippets.shoulderDartTip = new Snippet('notch', points.armholeDartTipInside)
}
2022-09-05 16:13:41 +02:00
points.titleAnchor = new Point(points.hpsCp2.x * 0.75, points.cfNeckCp1.y * 1.5)
2022-06-19 23:23:10 +00:00
macro('title', {
at: points.titleAnchor,
nr: 1,
2023-09-28 03:56:24 +00:00
title: 'frontInside',
2022-06-19 23:23:10 +00:00
})
2023-09-28 03:56:24 +00:00
points.gridAnchor = points.hps.clone()
2022-09-05 16:13:41 +02:00
points.scaleboxAnchor = points.titleAnchor.shift(-90, 90).shift(0, 10)
2022-06-19 23:23:10 +00:00
macro('scalebox', { at: points.scaleboxAnchor, rotate: 270 })
if (sa) {
paths.sa = paths.insideSeam.offset(sa).line(points.cfNeck).attr('class', 'fabric sa')
paths.sa = paths.sa.move(points.cfHem).line(paths.sa.start())
}
2022-06-20 19:40:41 +00:00
2023-09-28 03:56:24 +00:00
let extraOffset = 0
if (options.dartPosition == 'shoulder') {
macro('hd', {
from: points.cfNeck,
to: points.shoulderDartInside,
y: points.hps.y - 25,
id: 'hpsToDart',
2022-06-19 23:23:10 +00:00
})
macro('vd', {
from: points.cfHem,
2023-09-28 03:56:24 +00:00
to: points.shoulderDartInside,
x: 0 - 30,
id: 'hemToDart',
2022-06-19 23:23:10 +00:00
})
macro('vd', {
from: points.cfHem,
2023-09-28 03:56:24 +00:00
to: points.shoulderDartTip,
x: 0 - 10,
id: 'hemToDartTip',
2022-06-19 23:23:10 +00:00
})
macro('hd', {
from: points.cfBust,
2023-09-28 03:56:24 +00:00
to: points.shoulderDartTip,
2022-06-20 19:40:41 +00:00
y: points.cfHem.y + sa + 25,
2023-09-28 03:56:24 +00:00
id: 'middleToDartTip',
2022-06-19 23:23:10 +00:00
})
2023-09-28 03:56:24 +00:00
} else {
extraOffset = 10
2022-06-19 23:23:10 +00:00
macro('hd', {
2023-09-28 03:56:24 +00:00
from: points.hps,
to: points.shoulderCp1,
y: points.hps.y - 35,
id: 'hpsToShoulder',
})
macro('hd', {
from: points.hps,
to: points.armholeDartInsideCp2,
y: points.hps.y - 25,
id: 'hpsToDart',
})
macro('vd', {
from: points.cfHem,
to: points.armholeDartInsideCp2,
x: 0 - 20,
id: 'hemToDart',
})
macro('vd', {
2022-06-19 23:23:10 +00:00
from: points.cfHem,
2023-09-28 03:56:24 +00:00
to: points.shoulderCp1,
x: 0 - 40,
id: 'hemToShoulder',
})
macro('vd', {
from: points.cfHem,
to: points.armholeDartTipInside,
x: 0 - 10,
id: 'hemToDartTip',
2022-06-19 23:23:10 +00:00
})
macro('hd', {
2023-09-28 03:56:24 +00:00
from: points.cfBust,
to: points.armholeDartTipInside,
y: points.cfHem.y + sa + 25,
id: 'middleToDartTip',
2022-06-19 23:23:10 +00:00
})
2022-07-12 20:09:17 +02:00
}
2022-06-20 21:25:06 +00:00
2023-09-28 03:56:24 +00:00
macro('vd', {
from: points.cfHem,
to: points.cfNeck,
x: 0 - 20 - extraOffset,
id: 'hemToNeck',
})
macro('vd', {
from: points.cfHem,
to: points.hps,
x: 0 - 40 - extraOffset,
id: 'hemToHps',
})
macro('hd', {
from: points.cfHem,
to: points.waistDartLeft,
y: points.cfHem.y + sa + 15,
id: 'middleToDart',
})
macro('hd', {
from: points.cfNeck,
to: points.hps,
y: points.hps.y - sa - 15,
id: 'middleToHps',
})
2022-09-05 16:13:41 +02:00
2023-09-28 03:56:24 +00:00
return part
},
2022-09-05 16:13:41 +02:00
}