[Bf-blender-cvs] [23252eece61] master: Minor improvement to last commit
Campbell Barton
noreply at git.blender.org
Sun Nov 26 08:26:27 CET 2017
Commit: 23252eece61bada6659f9d7b3e923954ae2ec413
Author: Campbell Barton
Date: Sun Nov 26 18:34:21 2017 +1100
Branches: master
https://developer.blender.org/rB23252eece61bada6659f9d7b3e923954ae2ec413
Minor improvement to last commit
Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.
===================================================================
M source/blender/bmesh/operators/bmo_rotate_edge.c
===================================================================
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);
}
}
More information about the Bf-blender-cvs
mailing list