Gyroid Tool Path for Clay 3D Printing

I am trying to slice a gyroid in grasshopper for clay 3d printing. I have a custom script to create gcode - which has a lot of advantages, but one downside is that you have to model your infill directly in rhino/grasshopper.

I have a gyroid that is trimmed to the shape of the 3d print. I then contour it and join the curves by each layer. I then split the outer curve into segments based on the gyroid curves. I need to cull the list of outer lines for every single branch of the contour so that there is a single tool path that the printer can follow. The cull pattern is different for every layer so I am wondering if there is a way to make an algorithm to find the best single path.



gyroid script to send to forum.gh (13.0 KB)
Gyroid-Unit-with-tex.3dm (6.1 MB)