diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-12-09 15:27:21 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-12-09 15:27:21 +0300 |
commit | e7e4cc5600b5264321c9a972be7d685da2b4a6d2 (patch) | |
tree | c69550739db0f22d667a9000f3de6bf0e54b0679 /src/admesh | |
parent | 61ab9e37d6cbafb62dc99f83520ff4fd9f930240 (diff) |
Fixed crash while repairing imported model
Diffstat (limited to 'src/admesh')
-rw-r--r-- | src/admesh/connect.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/admesh/connect.cpp b/src/admesh/connect.cpp index d6de6ce6a..c266c724c 100644 --- a/src/admesh/connect.cpp +++ b/src/admesh/connect.cpp @@ -601,11 +601,12 @@ void stl_remove_unconnected_facets(stl_file *stl) stl->neighbors_start[facet].which_vertex_not[edge[1]], stl->neighbors_start[facet].which_vertex_not[edge[2]] }; + // Update statistics on edge connectivity. - if (neighbor[0] == -1) - stl_update_connects_remove_1(neighbor[1]); - if (neighbor[1] == -1) - stl_update_connects_remove_1(neighbor[0]); + if ((neighbor[0] == -1) && (neighbor[1] != -1)) + stl_update_connects_remove_1(neighbor[1]); + if ((neighbor[1] == -1) && (neighbor[0] != -1)) + stl_update_connects_remove_1(neighbor[0]); if (neighbor[0] >= 0) { if (neighbor[1] >= 0) { |