Interlocking Layers Post-Processing Script for PrusaSlicer, OrcaSlicer, and BambuStudio
I made major changes on travel, retraction, and wiping. It is printing much better.
But just like a 0.6mm nozzle, it seems Brick Layers is prone to stringing - time to start playing with settings and share our findings!
To use the script, you need Python 3 installed in your machine:
- Download Python 3 CPython, or
- Download PyPy 3 PYPY (faster)
Edit the "Post processing scripts" section in your slicer.
Make sure to update the path to match:
- Your Python installation folder.
- The folder where you saved
bricklayers.py
.
- Normal Python (CPython):
%USERPROFILE%\AppData\Local\Programs\Python\Python313\python.exe C:\3DPrinting\Scripts\bricklayers.py -startAtLayer 3 -extrusionMultiplier 1.05 -enabled 1;
- PYPY3:
C:\3DPrinting\pypy3.11-v7.3.19-win64\pypy3.exe C:\3DPrinting\Scripts\bricklayers.py -startAtLayer 3 -extrusionMultiplier 1.05 -enabled 1;
- CPython (installed globally):
/usr/local/bin/python3 /Volumes/3DPrinting/Scripts/bricklayers.py -startAtLayer 3 -extrusionMultiplier 1.05 -enabled 1;
- CPython (installed locally):
/Users/YourName/.pyenv/shims/python3 /Volumes/3DPrinting/Scripts/bricklayers.py -startAtLayer 3 -extrusionMultiplier 1.05 -enabled 1;
- PyPy3 (installed globally):
/usr/local/bin/pypy3 /Volumes/3DPrinting/Scripts/bricklayers.py -startAtLayer 3 -extrusionMultiplier 1.05 -enabled 1;
- PyPy3 (installed locally):
/Users/YourName/.pyenv/versions/pypy3/bin/pypy3 /Volumes/3DPrinting/Scripts/bricklayers.py -startAtLayer 3 -extrusionMultiplier 1.05 -enabled 1;
In "Quality", "Walls printing order" be sure you select "Inner/Outer" - this is very important for the right detection of the Loops 'Depth':
In Prusa Slicer you can choose Classic or Arachne, both work equaly fine. But on Orca Slicer and Bambu Studio forks, Arachne sometimes creates orphaned loops that will turn into minor glitches in Brick Layers (I cannot fix, so far) - so I recommend 'Classic'.
The plan, from the beginning, is to support ARC. But it's not completely done yet - it needs an algorithm to calculate Bounding Boxes of the exact area an arc of any arbitrary angle occupies, ideally without making the script much slower.
You must disable "Supports binary G-code"
in Printers → General → Firmware (Expert Mode)
The Binary G-code format is incompatible with post-processing scripts.
Saddly, none of the slicers show the changes automatically - which is weird since we can see they are running the Post-processing Script every time we slice.
We need to drag the exported gcode file back to the Slicer to see the results of any Post-Processing Script.
I wish this was different. Post-processing scripts would be more appealing if previewing was automatic.
More details: #20
You can use the script to modify GCode files outside of the slicer. First, I recommend you to check 2 examples in this file: https://github.com/GeekDetour/BrickLayers/blob/main/sample_tests/simpletest.sh
Try running it once, as provided.
If you downloaded or cloned the repository, in your Terminal, go to the repository and:
cd sample_tests
chmod +x simpletest.sh
./simpletest.sh