[vtkusers] (no subject)
Shyam Prakash
ramakrishna.prakash at quest-global.com
Tue Oct 14 05:06:23 EDT 2003
Hello Benjamin,
Thanks for the reply. Sorry that I did not explain the
problem completely. The cross section whose perimeter I am trying to
determine may not be circle always. I doubt I can use the method you
mentioned for irregular cross section (for instance, consider a bean
shaped c/s). Please let me have your views.
Thanks
Shyam
-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of Benjamin King
Sent: Tuesday, October 14, 2003 3:01 PM
To: Shyam Prakash; vtkusers at vtk.org
Subject: Re: [vtkusers] (no subject)
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
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list