1
0
Fork 0

chore(lucy): Prettier run

This commit is contained in:
Joost De Cock 2022-05-31 16:01:00 +02:00
parent 39712ce70b
commit 67e1a6befd
2 changed files with 91 additions and 100 deletions

View file

@ -22,7 +22,7 @@ export default {
'sewing pattern',
],
optionGroups: {
style: ['width', 'length', 'edge' ],
style: ['width', 'length', 'edge'],
},
measurements: [],
dependencies: {},
@ -31,7 +31,7 @@ export default {
parts: ['pocket'],
options: {
width: { pct: 50, min: 30, max: 100 },
length: {pct: 50, min: 30, max:100},
length: { pct: 50, min: 30, max: 100 },
edge: { pct: 25, min: 20, max: 50 },
},
}

View file

@ -2,42 +2,35 @@ export default function (part) {
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
part.shorthand()
//pocket seams here
let pocketLength = 800 * options.length
let pocketWidth = 500 * options.width
let pocketEdge = options.edge
// Pocket seams here
const pocketLength = 800 * options.length
const pocketWidth = 500 * options.width
const pocketEdge = options.edge
points.topLeft = new Point(0, 0)
points.topRight = new Point(pocketWidth, 0)
points.bottomLeft = new Point(0, pocketLength)
points.bottomRight = new Point(pocketWidth, pocketLength)
//center point
points.center = new Point((pocketWidth / 2), 0)
// Center point
points.center = new Point(pocketWidth / 2, 0)
//slit end
points.middle = points.center.shift(270,(pocketLength*0.525))
// Slit end
points.middle = points.center.shift(270, pocketLength * 0.525)
//top
points.centerRight = points.center.shift(0, (pocketWidth * pocketEdge))
points.centerLeft = points.center.shift(180, (pocketWidth * pocketEdge))
//taper point
points.taperRight = new Point(pocketWidth, (pocketLength * 0.4375))
points.taperLeft = new Point(0, (pocketLength * 0.4375))
//control points curve
points.leftCp1 = points.bottomLeft.shiftFractionTowards(points.taperLeft, 2 / 7)
points.leftCp2 = points.bottomLeft.shiftFractionTowards(points.bottomRight, 0.2)
points.rightCp1 = points.bottomRight.shiftFractionTowards(points.taperRight, 2 / 7)
points.rightCp2 = points.bottomRight.shiftFractionTowards(points.bottomLeft, 0.2)
// Top
points.centerRight = points.center.shift(0, pocketWidth * pocketEdge)
points.centerLeft = points.center.shift(180, pocketWidth * pocketEdge)
// Taper point
points.taperRight = new Point(pocketWidth, pocketLength * 0.4375)
points.taperLeft = new Point(0, pocketLength * 0.4375)
// Control points curve
points.leftCp1 = points.bottomLeft.shiftFractionTowards(points.taperLeft, 2 / 7)
points.leftCp2 = points.bottomLeft.shiftFractionTowards(points.bottomRight, 0.2)
points.rightCp1 = points.bottomRight.shiftFractionTowards(points.taperRight, 2 / 7)
points.rightCp2 = points.bottomRight.shiftFractionTowards(points.bottomLeft, 0.2)
paths.seam = new Path()
.move(points.centerLeft)
@ -52,18 +45,16 @@ export default function (part) {
// Complete?
if (complete) {
paths.slit = new Path()
.move(points.center)
.line(points.middle)
.attr("class", "path fabric dashed")
paths.slit = new Path()
.move(points.center)
.line(points.middle)
.attr('class', 'path fabric dashed')
points.logo = points.center.shiftOutwards(points.middle, pocketWidth / 5)
snippets.logo = new Snippet('logo', points.logo)
points.scalebox = points.logo
.shift(270, pocketWidth / 5)
macro("scalebox", { at: points.scalebox })
points.scalebox = points.logo.shift(270, pocketWidth / 5)
macro('scalebox', { at: points.scalebox })
if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')