<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.17098" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=656341608-01082011><FONT face=Arial color=#0000ff size=2>There
is a class in ParaView that will do this for you, but unfortunately it is not
available in VTK yet. However, it has been flagged up in
Mantis.</FONT></SPAN></DIV>
<DIV><SPAN class=656341608-01082011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=656341608-01082011><FONT face=Arial color=#0000ff size=2>I've
done something similar as you want, but I managed to obtain connectivity
information first by using extracting feature edges. I then order the
points in clockwise fashion by doing a simple loop around each feature edge (or
vtkLine), which would then loop around the rest of the edges looking for a
common point. This worked for me in the end although for a very large number of
points it will get slow. The other option is to come up with a scalar value
that gives you the correct ordering of the points and then sort the points based
on it (something like value = sqrt(x*x + y*y)*(value for direction). Otherwise,
I'd check out vtkPlotEdges in the ParaView distribution and see if you can
integrate it into VTK yourself.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=656341608-01082011><FONT face=Arial color=#0000ff
size=2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=656341608-01082011><FONT face=Arial color=#0000ff
size=2>Adriano</FONT></SPAN></DIV><!-- Converted from text/plain format -->
<P><FONT size=2>===================================<BR><BR>Adriano Gagliardi
MEng PhD<BR>Business Sector Leader<BR>Computational Aerodynamics<BR>Aircraft
Research Association Ltd.<BR>Manton Lane<BR>Bedford<BR><BR>Tel: 01234 32
4644<BR>E-mail: agagliardi@ara.co.uk<BR>Url: www.ara.co.uk </FONT></P>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <B>On Behalf Of </B>Miguel
Sotaquirá<BR><B>Sent:</B> 30 July 2011 04:14<BR><B>To:</B>
vtkusers@vtk.org<BR><B>Subject:</B> [vtkusers] Sort unordered set of points
clockwise (orcounter-clockwise)<BR></FONT><BR></DIV>
<DIV></DIV>Hi,
<DIV><BR></DIV>
<DIV>In 3-D space I have an unordered set of, say, 6 points; something like
this:</DIV>
<DIV><BR></DIV>
<DIV> (A)*</DIV>
<DIV>
(C)*</DIV>
<DIV>(E)*</DIV>
<DIV>
(F)*</DIV>
<DIV> (B)*</DIV>
<DIV><BR></DIV>
<DIV>
(D)*</DIV>
<DIV><BR></DIV>
<DIV>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:</DIV>
<DIV><BR></DIV>
<DIV>orderedList = [A - E - B - D - F - C]</DIV>
<DIV>or</DIV>
<DIV>orderedList = [A - C - F - D - B - E]</DIV>
<DIV><BR></DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV>How can I do this in VTK?</DIV>
<DIV><BR></DIV>
<DIV>Thanks,</DIV>
<DIV>Miguel</DIV><p>**********************************************************************<br />This email contains information that is private and confidential and is intended only for the addressee.<br />If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br />Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br />system management and security reasons.<br />Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:<br />Manton Lane, Bedford MK41 7PF England VAT No GB 196351245</p><p>**********************************************************************</p>
</BODY></HTML>