while running a CNC project i noticed a lot of wasted Z-axis movement (it was a raster pattern stepping along the Y axis tho this would have happened in the X-axis as well) whereby the cutter wasn't actually cutting as it was tracing over the previous cut-path for the same Y value. my idea is to remove those pointless lines to optimize the speed (by how much is TBD).
the general idea i have is to remove G-code lines that have identical point values (X,Y,Z); i.e., commands that tell the cutter to go to the same location more than once. as it's easier to parse/generate G-code than try to fix the encoder used by Aspire (the CNC software i use) that's the path i'm considering. since Java is what i know i'm considering using that (at least at first; this feels like something that could be done in a script language like Python) to test out the approach.
* parsing G-code should only require a regex and, from that, a model of command + X,Y,Z (where any 2 axis could be null; i.e., they inherit those axis values from previous commands; i.e., the command context). * visualizing G-code will start with just printing out the C+(X,Y,Z) values in order to find duplicates