4.2.8 • Published 4 years ago

gerber-plotter v4.2.8

Weekly downloads
161
License
MIT
Repository
github
Last release
4 years ago

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

Or, use a script tag:

<script src="https://unpkg.com/gerber-plotter@^4.0.0/dist/gerber-plotter.min.js"></script>
<script>
  // global variable gerberPlotter now available
  var plotter = gerberPlotter()
</script>

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. If you are using the script tag installation method instead, there will be a global variable gerberPlotter available after you have included gerber-plotter.min.js.

api

See API.md

4.2.7

4 years ago

4.2.8

4 years ago

4.2.5

5 years ago

4.2.4

5 years ago

4.2.2

5 years ago

4.2.1

6 years ago

4.2.0

6 years ago

4.1.1

6 years ago

4.1.0

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.0

7 years ago

4.0.0-next.19

7 years ago

4.0.0-next.15

7 years ago

4.0.0-next.13

7 years ago

4.0.0-next.9

7 years ago

4.0.0-next.8

7 years ago

4.0.0-next.7

7 years ago

2.0.0

8 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago