Book Image

Instant Slic3r

By : David Moore
Book Image

Instant Slic3r

By: David Moore

Overview of this book

One of the most critical parts of 3D printing is taking a 3D model and converting it to a format that a 3D printer can print. Slic3r is one of the best pieces of software out there. It gives great control over how an object is converted, and can save you hours upon hours of frustration by producing great prints. This book will show you how. Instant Slic3r strives to give you a good foundation for what Slic3r can do. It offers a hands-on way to learn about how Slic3r works, and how you can use its powerful features to produce great prints. It takes you from the beginning setup, through advanced features such as post processing the G-Code that it produces. You will get a good grasp on how Slic3r works, and ways to troubleshoot your prints to make the best objects your printer can produce. Instant Slic3r covers where to get Slic3r and how to install it on a variety of platforms, and helps lead you through the setup and tweaking your personal printer settings. The book is clearly laid out and easy to follow, but with information that even experienced users of Slic3r will find useful. You will learn how Slic3r converts your model into G-Code. Then, you will learn how to not only read that G-Code, but how you can write scripts for post-processing the output, before it is sent to the printer. You will also learn what things can go wrong with printing, and how you can use Slic3r to troubleshoot the issue and then fix it. Along with this, you will learn how to improve your printing by delving into Slic3r's expert settings. The book is filled with examples, leading you through not only how to do things, but why they need to be done. After you are finished with this book, you will have a deeper understanding of Slic3r and 3D printing.
Table of Contents (7 chapters)

Running Slic3r from the command line (Become an expert)

Some of us like our GUIs, but some of us yearn for the control and options that only the command line can give. The creators of Slic3r are our kind of people. They've built in command line usage into Slic3r from the early stages of the project.

So far we have created prints from the graphical interface. Slic3r can also be controlled and tweaked from the command line, which gives the user more power and control over the printing process.

Getting ready

So now that we know about the command line, how do we get to it?

  • Windows:

    1. Open a command window and navigate to the directory where we uncompressed Slic3r.

    2. At the command prompt type slic3r-console.exe.

  • Mac:

    1. Open a terminal window and navigate to the directory where Slic3r is installed.

    2. At the prompt type -help.

  • Linux:

    1. Open a terminal window and navigate to the directory where Slic3r is installed.

    2. At the prompt type -help.

We'll now see the list of Slic3r commands that are available to us. If you'd like to look at the list, they are listed in the How it works... section of this recipe.


One caveat for these instructions: As of the time of this writing, the Windows version of slic3r-console has a bug in it. We can substitute slic3r.exe to slice from the command line, but it will not have any console output.

How to do it...

Because Slic3r command line options are normally built in one line, we'll be splitting out the options into separate steps. At the end, we'll put it all together to run.


The Windows command is different from the Mac and Linux version. We'll be demonstrating the Linux and Mac command, just substitute slicer-console in for

  1. Load in our current configuration using the following command: --load <config filename>
  2. Add in our options. In this case, changing the size of our object to twice the size:

    --scale 2
  3. Finally, we give Slic3r the name of our model:


Slic3r will take the file, scale it up 200 percent as it slices it, and then output our file to modelFilename.gcode.


This method could be used to automate our printing process, batch slice a variety of files, and even process one file for a multitude of printer configurations.

How it works...

So now that we've looked at some things we can do with the command-line options, the ideas for what else we can do are starting to come to mind. The command-line options can be called from the programs we write, or set up to run later using the scheduling in Windows or cron on Linux and Mac. We can also set up web pages or mobile apps to call Slic3r.

The following is a list of what we see when we list out the help for Slic3r. There are wealth of options available to us. Look through it, and ideas for how to use Slic3r from the command line will continue to flow:

Slic3r 0.9.10b is a STL-to-GCODE translator for RepRap 3D printers written by Alessandro Ranellucci <[email protected]> -
Usage: [ OPTIONS ] file.stl

This first section of the help is the general options, allowing us to check the version, to load and save configuration files, and even specify the number of processor threads that Slic3r can use. The following table lists them out:


Outputs this usage screen and exits


Outputs the version of Slic3r and exits

--save <file>

Saves the configuration to the specified file

--load <file>

Load the configuration from the specified file. It can be used more than once to load options from multiple files.

-o, --output <file>

File to output G-code to (by default, the file will be saved into the same directory as the input file using the --output-filename- format to generate the filename)

-j, --threads <num>

Number of threads to use (1+, default: 2)

The output options are exactly what it says, the different settings we can use for output. This includes post processing, svg export, and merging multiple files into a single print.

Output option:


The output filename format; all config options enclosed in brackets will be replaced by their values, as well as [input_filename_base] and [input_filename] (default: [input_filename_base].gcode)


Generated G-code will be processed with the supplied script; call this more than once to process through multiple scripts.


