[Bf-blender-cvs] [acd989adb79] soc-2019-adaptive-cloth: Cloth: improve edge flip condition

ishbosamiya noreply at git.blender.org
Wed Jul 10 15:33:20 CEST 2019


Commit: acd989adb7948c73119546c552b47c63695ea23b
Author: ishbosamiya
Date:   Wed Jul 10 16:26:43 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rBacd989adb7948c73119546c552b47c63695ea23b

Cloth: improve edge flip condition

===================================================================

M	source/blender/blenkernel/intern/cloth_remeshing.cpp

===================================================================

diff --git a/source/blender/blenkernel/intern/cloth_remeshing.cpp b/source/blender/blenkernel/intern/cloth_remeshing.cpp
index 3c4f643449b..c07fc81499c 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -316,6 +316,7 @@ static pair<BMVert *, BMVert *> cloth_remeshing_edge_side_verts(BMEdge *e)
 }
 
 /* from Bossen and Heckbert 1996 */
+#define CLOTH_REMESHING_EDGE_FLIP_THRESHOLD 0.001f
 static bool cloth_remeshing_should_flip(
     BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4, vector<ClothSizing> &sizing)
 {
@@ -346,8 +347,8 @@ static bool cloth_remeshing_should_flip(
 
   return cloth_remeshing_wedge(zy, xy) * dot_v2v2(xw, mzw) +
              dot_v2v2(zy, mxy) * cloth_remeshing_wedge(xw, zw) <
-         0.0f; /* TODO(Ish): update 0.0f to what it is supposed to be,
-                * but 0.0f should work for testing for now */
+         -CLOTH_REMESHING_EDGE_FLIP_THRESHOLD *
+             (cloth_remeshing_wedge(zy, xy) + cloth_remeshing_wedge(xw, zw));
 }
 
 static vector<BMEdge *> cloth_remeshing_find_edges_to_flip(BMesh *bm,



More information about the Bf-blender-cvs mailing list