[Bf-blender-cvs] [d2f7b1a1e8a] soc-2021-adaptive-cloth: adaptive_cloth: Mesh: is_edge_loose()

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


Commit: d2f7b1a1e8a9e3c1b60e4834e11d2e7bc4edaa3b
Author: ishbosamiya
Date:   Thu Jul 22 11:38:26 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rBd2f7b1a1e8a9e3c1b60e4834e11d2e7bc4edaa3b

adaptive_cloth: Mesh: is_edge_loose()

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

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 3ed058f04a1..858d4497b24 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -1855,6 +1855,23 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
                     std::move(deleted_faces));
   }
 
+  /**
+   * An edge is loose when it doesn't have any faces.
+   */
+  bool is_edge_loose(const Edge<EED> &edge) const
+  {
+    return edge.get_faces().size() == 0;
+  }
+
+  /**
+   * Easy call when only `edge_index` is available.
+   */
+  bool is_edge_loose(EdgeIndex edge_index) const
+  {
+    const auto &edge = this->get_checked_edge(edge_index);
+    return is_edge_loose(edge);
+  }
+
   /**
    * Boundary is the set of "3D edges" that have only a single
    * face. Not all meshes will have a boundary.



More information about the Bf-blender-cvs mailing list