gerbv(1)

๐Ÿ“ฆ
version 2.10.0 ยท 3 versions
, in debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ‘‘ gerbv โ€” Gerber Viewer ๐Ÿ’…

okay bestie, welcome to the gerbv(1) page, aka the General Commands Manual moment for the Gerber Viewer. yes it's a real manual page, yes it's long, and yes we're doing the whole thing. grab a snack ๐Ÿ“


โœจ NAME โœจ

gerbv โ€” Gerber Viewer. that's it, that's the name, she's iconic ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

gerbv [OPTIONS] [gerberfile[s]]

like. you give her options, you give her files, she renders. simple as that ๐Ÿ’–


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so gerbv is a viewer for RS274-X files, which everyone just calls Gerber files because who has time. these RS274-X files get generated by all the different PCB CAD programs out there, and they're what gets used in the actual printed circuit board manufacturing process. so like, they matter fr fr.

and she doesn't stop there โ€” gerbv also supports Excellon/NC drill files as well as XY (centroid) files produced by the program PCB (that's http://pcb.geda-project.org/). multi-talented. ate. ๐Ÿ’…


๐Ÿ’– OPTIONS ๐Ÿ’–

โš ๏ธ Warning! On some platforms, which hasn't long option available, only short options are available. so like, if your platform is being difficult, the long options might just not exist. keep that in mind bestie ๐Ÿซถ

๐ŸŒˆ gerbv General options:

  • -V, --version โ€” prints the version number of gerbv and then exits. quick little flex โœจ
  • -h, --help โ€” prints a brief usage guide and exits. the classic "help me" move ๐Ÿ™ˆ
  • -b<hex>, --background=<hex> โ€” sets the background color to <hex>. <hex> is written as an html-color code, like #FF0000 for Red. ๐ŸŽจ
  • -f<hex>, --foreground=<hex> โ€” sets the foreground color to <hex>, also an html-color code, like #00FF00 for Green. and listen, if you also want to set the alpha (that's when you're rendering with Cairo), you can write it as an #RRGGBBAA code. use multiple -f flags to set the color for multiple layers. one per layer, queen ๐Ÿ’…
  • -l <filename>, --log=<filename> โ€” all error messages etc are stored in a file with filename <filename>. receipts, basically ๐Ÿงพ
  • -t <filename>, --tools=<filename> โ€” reads Excellon tools from the file <filename>.
  • -p <project filename>, --project=<project filename> โ€” loads a stored project. please note that the project file must be stored in the same directory as the Gerber files. she's picky like that ๐Ÿ˜ญ

๐ŸŽ€ gerbv Export-specific options:

the following commands can be used in combination with the -x flag. so like, -x is the main character and these are her supporting cast ๐Ÿ’…

  • -B<b>, --border=<b> โ€” sets the border around the image to <b> percent of the width and height. default <b> is 5%. ๐Ÿ–ผ๏ธ
  • -D<XxY>or<R>, --dpi=<XxY>or<R> โ€” resolution (Dots per inch) for the output bitmap. use <XxY> when you want different resolutions for the width and the height (only when compiled with Cairo as render engine). use <R> when you want the same resolution in both directions. defaults to 72 DPI in both directions. ๐Ÿ”
  • -T<XxYrR|X;YrR>, --translate=<XxYrR|X;YrR> โ€” translate the image by X and Y, and rotate by R degree. use multiple -T flags to translate multiple files. the distance defaults to inches but may be changed with --units. only evaluated when exporting as RS274X or drill. โœจ
  • -O<XxY|X;Y>, --origin=<XxY|X;Y> โ€” sets the lower left corner of the exported image to coordinate <XxY>. coordinates default to inches but may be changed with --units.
  • -a, --antialias โ€” use antialiasing for the generated output-bitmap. smooth edges, slay โœจ
  • -o <filename>, --output=<filename> โ€” export to <filename>.
  • -u<inch/mm/mil>, --units=<inch/mm/mil> โ€” use the given unit for coordinates. defaults to inches.
  • -W<WxH>, --window_inch=<WxH> โ€” window size in inches <WxH> for the exported image.
  • -w<WxH>, --window=WxH> โ€” window size in pixels <WxH> for the exported image. autoscales to fit if no resolution is specified (note that the default 72 DPI also changes in that case). if a resolution is specified, it will clip the image to this size. ๐ŸชŸ
  • -x<png/pdf/ps/svg/rs274x/drill>, --export=<png/pdf/ps/svg/rs274x/drill> โ€” export to a file and set the format for the output file.

