Command-line tool for isolation, routing and drilling of PCBs
Clone or download
Latest commit 9af2eac Oct 22, 2018
Permalink
Failed to load latest commit information.
.github Add issue template Jul 31, 2018
extras Make the cut-infeed more realistic in the gerbv examples Oct 16, 2018
m4 Add a comment about boost 1.67+ Aug 3, 2018
man Set vectorial to be true by default (#132) Jun 12, 2018
testing Don't optimize bits for milldrill Oct 19, 2018
.gitignore add error counts to test outputs Aug 20, 2018
.travis.yml pin to a different version Sep 25, 2018
AUTHORS Clean build files Sep 28, 2016
COPYING Fix #5 Nov 10, 2014
Fixed.hpp Reduce Boost dependencies Jun 9, 2016
INSTALL WIP - vectorial core Jun 3, 2016
Makefile.am WIP, got svg to pixmap working somewhat Aug 20, 2018
README.md Update README.md Oct 18, 2018
autoleveller.cpp use ceil instead of round for autolevelling probe distances Aug 4, 2018
autoleveller.hpp Convert all options into Unit options (#119) Mar 26, 2018
available_drills.hpp Add drill tolerances support (#158) Jun 10, 2018
available_drills_tests.cpp Add drill tolerances support (#158) Jun 10, 2018
bg_helpers.hpp process all masked milling polys Jul 27, 2018
board.cpp climb/conventional code compiles Aug 4, 2018
board.hpp climb/conventional code compiles Aug 4, 2018
common.cpp Convert all options into Unit options (#119) Mar 26, 2018
common.hpp Convert all options into Unit options (#119) Mar 26, 2018
configure.ac Allow librsvg >= 2.0 Sep 26, 2018
core.cpp WIP - vectorial core Jun 4, 2016
core.hpp Clean mirror_absolute Oct 31, 2016
drill.cpp Don't optimize bits for milldrill Oct 19, 2018
drill.hpp WIP: Add millfeed direction to drill.hpp Aug 5, 2018
eulerian_paths.hpp save up linear circular paths and do them all at the end Aug 19, 2018
eulerian_paths_tests.cpp accidentally broke eulerian_paths_tests Aug 19, 2018
exporter.hpp Reduce Boost dependencies Jun 9, 2016
geometry.hpp Change the width and height but not the viewbox parameters. Sep 26, 2018
gerberimporter.cpp cairo normal by default and only use high quality for unit tests beca… Sep 13, 2018
gerberimporter.hpp cairo normal by default and only use high quality for unit tests beca… Sep 13, 2018
gerberimporter_tests.cpp cairo normal by default and only use high quality for unit tests beca… Sep 13, 2018
importer.hpp cairo normal by default and only use high quality for unit tests beca… Sep 13, 2018
integration_tests.py Add milldrilldiatest to integration testing Oct 19, 2018
layer.cpp Clean mirror_absolute Oct 31, 2016
layer.hpp Only mirror absolute (#110) Mar 27, 2018
main.cpp Add flag to ignore warnings from pcb2gcode and continue processing Sep 26, 2018
mill.hpp Preserve thermal reliefs by default when voronoi is true Jun 10, 2018
millproject_example Remove executable bit from millproject_example Jul 4, 2016
ngc_exporter.cpp Add flag to ignore warnings from pcb2gcode and continue processing Sep 26, 2018
ngc_exporter.hpp WIP to repair the offsets in autolevelling Aug 1, 2018
options.cpp Can't maybe_exit until the parse is done Sep 27, 2018
options.hpp Add flag to ignore warnings from pcb2gcode and continue processing Sep 26, 2018
options.svg Add options.svg Sep 27, 2016
outline_bridges.cpp Reduce Boost dependencies Jun 9, 2016
outline_bridges.hpp Reduce Boost dependencies Jun 9, 2016
segmentize.hpp Refactor segmentize into one function with optional param Aug 8, 2018
segmentize_tests.cpp Refactor segmentize into one function with optional param Aug 8, 2018
surface.cpp Only mirror absolute (#110) Mar 27, 2018
surface.hpp Tsp 2opt (#74) Mar 8, 2018
surface_vectorial.cpp Change the width and height but not the viewbox parameters. Sep 26, 2018
surface_vectorial.hpp Change the width and height but not the viewbox parameters. Sep 26, 2018
tile.cpp custom autoleveller fixed and integration test added Aug 3, 2018
tile.hpp Remove initial_OffsetVar, which is unused Aug 3, 2018
tsp_solver.hpp startingPoint is already optional, no need to make_optional there Aug 6, 2018
tsp_solver_tests.cpp Don't reverse in nearest neighbor but use optional endpoints in tsp_2… Aug 5, 2018
unique_codes.hpp Cleaned O codes and global varibale defines Nov 16, 2015
units.hpp specify isinf is std::isinf Aug 10, 2018
units_tests.cpp Add unit test for parsing MillFeedDirection Aug 7, 2018
voronoi.cpp Pass in the millfeed direction to attach_polygons Aug 5, 2018
voronoi.hpp Add int64_t specialization of coordinate_traits Feb 3, 2018
voronoi_tests.cpp New build_voronoi (#81) Jan 7, 2018
voronoi_visual_utils.hpp Add TSP solver in surface_vectorial Jun 4, 2016

README.md

pcb2gcode Build Status Coverage Status Donate

pcb2gcode is a command-line software for the isolation, routing and drilling of PCBs. It takes Gerber files as input and it outputs gcode files, suitable for the milling of PCBs. It also includes an Autoleveller, useful for the automatic dynamic calibration of the milling depth.

pcb2gcodeGUI, the official GUI for pcb2gcode, is available here.

If you find this project useful, consider buying me a beer.

Quick Installation

This development version of pcb2gcode does not get into repositories of distros. If you want to test this version, you will have to go to the section below (installation from GIT).

Archlinux:

Fedora:

  • Download the latest tarball from https://github.com/pcb2gcode/pcb2gcode/releases

  • Open a terminal and cd to the extracted tarball

  • type the following:

    su
    <the root password>
    yum groupinstall "Development Tools"
    yum install automake autoconf libtool boost-devel gtkmm24-devel gerbv-devel
    exit
    ./configure
    make
    su -c 'make install'
    
  • done.

Debian, Ubuntu:

There are pcb2gcode packages in the official repositories. You can install the with

sudo apt-get install pcb2gcode

Unfortunately, these packages are seriously outdated. If you want to download the latest development version, go to "Installation from GIT".

Windows

Windows prebuilt binaries (with all the required DLLs) are available in the release page.

Mac OS X

pcb2gcode is available in Homebrew. To install it open the "Terminal" app and run the following commands; pcb2gcode and the required dependencies will be automatically downloaded and installed:

 $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 $ brew install pcb2gcode

Installation from GIT (latest development version):

If you want to install the latest version from git you'll need the autotools, Boost with the program_options library (dev, >= 1.56), gtkmm2.4 (dev) and libgerbv (dev).

Unfortunately pcb2gcode requires a rather new version of Boost (1.56), often not included in the oldest distros (like Ubuntu < 15.10 or Debian Stable). Moreover Boost 1.56 sometimes freezes pcb2gcode, while Boost 1.59, 1.60 and 1.61 are affected by a program options bug. You can download a working version of Boost (1.57 and 1.58 work well) and build it manually with:

$ ./bootstrap.sh --with-libraries=program_options --prefix=<somewhere>
$ ./b2 variant=release link=static
$ ./b2 install

Then add --with-boost=<boost install directory> --enable-static-boost to the ./configure command.

To build with coverage outputs, add --enable-code-coverage to ./configure and then later run make check-code-coverage to run unit tests to collect coverage. The last line of the output will include a URL to view the coverage.

Ubuntu 12.04 does not include gcc 4.8 (needed for the C++11 support); you can install it with:

$ sudo apt-get update
$ sudo apt-get install software-properties-common python-software-properties
$ sudo add-apt-repository "ppa:ubuntu-toolchain-r/test"
$ sudo apt-get update
$ sudo apt-get install g++-4.8
$ export CXX=g++-4.8

Debian Testing or newer, Ubuntu Wily or newer

$ sudo apt-get update
$ sudo apt-get install build-essential automake autoconf autoconf-archive libtool libboost-program-options-dev libgtkmm-2.4-dev gerbv git librsvg2-dev
$ git clone https://github.com/pcb2gcode/pcb2gcode.git
$ cd pcb2gcode

Then follow the common build steps

Fedora

su
<the root password>
yum groupinstall "Development Tools"
yum install automake autoconf libtool boost-devel gtkmm24-devel gerbv-devel git
exit

Then follow the common build steps

Common build steps

$ autoreconf -fvi
$ ./configure
$ make
$ sudo make install

Windows

You can easily build pcb2gcode for Windows with MSYS2 (http://sourceforge.net/projects/msys2/). Download MSYS2 and install it somewhere, then run "MinGW-w64 Win32 Shell" (if you want a i686 binary) or "MinGW-w64 Win64 Shell" (if you want a x86_64 binary). The following commands are for the i686 binary, if you want the x86_64 binary replace all the "/mingw32" with "/mingw64" and all the mingw-w64-i686-* packages with mingw-w64-x86_64-*

$ pacman -Sy
$ pacman --needed -S bash pacman pacman-mirrors msys2-runtime

Close and reopen the shell

$ pacman -Su
$ pacman --needed -S base-devel git mingw-w64-i686-gcc mingw-w64-i686-boost mingw-w64-i686-gtkmm

Now let's download, build and install gerbv (version 2.6.1 is broken, don't use it)

$ wget downloads.sourceforge.net/gerbv/gerbv-2.6.0.tar.gz
$ tar -xzf gerbv-2.6.0.tar.gz
$ cd gerbv-2.6.0/    
$ ./configure --prefix=/mingw32 --disable-update-desktop-database
$ make
$ make install

Finally, download and build pcb2gcode

$ cd ..
$ git clone https://github.com/pcb2gcode/pcb2gcode.git
$ cd pcb2gcode/
$ autoreconf -fvi
$ ./configure --prefix=/mingw32
$ make LDFLAGS='-s'

The dynamically linked binary is <msys2 installation folder>/home/<user>/pcb2gcode/.libs/pcb2gcode.exe. You can find all the DLLs in <msys2 installation folder>/mingw32/bin; copy them in the same folder of pcb2gcode. The required DLLs are:

  • libatk-1.0-0.dll
  • libboost_program_options-mt.dll
  • libbz2-1.dll
  • libcairo-2.dll
  • libcairomm-1.0-1.dll
  • libexpat-1.dll
  • libffi-6.dll
  • libfontconfig-1.dll
  • libfreetype-6.dll
  • libgcc_s_dw2-1.dll (for the i686 binary)
  • libgcc_s_seh-1.dll (for the x86_64 binary)
  • libgdkmm-2.4-1.dll
  • libgdk_pixbuf-2.0-0.dll
  • libgdk-win32-2.0-0.dll
  • libgerbv-1.dll
  • libgio-2.0-0.dll
  • libglib-2.0-0.dll
  • libglibmm-2.4-1.dll
  • libgmodule-2.0-0.dll
  • libgobject-2.0-0.dll
  • libgtk-win32-2.0-0.dll
  • libharfbuzz-0.dll
  • libiconv-2.dll
  • libintl-8.dll
  • libpango-1.0-0.dll
  • libpangocairo-1.0-0.dll
  • libpangoft2-1.0-0.dll
  • libpangomm-1.4-1.dll
  • libpangowin32-1.0-0.dll
  • libpixman-1-0.dll
  • libpng16-16.dll
  • libsigc-2.0-0.dll
  • libstdc++-6.dll
  • libwinpthread-1.dll
  • zlib1.dll

Mac OS X

You can build the latest pcb2gcode version with Homebrew. If Homebrew is not installed yet, install it with the following command:

 $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

You might need some build tools that typically are not present:

 $ brew install autoconf automake libtool

Then you can download and build the git version with

 $ brew install --HEAD pcb2gcode

or (if pcb2gcode is already installed)

 $ brew upgrade --HEAD pcb2gcode

For further details, see INSTALL.