<P>GerbMerge is written in pure <AHREF="http://www.python.org">Python</A>. It
depends upon the following packages for operation:
<UL>
<LI><AHREF="http://www.python.org">Python</A> version 2.4 or later</LI>
<LI><AHREF="http://simpleparse.sourceforge.net">SimpleParse</A> version 2.1.0 or later</LI>
</UL>
<P>All of the above packages come with easy installation programs for both Windows, Mac OS X,
and Linux.
<P><ANAME="Installation"></A></P>
<H2>Installation</H2>
<P>First, install all of the packages listed above in the Requirements section.
<H3>Windows</H3>
<P>Run the <TT>gerbmerge1.8.exe</TT> installation program. I will assume
you choose all of the default installation options. The installer
will create and populate the following directories:</P>
<UL>
<PRE>
c:\Python24\lib\site-packages\gerbmerge
c:\Python24\gerbmerge
</PRE>
</UL>
<P>The above assumes you have Python installed in <TT>C:\Python24</TT>. The
first directory is where the actual program resides. The second directory
contains the documentation, example files, etc. In the <TT>C:\Python24</TT>
directory is a sample batch file <TT>GERBMERGE.BAT</TT> which shows you how to
run the GerbMerge program.
<H3>Unix / Mac OS X</H3>
<P>Extract the <TT>gerbmerge1.8.tar.gz</TT> file then install as follows:</P>
<UL>
<TT>python setup.py install</TT> (You may need to be root to install to system directories)
</UL>
<P>The installer will create and populate the following directories/files:</P>
<UL>
<PRE>
/usr/local/lib/python2.4/site-packages/gerbmerge
/usr/local/lib/python2.4/gerbmerge
/usr/local/bin/gerbmerge
</PRE>
</UL>
<P>The above assumes your Python library directory is as indicated (it may be
elsewhere but the installer should be able to find it, so don't worry about
it). The first directory is where the actual program resides. The second
directory contains the documentation, example files, etc. A sample program for
invoking GerbMerge is installed as <TT>/usr/local/bin/gerbmerge</TT>...feel free to move
it somewhere else.
<P>Not all Linux distributions are the same, however. If you have trouble, there is a useful set of instructions from <AHREF="http://blog.bhargavaz.us/2009/05/installing-gerbmerge-on-ubuntu-linux.html">Chetan Bhargava</A> for installing GerbMerge on Ubuntu distributions.
<P><ANAME="Running"></A></P>
<H2>Running GerbMerge</H2>
<H3>Windows</H3>
<P>Open a DOS box and invoke the Python interpreter on the <TT>gerbmerge.py</TT> file.
Have a look at GERBMERGE.BAT (and put this on your Path somewhere) for an example.
<DD><P>For Windows, <AHREF="http://www.graphicode.com">GC-Prevue</A> is a good program
that I have used often. It is a free program. GraphiCode makes lots of other, more
powerful Gerber manipulation and viewing programs but they are quite pricey ($495 and up).</DD>
<DT><B>ViewMate</B></DT>
<DD><P>Another free Windows program, <AHREF="http://www.pentalogix.com">ViewMate</A> is similar
to GC-Prevue. I have not used ViewMate much, but that is mostly due to familiarity with
GC-Prevue. The two programs are comparable, although I'm sure that someone who is much
more familiar with both could point out some differences.</DD>
</DL>
<P><ANAME="Limitations"></A></P>
<H2>Limitations</H2>
<UL>
<LI>This program has mainly been tested with output from the Eagle CAD program.
Limited testing has been performed with Orcad, Protel, and PCB.
Other CAD programs will NOT WORK with a very high probability, as the input
parser is quite primitive.
<P>If you have the need/motivation to adapt GerbMerge to other CAD programs,
have a look at the <TT>gerber2pdf</TT> program. It is written in Python and
implements a much more complete RS274-X input file parser. Combining GerbMerge
with <TT>gerber2pdf</TT> should be a fairly simple exercise. Also, feel free to
send us samples of Gerber/Excellon output of your CAD tool and we'll see if we can
add support for it.
<LI><P>This program handles apertures that are rectangles, ovals, circles, macros
without parameters or operators, and Eagle octagons (which are defined using a macro with a single parameter, hence currently handled as a special case).
<LI><P>The panelizing capabilities of this program do not allow for arbitrary
placement of jobs, although there is a fair amount of flexibility.
<LI><P>All jobs are assumed to be rectangular in shape. Non-rectangular jobs
can be handled but will lead to wasted space in the final panel.
<LI><P>A maximum of 26 different drill sizes is supported for generating a
fabrication drawing.</LI>
</UL>
<P><ANAME="ProgramOptions"></A></P>
<H2>Program Options</H2>
<DL>
<DT>--octagons=normal</DT>
<DT>--octagons=rotate</DT>
<DD>The <TT>--octagons</TT> option affects how the octagon aperture is defined in the output files. The parameter
to this option must either be <TT>rotate</TT> or <TT>normal</TT>. Normally,
octagons begin at an angle of 22.5 degrees, but some Gerber viewers have a problem
with that (notably CircuitMaker from LPKF). These programs expect octagons to begin
at 0.0 degrees.
<P>The <TT>--octagons=normal</TT> option is the default (22.5 degrees) and need not
be specified. A rotation of 0.0 degrees can be achieved by specifying <TT>--octagons=rotate</TT>.</DD>
<P><DT>--random-search</DT>
<DD>This option is the default when only a configuration file is specified (see the documentation on <AHREF="autosearch.html">Automatic Placement</A> for more information). It indicates that a randomized search of possible job tilings is
to be performed. This option does not make sense when a layout file is specified.</DD>
<P><DT>--full-search</DT>
<DD>This option may be specified to indicate that all possible job tilings are to be searched (see the documentation on <AHREF="autosearch.html">Automatic Placement</A> for more information). This option does not make sense when a layout file
is specified.</DD>
<P><DT>--rs-fsjobs=N</DT>
<DD>This option is used with randomized search to indicate how many jobs are to undergo full search for each tiling. See the documentation on <AHREF="autosearch.html">Automatic Placement</A> for more information.</DD>
<P><DT>--place-file=filename</DT>
<DD>This option performs a panel layout based upon absolute job positions in
the given text file, rather than by random/full search or by a layout file.
The placement file created by GerbMerge can be used as an input file to
this option in order to recreate a previous layout.</DD>
<P><DT>--no-trim-gerber</DT>
<DD>This option prevents GerbMerge from trying to trim all Gerber data to lie within the
extents of a given job's board outline. Normally, GerbMerge will try to do so to prevent
one job's Gerber data (most notably, silkscreen lines for connectors that protrude from
the board) from interfering with a neighboring job on the final panel. Specify this
command-line option if you do not want this trimming to occur.</DD>
<P><DT>--no-trim-excellon</DT>
<DD>This option prevents GerbMerge from trying to trim all Excellon data to lie within the
extents of a given job's board outline. Normally, GerbMerge will try to do so to prevent
one job's drill holes from landing in the middle of a neighboring job on the final panel. Specify
this command-line option if you do not want this trimming to occur.</DD>
<P><DT>--search-timeout=seconds</DT>
<DD>When random placements are used, this option can be used to automatically terminate the
search process after the specified number of seconds. If the number of seconds is 0 or this
option is not specified, then random placements are tried forever, until Ctrl-C is pressed
to stop the process and keep the best placement so far.</DD>
<P><DT>-h, --help</DT>
<DD>The '<TT>-h</TT>' or '<TT>--help</TT>' option prints a brief summary of available options.
<P><DT>-v, --version</DT>
<DD>The '<TT>-v</TT>' or '<TT>--version</TT>' option prints the current program version and author contact information.</DD>