[Bf-blender-cvs] [8cd106f] master: minor edits to last commit

Campbell Barton noreply at git.blender.org
Mon Feb 2 09:21:46 CET 2015


Commit: 8cd106f12a760ffa9dc6205c4bce30d932f96900
Author: Campbell Barton
Date:   Mon Feb 2 19:19:52 2015 +1100
Branches: master
https://developer.blender.org/rB8cd106f12a760ffa9dc6205c4bce30d932f96900

minor edits to last commit

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

M	source/blender/bmesh/intern/bmesh_queries.h
M	source/blender/bmesh/operators/bmo_connect_concave.c

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

diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h
index 535b752..abff557 100644
--- a/source/blender/bmesh/intern/bmesh_queries.h
+++ b/source/blender/bmesh/intern/bmesh_queries.h
@@ -143,7 +143,6 @@ bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag) ATTR_WARN_
 bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
 bool BM_face_is_normal_valid(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-bool BM_face_is_convex(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
 float BM_mesh_calc_volume(BMesh *bm, bool is_signed) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
diff --git a/source/blender/bmesh/operators/bmo_connect_concave.c b/source/blender/bmesh/operators/bmo_connect_concave.c
index aec8119..f6f0ed4 100644
--- a/source/blender/bmesh/operators/bmo_connect_concave.c
+++ b/source/blender/bmesh/operators/bmo_connect_concave.c
@@ -22,6 +22,14 @@
  *  \ingroup bmesh
  *
  * Connect vertices so all resulting faces are convex.
+ *
+ * Implementation:
+ *
+ * - triangulate all concave face (tagging convex verts),
+ * - rotate edges (beautify) so edges will connect nearby verts.
+ * - sort long edges (longest first),
+ *   put any edges between 2 convex verts last since they often split convex regions.
+ * - merge the sorted edges as long as they don't create convex ngons.
  */
 
 #include "MEM_guardedalloc.h"
@@ -56,11 +64,12 @@ static int bm_edge_length_cmp(const void *a_, const void *b_)
 	else if (e_a_concave > e_b_concave) return  1;
 	else
 	{
+		/* otherwise shortest edges last */
 		const float e_a_len = BM_edge_calc_length_squared(e_a);
 		const float e_b_len = BM_edge_calc_length_squared(e_b);
 		if      (e_a_len < e_b_len) return  1;
 		else if (e_a_len > e_b_len) return -1;
-		else                    return  0;
+		else                        return  0;
 	}
 }




More information about the Bf-blender-cvs mailing list