@MJLew What am I suggesting?
Not a firmware change.
This is a post-processing script (Python) that takes your G-code or path data after slicing and replaces thousands of straight G1 moves (tiny segments) with smooth arcs (G2/G3) or splines (G5), using an “adaptive π” correction for ultra-precise arcs.
Why bother?
Reduces G-code file size (sometimes by 90%+).
Smoother motion = quieter, less vibration, better print quality.
Cleaner walls—no more “polygon scars” from all those little straight lines.
How does it work?
You slice your model normally (like you do now).
Then, you run the generated G-code through my Python script.
The script analyzes curves, calculates their true arc lengths (with a curvature correction, “adaptive π”), and outputs new G-code using G2/G3/G5 for arcs/splines.
Is there a tool for this?
Yes! I shared a simple Python snippet as a starting point (see above).
You don’t have to modify firmware—just run the script on your G-code and upload the new file to your Duet.
Anything missing?
No special firmware: RRF already supports arcs and splines.
No special slicer: Works as a post-process step.
Still experimental: I’m looking for testers to try it on their own prints, especially for tuning the β parameter (calibrates the curvature correction).
Want to try it?
Slice your part as usual (with fine segments, e.g., Cura or PrusaSlicer).
Download/run the Python script on your G-code.
Upload the processed G-code to your Duet and print.
Model precision tip: For best results, use smooth STLs with high tessellation (low chord height, ~0.01 mm). This helps the script detect arcs properly. Think of it like giving the optimizer a clean signal to work with — smooth in, smooth out.
You can think of it like using electricity to trace the curve — not in straight lines, but in natural arcs that follow the flow of the current. Adaptive π lets us correct for the difference between the actual path and the chord segments, like using a smarter compass instead of pixelated lines.
Report results and share before/after photos or files!