Export a SVG file containing slices instead of G-code.

-m, --merge

If multiple files are supplied, they will be composed into a single print rather than processed individually.

Here is where we can tell Slic3r about our printer: the physical sizes, and what type of G-code that Slic3r should expect.

Printer options


Diameter of nozzle in mm (default: 0.5)


Coordinates in mm of the point to center the print around (default: 100,100)


Additional height in mm to add to vertical coordinates (+/-, default: 0)


The type of G-code to generate (reprap/teacup/makerbot/sailfish/mach3/no-extrusion, default: recprap)


Enable this to get relative E values


Use G2/G3 commands for native arcs (experimental, not supported by all firmware)


Use G0 commands for retraction (experimental, not supported by all firmware)


Make G-code verbose by adding comments (default: no)


Limit the frequency of moves on X and Y axes (Hz, set zero to disable; default: 0)

Filament options gives us finer control over how Slic3r will handle our plastic that we are printing with. We can change the first layer's temperature compared to the later layers, what the bed temperature should be, and what diameter filament we are using.

Filament option


Diameter in mm of your raw filament (default: 3)


Change this to alter the amount of plastic extruded. There should be very little need to change this value, which is only useful to compensate for filament packing (default: 1)


Extrusion temperature in degree Celsius; set 0 to disable (default: 200)


Extrusion temperature for the first layer in degree Celsius; set 0 to disable (default: same as --temperature)


Heated bed temperature in degree Celsius; set 0 to disable (default: 0)


Heated bed temperature for the first layer, in degree Celsius, set 0 to disable (default: same as --bed-temperature)

Speed options is where we can make our prints run faster, but if we aren't careful we will sacrifice quality. Some areas, such as gap filling, we may want to run faster, so there is less chance of sagging.

Speed options


Speed of non-print moves in mm/s (default: 130)


Speed of print moves for perimeters in mm/s (default: 30)


Speed of print moves for small perimeters in mm/s or % over perimeter speed (default: 30)


Speed of print moves for the external perimeter in mm/s or % over perimeter speed (default: 70)


Speed of print moves in mm/s (default: 60)


Speed of print moves for solid surfaces in mm/s or % over infill speed (default: 60)


Speed of print moves for top surfaces in mm/s or % over solid infill speed (default: 50)


Speed of support material print moves in mm/s (default: 60)


Speed of bridge print moves in mm/s (default: 60)


Speed of gap fill print moves in mm/s (default: 20)


Speed of print moves for bottom layer, expressed either as an absolute value or as a percentage over normal speeds (default: 30%)

Depending on the physical stability of our printer, adding in acceleration with these options can help speed up and improve the quality of our print.

Acceleration options


Overrides firmware's default acceleration for perimeters. (mm/s^2, set zero to disable; default: 0)


Overrides firmware's default acceleration for infill. (mm/s^2, set zero to disable; default: 0)


Acceleration will be reset to this value after the specific settings have been applied. (mm/s^2, set zero to disable; default: 130)

Accuracy options is a little misleading. While adjusting layer height does usually yield smoother prints, adding in infill can also make the print sturdier.

Accuracy options


Layer height in mm (default: 0.4)


Layer height for first layer (mm or %, default: 0.35)


Infill every N layers (default: 1)


Force a solid layer every N layers (default: 0)

Print options is also confusing at first, because it sounds like a catch-all category. These are the actual settings for the object to be printed: if it should have a solid top or bottom, how dense the fill material will be, and also allow us to use custom G-code for the start and end of the print.

Print options


Number of perimeters/horizontal skins (range: 0+, default: 3)


Number of solid layers to be done for top surfaces (range: 0+, default: 3)


Number of solid layers to be done for bottom surfaces (range: 0+, default: 3)


Shortcut for setting the preceding two options at once


Infill density (range: 0-1, default: 0.4)


Infill angle in degrees (range: 0-90, default: 45)


Pattern to use to fill non-solid layers (default: honeycomb)


Pattern to use to fill solid layers (default: rectilinear)


Load the initial G-code from the supplied file. This will overwrite the default command (home all axes [G28]).


Load the final G-code from the supplied file. This will overwrite the default commands (turn off temperature [M104 S0], home X axis [G28 X], disable motors [M84]).


Load layer-change G-code from the supplied file (default: nothing).


Load tool-change G-code from the supplied file (default: nothing).


Add more perimeters when needed (default: yes)


Randomize the starting point across layers (default: yes)


Disable retraction when travelling between infill paths inside the same island (default: no)


Force solid infill when a region has a smaller area than the current threshold (mm^2, default: 70)

When we use support material, the following are the settings we would want to adjust. These tell Slic3r to use a support material or not, and where.

Support material options


Generate support material for overhangs


