RUG/Pennsylvania/State College/RepSnapper

From RepRap
Revision as of 05:01, 29 February 2012 by Filmgineer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Currently, we are using an old version of RepSnapper which we refer to as "RepSnapper Zero". It saves to XML files, and does not list "Logick's Algorithm" among the shrink algorithms.

This version is available here. It's a win32 binary compiled using VC2005, using the RepSnapper source at revision 257.

We use it instead of RepSnapper beta (1.1.x) because we find it generates better gcode, and does not crash as frequently.

A windows binary of RepSnapper Zero, including our settings as of 1/12/11, can be found here

However, we have put effort into being able to compile RepSnapper beta ourselves, in hopes of being able to tweak/revert the gcode generation and fix other minor issues.

We get improved gcode from RepSnapper Zero by using the shrink algorithm "Much slower, perfect, small details". This shrink option corresponds to a "ShrinkNice" function in stl.cpp, which uses a "Generic Polygon Clipper" library (gpc.h, gpc.cpp) written by Alan Murta of the Advanced Interfaces Group at the University of Manchester. This code was disabled in RepSnapper at subversion revision 289, "due to license incompatibility". I presume this is because GPC is "free for non-commercial use", while RepSnapper is GPL licensed.


A basic video tutorial can be watched on the PSU RepRap YouTube channel. It covers basic interface and how to get started on a basic print.

Compiling on Ubuntu Linux

Repsnapper Beta (1.1.x)

One of our machines runs Ubuntu linux 10.10. Here is how we installed repsnapper 1.1.x:

Note: The machine is not connected to the internet, so packages are transferred using Synaptic's "Generate Download Script" option on a separate computer.

The following packages were required, as listed by the readme:

build-essential fluid libgtk2.0-dev libfltk1.1 libfltk1.1-dev libglut3 libglut3-dev libboost-thread-dev libboost-system-dev libconfig++8-dev libconfig8-dev

Note: Initially I neglected to install libgtk2.0-dev, which caused confusing build errors that the packages "gtk+-2.0" and "gthread-2.0" could not be found. Installing libgtk2.0-dev fixed the problem (gtk+-2.0 is satisfied by libgtk2.0-dev, and gthread-2.0 is satisfied by libglib2.0-dev, which is a dependency).

The codebase was downloaded using Git on a windows pc:

git clone git:// -b repsnapper-1.1.x

The code was compiled:

cd repsnapper/src


The resulting executable "repsnapper" was then moved to ~/toolchain, and a desktop shortcut created.

RepSnapper Zero

Compiling RepSnapper "Zero" is equally straightforward, once a copy of the source is obtained from the SVN repository (I used revision 255). The readme recommends installing dependencies by running

sudo apt-get install build-essential libfltk1.1 libfltk1.1-dev libglut3 libglut3-dev libboost1.37-dev

However, because I had previously build repsnapper-1.1.x, I was able to compile without any further configuration, since these dependencies are a subset of those I had already installed. The code was compiled by running make as before.

Compiling on Windows MinGW


 * This process is fairly involved.
 * The resulting executable requires a number of dynamic link libraries.
 * According to the MinGW documentation, it would have been better to install libraries into /mingw instead of /usr/local where possible. (eg. using make --prefix=/mingw)
 * In the MinGW shell, /mingw/* corresponds to C:\Path\to\MinGW\* and /usr/local/* corresponds to C:\Path\to\MinGW\msys\1.0\local\*

Install MinGW

 1. Install MinGW 20110802 (mingw-get-inst-20110802.exe from
   * I installed to C:\PROGRAMS\MinGW. Path shouldn't matter as long as there are no spaces.
 2. Open a MinGW Shell

Install fltk library

 1. Download and extract fltk-1.1.10 (
 2. $ cd /c/path/to/fltk-1.1.10-source/fltk-1.1.10/
 3. $ ./configure
 4. $ make
 5. $ make install
 6. $ cd FL/
 7. $ make install

Install lua library

 1. Download and extract lua-5.1.4.tar.gz (
 2. $ cd /c/path/to/lua-5.1.4/
 3. $ make mingw
 4. $ make install

Install boost-build engine

 1. Download and extract (
 2. $ cd /c/path/to/boost_1_47_0/tools/build/v2/engine
 3. $ ./ mingw
 4. $ cp bin.ntx86/*.exe /usr/local/bin

Install luabind library

 1. Download and extract (
 2. $ cd /c/path/to/luabind-0.9.1
 3. $ cp -r luabind /usr/local/include
 4. $ b2 --toolset=gcc link=static variant=release -sBOOST_ROOT=../boost_1_47_0/ -sLUA_PATH=/usr/local
 5. $ cp bin/gcc-mingw-4.5.2/release/link-static/libluabind.a /usr/local/lib

Install boost libraries

 1. $ cd /c/path/to/boost_1_47_0/
 2. $ b2 --toolst=gcc link=static threading=multi variant=release system filesystem
 3. $ b2 --toolset=gcc link=shared theading=muli variant=release thread
 4. $ cp bin.v2/libs/thread/build/gcc-mingw-4.5.2/release/threading-multi/libboost_thread-mgw45-mt-1_47.* /usr/local/lib/
 5. $ cp bin.v2/libs/system/build/gcc-mingw-4.5.2/release/link-static/threading-multi/libboost_system-mgw45-mt-1_47.a /usr/local/lib/
 6. $ cp bin.v2/libs/filesystem/build/gcc-mingw-4.5.2/release/link-static/threading-multi/libboost_filesystem-mgw45-mt-1_47.a /usr/local/lib/
 7. $ cp -r boost/ /usr/local/include

Install GLUT

 1. Download and extract (
 2. $ cd /c/path/to/glutdlls37beta
 3. $ mkdir /usr/local/include/GL
 4. $ cp *.h /usr/local/include/GL
 5. $ cp *.lib /usr/local/lib
 6. $ cp *.dll /usr/local/bin

Install libconfig

 1. Download and extract libconfig-1.4.8.tar.gz (
 2. $ cd /c/path/to/libconfig-1.4.8/
 3. $ ./configure
 4. $ make
 5. $ make install

Install GTK+

 1. Download and extract (
 2. $ cd /c/path/to/gtk+-bundle_*_win32
 3. $ cp -r bin/* /usr/local/bin
 4. $ cp -r lib/* /usr/local/lib
 5. $ cp -r include/* /usr/local/include

Build repsnapper

 1. Obtain the repsnapper source from the repository:
   git clone git:// -b repsnapper-1.1.x
 2. You'll also need the windows Serial libraries from:
   Put them in repsnapper_1_1/src/Serial
 3. cd /c/path/to/repsnapper_1_1
 4. Add the following to the Makefile above "# Linux":
 # MinGW
 ifeq ($(UNAME),MINGW32_NT-6.1)
   GTK_LIBS=`pkg-config --libs gtk+-2.0 gthread-2.0`
   GTK_CFLAGS=`pkg-config --cflags gtk+-2.0 gthread-2.0` -DHAVE_GTK
   INC=$(GTK_CFLAGS) -I/usr/include -I/mingw/include -I/mingw/include/GL -I$(LIB_DIR) -I$(LIB_DIR)/vmmlib/include -I/usr/include/boost -I/usr/include/lua5.1 -I/usr/local/include
   LDFLAGS=$(GTK_LIBS) -L/usr/lib -L/usr/local/lib -L/mingw/lib -lfltk -lfltk_gl -lfltk_forms -lglut32 -lopengl32 -lglu32 -lboost_thread-mgw45-mt-1_47.dll -lboost_system-mgw45-mt-1_47 -lboost_filesystem-mgw45-mt-1_47 -lws2_32 -llua -lluabind -lgdi32 -lole32 -luuid -luser32 -lcomctl32 -lkernel32 -lconfig++
   LDFLAGS+=-L$(LIB_DIR)/polylib -lpolylib
 5. make

Run Repsnapper

This compiled copy of repsnapper needs the following dynamic link libraries:


As well as the following GTK+ libraries (should be available if you have the GTK+ runtime installed, but can also be found in /usr/local/bin)


Changes when building Repsnapper 1.0.x

These instructions can be used to build RepSnapper 1.0.x instead of 1.1.x, with the following changes:

  • Don't use a modified 1.1.x Makefile; start with the 1.0.x Makefile and modify it as described above.
  • Change the following line in file.cpp (line 227):
 std::string directory_path = path.branch_path().native_directory_string();

to this:

 std::string directory_path = path.branch_path().string();

We initially built Repsnapper 1.0.x in hopes that it would include the Gcode generation used by Repsnapper Zero. Unfortunately, Repsnapper 1.0.x is not old enough to include the desired code. Therefore, there doesn't seem to be a good reason to use Repsnapper 1.0.x -- use either 1.1.x, or Zero.


I'd like to get rid of some of the dynamic library requirements.

It should be possibly to statically link libboost_thread with a modification to the Makefile as per

It should be possible to remove the libgcc and libstdc requirements by using the flags -static-libstdc++ -static-libgcc in the Makefile, but this currently causes problems, likely because some of the other dlls themselves have dynamic links to those libraries.

Statically linking GTK+ would be the most significant, but I'm not sure how hard this would be.

Compiling libconfig does produce libconfig++.a, but this doesn't get linked in statically for some reason; not sure why.

Will need to compile glut instead of using a binary distro to get it to link statically.

PSURUGRepsnapper settings.png - Huxley's Settings as of 1/1/2012