I’m working on a g-code generator for a cnc router and I would like to sort the paths that the cnc follows in order to save time.
The points in the attached file (can also be seen in the immage above) come from the starting point of each path. As you can see they are sorted by their Z value and I would like to keep it that way. What I’m looking for is a way to sort these points sequentially (the result being their new indices like in the immage).
Desired result would be:
1st point of 1st branch is the starting point, once it sorts one branch it goes to the next one
Last point in the previous branch becomes the new starting point for the current branch and so on
I already tried the component sequential closest points and it doesn’t have the desired effect.
I don’t know programming but I am willing to learn the basics if the answer to this problem happens to be a script.
I was also thinking of trying anemone but would be overkill if the solution has to do with data tree manipulation.
Let me know if you need anything else, thank you.
sequential closest points.gh (16.0 KB)