[Bf-blender-cvs] [79f714db6eb] soc-2019-adaptive-cloth: Cloth: Initial steps for flip edges

ishbosamiya noreply at git.blender.org
Fri Jun 28 19:52:38 CEST 2019


Commit: 79f714db6ebb12b6ed542ab704485c013e60577b
Author: ishbosamiya
Date:   Thu Jun 27 13:23:22 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB79f714db6ebb12b6ed542ab704485c013e60577b

Cloth: Initial steps for flip edges

Basic foundation for the general flow of the flip edges has been set. This is extremely important for both split edges and collapse edges.

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

M	source/blender/blenkernel/intern/cloth.c

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

diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index fef64c41231..eb77fd71734 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -588,6 +588,38 @@ static Mesh *cloth_remeshing_update_cloth_object_bmesh(Object *ob, ClothModifier
   return mesh_result;
 }
 
+static LinkNodePair *cloth_remeshing_find_edges_to_flip(BMesh *bm, LinkNodePair *active_faces)
+{
+  /* TODO(Ish) */
+}
+
+static LinkNodePair *cloth_remeshing_find_independent_edges(LinkNodePair *edges)
+{
+  /* TODO(Ish) */
+}
+
+static void cloth_remeshing_flip_edges(BMesh *bm, LinkNodePair *active_faces)
+{
+  /* TODO(Ish): This loop might cause problems */
+  while (BLI_linklist_count(active_faces->list) != 0) {
+    LinkNodePair *flipable_edges = cloth_remeshing_find_edges_to_flip(bm, active_faces);
+    LinkNodePair *independent_edges = cloth_remeshing_find_independent_edges(flipable_edges);
+
+    while (BLI_linklist_count(independent_edges->list) != 0) {
+      BMEdge *edge = BLI_linklist_pop(&independent_edges->list);
+      BM_edge_rotate(
+          bm, edge, true, BM_EDGEROT_CHECK_SPLICE); /* this sets it up for BM_CREATE_NO_DOUBLE */
+    }
+
+    /* TODO(Ish): need to update active_faces */
+  }
+}
+
+static bool cloth_remeshing_fix_mesh(BMesh *bm, LinkNodePair *active_faces)
+{
+  cloth_remeshing_flip_edges(bm, active_faces);
+}
+
 static float cloth_remeshing_edge_size(BMesh *bm, BMEdge *edge, LinkNodePair *sizing)
 {
   /* BMVert v1 = *edge->v1; */



More information about the Bf-blender-cvs mailing list