Skip to content

Instantly share code, notes, and snippets.

@afabri
Created September 28, 2023 15:08
Show Gist options
  • Save afabri/3d1f85feee53e4b5973e50b2c9d43a7f to your computer and use it in GitHub Desktop.
Save afabri/3d1f85feee53e4b5973e50b2c9d43a7f to your computer and use it in GitHub Desktop.
iterate over vertices
#include <CGAL/Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_3 Point_3;
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
int main()
{
Surface_mesh sm;
boost::graph_traits<Surface_mesh>::vertex_descriptor vd = sm.add_vertex(Point_3(0,0,0));
sm.remove_vertex(vd);
vd = sm.add_vertex(Point_3(1,0,0));
for(auto v : vertices(sm)){
std::cout << sm.point(v) << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment