3 #pragma GCC diagnostic push
4 #pragma GCC diagnostic ignored "-Wpedantic"
5 #include <CGAL/Polyhedron_3.h>
6 #include <CGAL/Surface_mesh/Surface_mesh.h>
7 #include <CGAL/boost/graph/iterator.h>
8 #pragma GCC diagnostic pop
18 using vidx_t =
typename sm_t::Vertex_index;
24 vertices.reserve(sm.number_of_vertices());
25 faces.reserve(sm.number_of_faces());
26 std::map<vidx_t, std::size_t>
index;
27 for (
const auto& vidx : sm.vertices())
30 const auto& p = sm.point(vidx);
31 armarx::Vector3f visp;
37 for (
const auto& fidx : sm.faces())
40 const auto hf = sm.halfedge(fidx);
42 for (
auto hi : CGAL::halfedges_around_face(hf, sm))
48 f.v0 =
index.at(vidx);
51 f.v1 =
index.at(vidx);
54 f.v2 =
index.at(vidx);
61 faces.emplace_back(f);
66 template <
class PolyhedronTraits_3,
67 class PolyhedronItems_3,
68 template <
class T,
class I,
class A>
82 vertices.reserve(p3.size_of_vertices());
83 faces.reserve(p3.size_of_facets());
84 auto vbeg = p3.vertices_begin();
85 for (
const auto&
v : CGAL::Iterator_range{vbeg, p3.vertices_end()})
87 const auto& p =
v.point();
88 armarx::Vector3f visp;
94 for (
const auto& fidx : CGAL::Iterator_range{p3.facets_begin(), p3.facets_end()})
96 auto circ = fidx.facet_begin();
98 <<
"One face is no triangle!";
107 <<
"Internal error while circulating a facet";
108 faces.emplace_back(f);