私が定義されており、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;
しかし、私は別のものに1をオンにする方法が表示されません。そのようなことを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の\ブースト/グラフ/ graph_traits.hpp(57)へのコンパイルに失敗:エラーC2039: のvertex_descriptorは:メンバーではありません の "OpenMesh :: PolyMesh_ArrayKernelT < OpenMesh :: DefaultTraits>"
コンパイルに失敗し、推奨される 'CGAL :: copy_face_graph()'関数 – DuckQueen
を使ったデモコードを追加しました。 '#include'がありません。 –
sloriot