Rewriting the extrusion path gcode generation in C++