[vtkusers] Sort unordered set of points clockwise (or counter-clockwise)

Miguel Sotaquirá msotaquira at gmail.com
Fri Jul 29 23:14:00 EDT 2011


Hi,

In 3-D space I have an unordered set of, say, 6 points; something like this:

               (A)*
                              (C)*
(E)*
                             (F)*
         (B)*

                      (D)*

The points form a 3-D contour but they are unordered. For unordered I mean
that they are stored in a vtkIdList = [A - B - C - D - E - F]. I just want
to reorganize this list starting from an arbitrary location (let's say point
A) and traversing the points clockwise or counter-clockwise. Something like
this:

orderedList = [A - E - B - D - F - C]
or
orderedList = [A - C - F - D - B - E]

I'm trying to implement an algorithm as simple as possible, since the set of
points in mention corresponds to a N-ring neighborhood of each vertex on a
mesh of ~420000 points, and I have to do this for each point on the mesh.

How can I do this in VTK?

Thanks,
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110730/fcb2c8d6/attachment.htm>


More information about the vtkusers mailing list