I have a set of 3D points (which I recover from a library that performs the tessellation of a solid body) that belong to a curve (i.e., an edge of the solid). That means that the curve surely passes by each of these points.
Nevertheless, the point set is unordered so I need to sort them in order to be able to draw this curve correctly.
Is there any known approach for these type of problem?
Some additional information:
- The curves are parametric in general (splines/bezier, circle slices.. ).
- The points are given as floating point coordinates.
- The points are packed very densely (but they can be as dense as I want it to be). To give you an idea, for a curve which occupies 19 units in x, 10 units in x and 5 units in z, I quote a sequence of points in a segment of curve: (20.7622, 25.8676, 0) (20.6573, 25.856, 0) (20.5529, 25.8444, 0) (20.4489, 25.8329, 0) (20.3454, 25.8213, 0)