When a CAD model is 3d printed, all the arc information is lost when the CAD model is converted to STL. The output of a slicer program will be a series of short line segments. Linuxcnc doesn't process little line segments very quickly (on my machine anyway) but it is fine with arcs. So this program attempts to restore the line segments to arcs.
The program has been hacked from the file, author.py, that is in the linuxcnc source tree. The recursive subdivision smarts have been removed and now just processes the file sequentially. As such, it is now pretty slow, but it does a better job of find arcs.
This was written for Slic3r output and as such, has only been tested with Slic3r output. It only converts arcs in the XY plane. It only works in millimeters (because the tolerance factors, defined in g1tog23.py, have been tweaked for millimeters - easy to change).
The program can read and write to stdin/stdout, or it can take the name of the file to convert as a command line argument. When passed as a command line argument, a backup of the file is made first (filename.ngc.bak) Eg
Usage...
g1tog23.py < mygcode.ngc > new_mygcode.ngc
or
g1tog23.py mygcode.ngc
I've added the script to the Slic3r, Print Settings, Post-processing scripts list. I run slic3r under MS-Windows, so I launch g1tog23 via a batch file.