[vtkusers] How to get coordinates of a cell?

gonza8888 gonzaloama at yahoo.com.ar
Tue Apr 24 06:47:11 EDT 2012


If you have the mesh, you should use

   GetPolys()->GetNextCell(npts,pts); 

to traverse your polydata.. then, each triangle of the mesh is stored in
pts. So you have the 3 vertices

   int v1 = pts[0]; 
   int v2 = pts[1];
   int v3 = pts[2];

And if you want the 3D coordinate of each vertice, you can use :

  double a[3];
  GetPoints()->GetPoint(iA, a);
   A_index[0] = a[0];
   A_index[1] = a[1];
   A_index[2] = a[2];

So you can play with that and have the center of the triangle =)

I didn't look for a function that make that specific thing, maybe take a
look at the polydata doc.

--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-coordinates-of-a-cell-tp5661492p5661633.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list