1
0
Fork 0
freesewing/designs/penelope/src/front.mjs

68 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-09-05 20:01:35 -07:00
import { pluginBundle } from '@freesewing/plugin-bundle'
import { measurements, optionalMeasurements, options, BuildMainShape } from './shape.mjs'
2019-08-21 11:11:05 -07:00
2022-09-11 16:26:35 +02:00
function penelopeFront(params) {
const { options, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro, part } =
params
2019-08-21 11:11:05 -07:00
2022-09-11 16:26:35 +02:00
BuildMainShape(params, true)
2019-08-21 11:11:05 -07:00
paths.seam = paths.leftSide
.clone()
.join(paths.bottom)
.join(paths.sideSeam)
.join(paths.waist)
.attr('class', 'fabric')
2019-08-21 11:11:05 -07:00
// Complete?
if (complete) {
macro('cutonfold', {
2019-08-21 11:11:05 -07:00
from: points.lWaist,
to: points.lLeg,
margin: 5,
2021-04-24 10:16:31 +02:00
offset: 10,
})
macro('title', {
nr: 1,
2019-08-21 11:11:05 -07:00
at: points.titleAnchor,
2021-04-24 10:16:31 +02:00
title: 'front',
})
macro('grainline', {
2019-08-21 11:11:05 -07:00
from: points.grainlineTop,
2021-04-24 10:16:31 +02:00
to: points.grainlineBottom,
})
2019-08-21 11:11:05 -07:00
points.scaleBox = points.logoAnchor.shift(270, 100)
macro('scalebox', { at: points.scaleBox })
2019-08-21 11:11:05 -07:00
snippets.logo = new Snippet('logo', points.logoAnchor)
2019-08-21 11:11:05 -07:00
if (sa) {
paths.sa = new Path()
.move(points.lHem)
2021-01-31 09:22:15 +01:00
.join(paths.bottom.join(paths.sideSeam).join(paths.waistSA).offset(sa))
2019-08-21 11:11:05 -07:00
.line(points.lWaist)
.attr('class', 'fabric sa')
2019-08-21 11:11:05 -07:00
}
if (paperless) {
macro('hd', {
2019-08-21 11:11:05 -07:00
from: points.lHem,
to: points.rHem,
2021-04-24 10:16:31 +02:00
y: points.rHem.y - options.paperlessOffset,
})
2019-08-21 11:11:05 -07:00
}
}
return part
2019-08-21 11:11:05 -07:00
}
2022-09-05 09:22:17 +02:00
export const front = {
name: 'penelope.front',
measurements,
optionalMeasurements,
2022-09-05 09:22:17 +02:00
options,
2022-09-11 16:26:35 +02:00
plugins: [pluginBundle],
2022-09-05 09:22:17 +02:00
draft: penelopeFront,
}