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
19 using vidx_t =
typename sm_t::Vertex_index;
25 vertices.reserve(sm.number_of_vertices());
26 faces.reserve(sm.number_of_faces());
27 std::map<vidx_t, std::size_t>
index;
28 for (
const auto& vidx : sm.vertices())
31 const auto& p = sm.point(vidx);
32 armarx::Vector3f visp;
38 for (
const auto& fidx : sm.faces())
41 const auto hf = sm.halfedge(fidx);
43 for (
auto hi : CGAL::halfedges_around_face(hf, sm))
49 f.v0 =
index.at(vidx);
52 f.v1 =
index.at(vidx);
55 f.v2 =
index.at(vidx);
62 faces.emplace_back(f);
67 template <
class PolyhedronTraits_3,
68 class PolyhedronItems_3,
69 template <
class T,
class I,
class A>
79 vertices.reserve(p3.size_of_vertices());
80 faces.reserve(p3.size_of_facets());
81 auto vbeg = p3.vertices_begin();
82 for (
const auto&
v : CGAL::Iterator_range{vbeg, p3.vertices_end()})
84 const auto& p =
v.point();
85 armarx::Vector3f visp;
91 for (
const auto& fidx : CGAL::Iterator_range{p3.facets_begin(), p3.facets_end()})
93 auto circ = fidx.facet_begin();
103 <<
"Internal error while circulating a facet";
104 faces.emplace_back(f);