Hello,
I'm using cgal-bindings with CGAL 4.3 and trying to render a polyhedron using processing 2. I've found that the hasNext() method of Polyhedron_3_Halfedge_around_facet_circulator seems to always return true. I've resorted to the following but it's obviously not ideal:
public void draw_facet(Polyhedron_3_Facet_handle fh)
{
// revolve around current face to get vertices
Polyhedron_3_Halfedge_around_facet_circulator hec = fh.facet_begin();
int i = 0;
beginShape();
while(i<3){
Polyhedron_3_Halfedge_handle current = hec.next();
Point_3 point = current.vertex().point();
vertex((float) point.x()*800f, (float) point.y() *800f, (float) point.z()*800f);
i++;
}
endShape(CLOSE);
}
I'd like to have the while loop look like this:
while(hec.hasNext()){
Polyhedron_3_Halfedge_handle current = hec.next();
Point_3 point = current.vertex().point();
vertex((float) point.x()*800f, (float) point.y() *800f, (float) point.z()*800f);
}
But due to the the problem with hasNext() always returning true this doesn't work. Any ideas on what I'm doing wrong here?
Thanks,
Roland