Skip to content
This service supports your 3D printing workflow by providing auto-rotation and slicing functionality.
Python HTML JavaScript Dockerfile CSS
Branch: master
Clone or download


This service supports your 3D printing workflow by utilizing auto-rotation and slicing functionality.

The PrePrint Service is based on:

  • The auto-rotation software for FDM 3D printing Tweaker-3
  • The slicing software Slic3r


The full workflow can be deployed either on a single machine or on two separated nodes as described below:


The following steps will be done:

  1. Slice a model using the PrePrint server Plugin.
  2. The model will be auto-rotated for a proper 3D print by the Tweaker-3 software.
  3. The auto-rotated model will be sent back to the octoprint server.
  4. The optimized model will be sliced using Slic3r.
  5. The final machine code will be sent back to the octoprint server.
  6. The printing can be started.

Each step is optional and can be set in the settings.


  1. One server node that is connected to your 3D printer, like a raspberry pi.
  2. One server node for pre-processing, which has at least 2GHz CPU frequency. If the node connected to the printer is strong enough, one server suffices.
  3. Optional: Install Docker version 1.10.0+ and Docker Compose version 1.6.0+ on the more powerful node.


1. Install the Plugin

Install the PrePrint Server plugin via the bundled Plugin Manager or manually using this URL on the Printer-Controller

In order to make the service highly available, it is recommended to deploy the PrePrint Service in docker. If you are not familiar with docker yet, have a quick look at the links in the requirements-section.

Then run the application locally with:

git clone
cd OctoPrint-PrePrintService
docker-compose up --build -d
docker-compose logs -f

Optional: The docker-compose.yml is also configured to run in a given docker swarm, adapt the docker-compose.yml to your setup and run:

docker-compose build
docker-compose push
docker stack deploy --compose-file docker-compose.yml preprintservice

The service is available localhost:2304/tweak (on the hosting node), where a simple UI is provided for testing the PrePrint Service. Use docker-compose down to stop the service. (If you ever wish ;) )

PrePrint Service


Configure the plugin in the settings and make sure the url for the PrePrint service is set correct:


Finally, click on the Slice-Button of uploaded STL-Models and produce printable machinecode via this Preprocessing-Plugin.


To test the whole setup, do the following steps:

  1. Visit localhost:2304/tweak, select a stl model file and make an extended Tweak (auto-rotation) without slicing. The output should be an auto-rotated (binary) STL model. If not, check the logs of the docker-service using docker-compose logs -f in the folder where the docker-compose.yml is located.

  2. Now, do the same with slicing, the resulting file should be a gcode file of the model. Else, check the logs of the docker-service using docker-compose logs -f in the same folder.

  3. Visit the octoprint server and try to slice an uploaded stl model file. After some seconds a .gco file should be uploaded. Note that in a small time frame a .gco file with only one line and 83 bytes can appear. This is expected and should be overwritten afterwards after a short time. If this doesn't work, start the octoprint server per CLI with octoprint serve and track the logs. The following two lines are expected:

     2019-04-07 22:28:44,301 - octoprint.plugins.preprintservice - INFO - Connection to PrePrintService on is ready, status code 200
     2019-04-07 22:28:44,321 - octoprint.plugins.preprintservice - INFO - Connection to Octoprint server on is ready, status code 200

    If the the Octoprint Server's URL is invalid, you will see this:

     2019-04-07 22:27:34,746 - octoprint.plugins.preprintservice - WARNING - "Connection to Octoprint server on couldn't be established"

    If you see instead the following, please check the APIKEY: (403 - forbidden)

     2019-04-07 22:30:09,570 - octoprint.plugins.preprintservice - WARNING - Connection to Octoprint server on couldn't be established, status code 403

    If the the PrePrint Server can't be reached, you will see this:

     2019-04-07 22:27:34,746 - octoprint.plugins.preprintservice - WARNING - Connection to PrePrint Server on couldn't be established

    Make also sure that your selected profile file is correct.

If you have any troubles in setting this plugin up or tips to improve this instruction, please let me know!


This plugin, as well as the auto-rotation module Tweaker-3 was developed in my spare time. If you like it, I would be thankful about a cup of coffee :)

More coffee, more code

Happy Printing!

You can’t perform that action at this time.