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

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

View file

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

View file

@ -5,9 +5,8 @@ import { bib } from './bib.mjs'
// Setup our new design // Setup our new design
const Bob = new Design({ const Bob = new Design({
data, data,
parts: [ bib ], parts: [bib],
}) })
//Named exports //Named exports
export { bib, Bob } export { bib, Bob }