G-Code Ripper

G-Code Ripper:
Read, Scale, Rotate, Split, Wrap G-Code.

** Now with "Auto Probe" for cutting on uneven surfaces **

HAD Mouse Pic Makey Mouse Pic


Related Links


G-Code Ripper is a g-code reading and manipulation program written in python. The root features of the program were written from scratch. The Graphic User Interface (GUI) is based heavily on the GUIs I wrote for F-Engrave and Dmap2Gcode. G-Code Ripper is a free open source program released under the GNU General Public License (GPL) Version 3.

G-Code Ripper Features

- Scale g-code
- Rotate g-code
- Split g-code
- Map linear axis to rotary axis (Wrap g-code like CNCWrapper)
- Origin selection allows user to select the location of g-code zero position
- Use inches or mm as export units
- Customizable g-code preamble and postamble
- Reads existing g-code
• Reads "Absolute" and "incremental" coordinates
• Evaluates expressions (i.e. [2*3])
• Understands parameters (i.e. #1,#2 and #<feed_rate>)
• Understands and interprets YZ and ZX arcs (converted to linear motions for compatibility with splitting and rotation)

Changes in Version 0.01

- Initial Release

Changes in Version 0.02

- Added feed rate scaling
- Eliminated read abort on N codes (the N code line numbers are simply ignored now)

Changes in Version 0.03

- Added ability to map X or Y axis moves to A or B rotary axis for cutting on a cylindrical surface.
- Added more plot view orientation options

Changes in Version 0.04

- Fixed bug relating to arcs without explicit g-codes (G2,G3) on each line
- Added ability to have zero decimal places on feed rates

Changes in Version 0.05

- Added "Export" to the g-code operations. Now gcode toolpath data can be exported as DXF or CSV (Comma Seperated Values) formated files. With or without rapid motions.

Changes in Version 0.06

- Fixed code to again automatically convert arcs to lines when wraping code (auto-convert was broken in V0.5)
- Fixed evaluation of equations using exponents "**"
- Added Auto Probe to g-code operations

Changes in Version 0.07

- Fixed bug in "Auto Probe" that caused an error when the Z offset is set to zero.
- Modified code to make it compatible with Python 2.5

Changes in Version 0.08

- Fixed bug in g-code wrapping resulting in mapping failure resulting from to zero length tool path.
- Added logic for dealing with ambiguous start positions (when the tool position is not set by G0 commands before a G1, G2 or G3 command)
- Added a warning pop-up message when assumptions are made about the tool starting position.
- Fixed automatic conversion from arcs to lines when required by conversion type selected.

Changes in Version 0.09

- Increased default decimal places to 1 for the feed rate. The adjusted feed rates for g-code mapped to a cylinder were being rounded to the nearest integer resulting in unpredictable cutting speeds.
- Added the ability to save and read probe data files for autoprobing.

Changes in Version 0.10

- Updated to be compatible with Python 3.x

Changes in Version 0.11

- Fixed a minor bug that cause a failed file read in rare cases (tries to calculate square root of negative number)

Changes in Version 0.12

- Updated the probe data file reading routine to be less sensitive to file formating
- Fixed error in probe Z offsets when using an external probe data file

Changes in Version 0.13

- Changed "Probe & Cut" to add the "Probe Z Safe" value to the height of the rapid moves ensuring the tool does not crash
- Fixed a bug in the conversion of arcs to lines when the arc spanned more than one Z value.

Changes in Version 0.14

- Added dialog that allows users to skip over errors when reading g-code files
- Fixed bug that prevented the feed rate to return to the input value after a rapid move in a split file until a G1 command was issued
- Fixed bug that resulted in the feed rate being scaled at the z axis scale value
- Fixed variable handling for some cases


(Right click on the link and select "Save target as" or "Save link as")
Source files
(zip file)
Windows Executable Files
(zip file)
Python Files Only (zip file)

If the windows executable does not work right away install the
“Microsoft Visual C++ 2008 Redistributable Package (x86)”. The program I use to create the Windows executables (py2exe) has a dependency to this package.


I have started the manual page for G-Code Ripper here: G-Code Ripper manual

Sample Items Made with Wrapped G-Code

These are lithophanes made from a PVC pipe. The pictures on the left are the lithophanes with backlighting (candle inside pipe). The pictures on the right are the same lithophanes without backlighting.

Sample G-Code Splitting Workflow

This example shows how I cut a design twice the size of my CNC machine travel.
1. Open Existing g-code file using G-Code Ripper.

2. Make the origin "Mid-Center". Enable splitting.
Make the split angle 90degrees

3. Select "Rotate Black" in G-Code Ripper
to rotate the black cuts 180 degrees.
Save the "white" and "Black" g-code files.
4. Prepare the CNC machine and work piece.
I used pins to maintain good alignment
when rotating the work piece 180 degrees
5. Machine the first of the two CNC file that
were generated ("Black" or "White"). It doesn't
matter which one is first)
6. Remove the work piece from the machine and
remount it rotated 180 degrees from the original
orientation. (My pins made this an easy task)
7. Machine the second of the two CNC file that
were generated ("Black" or "White")

8. Here is the final result of the eagle cut into
a piece of scrap. The smaller eagle is the max
size my machine could do without splitting.

9. The finished eagle plague with a little paint


Related Links

F-Engrave: Used to create the V-Carved text on the lake map plaques shown above.
Dmap2Gcode: Dmap2gcode is a depth map image cutting program
CNCWrapper: CNCWrapper is commercial program (~$25) that maps a g-code linear axis to a rotary axis. CNCWrapper also includes context based g-code editing.

Scorch Works Blog

Scorch's Home
Scorch Works Home
Scorch Works Blog
@scorchworks On Twitter