From 2f53741cfe66fca724712f46a1321999a32a92e7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 Jan 2013 03:12:19 +0000 Subject: bridge tool could make bow-tie quads when given 2 isolated edges. --- source/blender/bmesh/operators/bmo_connect.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source') diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index 3a0e18b9ee5..9a17ebea38d 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -359,6 +359,17 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op) /* Last point of loop 2 */ v4 = get_outer_vert(bm, ee2[clamp_index(-1, BLI_array_count(ee2))]); + /* ugh, happens when bridging single edges, user could just make a face + * but better support it for sake of completeness */ + if (v1 == v2) { + BLI_assert(BLI_array_count(ee1) == 1); + v2 = (vv1[0] == v2) ? vv1[1] : vv1[0]; + } + if (v3 == v4) { + BLI_assert(BLI_array_count(ee2) == 1); + v4 = (vv2[0] == v4) ? vv2[1] : vv2[0]; + } + /* If v1 is a better match for v4 than v3, AND v2 is a better match * for v3 than v4, the loops are in opposite directions, so reverse * the order of reads from vv1. We can avoid sqrt for comparison */ -- cgit v1.2.3