我已根据here:typedef OpenMesh::PolyMesh_ArrayKernelT</* MyTraits*/> Surface_mesh;
中的建议定义并加载了曲面网格,但尚未使用
算法为Triangulated Surface Mesh Segmentation我需要一个多面体:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
然而,我不知道如何将一个变成另一个。如何在CGAL中做这样的事情?
简化演示:
#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);
}
}
由于
而无法编译boost_1_63_0 \ boost / graph / graph_traits.hpp(57):错误C2039: vertex_descriptor:不是。的成员 &#34; OpenMesh :: PolyMesh_ArrayKernelT&LT; OpenMesh :: DefaultTraits&gt;&#34;