views:

77

answers:

2

Hi,

I'm using the triangle++ wrapper class from http://www.compgeom.com/~piyush/scripts/triangle/ to triangulate a point cloud for visulaizing with OpenGL. I was able to put in my points and caluculate the triangulation. After that i also was able to access the vertices over a vertex iterator, how it is shown in the main.cpp example included in the package. Now i want to access the vertices over the face iterator (theres also an example in the main.cpp). I want to iterate over all faces and get the three vertices for every face. Has anyone done that already? I've been trying to modify the wrapper class for ~2 days already with no success.

thanks a lot in advance! Sebastian

A: 

the sample code works, but doesn't contain what i want. I want to take one face an get all three vertices separately, for example:

Delaunay::fIterator fit = delobject.fbegin(); double x0 = fit.GetVertex(0).x(); double y0 = fit.GetVertex(0).y(); double z0 = fit.GetVertex(0).z(); double x1 = fit.GetVertex(1).x(); double y1 = fit.GetVertex(1).y(); double z1 = fit.GetVertex(1).z();

or something like that. Of course these functions doesnt exist, but I even don't know how to access the vertices of a concret face in generally.

Sebastian
A: 

Hi, i got a solution for the problem. Just for the sake of completeness, it works like that:

double x0 = delobject.point_at_vertex_id(delobject.Org(fit))[0]; double y0 = delobject.point_at_vertex_id(delobject.Org(fit))[1]; double x1 = delobject.point_at_vertex_id(delobject.Dest(fit))[0]; double y1 = delobject.point_at_vertex_id(delobject.Dest(fit))[1]; double x2 = delobject.point_at_vertex_id(delobject.Apex(fit))[0]; double y2 = delobject.point_at_vertex_id(delobject.Apex(fit))[1]; ...

sebastian

Sebastian