diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-26 10:34:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-26 10:38:45 +0300 |
commit | 23252eece61bada6659f9d7b3e923954ae2ec413 (patch) | |
tree | ea2125c5795d9731cdc66c43cf65ee5516f126d9 /source/blender | |
parent | 329bf8e1bf0e9c74a7ef9426dcb237df9ac1287d (diff) |
Minor improvement to last commit
Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/operators/bmo_rotate_edge.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); } } |