hi siqi..<br><br>Thanks for the code.. I tried implementing your code.. I passed the <br>vtkPolyData which i get from the output of vtkContourFilter to this function<br><br>And when i run it, it displays<br><br>more than two neighbors in CumulativeLength<br><br>this stmt is displayed, N (no. of points) number of times.<br>after that, this stmt is being displayed infinitely<br><br>connectmatrix problem in CumulativeLenth<br><br>I guess your code works for 2D coordinates..<br>I got to struggle with 3D points., So what change do i have to do..?? <br><br>Thanks<br><br><br><div style="border-top:1px dashed #ccc; border-bottom:1px dashed #ccc; padding:5px;"><a href="http://mail.in.com/mails/new_reg.php?utm_source=invite&utm_medium=outgoing" style="font:13px arial; color:#1E56A1; text-decoration:none;">Dear <b>vtkusers !</b> Get Yourself a cool, short <b>@in.com</b> Email ID now!</a></div>