Interlocking Layers Post-Processing Script for PrusaSlicer, OrcaSlicer, and BambuStudio
This fork adds fixes and features on top of GeekDetour/BrickLayers.
Arc fitting can now be left enabled in your slicer. This fork properly handles G2/G3 arc commands:
- Bounding box: Computes true arc bounding box via cardinal angle crossing detection (not just endpoints)
- Wipe path: Arc-aware distance calculation and endpoint interpolation for correct wipe retracing
Fixes missing chunks in Bambu Studio's G-code preview and improves print quality at brick layer transitions. Prevents Travel Fix Up injection inside wipe blocks.
A patched BambuStudio fork is available that re-parses G-code after post-processing scripts run, showing the BrickLayers toolpath directly in the preview without manual re-import.
Fixes G92 E reset using wrong value after deferred perimeters in absolute extrusion mode. The reset now uses the E value from before the deferred block, since the firmware E register did not advance during relative extrusion replay.
| Branch | Feature |
|---|---|
arc-support |
G2/G3 arc bounding box and wipe path |
wipe-fix |
Prevent Travel Fix Up injection inside wipe blocks |
absolute-extrusion-fix |
G92 E reset fix for absolute extrusion mode |
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'.
This fork adds full G2/G3 arc support — you can leave arc fitting enabled in your slicer settings.
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: GeekDetour#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



