gerbv - A Free/Open Source Gerber Viewer

Overview

Gerbv is a viewer for Gerber RS-274X files, Excellon drill files, and CSV pick-and-place files.

Gerbv is a native Linux application, and it runs on many common UNIX platforms. A Windows version is also available.

Gerbv is free / open-source software.

You may download the source code from this page.

The core functionality of gerbv is located in a separate library (libgerbv), allowing developers to include Gerber parsing/editing/exporting/rendering into other programs. Documentation for libgerbv is here.

Gerbv is one of the utilities affiliated with the gEDA project, an umbrella organization dedicated to producing free software tools for electronic design.

The latest official gerbv release is available here.

About Gerber files

Gerber files are typically output by a PCB CAD tool (such as the gEDA Project's PCB), and are sent to a PCB manufacturer who uses the files for manufacturing Printed Circuit Boards (PCBs).

There are two standards defining Gerber files: An old one called RS-274D, and a newer one called RS-274X. Gerber files generated in the old format (RS-274D) lack aperture information, which must be supplied separately. The new standard (RS-274X) embeds aperture information into the file. Note: Gerbv displays RS-274X files! Gerbv will not display RS-274D files! When you create Gerber files using your PCB tool make sure you export RS-274X files if you want to view the files with gerbv.

In the Gerber format, the different layers of a PCB (e.g. top silk, top metal, interior layers, etc.) are held in separate files. Information about the PCB's stackup (i.e. layer order, thickness, etc.) is not captured by Gerber files; it is up to the user to supply this information to gerbv, and to his PCB manufacturer.

Gerbv's featureset

In summary, gerbv supports the following features:

Gerbv runs on Linux and other Unices (Linux native).

An experimental Windows version is available for beta-testing.

Gerbv displays RS-274X files. (It does not display RS-274D files)

display RS-274D files) Gerbv handles aperture macros with up to 10 levels of recursion.

Gerbv supports complex layer operations (e.g. knockout).

Gerbv can display many different drill file formats. In particular, Excellon drill files are supported. Other drill files with similar syntax will also display.

Gerbv displays well-formed pick-and-place files. Pick-place files should contain XYRS (X, Y, Rotation, placement Side) information, and be held in a comma-separated ASCII (.csv) format.

Gerbv will autodetect Gerber, drill, or pick-place file type when reading in the file.

When built using the Cairo rendering engine, gerbv can display Gerber layers in "semi-transparent" mode, making it easy to visualize your board's stack up.

Gerbv provides facilities for analyzing and validating your Gerber file's syntax, code count, aperture usage, etc. This can be useful in situations in which you are having problems in the CAM stage of manufacturing your PC Board (i.e. when your manufacturer is having problems with your files).

When built using Cairo, gerbv allows for limited Gerber editing. (Currently limited to object deletion.)

Panning and zooming (both stepwise and outline) of the image is supported.

Gerbv supports image autoscale — i.e. zoom and pan the image to fit the viewing window.

Multiple files can be loaded simultaneously and be shown "on top of each other".

The number of layers you may load simultaneously is unlimited by gerbv.

The layer order (stackup) may be changed using an intuitive "drag and drop" menu.

You may turn display of individual layers on and off independently using a checkbox.

You may set layer colors independently using a pop up color choice window.

You may change the layer polarity (negative/positive display).

Gerbv incorporates a measurement tool so you can make measurements on the image.

Three different measurement units supported: inch, mm, mil (1/1000 inch). Measurement units are user-selectable

Gerbv can export a layer image to PNG, .ps, .pdf, and .svg, both from within the GUI as well as via a command line switch (cairo version only).

Gerbv performs negative/scratch draws.

Gerbv includes a reload operation, which re-reads all loaded files off disk. This feature is useful when you are manually hacking Gerber files.

Gerbv allows you to save a session into a project file. The project file stores the names of all loaded files, their stackup, color, etc. so so you can easily reload all Gerber files in a project at a later date (e.g. after re-editing then using a PCB layout tool).

Obtaining and installing gerbv

Gerbv is targeted to run on Linux and other UNIX variants. Gerbv is now carried in most of the major Linux distribution's software repositories. Therefore, most people will want to install gerbv using their favorite package tool (such as yum, apt-get, etc.) You can get installation files from the following places:

Build and install instructions

Prerequisites

If you wish to build gerbv from source, your system should have the following libraries:

GTK+, the graphical toolkit.

Cairo, a graphics library. This provides advanced graphics rendering capability, as well as Gerber editing.

Building gerbv by downloading a release

Download source tarballs from here. Expand source by running gzip -dc <filename> | tar xf - Change to newly expanded directory Type ./configure <switches> .

