【发布时间】:2019-11-20 13:11:35
【问题描述】:
我想使用 CGAL 的多边形网格处理包对两个网格执行布尔运算。 问题是 corefinement_and_union 示例崩溃了:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_mesh_processing/corefinement.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Surface_mesh<K::Point_3> Mesh;
namespace PMP = CGAL::Polygon_mesh_processing;
int main(int argc, char* argv[])
{
const char* filename1 = (argc > 1) ? argv[1] : "blobby.off";
const char* filename2 = (argc > 2) ? argv[2] : "eight.off";
std::ifstream input1(filename1);
std::ifstream input2(filename2);
Mesh mesh1, mesh2;
input1 >> mesh1;
std::cout << mesh1.number_of_vertices() << std::endl; //mesh1 input OK
input1.close();
input2 >> mesh2;
input2.close();
std::cout << mesh2.number_of_vertices() << std::endl; //mesh2 input OK
Mesh out;
bool valid_union = PMP::corefine_and_compute_union(mesh1,mesh2, out); //crashes
if (valid_union)
{
std::cout << "Union was successfully computed\n";
std::ofstream output("union.off");
output << out;
return 0;
}
std::cout << "Union could not be computed\n";
return 1;
}
我使用 cgal 5.0 作为仅标头库,带有 boost 1.71.0 v14.1、Eigen 3.3.7 和 msvc 2017。我尝试在 PMP::corefine_and_compute_union(mesh1,mesh2, out) 上运行 msvc 调试器,但无济于事......
任何想法为什么会发生这种情况以及如何让它在 MSVC 2017 上运行?
【问题讨论】:
标签: cgal