Plotter crashes and burns on stroke with non-existent tool #14
Comments
@ju5t that's pretty odd. Gerber file would be super helpful if available |
@ju5t turns out this is a bug in plotter exposed by a bug in the parser which is actually causing your problems: mcous/gerber-parser#23. TL;DR: As a workaround until the parser is fixed, you could look into passing the const whatsThatGerber = require('whats-that-gerber')
const gerberToSvg = require('gerber-to-svg')
// ...
const filename = getFilenameSomehow()
const layerType = whatsThatGerber(filename)
// ...
const converter = gerberToSvg(fs.createReadStream(filename), {
id: getIdSomehow(),
filetype: (layerType === 'drl') ? 'drill' : 'gerber'
})
// ... |
Got it. I don't think it'll be that easy for us to implement the workaround because we're using |
@ju5t pcb-stackup still has the ability to pass options into const fs = require('fs')
const pcbStackup = require('pcb-stackup')
const whatsThatGerber = require('whats-that-gerber')
const shortId = require('shortid')
const fileNames = [
'/path/to/board-F.Cu.gtl',
'/path/to/board-F.Mask.gts',
'/path/to/board-F.SilkS.gto',
'/path/to/board-F.Paste.gtp',
'/path/to/board-B.Cu.gbl',
'/path/to/board-B.Mask.gbs',
'/path/to/board-B.SilkS.gbo',
'/path/to/board-B.Paste.gbp',
'/path/to/board-Edge.Cuts.gm1',
'/path/to/board.drl',
'/path/to/board-NPTH.drl',
]
const layers = fileNames.map(filename => ({
filename,
gerber: fs.createReadStream(path),
options: {
id: shortId.generate()
filetype: (layerType === 'drl') ? 'drill' : 'gerber'
}
}))
pcbStackup(layers, (error, stackup) => {
if (error) return console.error(error)
console.log(stackup.top.svg) // logs "<svg ... </svg>"
console.log(stackup.bottom.svg) // logs "<svg ... </svg>"
}) |
@mcous thanks for the example. I've tested the workaround locally and that works. |
Closing in favor of tracespace/tracespace#83 |
I ran into a problem today and for some reason I can't seem to
try {} catch {}
my way out of it. I get the following error when trying to parse gerber files that were created with Vutrax.@mcous I can send you the gerber files via e-mail if that helps.
The text was updated successfully, but these errors were encountered: