Use admesh's stl_repair() instead of simulating it ourselves.

fixes #4805
This commit is contained in:
Joseph Lenox 2019-05-18 00:45:42 -05:00 committed by Joseph Lenox
parent c3ca6d2bb1
commit de538954aa

View File

@ -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();