Search code examples
cgaledges

CGAL Endpoint Vertices of 3D Polyhedron


Is there any way to get the two endpoint vertices of an edge from a 3D Polyhedron? I know I can iterate over halfedges, but I would rather iterate over every other halfedge because I only need the edge length along each side of a given facet.


Solution

  • If you have eit an Edge_iterator, you can access the source and target vertices using eit->opposite()->vertex() and eit->vertex() respectively. If you want to access the point associated to a vertex, you can use the point() member function (that is eit->vertex()->point()).