diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-02 11:19:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-02 11:21:26 +0300 |
commit | 8cd106f12a760ffa9dc6205c4bce30d932f96900 (patch) | |
tree | 94dffb5a2be7e4a9ce36b311541a35c15a0b19e8 /source/blender/bmesh/operators/bmo_connect_concave.c | |
parent | f12c17abfe14cd7f7663a2206dd33cf9b168b0d6 (diff) |
minor edits to last commit
Diffstat (limited to 'source/blender/bmesh/operators/bmo_connect_concave.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_connect_concave.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_connect_concave.c b/source/blender/bmesh/operators/bmo_connect_concave.c index aec8119d421..f6f0ed48534 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; } } |