1
0
Fork 0

chore(bob): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-10 20:28:51 +02:00
parent f32fdd45ad
commit a4983dfdc6
3 changed files with 34 additions and 28 deletions

View file

@ -11,8 +11,7 @@ export const bib = {
headSize: { pct: 100, min: 10, max: 200, snap: 5, menu: 'size' },
},
plugins: [pluginBundle],
draft: part => {
const {
draft: ({
Point,
points,
Path,
@ -20,13 +19,13 @@ export const bib = {
optionalMeasurements,
options,
macro,
raise,
log,
complete,
snippets,
Snippet,
paperless,
} = part.shorthand()
part,
}) => {
// Head size
const head = (optionalMeasurements?.head || 360) * options.headSize
@ -176,9 +175,9 @@ export const bib = {
.close()
.attr('class', 'fabric')
raise.info(['biasTapeLength', { mm: paths.seam.length() }])
raise.info(['fabricHeight', { mm: points.tipRightTopStart.dy(points.bottomLeftEnd) }])
raise.info(['fabricWidth', { mm: points.bottomLeftStart.dx(points.bottomRightEnd) }])
log.info(['biasTapeLength', { mm: paths.seam.length() }])
log.info(['fabricHeight', { mm: points.tipRightTopStart.dy(points.bottomLeftEnd) }])
log.info(['fabricWidth', { mm: points.bottomLeftStart.dx(points.bottomRightEnd) }])
// Complete?
if (complete) {
@ -246,6 +245,5 @@ export const bib = {
}
return part
},
}
}

View file

@ -1,7 +1,16 @@
export default function (part) {
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
part.shorthand()
export default function ({
options,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
paperless,
macro,
}) {
const w = 500 * options.size
points.topLeft = new Point(0, 0)
points.topRight = new Point(w, 0)

View file

@ -10,4 +10,3 @@ const Bob = new Design({
//Named exports
export { bib, Bob }