I have defined and loaded a surface mesh as suggested in here: typedef OpenMesh::PolyMesh_ArrayKernelT</* MyTraits*/> Surface_mesh;
, yet to use such
algorithm as Triangulated Surface Mesh Segmentation I need a Polyhedron alike:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
Yet I do not see how to turn one into another. How to do such thing in CGAL?
A simplified demo:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/mesh_segmentation.h>
#include <CGAL/Polygon_mesh_processing/connected_components.h>
#include <CGAL/boost/graph/copy_face_graph.h>
#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <iostream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef OpenMesh::PolyMesh_ArrayKernelT</* MyTraits*/> Surface_mesh;
int main()
{
// create and read Polyhedron
Surface_mesh mesh_in, mesh_out;
Polyhedron mesh;
OpenMesh::IO::read_mesh( mesh_in, "data/elephant.off");
CGAL::copy_face_graph(mesh_in, mesh);
CGAL::copy_face_graph(mesh, mesh_out);
if (!OpenMesh::IO::write_mesh(mesh_out, "slon.obj"))
{
std::cerr << "write error\n";
exit(1);
}
}
Which fails to compile due to
boost_1_63_0\boost/graph/graph_traits.hpp(57): error C2039: vertex_descriptor: is not a member of "OpenMesh::PolyMesh_ArrayKernelT< OpenMesh::DefaultTraits >"