Turns gcode states into line segments