1gerbv(1) 2.5.0 gerbv(1)
2
3
4
6 gerbv - Gerber Viewer
7
9 gerbv [OPTIONS] [gerberfile[s]]
10
12 gerbv is a viewer for RS274-X, commonly known as Gerber, files.
13 RS274-X files are generated from different PCB CAD programs and are
14 used in the printed circuit board manufacturing process. gerbv also
15 supports Excellon/NC drill files as well as XY (centroid) files pro‐
16 duced by the program PCB (http://pcb.sf.net).
17
18
20 Warning! On some platforms, which hasn't long option available, only
21 short options are available.
22
23
24 gerbv General options:
25 -V|--version Print the version number of gerbv and exit.
26
27 -h|--help
28 Print a brief usage guide and exit.
29
30 -b<hex>|--background=<hex>
31 Use background color <hex>. <hex> is specified as an html-color
32 code, e.g. #FF0000 for Red.
33
34 -f<hex>|--foreground=<hex>
35 Use foreground color <hex>. <hex> is specified as an html-color
36 code, e.g. #00FF00 for Green. If a user also wants to set the
37 alpha (rendering with Cairo) it can be specified as an #RRGGBBAA
38 code. Use multiple -f flags to set the color for multiple lay‐
39 ers.
40
41 -l <filename>|--log=<filename>
42 All error messages etc are stored in a file with filename <file‐
43 name>.
44
45 -t <filename>|--tools=<filename>
46 Read Excellon tools from the file <filename>.
47
48 -p <project filename>|--project=<project filename>
49 Load a stored project. Please note that the project file must be
50 stored in the same directory as the gerber files.
51
52
53 gerbv Export-specific options:
54 The following commands can be used in combination with the -x flag:
55 -B<b>|--Border=<b> Set the border around the image <b> percent of the
56 width and height. Default <b> is 5%%.
57
58 -D<XxY>or<R>|--dpi=<XxY>or<R>
59 Resolution (Dots per inch) for the output bitmap. Use <XxY> for
60 different resolutions for the width and height (only when com‐
61 piled with Cairo as render engine). Use <R> to have the same
62 resolution in both directions. Defaults to 72 DPI in both
63 directions.
64
65 -T<X,Y>|--translate=<X,Y>
66 Translate the image by the distance <X,Y>. Use multiple -T flags
67 to translate multiple files.
68
69 -O<XxY>|--origin=<XxY>
70 Set the lower left corner of the exported image to coordinate
71 <XxY>. Coordinates are in inches.
72
73 -a|--antialias
74 Use antialiasing for the generated output-bitmap.
75
76 -o <filename>|--output=<filename>
77 Export to <filename>.
78
79 -W<WxH>|--window_inch=<WxH>
80 Window size in inches <WxH> for the exported image.
81
82 -w<WxH>|--window=WxH>
83 Window size in pixels <WxH> for the exported image. Autoscales
84 to fit if no resolution is specified (note that the default 72
85 DPI also changes in that case). If a resolution is specified, it
86 will clip the image to this size.
87
88 -x<png/pdf/ps/svg/rs274x/drill>|--export=<png/pdf/ps/svg/rs274x/drill>
89 Export to a file and set the format for the output file.
90
91
92 GTK Options
93 --gtk-module=MODULE Load an additional GTK module
94
95 --g-fatal-warnings
96 Make all warnings fatal
97
98 --gtk-debug=FLAGS
99 GTK debugging flags to set
100
101 --gtk-no-debug=FLAGS
102 GTK debugging flags to unset
103
104 --gdk-debug=FLAGS
105 GDK debugging flags to set
106
107 --gdk-no-debug=FLAGS
108 GDK debugging flags to unset
109
110 --display=DISPLAY
111 X display to use
112
113 --sync Make X call synchronous
114
115 --no-xshm
116 Don't use X shared memory extension
117
118 --name=NAME
119 Program name as used by the window manager
120
121 --class=CLASS
122 Program class as used by the window manager
123
124
126 When you start gerbv you can give the files to be loaded on the command
127 line, either as each file separated with a space or by using wildcards.
128
129 The user interface is graphical. Simply press left mouse button and the
130 image will pan as you move the mouse. To manipulate a layer, right-
131 click on one of the rightmost buttons. That will bring up a pop-up menu
132 where you can select what you want to do with that layer (load file,
133 change color, etc).
134
135 If you hold the mouse button over one the rightmost button a tooltips
136 will show you the name of the file loaded on that layer.
137
138
139
141 You can load several files at one time. You can then turn displaying of
142 the layers on and off by clicking on one of the rightmost buttons.
143
144 You can also control this from the keyboard. Press Alt, enter the num‐
145 ber on the layer you want activate/deactivate on the numerical keypad
146 and then release the Alt key.
147
148
150 Zooming can be handled by either menu choices, keypressing, middle
151 mouse button or scroll wheel. If you press Alt+I you will zoom in and
152 if you press Alt+O you will zoom out. If you press middle mouse button
153 you will zoom out, and if you press Shift and middle mouse button you
154 will zoom in. Scroll wheel works if you enabled that in your X server
155 and mapped it to button 4 and 5. You can also zoom in by pressing z and
156 zoom out by pressing shift+z (ie Z). You can make the image fit by
157 pressing f (there is also a menu alternative for this).
158
159 You can also do zooming by outline. Press right mouse button, draw,
160 release. The dashed line shows how the zooming will be dependent on
161 the resolution of the window. The non-dashed outline will show what you
162 actually selected. If you change your mind when started to mark out‐
163 line, you can always abort by pressing escape. By holding down the
164 shift key when you press the right mouse button, you will select an
165 area where the point you started at will be the center of your selec‐
166 tion.
167
168
170 You can do measurement on the image displayed. By pressing shift, the
171 cursor changes to a plus. By using left mouse button you can draw the
172 lines that you want to measure. The result of the last measurement is
173 also displayed on the statusbar. All measurements are in the drawing
174 until you either zoom, pan or press the escape key.
175
176 The statusbar shows the current mouse position on the layer in the same
177 coordinates as in the file. Ie if you have (0,0) in the middle of the
178 image in the gerber files, the statusbar will show (0,0) at the same
179 place.
180
181
183 When you load several Gerber files, you can display them "on top of
184 each other", ie superimposing. The general way to display them are that
185 upper layers cover the layers beneath, which is called copy (GTK+
186 terms).
187
188 The other ways selectable are and, or, xor and invert. They map
189 directly to corresponding functions in GTK. In GTK they are described
190 as: "For colored images, only GDK_COPY, GDK_XOR and GDK_INVERT are gen‐
191 erally useful. For bitmaps, GDK_AND and GDK_OR are also useful."
192
193
195 gerbv can also handle projects. A project consist of bunch of loaded
196 layers with their resp. color and the background color. The easiest way
197 to create a project is to load all files you want into the layer you
198 want, set all the colors etc and do a "Save Project As...".
199
200 You load a project either from the menu bar or by using the commandline
201 switches -p or --project.
202
203 Currently there is a limit in that the project file must be in the same
204 directory as the gerber files to be loaded.
205
206
208 The project files are simple Scheme programs that is interpreted by a
209 built in Scheme interpreter. The Scheme interpreter is TinyScheme and
210 needs a Scheme program called init.scm to initialize itself. The search
211 path for init.scm is (in the following order) /usr/share/gerbv/scheme,
212 the directory with the executable gerbv, the directory gerbv was
213 invoked from and finally according to the environment variable
214 GERBV_SCHEMEINIT.
215
216
218 Not every Excellon drill file is self-sufficient. Some CADs produce
219 .drd files where tools are only referenced, but never defined (such as
220 what diameter of the tool is.) Eagle CAD is one of such CADs, and there
221 are more since many board houses require Tools files.
222
223 A Tools file is a plain text file which you create in an editor. Each
224 line of the file describes one tool (the name and the diameter, in
225 inches):
226
227 T01 0.024
228 T02 0.040
229 ...
230
231 These are the same tools (T01 etc.) that are used in the Drill file. A
232 standard practice with Eagle is to create an empty Tools file, run the
233 CAM processor, and the error report tells you which tools you "forgot".
234 Then you put these tools into the file and rerun the CAM processor.
235
236 You load a tool file by using the commandline switches -t or --tools.
237 The file can have any name you wish, but Eagle expects the file type to
238 be ".drl", so it makes sense to keep it this way. Some board houses are
239 still using CAM software from DOS era, so you may want to excercise
240 caution before going beyond the 8.3 naming convention.
241
242 When gerbv reads the Tools file it also checks that there are no dupli‐
243 cate definitions of tools. This does happen from time to time as you
244 edit the file by hand, especially if you, during design, add or remove
245 parts from the board and then have to add new tools into the Tools
246 file. The duplicate tools are a very serious error which will stop
247 (HOLD) your board until you fix the Tools file and maybe the Excellon
248 file. gerbv will detect duplicate tools if they are present, and will
249 exit immediately to indicate such a fatal error in a very obvious way.
250 A message will also be printed to standard error.
251
252 If your Excellon file does not contain tool definitions then gerbv will
253 preconfigure the tools by deriving the diameter of the drill bit from
254 the tool number. This is probably not what you want, and you will see
255 warnings printed on the console.
256
257
259 GERBV_SCHEMEINIT
260 Defines where the init.scm file is stored. Used by scheme inter‐
261 preter, which is used by the project reader.
262
263
265 Stefan Petersen (spetm at users.sourceforge.net): Overall hacker and project leader
266 Andreas Andersson (e92_aan at e.kth.se): Drill file support and general hacking
267 Anders Eriksson (aenfaldor at users.sourceforge.net) : X and GTK+ ideas and hacking
268
269
271 Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Stefan Petersen
272
273 This document can be freely redistributed according to the terms of the
274 GNU General Public License version 2.0
275
276
277
278Version January 11, 2008 gerbv(1)