Space filling / connect the dots random line

Hi, I am in need of some help with an idea I am working on. I want to create some gcode paths using some sort of space filling line; I am familiar with the Hilbert curve and differential growth but these two just don’t cut it for me…

I tried running a differential growth and lock the point onto a grid, almost what I need but the line crosses at some points and preferably I only have straight angles… (see image) so one would expect the Hilbert curve is what I need, but; I need about a 100 different layers, so Hilbert isn’t suitable for this.

So is anybody familiar with a way to populate a plane with a point grid and connect these points, without intersection and without diagonal lines, in a way where there is a different output every time I run the script? Or can help me get started… :slight_smile:

you have this thread.

If differential growth doesn’t work, there are some parameters to change to make it work, so post your file with geometry (size matters). I am quite sure we will make it work.

If you want perpendicular line, make a grid then a maze the offset the path of Maze with Clipper and the good option to have corner like corner and not arcs.

Sorry, I forgot to mention I need it to be a single, closed curve… or do you mean to make a constant curve by offsetting the maze?

Offsetting makes it single and closed !

Exactly, that’s a neat solution. Thanks!!