[vtkusers] Splitting vtkFeatureEdges into lines

Sergey Programmer croooter at gmail.com
Wed Jul 14 09:48:53 EDT 2010


Hi All,

I'm trying to refine my surface and then split into lines. The steps are
1. take original vtkPolyData and filter it using vtkFeatureEdges - dataset
after rendering looks nice
2. now I want to traverse the result vtkPolyData (named below contours) and
extract lines
            vtkCellArray *ca = contours->GetOutput()->GetLines();
            vtkIdType ncells = ca->GetNumberOfCells();

And at the step 2 I'm having problems:

The ncells is too big (1000+, while on step 1 I see at most 10-20 lines),
when I draw extracted lines I see triangles, not the contours I saw on step
1.

What am I missing?

PS: Lines points extraction is implemented as following:
    ca->InitTraversal();
    while ( ca->GetNextCell( npts, pts ) )
    {
        for ( cc = 1; cc < npts; cc++ )
        {
            p1 = pts[cc-1] + 1;
            p2 = pts[cc] + 1;
            contours->GetOutput()->GetPoint( p1, pc1 );
            contours->GetOutput()->GetPoint( p2, pc2 );
            .... // creating and rendering the extracted line
        }
  }


Regards,
C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100714/60fddc79/attachment.htm>


More information about the vtkusers mailing list