<br>The reason is that the points from the vtkContourFilter are not ordered. You need to reorder these points.  I can share with you one function I wrote yesterday which solves exactly the same problem. <br>The input is the vtkpolydata you extract from contourfilter or marchingsquares. The output is a vector which stores the ordered index of the original points. For example, if the output vector is {1, 3, 5, 2, 4}, which means you can connect points 1 3 5 2 4 and they are in ordered. Of course there are two ways of connection, clockwise or counter-, you can change it in the function also. I have a comment there you can find.<br>
<br><a href="http://www.rpi.edu/~chens/download/connectivityDetermine.cpp">http://www.rpi.edu/~chens/download/connectivityDetermine.cpp</a><br><br>I can&#39;t guarantee if will work on your data set, since it is still very preliminary,  just give it a try.<br>
<br>Siqi <br><br><br><div class="gmail_quote">On Fri, Jan 29, 2010 at 5:30 AM, Rakesh Patil <span dir="ltr">&lt;<a href="mailto:rakeshthp@in.com" target="_blank">rakeshthp@in.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I have a scatter data, (xyz file), where x and y are long, and lat resp and<br>

z is depth. I need to extract a zero contour from this xyz data. I use <br>vtkContourFilter to extract the points for zero contour.<br><br>I get the points what i require correctly.. But if i connect them serially,<br>it shows that points are connected in a zig-zag form. I get points directly <br>

from contuorfilter. i.e.<br><br>vtkPoints *pts = contFilter-&gt;GetOutput()-&gt;GetPoints();<br><br>What and how do i do, so that when i connect the points, i get a decent<br>connected line, instead of zig zag ..?<br><br>

Thanks <br><br>Regards<br><br><br><div style="border-top: 1px dashed rgb(204, 204, 204); border-bottom: 1px dashed rgb(204, 204, 204); padding: 5px;"><a href="http://mail.in.com/mails/new_reg.php?utm_source=invite&amp;utm_medium=outgoing" style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(30, 86, 161); text-decoration: none;" target="_blank">Dear <b>vtkusers !</b> Get Yourself a cool, short <b>@in.com</b> Email ID now!</a></div>


<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>