chore(lucy): Prettier run
This commit is contained in:
parent
39712ce70b
commit
67e1a6befd
2 changed files with 91 additions and 100 deletions
|
@ -22,7 +22,7 @@ export default {
|
||||||
'sewing pattern',
|
'sewing pattern',
|
||||||
],
|
],
|
||||||
optionGroups: {
|
optionGroups: {
|
||||||
style: ['width', 'length', 'edge' ],
|
style: ['width', 'length', 'edge'],
|
||||||
},
|
},
|
||||||
measurements: [],
|
measurements: [],
|
||||||
dependencies: {},
|
dependencies: {},
|
||||||
|
@ -31,7 +31,7 @@ export default {
|
||||||
parts: ['pocket'],
|
parts: ['pocket'],
|
||||||
options: {
|
options: {
|
||||||
width: { pct: 50, min: 30, max: 100 },
|
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 },
|
edge: { pct: 25, min: 20, max: 50 },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,98 +1,89 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
|
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
|
||||||
part.shorthand()
|
part.shorthand()
|
||||||
|
|
||||||
|
// Pocket seams here
|
||||||
//pocket seams here
|
const pocketLength = 800 * options.length
|
||||||
let pocketLength = 800 * options.length
|
const pocketWidth = 500 * options.width
|
||||||
let pocketWidth = 500 * options.width
|
const pocketEdge = options.edge
|
||||||
let pocketEdge = options.edge
|
|
||||||
|
points.topLeft = new Point(0, 0)
|
||||||
|
points.topRight = new Point(pocketWidth, 0)
|
||||||
points.topLeft = new Point(0, 0)
|
points.bottomLeft = new Point(0, pocketLength)
|
||||||
points.topRight = new Point(pocketWidth, 0)
|
points.bottomRight = new Point(pocketWidth, pocketLength)
|
||||||
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)
|
||||||
//top
|
points.centerLeft = points.center.shift(180, pocketWidth * pocketEdge)
|
||||||
|
|
||||||
points.centerRight = points.center.shift(0, (pocketWidth * pocketEdge))
|
// Taper point
|
||||||
points.centerLeft = points.center.shift(180, (pocketWidth * pocketEdge))
|
points.taperRight = new Point(pocketWidth, pocketLength * 0.4375)
|
||||||
|
points.taperLeft = new Point(0, pocketLength * 0.4375)
|
||||||
//taper point
|
|
||||||
points.taperRight = new Point(pocketWidth, (pocketLength * 0.4375))
|
// Control points curve
|
||||||
points.taperLeft = new Point(0, (pocketLength * 0.4375))
|
points.leftCp1 = points.bottomLeft.shiftFractionTowards(points.taperLeft, 2 / 7)
|
||||||
|
points.leftCp2 = points.bottomLeft.shiftFractionTowards(points.bottomRight, 0.2)
|
||||||
//control points curve
|
points.rightCp1 = points.bottomRight.shiftFractionTowards(points.taperRight, 2 / 7)
|
||||||
|
points.rightCp2 = points.bottomRight.shiftFractionTowards(points.bottomLeft, 0.2)
|
||||||
points.leftCp1 = points.bottomLeft.shiftFractionTowards(points.taperLeft, 2 / 7)
|
|
||||||
points.leftCp2 = points.bottomLeft.shiftFractionTowards(points.bottomRight, 0.2)
|
paths.seam = new Path()
|
||||||
|
.move(points.centerLeft)
|
||||||
points.rightCp1 = points.bottomRight.shiftFractionTowards(points.taperRight, 2 / 7)
|
.line(points.taperLeft)
|
||||||
points.rightCp2 = points.bottomRight.shiftFractionTowards(points.bottomLeft, 0.2)
|
.line(points.leftCp1)
|
||||||
|
.curve_(points.bottomLeft, points.leftCp2)
|
||||||
|
.line(points.rightCp2)
|
||||||
|
.curve_(points.bottomRight, points.rightCp1)
|
||||||
paths.seam = new Path()
|
.line(points.taperRight)
|
||||||
.move(points.centerLeft)
|
.line(points.centerRight)
|
||||||
.line(points.taperLeft)
|
.close()
|
||||||
.line(points.leftCp1)
|
|
||||||
.curve_(points.bottomLeft, points.leftCp2)
|
// Complete?
|
||||||
.line(points.rightCp2)
|
if (complete) {
|
||||||
.curve_(points.bottomRight, points.rightCp1)
|
paths.slit = new Path()
|
||||||
.line(points.taperRight)
|
.move(points.center)
|
||||||
.line(points.centerRight)
|
.line(points.middle)
|
||||||
.close()
|
.attr('class', 'path fabric dashed')
|
||||||
|
|
||||||
// Complete?
|
points.logo = points.center.shiftOutwards(points.middle, pocketWidth / 5)
|
||||||
if (complete) {
|
snippets.logo = new Snippet('logo', points.logo)
|
||||||
|
|
||||||
paths.slit = new Path()
|
points.scalebox = points.logo.shift(270, pocketWidth / 5)
|
||||||
.move(points.center)
|
macro('scalebox', { at: points.scalebox })
|
||||||
.line(points.middle)
|
|
||||||
.attr("class", "path fabric dashed")
|
if (sa) {
|
||||||
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||||
points.logo = points.center.shiftOutwards(points.middle, pocketWidth / 5)
|
}
|
||||||
snippets.logo = new Snippet('logo', points.logo)
|
}
|
||||||
|
|
||||||
points.scalebox = points.logo
|
// Paperless?
|
||||||
.shift(270, pocketWidth / 5)
|
if (paperless) {
|
||||||
macro("scalebox", { at: points.scalebox })
|
macro('hd', {
|
||||||
|
from: points.bottomLeft,
|
||||||
if (sa) {
|
to: points.bottomRight,
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
y: points.bottomLeft.y + sa + 15,
|
||||||
}
|
})
|
||||||
}
|
macro('vd', {
|
||||||
|
from: points.bottomRight,
|
||||||
// Paperless?
|
to: points.topRight,
|
||||||
if (paperless) {
|
x: points.topRight.x + sa + 15,
|
||||||
macro('hd', {
|
})
|
||||||
from: points.bottomLeft,
|
macro('hd', {
|
||||||
to: points.bottomRight,
|
from: points.centerLeft,
|
||||||
y: points.bottomLeft.y + sa + 15,
|
to: points.centerRight,
|
||||||
})
|
y: points.topLeft.y + sa + 15,
|
||||||
macro('vd', {
|
})
|
||||||
from: points.bottomRight,
|
macro('vd', {
|
||||||
to: points.topRight,
|
from: points.center,
|
||||||
x: points.topRight.x + sa + 15,
|
to: points.middle,
|
||||||
})
|
y: points.center.x + sa + 15,
|
||||||
macro('hd', {
|
})
|
||||||
from: points.centerLeft,
|
}
|
||||||
to: points.centerRight,
|
|
||||||
y: points.topLeft.y + sa + 15,
|
return part
|
||||||
})
|
}
|
||||||
macro('vd', {
|
|
||||||
from: points.center,
|
|
||||||
to: points.middle,
|
|
||||||
y: points.center.x + sa + 15,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return part
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue