Tuesday, 17 January 2012


It never ceases to amaze me on the quality, generosity and level of sharing in the RepRap community.

I recently started using Slic3r and was getting fairly good prints, then I discovered RichRap's blog Slic3r is nicer with some excellent posts on how to setup and get the best out of Slic3r.  Excellent, and what's more my prints are now ever better.

That someone took the time to experiment with the various setting, and then made the time to share that information with the rest of the community is what makes Open Source and RepRap in particular a great place to hang out.

Saturday, 7 January 2012

Automated stl creation and slicing.

Kaizen is the Japanese technique of continuous improvement. I.E. Spotting an area in your current process where a small change would make an improvement.

Recently I posted an OpenSCAD / STL file to Thingiverse but did not realise that when being sliced it came up with the dreaded 'your mesh is not manifold' error. To fix this I went back though the OpenSCAD file commenting out an operation and running a Render/Export from OpenSCAD, then running a slice with Slic3r until I found the operation that caused the error.  Each time this involved several clicks of the mouse, selecting in dialog boxes etc.  Eventually I thought there must be a different way.

Looking at the OpenSCAD and Slic3r documentation I realised there was.  Both have a command line option, so I could write a quick script to automate the operation.

The first stumbling block, this is computers there are always stumbling blocks, was that I work on a Mac and to execute either program from a script / command line is a bit cumbersome, so I created a symbolic link for each that made them easily accessible from the command line.
   sudo ln -s /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD /usr/local/bin/openscad   
   sudo ln -s /Applications/Slic3r.app/Contents/MacOS/slic3r /usr/local/bin/slic3r   
Now from a Terminal session I can type openscad or slic3r and the application opens up.

The next thing was to create a shell script that uses those.

In my local work directory I created a file, oss, that contains the following:

   openscad -s $1.stl  $1.scad   
   slic3r --load ~/projects/mechanical/Slic3rConfigs/yellow_abs.INI --gcode-arcs $1.stl   

The #!/bin/bash line indicates which shell processor is required.

The $1 represents the first parameter after the script name

The openscad line processes the scad file and outputs an stl file with the same filename, but stl prefix.

The slic3r line loads my standard config file for the ABS filament currently in my Prusa. This will need to be edited when I load a different filament into the machine.

The --gcode-arcs option enables an experimental option in Slic3r that uses G2/G3 codes to draw arcs.  Not all firmwares support this, I use Marlin which does.

Having saved the file I setup another symbolic link to allow oss to be executed from anywhere. So:

   ln -s full_path_to_oss /usr/local/bin/oss   

On my machine the full path is /Users/geoffd/projects/mechanical/oss, you need to use the one for your configuration.

And that's it, now I can switch to the directory containing my scad files, type oss filename, press return and within a few seconds my file has been rendered, exported as stl and sliced for my current setup.  Kaizen in action.

For more details of the available command line options see OpenSCAD and Slic3r under command line usage.

As I said I use a Mac, so these instructions will also work on a Linux machine, but with slightly different source paths for the symbolic links.  On Windows you will need to use a batch file and full paths names.  I haven't used Windows for quite some time and don't have access to a machine that I can try them on.

Happy slicing.


Wednesday, 4 January 2012

Prusa Adjustable Z opto Endstop

I have been finding it difficult to adjust the Z axis end stop on my Prusa. I am normally able to get it to the correct ball park, but getting the adjustment of the bed to extruder spacing correct was taking some time. Each time I moved the end stop up or down I would move it too far.

So I came up with this solution.

It consists of two parts, the top plate holds the opto sensor and has a cable tie to hold the wires securely. The bottom plate mounts to the machine and fastens two bolts with spring and nuts to provide tension for the top plate. A bolt with a locking nut is used to move the opto sensor up and down by small amounts.

Full assembly instructions and the OpenScad and STL file can be found here on Thingiverse.