Skip to content

Automatic Slicing

Use Case

Continuous Print normally prints .gcode files. These files are sliced for a specific printer and are not portable across makes/models.

Typically, 3d models are sliced by external slicer programs, and profiles are assigned in the queue so it only runs on compatible printers. This is especially important for heterogeneous LAN queues.

With automatic slicing, you can add 3D models directly to the queue for printing. This eliminates some manual effort and sources of error.

Setup

OctoPrint supports integration with slicers via the SlicerPlugin mixin - this mixin is inherited by various plugins to allow slicing models in the OctoPrint file manager by clicking a "slice" button next to the file.

Any plugin that uses this mixin should enable automated slicing, but for the sake of awesomeness we will use PrePrintService which can also automatically orient your model before slicing it to maximize the likelihood of a successful print.

Warning

Just because the file automatically slices, doesn't mean it'll slice correctly.

PrePrintService improves the odds with automatic orientation, but this will only work as correctly as it's configured, and may not work at all if your printer is non-cartesian (e.g. a belt printer).

Requirements

You will need:

  • A machine with Docker installed and running - this may be the same as the OctoPrint server, or a different one on the same network.
  • Some form of git tool to download the forked PrePrintService repository

Install PrePrintService

First, we'll set up the slicer server. On your OctoPrint machine or another machine accessible over the network, run the following commands (assuming Linux):

git clone https://github.com/ChristophSchranz/Octoprint-PrePrintService.git --branch test_and_fix --single-branch
cd Octoprint-PrePrintService
docker-compose up --build -d

# To follow the logs:
docker-compose logs -f

Now, we need to install the plugin so OctoPrint can communicate with the slicer.

  1. Navigate to Settings > Plugin Manager > + Get More in the OctoPrint interface.
  2. Add the following URL into the ... from URL box.
  3. Click the adjacent Install button to install the forked PrePrintService plugin, then restart OctoPrint when prompted.
  4. Navigate to Settings > PrePrintService Plugin.
  5. Set the PrePrintService URL text input to point to your slicer server, e.g. http://pre-print-service:2304/tweak.
  6. Uncheck the Receive auto-rotated model file setting to prevent the slicer server from pushing intermediate models into the queue.
  7. Import a slic3r profile - you can generate one in Slic3r and export it like this.
  8. Click Save to save your settings, then restart OctoPrint.

You should be able to click the "magic wand" button next to an STL file in the file manager to slice the file to .gcode - this may take a minute or two if you installed the slicer server on a slow machine (e.g. raspberry pi).

Finally, we need Continuous Print to know what slicer to use when running STL files:

  1. Navigate to Settings > Continuous Print in the OctoPrint interface, then click the Behavior tab to show behavior settings.
  2. Select PrePrintService under Slicer for auto-slicing.
  3. Select the profile you uploaded earlier under Slicer Profile.
  4. Click Save.

After following these instructions, you should have:

  • The service container started and running
  • PrePrintService plugin installed and pointing to the service
  • The Continuous Print plugin installed (of course!)

You'll know you have the correct settings when you see in the logs:

Connection to PrePrintService on <...> is ready

Usage

Warning

Auto-slicing may make weird decisions about how to orient your print, or even incorrect decisions if your printer is not correctly modeled (e.g. belt printers are not currently supported in Tweaker).

It's strongly recommended to watch your first few print attempts until you're confident in the setup.

Also, consider setting up failure recovery so failing prints are more likely to be caught automatically.

With the default slicer configured, it's time to try it out!

  1. Upload an .stl file you wish to test out.
  2. Click the + arrow in the file manager to add it to the queue. . ClickStart Managing, and watch as the STL is detected, sliced into.gcode`, and printed.

Note that you can mix .gcode and .stl files in your queue, and Continuous Print will handle them accordingly.