1
0
Fork 0
freesewing/designs/hugo/src/back.mjs

125 lines
3.4 KiB
JavaScript
Raw Normal View History

2022-09-05 19:21:51 +02:00
import { back as brianBack } from '@freesewing/brian'
import { front } from './front.mjs'
import { hidePresets } from '@freesewing/core'
2022-09-05 19:21:51 +02:00
2022-09-11 15:41:29 +02:00
function hugoBack({
store,
measurements,
options,
sa,
Point,
points,
Path,
paths,
Snippet,
snippets,
complete,
paperless,
macro,
part,
}) {
2018-12-20 11:41:35 +01:00
// Remove clutter
for (const i in paths) delete paths[i]
2018-09-21 21:30:20 +02:00
// Remove notch inherited from Brian
delete snippets.armholePitchNotch
// Fit the hips
points.hem.x = (measurements.hips * (1 + options.hipsEase)) / 4
points.hemCp2 = new Point(points.hem.x, points.cbWaist.y)
2018-09-21 21:30:20 +02:00
2018-12-20 11:41:35 +01:00
// Ribbing
2019-08-03 15:03:33 +02:00
points.cbRibbing = points.cbHem.shift(90, store.get('ribbing'))
points.ribbing = points.hem.shift(90, store.get('ribbing'))
2018-09-21 21:30:20 +02:00
2018-12-20 11:41:35 +01:00
// Raglan tip
2019-08-03 15:03:33 +02:00
let neckOpening = new Path().move(points.cbNeck).curve(points.cbNeck, points.neckCp2, points.neck)
points.raglanTipBack = neckOpening.shiftFractionAlong(0.7)
let neckOpeningParts = neckOpening.split(points.raglanTipBack)
2018-12-20 11:41:35 +01:00
// Paths
paths.saBase = new Path()
.move(points.cbRibbing)
.line(points.ribbing)
.curve_(points.hemCp2, points.armhole)
2018-12-20 11:41:35 +01:00
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.line(points.raglanTipBack)
2019-08-03 15:03:33 +02:00
.join(neckOpeningParts[0].reverse())
paths.seam = paths.saBase.clone().close().attr('class', 'fabric')
2022-09-18 17:01:19 +02:00
paths.saBase.hide()
2018-09-21 21:30:20 +02:00
2018-12-20 11:41:35 +01:00
// Store neck opening path
2019-08-03 15:03:33 +02:00
store.set('neckOpeningPartBack', neckOpeningParts[1])
store.set('neckOpeningAnchorBack', points.neck)
store.set('neckOpeningLenBack', neckOpening.length())
store.set('neckCutoutBack', points.cbNeck.y)
2018-09-21 21:30:20 +02:00
2018-12-20 11:41:35 +01:00
// Complete pattern?
if (complete) {
2019-08-03 15:03:33 +02:00
macro('cutonfold', {
2018-12-20 11:41:35 +01:00
from: points.cbNeck,
to: points.cbRibbing,
2021-04-24 10:16:31 +02:00
grainline: true,
2019-08-03 15:03:33 +02:00
})
points.title = new Point(points.armhole.x / 2, points.armhole.y)
macro('title', { at: points.title, nr: 2, title: 'back' })
store.set('notchBack', points.raglanTipBack.dist(points.armholeHollow) / 2)
2018-12-20 11:41:35 +01:00
points.sleeveNotch = points.raglanTipBack.shiftTowards(
points.armholeHollow,
2019-08-03 15:03:33 +02:00
store.get('notchBack')
)
snippets.sleeveNotch = new Snippet('bnotch', points.sleeveNotch)
store.set('backRaglanTipToNotch', points.raglanTipBack.dist(points.sleeveNotch))
points.logo = points.title.shift(-90, 70)
snippets.logo = new Snippet('logo', points.logo)
2018-12-20 11:41:35 +01:00
if (sa) {
paths.sa = paths.saBase.offset(sa).line(points.cbNeck).attr('class', 'fabric sa')
2019-08-03 15:03:33 +02:00
paths.sa.move(points.cbRibbing).line(paths.sa.start())
2018-09-21 21:30:20 +02:00
}
2018-12-20 11:41:35 +01:00
}
2018-09-21 21:30:20 +02:00
2018-12-20 11:41:35 +01:00
// Paperless?
if (paperless) {
2019-08-03 15:03:33 +02:00
macro('vd', {
2018-12-20 11:41:35 +01:00
from: points.cbRibbing,
to: points.cbNeck,
2021-04-24 10:16:31 +02:00
x: points.cbNeck.x - 15,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2018-12-20 11:41:35 +01:00
from: points.cbRibbing,
to: points.raglanTipBack,
2021-04-24 10:16:31 +02:00
x: points.cbNeck.x - 30,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2018-12-20 11:41:35 +01:00
from: points.ribbing,
to: points.armhole,
2021-04-24 10:16:31 +02:00
x: points.ribbing.x + 15 + sa,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2018-12-20 11:41:35 +01:00
from: points.cbNeck,
to: points.raglanTipBack,
2021-04-24 10:16:31 +02:00
y: points.raglanTipBack.y - 15 - sa,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2018-12-20 11:41:35 +01:00
from: points.raglanTipBack,
to: points.armhole,
2021-04-24 10:16:31 +02:00
y: points.raglanTipBack.y - 15 - sa,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2018-12-20 11:41:35 +01:00
from: points.cbRibbing,
to: points.ribbing,
2021-04-24 10:16:31 +02:00
y: points.cbRibbing.y + 15 + sa,
2019-08-03 15:03:33 +02:00
})
2018-09-21 21:30:20 +02:00
}
2019-08-03 15:03:33 +02:00
return part
}
2022-09-05 19:21:51 +02:00
export const back = {
name: 'hugo.back',
from: brianBack,
hide: hidePresets.HIDE_TREE,
2022-09-05 19:21:51 +02:00
measurements: ['hips'],
after: front,
draft: hugoBack,
}