The following (gerbv) switches are available to configure: --help : Lists all configure options.

: Lists all configure options. --enable-debug : Program will output lots of debug spew while running. (default = no -> no debug output by default.)

: Program will output lots of debug spew while running. (default = no -> no debug output by default.) --enable-unit-mm : Set default unit for coordinates in status bar to mm (default = no -> units = inches by default.)

: Set default unit for coordinates in status bar to mm (default = no -> units = inches by default.) --enable-efence : Link with ElectricFence for malloc debugging (default = no -> efence off by default.)

: Link with ElectricFence for malloc debugging (default = no -> efence off by default.) --disable-update-desktop-database : Update desktop icon database after installation (default = no -> desktop icon installed by default.) Type make Type make install . Please note that if you want to install it in a system directory you have to su first. Test by typing gerbv

Building gerbv by downloading from anonymous git repository

Check out the source tree:

git clone git://git.geda-project.org/gerbv.git Recreate all build system files:

sh autogen.sh

Type ./configure <switches> .

The following (gerbv) switches are available to configure: --help : Lists all configure options.

: Lists all configure options. --enable-debug : Program will output lots of debug spew while running. (default = no -> no debug output by default.)

: Program will output lots of debug spew while running. (default = no -> no debug output by default.) --enable-unit-mm : Set default unit for coordinates in status bar to mm (default = no -> units = inches by default.)

: Set default unit for coordinates in status bar to mm (default = no -> units = inches by default.) --enable-efence : Link with ElectricFence for malloc debugging (default = no -> efence off by default.)

: Link with ElectricFence for malloc debugging (default = no -> efence off by default.) --disable-update-desktop-database : Update desktop icon database after installation (default = no -> desktop icon installed by default.) Type make Type make install . Please note that if you want to install it in a system directory you have to su first. Test by typing gerbv Run git pull in the checked out gerbv directory to get the latest changes.

Supported platforms

Linux (2.2/2.4/2.6)

NetBSD/i386 (1.4.1)

NetBSD/Alpha (1.5.1)

Solaris (5.7 and 5.8)

FreeBSD/i386 (6.0 and 7.0)

Information for developers

Gerbv is split into a core functional library and a GUI portion. Developers wishing to incorporate Gerber parsing/editing/exporting/rendering into other programs are welcome to use libgerbv. Complete API documentation for libgerbv is here, as well as many example programs using libgerbv.

Gerbv now uses git for source code control. It is generously provided by geda-project.org. You can get a crash course in geda-projet git from here.

Random resources and information

Gerbv resources

Other Gerber software

gerbvQt uses QPainter from Qt rather than Cairo in libgerbv for vector graphics. The project is incomplete and needs some help.

pcb2gcode takes (contrary to its name) Gerber files and generates G-code used for drilling machines. The cool thing with this is that it uses libgerbv for actual Gerber parsing (Added on 20090819).

gerber2eps generates Encapsulated PostScript from Gerber files.

gerb2tiff generates TIFF's from Gerber files. Also includes a win32 binary for the interested (URL updated 20090819).

Gerber RS-274D/X file viewer in Java. Doesn't seem to work too well. Maybe a start if someone likes to hack Java.

gerber2pdf. A Python script that converts a gerber file 2 pdf. Seems quite advanced.

GBTiler is not actually a viewer, but a panelizer as I understand it. Takes several gerber files and puts them together next to each other. Written in Perl (URL updated 20090819).

GerbMerge is also a panelizer, but written in Python.

To convert an RS274D with an external aperture list to an RS274X Larry Doolittle described a short perl script in an email. Ormund Williams tried to use it, but had to do some slight modifications to make it work for him.

Information about Gerber and Excellon file formats

Submitting a patch or addition to gerbv

We are interested in all ideas and suggestions regarding gerbv. We also reserve us the right to reject them though. Ideas implemented in source code always have a greater chance to make it into the release in a near future.

If you want to implement something for gerbv there is a certain "code standard" we try to maintain. That is described in a text file in the distribution HACKING. Please read it. And check that your code doesn't stand out too much from the rest regarding naming of functions and variables.

When submitting a patch, the developers prefer git patches. The parameter to use to git is:

git format-patch <revision range>

and send us the diff file using Sourceforge's patch tracker.

and send us the diff file using Sourceforge's patch tracker. If you have questions about submitting patches, post them to the geda-dev mailing list.

License

gerbv and all associated files are released under the GNU Public License (GPL) version 2.0.

Programs and associated files are:

Copyright © 2001 — 2011 by Stefan Petersen and the respective original authors who are listed in the source files.

Contact information

Archives