From 23252eece61bada6659f9d7b3e923954ae2ec413 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 26 Nov 2017 18:34:21 +1100 Subject: Minor improvement to last commit Don't operate on multiple boundaries at once, instead keep collapsing from the first selected boundary. --- source/blender/bmesh/operators/bmo_rotate_edge.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/bmesh/operators') diff --git a/source/blender/bmesh/operators/bmo_rotate_edge.c b/source/blender/bmesh/operators/bmo_rotate_edge.c index d4cafdd0dde..dd6bf77dd3c 100644 --- a/source/blender/bmesh/operators/bmo_rotate_edge.c +++ b/source/blender/bmesh/operators/bmo_rotate_edge.c @@ -156,6 +156,18 @@ static void bm_rotate_edges_shared( if (ok) { float cost = bm_edge_calc_rotate_cost(e); + if (pass_type == PASS_TYPE_BOUNDARY) { + /* Trick to ensure once started, non boundaries are handled before other boundary edges. + * This means the first longest boundary defines the starting point which is rotated + * until all its connected edges are exhausted and the next boundary is popped off the heap. + * + * Without this we may rotate from different starting points and meet in the middle + * with obviously uneven topology. + * + * Move from negative to positive value, inverting so large values are still handled first. + */ + cost = cost != 0.0f ? -1.0f / cost : FLT_MAX; + } eheap_table[i] = BLI_heap_insert(heap, cost, e); } } -- cgit v1.2.3