From de538954aaf16ea81e016ca75308b13f5860222d Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sat, 18 May 2019 00:45:42 -0500 Subject: [PATCH] Use admesh's stl_repair() instead of simulating it ourselves. fixes #4805 --- xs/src/libslic3r/TriangleMesh.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/xs/src/libslic3r/TriangleMesh.cpp b/xs/src/libslic3r/TriangleMesh.cpp index 32b65ce86..60489ef58 100644 --- a/xs/src/libslic3r/TriangleMesh.cpp +++ b/xs/src/libslic3r/TriangleMesh.cpp @@ -172,23 +172,9 @@ TriangleMesh::repair() { if (this->stl.stats.number_of_facets == 0) return; this->check_topology(); - - // remove_unconnected - if (stl.stats.connected_facets_3_edge < stl.stats.number_of_facets) { - stl_remove_unconnected_facets(&stl); - } - - // fill_holes - if (stl.stats.connected_facets_3_edge < stl.stats.number_of_facets) { - stl_fill_holes(&stl); - stl_clear_error(&stl); - } - - // normal_directions - stl_fix_normal_directions(&stl); - - // normal_values - stl_fix_normal_values(&stl); + + /// Call the stl_repair from admesh rather than reimplementing it ourselves. + stl_repair(&(this->stl), 1, 1, 0, 0, 0, 0, 0, 100, 1, 1, 1, 1, 1, 0); // always calculate the volume and reverse all normals if volume is negative (void)this->volume();