SV: SV: [vtkusers] using GetNumberOfTriangles()
mam06bhv at studserv.uni-leipzig.de
mam06bhv at studserv.uni-leipzig.de
Sun Nov 12 16:41:22 EST 2006
Hi Darvann,
thanks, the program is running. Now I get a real good number.
Is it possible that if I run this code after reducing the number of triangles I
get a lower (as I run the code before the reducing) number of cells (triangles)?
Or do I have to save the reduced model before running the code again?
Zitat von Tron Darvann <trd at odont.ku.dk>:
> Sorry, there seems to have been many errors in the example, I was too quick!
> It should have been like this:
>
>
> // Read the surface (VTK type in this example)
>
> vtkPolyDataReader *surfreader = vtkPolyDataReader :: New();
>
> surf -> SetFileName(filename);
>
> surf -> Update();
>
> // Put it in a PolyData object
>
> vtkPolyData *surf = surfreader -> GetOutput();
>
> // Get the number of cells, e.g. triangles
>
> ncells = surf-> 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: Markus voigt [mailto:markus-voigt at gmx.net]
> Sendt: sø 12-11-2006 19:51
> Til: Tron Darvann
> Cc: vtkusers at vtk.org
> Emne: Re: SV: [vtkusers] using GetNumberOfTriangles()
>
>
>
> 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 <mailto: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