I would like to be able to take a gcode file for 3D printer and split it vertically in a selected Axis.
i.e. lets say that the print job is in between X100 & X200 and I would like to be able to cut it anywhere by a given X position (i.e. 110mm , 160 or 180...)
Gcode looks like that:
G1 X148.642 Y148.058 E35.1107
G1 X128.785 Y167.916 E36.7919
G1 X128.106 Y167.916 E36.8326
G1 X147.964 Y148.058 E38.5138
G1 X147.285 Y148.058 E38.5545
G1 X127.427 Y167.916 E40.2357
G1 X126.748 Y167.916 E40.2764
G1 X146.606 Y148.058 E41.9577
G1 X145.927 Y148.058 E41.9983
G1 X126.070 Y167.916 E43.6796
G1 X125.391 Y167.916 E43.7202
G1 X145.248 Y148.058 E45.4015
You will have to short the vectors, cut them on the axis cut point, recalculate the new E (amount of plastic) for each of the new child vectors and rearrange the travel etc...
keep in mind that there are gcode commands that are not vectors, seed, Z lifts and others that should be duplicated to the child Gcode files.
This is a very general description of course. I am interested with the result.
- Acceptance test: take any Gcode file, run the split in any given X points and be able to print correctly with the child gcode files.
- Please provide a python code.
- there are many free Gcode viewers so you do not need a 3d printer for self tests but I will prefer providers with 3d printers.