我加载了自己的网格文件(.obj),该文件由“CGAL::Polygon_mesh_processing::extrude_mesh()”创建。我想使用“Nef_polyhedron_3()”将 Surface_mesh 对象转换为 Nef_polyhedron_3 对象。代码无法编译,我收到一些如下错误:
C2440 "Initialize": Cannot convert from "_Ty" to "size_t" polygon_mesh_to_nef_3.h 199
C2440 "Initialize": Cannot convert from "_Ty" to "size_t" polygon_mesh_to_nef_3.h 250
C2440 "Initialize": Cannot convert from "_Ty" to "size_t" polygon_mesh_to_nef_3.h 282
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Surface_mesh<Point> SM;
typedef Kernel::Vector_3 Vector;
typedef boost::graph_traits<SM>::face_descriptor face_descriptor;
typedef boost::graph_traits<SM>::halfedge_descriptor halfedge_descriptor;
typedef SM::Property_map<face_descriptor, Vector> FaceMap;
typedef SM::Property_map<halfedge_descriptor, Vector> halfedgeMap;
using namespace std;
namespace PMP = CGAL::Polygon_mesh_processing;
namespace params = CGAL::parameters;
int main(int argc, char** argv)
{
char final[] = "E:/point/output/0_10_small_final.obj";
SM mesh;
FaceMap faceMap;
halfedgeMap HalMap;
CGAL::IO::read_polygon_mesh(final, mesh);
Nef_PHD mesh3(mesh, HalMap, faceMap);
cout << mesh3 << endl;
return EXIT_FAILURE;
}
我希望能够使用“Nef_polyhedron_3()”将我的Surface_mesh对象转换为Nef_polyhedron_3对象,然后我可以对Nef Polyhedra进行一些布尔运算。 如果需要我的数据(.obj),我可以使用“Wetransfer”提供。
#include <CGAL/Nef_polyhedron_3.h>
typedef CGAL::Nef_polyhedron_3<K> Nef3; // K is your kernel
Nef3 nef(mesh); // convert mesh to nef