Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-05-13 10:19:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-05-13 10:49:57 +0400
commitbdf477d19a92b210aafc7a4d1d09b46717538ffd (patch)
tree61f7428ef7fd515807de60b37ccadc4549d8556c /source/blender/bmesh/operators
parent2055e968df654ade2a7a477dcc7c134b1f65dcb8 (diff)
BMesh: add check to BM_vert_pair_share_face to allow adjacent loops
Add BM_vert_pair_share_face_by_angle to avoid selecting concave splits.
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index e0c86564db4..8d948fbcc69 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -140,13 +140,19 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v_a, BMVert *v_b, BMFace
/* this isn't the best thing in the world. it doesn't handle cases where there's
* multiple faces yet. that might require a convexity test to figure out which
- * face is "best" and who knows what for non-manifold conditions. */
- f = BM_vert_pair_share_face(v_a, v_b, &l_a, &l_b);
+ * face is "best" and who knows what for non-manifold conditions.
+ *
+ * note: we allow adjacent here, since theres no chance this happens.
+ */
+ f = BM_vert_pair_share_face_by_len(v_a, v_b, &l_a, &l_b, true);
+
if (f) {
BMFace *f_new;
BMLoop *l_new;
+ BLI_assert(!BM_loop_is_adjacent(l_a, l_b));
+
f_new = BM_face_split(bm, f, l_a, l_b, &l_new, NULL, false);
if (r_f_new) *r_f_new = f_new;