From 48190fa51afee4e72eaea7b8f7477c883660b067 Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Thu, 19 May 2022 17:45:18 +0200 Subject: [PATCH] compilation works, but results are still terrbile --- src/slic3r/Utils/FixModelByTetrahedrons.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/slic3r/Utils/FixModelByTetrahedrons.cpp b/src/slic3r/Utils/FixModelByTetrahedrons.cpp index edc430456d..d8ca03d900 100644 --- a/src/slic3r/Utils/FixModelByTetrahedrons.cpp +++ b/src/slic3r/Utils/FixModelByTetrahedrons.cpp @@ -41,14 +41,13 @@ indexed_triangle_set fix_model_volume_mesh(const TriangleMesh &mesh) { std::cout << "vertices v" << vertices.rows() << std::endl; std::cout << "faces f" << faces.rows() << std::endl; - Eigen::MatrixXf vertices2; Eigen::MatrixXi faces2; Eigen::VectorXi I; Eigen::MatrixXi IF; - remesh_self_intersections(vertices, faces, {}, vertices2, faces2, IF, J, I); + igl::copyleft::cgal::remesh_self_intersections(vertices, faces, {}, hull_v, faces2, IF, J, I); - igl::copyleft::cgal::outer_hull_legacy(vertices2, faces2, hull_v, hull_f, J, flip); + igl::copyleft::cgal::outer_hull_legacy(hull_v, faces2, hull_f, J, flip); std::cout << "hull v" << hull_v.rows() << std::endl; std::cout << "hull f" << hull_f.rows() << std::endl; @@ -98,14 +97,14 @@ indexed_triangle_set fix_model_volume_mesh(const TriangleMesh &mesh) { indexed_triangle_set fixed_mesh; fixed_mesh.vertices.resize(hull_v.rows()); - fixed_mesh.indices.resize(hull_f.rows()); + fixed_mesh.indices.resize(new_faces.rows()); for (int v = 0; v < hull_v.rows(); ++v) { fixed_mesh.vertices[v] = hull_v.row(v).cast(); } - for (int f = 0; f < hull_f.rows(); ++f) { - fixed_mesh.indices[f] = hull_f.row(f); + for (int f = 0; f < new_faces.rows(); ++f) { + fixed_mesh.indices[f] = new_faces.row(f); } std::cout << "returning fixed mesh " << std::endl;