Overhang threshold angle (range: 0-90, set 0 for automatic detection, default: 0)


Pattern to use for support material (default: rectilinear)


Spacing between pattern lines (mm, default: 2.5)


Support material angle in degrees (range: 0-90, default: 0)

Since the extruder is making the plastic filament more liquid, we will sometimes need the extruder to run backward, pulling the plastic back in so we don't get blobbing and dripping.

Retraction option


Length of retraction in mm when pausing extrusion (default: 1)


Speed for retraction in mm/s (default: 30)


Additional amount of filament in mm to push after compensating retraction (default: 0)


Only retract-before-travel moves of this length in mm (default: 2)


Lift Z by the given distance in mm when retracting (default: 0)

If we are using multiple extruders, we definitely want to retract the plastic of the extruder that just finished so that it doesn't drip or dribble over the new plastic from the other extruder.

Retraction options for multi-extruder setups


Length of retraction in mm when disabling tool (default: 1)


Additional amount of filament in mm to push after switching tool (default: 0)

Having the print sag, pop off the build platform and having gaps between layers can all be related to improper cooling. Slic3r gives us good controls over the cooling of the print with the following settings:

Cooling options


Enable fan and cooling control


Minimum fan speed (default: 35%)


Maximum fan speed (default: 100%)


Fan speed to use when bridging (default: 100%)


Enable fan if layer print time is below this approximate number of seconds (default: 60)


Slow down if layer print time is below this approximate number of seconds (default: 30)


Minimum print speed (mm/s, default: 10)


Disable fan for the first N layers (default: 1)


Keep fan always on at min fan speed, even for layers that don't need cooling

If we need to pre-extrude some plastic before printing the object, or have Slic3r add a brim to help the model stick to the platform, the following are the settings we will use.

Skirt options


Number of skirts to draw (0+, default: 1)


Distance in mm between the innermost skirt and the object (default: 6)


Height of skirts to draw (expressed in layers, 0+, default: 1)


Generate no less than the number of loops required to consume this length of filament on the first layer, for each extruder (mm, 0+, default: 0)


Width of the brim that will get added to each object to help adhesion (mm, default: 0)

We can change the size and position of the object we want to print, without going back to edit the model. Using the two duplicate settings, we can even print several copies of the same object at the same time.

Transform options


Factor for scaling input object (default: 1)


Rotation angle in degrees (0-360, default: 0)


Number of items with auto-arrange (1+, default: 1)


Bed size, only used for auto-arrange (mm, default: 200,200)


Number of items with grid arrangement (default: 1,1)


Distance in mm between copies (default: 6)

Sometimes we want to finish a whole object in a print file before moving on to the next one in the file. We need to be careful about where the extruder head goes so that it doesn't hit any of the objects. Also, having one of the parts done while the others print can sometimes be just what we need.

Sequential printing options


When printing multiple objects and/or copies, complete each one before starting the next one; watch out for extruder collisions (default: no)


Radius in mm above which the extruder won't collide with anything (default: 20)


Maximum vertical extruder depth; that is, the vertical distance from the extruder tip and carriage bottom (default: 20)

If we want to add in some comments to the output file, such as the date it was printed, what printer settings were used, even notes to ourselves on why we used the settings we did, we can put those in using the following option:

Miscellaneous options


Notes to be added as comments to the output file

The following are fairly advanced options, dealing with how wide the Slic3r will make the extrusion layer, if it should have a different first layer, and even have a different width between the perimeter and infill:

Flow options (advanced)


Set the extrusion width manually; it accepts either an absolute value in mm (such as 0.65) or a percentage over layer height (such as 200%)


Set a different extrusion width for the first layer


Set a different extrusion width for perimeters


Set a different extrusion width for infill


Set a different extrusion width for support material


Multiplier for extrusion when bridging (> 0, default: 1)

Previously, we had some multi-extruder options with the retraction settings. These settings round out the other settings that we need to use with more than one extruder.

Multiple extruder options


Offset of each extruder, if firmware doesn't handle the displacement (can be specified multiple times, default: 0x0)


Extruder to use for perimeters (1+, default: 1)


Extruder to use for infill (1+, default: 1)


Extruder to use for support material (1+, default: 1)

There's more...

There are many things that we can do with access to the command line. Every system that it runs on is capable of running a timed process, or a batch process.

So let's think about a few things we could do by using the command line. We could make a process that accepts models from the Web and automatically slices them and start a print remotely. We could even set up a webcam to watch the print in progress.

Taking that one step further, we could have other people upload their models. A Slic3r script could then calculate the amount of plastic needed and charge them for the print. They could watch the print on the webcam and see the results even before we put it in the mail to deliver.

That's just one idea of what we could do with access to the command line. Just like having your own 3D printer at your disposal, the sky is the limit for what we can do with Slic3r.