Notify President Madagascar

    gerber-plotter
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.0 • Public • Published

    gerber plotter

    Streaming Gerber / NC drill layer image plotter

    latest next david

    A printed circuit board Gerber and drill file plotter. Implemented as a Node transform stream that consumes objects output by gerber-parser and outputs PCB image objects.

    Part of the tracespace collection of PCB visualization tools.

    install

    npm install --save gerber-plotter
    # or 
    yarn add gerber-plotter

    gerber-parser is a peer dependency, so you probably want to install it too:

    npm install --save gerber-parser
    # or 
    yarn add gerber-parser

    example

    var fs = require('fs')
    var gerberParser = require('gerber-parser')
    var gerberPlotter = require('gerber-plotter')
     
    var parser = gerberParser()
    var plotter = gerberPlotter()
     
    plotter.on('warning', function(w) {
      console.warn('plotter warning at line ' + w.line + '' + w.message)
    })
     
    plotter.once('error', function(e) {
      console.error('plotter error: ' + e.message)
    })
     
    fs.createReadStream('/path/to/gerber/file.gbr')
      .pipe(parser)
      .pipe(plotter)
      .on('data', function(obj) {
        console.log(JSON.stringify(obj))
      })

    To run this module in a browser, it should be bundled with a tool like browserify or webpack.

    api

    See API.md

    Install

    npm i gerber-plotter@4.0.0

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    140 kB

    Total Files

    18

    Last publish

    Collaborators

    • mcous