[vtkusers] (no subject)

Benjamin King king.benjamin at mh-hannover.de
Tue Oct 14 05:30:58 EDT 2003


Hello Shyam,

I'm not sure if there is a direct solution in VTK, but you could first find 
another point c inside the circle (i.e. the mean of all the points or just 
the point at the top) and then build an array that associates each pointid 
i with the angle of the line between c and i. If you sort that array by the 
angle values, you get a suitable sequence of point ids. This is also a 
resonably fast way to do this because the time for the sort (O(n log n)) 
will always dominate the time for creating the array (O(n)). And you won't 
get away without sorting.
You could also use any convex hull algorithm, but I don't think vtkHull 
will do.

Hope it helps,
  Benjamin

> Hi,
> My output polydata represents a circle. The point ids on
> this poly data are distributed randomly(please refer the attached
> image). Is it possible to get the ordered points (for example if I start
> with point id 0, then the preferred enumeration order will be
> 0 - 1 - 2 - 4 - 6 - 9 - 10 - 11 - 8 - 7 - 5 - 3 or in the anticlockwise
> direction.
> The basic idea is to find the perimeter of the circle (i.e by measuring
> the distance between set of points and finally adding all the individual
> distances) . For this I need the points in the order of appearance. Can
> you please suggest a way to achieve this.
> Thanks
> Shyam
>



-- 
Benjamin King
Institut für Medizinische Informatik
Medizinische Hochschule Hannover
Tel.: +49  511  532-2663



More information about the vtkusers mailing list