[vtkusers] Retrieve poligonal data after delaunay triangulation

Samuel Marcos godofredoiii at gmail.com
Fri May 11 03:50:47 EDT 2007


Again, many many thanks. After following your suggestions (and looking at
Mike's code which is really helpfull) this is what I'm doing but my program
crashes:

// "oPolyDataDel"  is a vtkPolyData where I store  the output of Delaunay
filter .  As I set the Aplha value,
// some lines and points appear in the triangulation (I've read in the
documentation that this  is to happen  when  you  set
// alpha value) but I only want triangles."vTriangulos" is an array of ints
where I wish to store triangle values consecutively
// So this is what I've written:

    int j=0;
    int npts,*pts;
    vtkCellArray* oCellArr= vtkCellArray::New();
    oCellArr=oPolyDataDel->GetPolys();
     for(int i=0;i<oPolyDataDel->GetNumberOfPolys();i++)
     {
            oCellArr->GetNextCell(npts,pts);
            vTriangulos[j]= pts[0];
            vTriangulos[j+1]= pts[1];
            vTriangulos[j+2]= pts[2];

            j+=3;
     }

Is that correct? Again, Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070511/70c305db/attachment.htm>


More information about the vtkusers mailing list