Operations on Surface_mesh in CGAL

#include #include #include # include typedef CGAL::Simple_cartesian K;typedef CGAL::Surface_mesh Mesh;typedef Mesh::Vertex_index vertex_descriptor;typedef Mesh::Face_index face_descriptor;int main(){ Mesh m; // ux // +------------+ // | | // | | // | f | // | | // | | // +---- --------+ // vw // Add the points as vertices vertex_descriptor u = m.add_vertex(K::Point_3(0,1,0)); vertex_descriptor v = m.add_vertex(K::Point_3 (0,0,0)); vertex_descriptor w = m.add_vertex(K::Point_3(1,0,0)); vertex_descriptor x = m.add_vertex(K::Point_3(1,1,0)); face_descriptor f = m.add_face(u,v,w,x); {std::cout << "vertices around vertex "<< v << std::endl; CGAL::Vertex_around_target_circulator vbegin(m.halfedge (v),m), done(vbegin); do {std::cout << *vbegin++ << std::endl;} while(vbegin != done);} {std::cout << "edges around face "<< f << std::endl; CGAL::Halfedge_around_face_iterator hbegin, hend; for(boost::tie(hbegin, hend) = halfedges_around_face(m.halfedge(f), m); hbegin != hend ; ++hbegin){ std::cout << *hbegin << std::endl; std::cout << m.face(*hbegin) << std::endl; std::cout << m.opposite (*hbegin) << std::endl; std::cout << m.face(m.opposite(*hbegin)) << std::endl;}} {std::cout << "vertices around face " << f << std::endl; CGAL::Vertex_around_face_iterator vbegin, vend; for(boost::tie(vbegin, vend) = vertices_around_face(m.halfedge(f), m); vbegin != vend; ++vbegin){ std::cout << *vbegin << std::endl;}} // or the same again, but directly with a range based loop BOOST_FOREACH(vertex_descriptor vd,vertices_around_face(m.halfedge(f), m)){ std::cout << vd << std::endl;} ret urn 0;}

note the difference between Surface_mesh and Polyhedron when referring to data from descriptor

In Polyhedron

Halfedge_handle h ; < /div>

Halfedge_handle g = h->next()->opposite()->next(); < /div>

In Surface_mesh

CGAL::Halfedge_around_face_iterator hbegin;

m.face(m. opposite(*hbegin))

Halfedge_handle h ;

Halfedge_handle g = h->next ()->opposite()->next();

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1482 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.