Sort curves to minimize travel distance

Here is this morning’s effort using Anemone. The problem is a compelling one…


minimize-travel_2021Oct16a.gh (87.7 KB)

The green group (upper right) weaves the “sorted” infill curves with the travel links to form one continuous toolpath per branch. The white group alternates start points by layer (branch) so in theory, the tool would minimize travel going from layer to layer.

OK, cool, though it means you can’t take shortcuts like ‘Flatten’, as I did inside the loop. The abridged ‘Tree/List Viewer’ in my code can be replaced by a second “outer” Anemone loop that would feed the “inner” Anemone loop shown. Again, best practice or not, I prefer to see what I’m doing so took this one-branch-at-a-time approach.

P.S. This (below) is branch zero, showing some wild long “travel links” to connect short segments of infill that were passed by when the tool was closer because of following infill curves to their ends. This appears to be correct, given the infill curves we have?

1 Like