[Bf-blender-cvs] [d7531b6a9a0] soc-2021-adaptive-cloth: adaptive_cloth: AdaptiveMesh: split_edges()

ishbosamiya noreply at git.blender.org
Mon Jul 26 08:17:40 CEST 2021


Commit: d7531b6a9a0e0e192ab94b965185a39d702796fd
Author: ishbosamiya
Date:   Mon Jul 19 22:03:06 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rBd7531b6a9a0e0e192ab94b965185a39d702796fd

adaptive_cloth: AdaptiveMesh: split_edges()

Splits edges whose "size" is greater than 1.0

TODO(ish): Need to flip edges of those faces that have been affected
by the split edge operation.

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

M	source/blender/blenkernel/intern/cloth_remesh.cc

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

diff --git a/source/blender/blenkernel/intern/cloth_remesh.cc b/source/blender/blenkernel/intern/cloth_remesh.cc
index 081ab14fe51..b2e8b902f57 100644
--- a/source/blender/blenkernel/intern/cloth_remesh.cc
+++ b/source/blender/blenkernel/intern/cloth_remesh.cc
@@ -269,6 +269,30 @@ class AdaptiveMesh : public Mesh<NodeData, VertData, EdgeData, internal::EmptyEx
     }
   }
 
+  /**
+   * Splits edges whose "size" is greater than 1.0
+   *
+   * Based on [1]
+   *
+   * Here "size" is determined by `Sizing` stores in `Vert`s of the
+   * `Edge`, using the function `Sizing::get_edge_size_sq()`.
+   */
+  void split_edges()
+  {
+    auto splittable_edges_set = this->get_splittable_edge_indices_set();
+    do {
+      for (const auto &edge_index : splittable_edges_set) {
+        auto &edge = this->get_checked_edge(edge_index);
+        this->split_edge_triangulate(edge.get_self_index(), true);
+
+        /* TODO(ish): Need to flip edges of those faces that have been
+         * affected by the split edge operation. */
+      }
+
+      splittable_edges_set = this->get_splittable_edge_indices_set();
+    } while (splittable_edges_set.size() == 0);
+  }
+
  private:
   /**
    * Gets the maximal independent set of splittable edge indices in



More information about the Bf-blender-cvs mailing list