Hi there. I've been trying to write a plugin that converts a sliced GCode file to Polar Coordinates for my Polar3D printer. I figured the file preprocessing hook would be good for this, but the whole thing with that is that you process it as a stream, line by line. The polar3dconvert
program takes the whole gcode file and rewrites it in place. I've tried a bunch of things to make this happen, but it seems that the whole "streaming line by line" thing seems to break it.
Here's everything I remember trying.
- Hardcoding the path and running the program on it
- Copying the hardcoded path to /tmp, running the file, and copying it back
- Capturing the input stream in a buffered input stream, writing it to a file in /tmp, running the program, and returning it all on the first line of the process_line output.
I don't know if this is even possible with this kind of hook. Please let me know if this is the best way to do this.