[Bf-blender-cvs] [111458f6c7a] soc-2021-adaptive-cloth: adaptive_cloth: fix: Mesh: collapse edge: can lead to loose verts
ishbosamiya
noreply at git.blender.org
Sun Aug 22 17:23:40 CEST 2021
Commit: 111458f6c7a8df52d073577e653935dc2902e8f0
Author: ishbosamiya
Date: Sun Aug 15 16:08:07 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rB111458f6c7a8df52d073577e653935dc2902e8f0
adaptive_cloth: fix: Mesh: collapse edge: can lead to loose verts
The previous commit can lead to loose verts (verts that don't have any
edges attached). Such verts should be deleted.
===================================================================
M source/blender/blenkernel/BKE_cloth_remesh.hh
===================================================================
diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index 263f393deb2..cba6bd108a4 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -2030,6 +2030,20 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
if (v2_e_f.has_vert_index(v1_index)) {
to_delete_edge_indices.add(v2_e_index);
+
+ /* It is possible for `ov` to become a loose vert when
+ * it has only one face attached. So delete it in such
+ * a case */
+ BLI_assert(v2_e.get_verts());
+ auto ov_index = std::get<0>(v2_e.get_verts().value());
+ if (ov_index == v2_index) {
+ ov_index = std::get<1>(v2_e.get_verts().value());
+ }
+
+ const auto ov_face_indices = this->get_checked_face_indices_of_vert(ov_index);
+ if (ov_face_indices.size() == 1) {
+ to_delete_vert_indices.add(ov_index);
+ }
}
}
}
More information about the Bf-blender-cvs
mailing list