๐Ÿ’œ GTK Options

  • --gtk-module=MODULE โ€” load an additional GTK module
  • --g-fatal-warnings โ€” make all warnings fatal
  • --gtk-debug=FLAGS โ€” GTK debugging flags to set
  • --gtk-no-debug=FLAGS โ€” GTK debugging flags to unset
  • --gdk-debug=FLAGS โ€” GDK debugging flags to set
  • --gdk-no-debug=FLAGS โ€” GDK debugging flags to unset
  • --display=DISPLAY โ€” X display to use
  • --sync โ€” make X call synchronous
  • --no-xshm โ€” don't use X shared memory extension
  • --name=NAME โ€” program name as used by the window manager
  • --class=CLASS โ€” program class as used by the window manager

๐ŸŒŸ GENERAL ๐ŸŒŸ

when you start gerbv you can give her the files to be loaded right there on the command line, either as each file separated with a space, or by using wildcards. easy ๐Ÿ’…

the user interface is graphical. simply press and drag the middle mouse button (that's the scroll wheel, bestie) and the image will pan as you move the mouse. to manipulate a layer, right-click on one of the rightmost list items. that brings up a pop-up menu where you can select what you want to do with that layer โ€” reload file, change color, etc. you get the vibe โœจ

and if you hold the mouse button over one of the rightmost buttons, a tooltip will show you the name of the file loaded on that layer. cute little peek ๐Ÿ‘€


๐Ÿฆ‹ ACTIVATION AND DEACTIVATION OF LAYERS ๐Ÿฆ‹

you can load several files at one time, no big deal. then you can turn the displaying of the layers on and off by clicking on one of the check boxes near the layer names. toggling, iconic ๐Ÿ’…

you can also control this from the keyboard. press Ctrl, enter the number of the layer you want to activate/deactivate on the numerical keypad, and then release the Ctrl key. keyboard shortcuts are the moment โŒจ๏ธ


๐Ÿงš ALIGNING OF LAYERS ๐Ÿงš

you can align two layers by selected elements. select one element on each of two layers and click Align layers from the context menu. match made in heaven fr fr ๐Ÿซถ


๐Ÿ” ZOOMING ๐Ÿ”

zooming can be handled by either menu choices, keypressing, or mouse scroll wheel. here's the tea:

  • press z and you will zoom in
  • press Shift+z (i.e. Z) and you will zoom out
  • scroll wheel works if you enabled that in your X server and mapped it to button 4 and 5
  • you can make the image fit by pressing f (there's also a menu alternative for this, don't worry)
  • if Pan, Zoom, or Measure Tool is selected you can press the right mouse button for zoom in, and if you press Shift and the right mouse button you will zoom out

you can also do zooming by outline. select Zoom Tool, press mouse button, draw, release. the dashed line shows how the zooming will be dependent on the resolution of the window. the non-dashed outline will show what you actually selected. and if you change your mind when you've started to mark the outline, you can always abort by pressing escape. no take-backsies needed, just escape ๐Ÿ˜Œ

and ooh โ€” by holding down the Shift key when you press the mouse button, you will select an area where the point you started at will be the center of your selection. main character positioning ๐Ÿ’…


๐Ÿ“ MEASUREMENTS ๐Ÿ“

you can do measurements on the image displayed. select Measure Tool and the cursor changes to a plus. by using the left mouse button you can draw the lines that you want to measure. the result of the last measurement is also displayed on the statusbar. all measurements stay in the drawing until you select another Tool. and to measure the distance between elements, select two of them and switch to Measure Tool. math girlie era ๐Ÿงฎ

the statusbar shows the current mouse position on the layer in the same coordinates as in the file. i.e. if you have (0,0) in the middle of the image in the Gerber files, the statusbar will show (0,0) at the same place. consistent, we love that ๐Ÿซถ


๐ŸŒˆ SUPERIMPOSING ๐ŸŒˆ

when you load several Gerber files, you can display them "on top of each other", i.e. superimposing. the general way to display them is that upper layers cover the layers beneath, which is called copy (GTK+ terms). stacking, but make it circuit boards โœจ

the other ways selectable are and, or, xor and invert. they map directly to corresponding functions in GTK. and in GTK they are described as: "For colored images, only GDK_COPY, GDK_XOR and GDK_INVERT are generally useful. For bitmaps, GDK_AND and GDK_OR are also useful." no cap ๐Ÿ’ฏ


๐Ÿ’– PROJECTS ๐Ÿ’–

gerbv can also handle projects. a project consists of a bunch of loaded layers with their respective color and the background color. the easiest way to create a project is to load all the files you want into the layer you want, set all the colors etc, and do a "Save Project As...". easy peasy ๐ŸŒธ

you load a project either from the menu bar or by using the commandline switches -p or --project.

โš ๏ธ currently there is a limit in that the project file must be in the same directory as the Gerber files to be loaded. yeah, she's particular about it ๐Ÿ˜ญ

๐Ÿงš SCHEME ๐Ÿงš

the project files are simple Scheme programs that are interpreted by a built in Scheme interpreter. the Scheme interpreter is TinyScheme and it needs a Scheme program called init.scm to initialize itself.

the search path for init.scm is, in the following order:

  1. /usr/share/gerbv/scheme
  2. the directory with the executable gerbv
  3. the directory gerbv was invoked from
  4. finally, according to the environment variable GERBV_SCHEMEINIT

she's thorough like that ๐Ÿ’…


๐Ÿ”ง TOOLS FILE ๐Ÿ”ง

not every Excellon drill file is self-sufficient, bestie. some CADs produce .drd files where tools are only referenced, but never defined (like, what diameter of the tool is??). Eagle CAD is one of such CADs, and there are more since many board houses require Tools files. ๐Ÿ™ˆ

a Tools file is a plain text file which you create in an editor. each line of the file describes one tool (the name and the diameter, in inches):

     T01 0.024
     T02 0.040
     ...

these are the same tools (T01 etc.) that are used in the Drill file. a standard practice with Eagle is to create an empty Tools file, run the CAM processor, and the error report tells you which tools you "forgot". then you put these tools into the file and rerun the CAM processor. the plot twist โœจ

you load a tool file by using the commandline switches -t or --tools. the file can have any name you wish, but Eagle expects the file type to be .drl, so it makes sense to keep it this way. some board houses are still using CAM software from the DOS era, so you may want to exercise caution before going beyond the 8.3 naming convention. ancient tech fr ๐Ÿ˜ญ

when gerbv reads the Tools file it also checks that there are no duplicate definitions of tools. this does happen from time to time as you edit the file by hand, especially if you, during design, add or remove parts from the board and then have to add new tools into the Tools file.

๐Ÿ’€ the duplicate tools are a very serious error which will stop (HOLD) your board until you fix the Tools file and maybe the Excellon file. gerbv will detect duplicate tools if they are present, and will exit immediately to indicate such a fatal error in a very obvious way. a message will also be printed to standard error.

if your Excellon file does not contain tool definitions then gerbv will preconfigure the tools by deriving the diameter of the drill bit from the tool number. this is probably not what you want, and you will see warnings printed on the console. consider yourself warned, bestie ๐Ÿซถ


๐Ÿ“ PICK&PLACE FILE ๐Ÿ“

supported comma separated file (CSV) with fixed order of data:

     # X,Y in mils.
     Designator,"Description","Value",X,Y,"Rotation (deg)",top/bottom

     or

     Designator,"Footprint","Mid X","Mid Y","Ref X","Ref Y",
               "Pad X","Pad Y",T/B,"Rotation","Comment"

units can be specified in the format # X,Y in mils. or as a suffix for X/Y-coordinates, i.e. ,10mil,. supported units: in, mil, cmil, dmil, km, m, dm, cm, mm, um, nm. so many units, we're spoiled honestly โœจ


๐ŸŒฟ ENVIRONMENT ๐ŸŒฟ

  • GERBV_SCHEMEINIT โ€” defines where the init.scm file is stored. used by the scheme interpreter, which is used by the project reader. ๐Ÿงš

โœจ AUTHOR โœจ

okay so this whole thing was literally built by some absolute legends and we're gonna give them their flowers fr fr ๐Ÿ’

  • Stefan Petersen (spetm at users.sourceforge.net) โ€” overall hacker and project leader ๐Ÿ‘‘ the main character, honestly. the whole vibe is his.
  • Andreas Andersson (e92_aan at e.kth.se) โ€” drill file support and general hacking ๐Ÿ”ฅ he's the reason your drill files don't just sit there being sad.
  • Anders Eriksson (aenfaldor at users.sourceforge.net) โ€” X and GTK+ ideas and hacking ๐ŸŽ€ the aesthetic department, the window-dressing genius, the one making the GUI not look like a potato.

like, three dudes, one gerber viewer, and a dream. iconic behaviour, no notes. ๐Ÿ’…


Copyright ยฉ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Stefan Petersen

bestie, this document can be freely redistributed according to the terms of the GNU General Public License version 2.0. so yeah โ€” share it, spread it, be free with it, that's the whole point. ๐Ÿฆ‹

just a lil reminder to respect the license terms, mwah ๐Ÿ’‹

and that's the whole page, bestie โ€” you made it to the end, which is giving dedication ๐Ÿซถ

this lil masterpiece comes from gerbv, and the page itself is dated Jule 13, 2013 (yes that's how it's spelled, we don't question the vibes ๐ŸŒธ). go look at some gerber files, you earned it. ๐Ÿ’œ