SV: [vtkusers] using GetNumberOfTriangles()

mam06bhv at studserv.uni-leipzig.de mam06bhv at studserv.uni-leipzig.de
Sun Nov 12 13:59:52 EST 2006


Hi Darvann
thanks for your help.
I used the vtkSTLReader to load the file and the vtkPolyDataMapper
Now I used your code but I got this error message:
"'GetPoints' : is not a member of 'vtkPolyDataReader'"

Tron Darvann schrieb:
>
> This code will get the number of cells.
>
> If you only have triangles, it will be the number of triangles.
>
> // Read the surface (VTK type in this example)
>
> vtkPolyDataReader *surf = vtkPolyDataReader :: New();
>
> surf -> SetFileName(filename);
>
> surf -> Update();
>
> // Put surface points in Points
>
> vtkPoints Points = Surf -> GetPoints();
>
> // Get the number of cells, e.g. triangles
>
> ncells = Points -> GetNumberOfCells();
>
>
>
> Tron Darvann
> Research Engineer, PhD, 3D-Laboratory
>
> Tel: (+45) 35 32 67 58 (lab) / (+45) 28 20 03 12 (mobile)
> E-mail: trd at odont.ku.dk
> Skype: tron.darvann
> Fax: (+45) 35 32 65 05
> Mailing and Visiting Address:
> 3D-Lab, School of Dentistry
> University of Copenhagen
> Nørre Alle 20
> DK-2200 Copenhagen N
> Denmark
>
> Fra: vtkusers-bounces+trd=odont.ku.dk at vtk.org på vegne af
mam06bhv at studserv.uni-leipzig.de
> Sendt: lø 11-11-2006 20:58
> Til: vtkusers at vtk.org
> Emne: [vtkusers] using GetNumberOfTriangles()
>
> Hello,
> does someone know how to use the function GetNumberOfTriangles() to get the
> numbers of triangles for a 3D model?
> thanks
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> 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



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the vtkusers mailing list