I've been playing around with TSP images (images made from a single unbroken squiggly

I’ve been playing around with TSP images (images made from a single unbroken squiggly line) and thought it would be fun to extrude one rather than plotting it with a pen. I’ve seen scripts and such that will convert a svg or dxf path to simple XY gcode. Does anyone have an idea how I can get a vector converted to gcode with extrusion and a defined extrusion width?

Convert TSP image to DXF, import into OpenSCAD, extrude, I would guess.

Alternately, you could use Python to simply take the TSP’ed list of coordinates, and render g-code for them directly, and just repeat it, adding a z-move every loop.

The vectors have no width, so there wouldn’t be a closed shape to extrude. I could stroke them, export a bitmap, then trace the bitmap back to vectors, but then the lines would be a minimum of 2 perimeters wide, rather than a single thread.

I know I can get the dxf turned into XY movements, I just don’t know how to add in extrusion and the proper flow rate.

Bring the vectors into inkscape, define a line width in mm, use the stroke to path function(path menu) then highlight the entire object, use the node tool(second cursor looking thing) highlight all of the nodes, a nodes by pursuing the +, convert the splines to points by clicking make selected nodes corners. Save as dxf. Import to openscad.

That is my work flow for something like that.

I had success using the math relating the volume ratio of the driven cylinder of filament to the extruded trace - assuming a rectangular cross section with round edges - to set the extrude speed.