21 #ifndef EMODNET_QMGC_DETECT_SHARP_EDGES_WITHOUT_BORDERS_H 22 #define EMODNET_QMGC_DETECT_SHARP_EDGES_WITHOUT_BORDERS_H 24 #include <CGAL/Surface_mesh.h> 25 #include <CGAL/Polygon_mesh_processing/compute_normal.h> 37 template<
typename PolygonMesh,
39 typename EdgeIsSharpMap,
41 void detect_sharp_edges_without_borders(PolygonMesh &pmesh,
43 EdgeIsSharpMap &edge_is_sharp_map) {
44 FT cos_angle(std::cos(CGAL::to_double(angle_in_deg) * CGAL_PI / 180.));
47 BOOST_FOREACH(
typename boost::graph_traits<PolygonMesh>::edge_descriptor ed, edges(pmesh)) {
48 typename boost::graph_traits<PolygonMesh>::halfedge_descriptor he = halfedge(ed, pmesh);
49 typedef typename boost::graph_traits<PolygonMesh>::face_descriptor face_descriptor;
52 if (is_border_edge(he, pmesh))
56 face_descriptor f1 = face(he, pmesh);
57 face_descriptor f2 = face(opposite(he, pmesh), pmesh);
60 const typename GT::Vector_3 &n1 = CGAL::Polygon_mesh_processing::compute_face_normal(f1, pmesh);
61 const typename GT::Vector_3 &n2 = CGAL::Polygon_mesh_processing::compute_face_normal(f2, pmesh);
64 if (n1 * n2 <= cos_angle) {
65 put(edge_is_sharp_map, edge(he, pmesh),
true);
71 #endif //EMODNET_QMGC_DETECT_SHARP_EDGES_WITHOUT_BORDERS_H