[vtkusers] Extract continous line from polydata

Dominik Szczerba domi at vision.ee.ethz.ch
Thu May 31 11:12:33 EDT 2007


I had eactly the same problem, and having failed to find something 
relevant among the vtk classes, I have it implemented myself. It's 
pretty simple, after all. Build connectivity (BuildLinks()), take the 
first line, take its first vertex and walk down the thread until you 
reach the starting position. You might want to run the 
connectivity/threshold filters before.

If anyone knows how to do it the vtk way, I would still be very interested.

  - Dominik


Praveen C wrote:
> I have a polydata containing a closed polygon. The lines are not ordered 
> contiguously
> 
> 
> LINES 209 627
> 2 0 1
> 2 2 3
> 2 4 5
> 2 6 7
> 2 8 9
> 2 10 11
> 2 12 13
> 2 14 15
> 2 16 17
> 2 18 19
> 2 20 21
> 2 22 20
> 2 23 24
> 2 25 26
> .
> .
> .
> 
> I want to order them continuously and extract the coordinates of the 
> vertices. How can I do this ?
> Thanks
> praveen
> 
> -- 
> http://pc.freeshell.org <http://pc.freeshell.org>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-- 
Dominik Szczerba, PhD
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list