Separate extrusion code and stl file writing