Fix CGAL import with shared boost

This commit is contained in:
tamasmeszaros 2019-12-10 15:10:39 +01:00
parent c6223e5d7c
commit c8a088e652
2 changed files with 11 additions and 5 deletions

View file

@ -1,5 +1,9 @@
if (SLIC3R_STATIC)
set(CGAL_Boost_USE_STATIC_LIBS ON)
endif ()
find_package(CGAL REQUIRED)
add_executable(meshboolean MeshBoolean.cpp)
target_link_libraries(meshboolean libslic3r CGAL::CGAL)

View file

@ -46,11 +46,14 @@ void mesh_boolean_test(const std::string &fname)
//igl::copyleft::cgal::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC,J);
std::cout << fname.c_str() << std::endl;
TriangleMesh mesh;
mesh.ReadSTLFile(fname.c_str());
mesh.repair(true);
its_write_obj(mesh.its, (fname + "-imported0.obj").c_str());
Eigen::MatrixXd VA,VB,VC;
Eigen::VectorXi J,I;
Eigen::MatrixXi FA,FB,FC;
@ -64,7 +67,6 @@ void mesh_boolean_test(const std::string &fname)
Eigen::MatrixXi F = MapMatrixXiUnaligned(mesh.its.indices.front().data(), mesh.its.indices.size(), 3);
its_write_obj(V, F, (fname + "-imported.obj").c_str());
// Self-union to clean up
igl::copyleft::cgal::mesh_boolean(V, F, Eigen::MatrixXd(), Eigen::MatrixXi(), boolean_type, VC, FC);