Created by: portnov
This node sorts (reorders) a list of Curve objects so that they could potentially be concatenated together, i.e. so that the end point of each curve would be near the beginning of the following curve. NOTE: this node does not change shapes of curves, it only changes the order of curves. So, if start / end points of curves do not match, exact concatenation will not be possible with any sorting.
Optionally, this node can reverse the direction of some curves to find the best order of curves concatenation. For example, if in general start / end points of curves were already matching, but some of curves in the input list had incorrect direction, this node will be able to find such curves and reverse them.
The first curve in the list will remain on it's place in any case, and it's direction will not be changed.
Calculation time is O(N^2), where N is the number of curves, so if you have a lot of curves to sort, you may want to consider other options, for example if you have a way to generate curves in the correct order in the first place.
Example: Take a simple object (plane) from scene. It's edges are unordered, and directions of these edges are random. Generate a Line curve segment from each of these edges. Next we want to concatenate these lines to one Curve object. In order to do this, we have to reorder line segments and reverse two of them.
Preflight checklist
Put an x letter in each brackets when you're done this item:
-
Code changes complete. -
Code documentation complete. -
Documentation for users complete (or not required, if user never sees these changes). -
Manual testing done. -
Unit-tests implemented. -
Ready for merge.