无法从“Surface_mesh”转换为“Nef_polyhedron_3”

问题描述 投票:0回答:1

问题

我加载了自己的网格文件(.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;
}

环境

  • 操作系统(Windows/Mac/Linux,32/64位):Windows 64位
  • 编译器:Visual Studio 2019
  • 发布或调试模式:debug Specific
  • CGAL版本:5.5.1
  • 增强版本:1.71.0
  • 其他库版本(如果使用)(Eigen、TBB 等):Eigen 3

我希望能够使用“Nef_polyhedron_3()”将我的Surface_mesh对象转换为Nef_polyhedron_3对象,然后我可以对Nef Polyhedra进行一些布尔运算。 如果需要我的数据(.obj),我可以使用“Wetransfer”提供。

c++ cgal
1个回答
0
投票
#include <CGAL/Nef_polyhedron_3.h>
typedef CGAL::Nef_polyhedron_3<K> Nef3; // K is your kernel
Nef3 nef(mesh); // convert mesh to nef
© www.soinside.com 2019 - 2024. All rights reserved.