[Bf-blender-cvs] [ec96b03] dyntopo_holes: merge pairs based on distance to brush

Campbell Barton noreply at git.blender.org
Sun Oct 5 22:23:40 CEST 2014


Commit: ec96b03c5f750ae62220a164d80c1b650162cb8f
Author: Campbell Barton
Date:   Sun Oct 5 15:25:33 2014 +0200
Branches: dyntopo_holes
https://developer.blender.org/rBec96b03c5f750ae62220a164d80c1b650162cb8f

merge pairs based on distance to brush

not logical but works nice-ish

===================================================================

M	source/blender/blenkernel/intern/pbvh_bmesh.c

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 5e0d047..589e996 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -862,7 +862,15 @@ static void close_vert_queue_create(EdgeQueueContext *eq_ctx,
 					BMVert **pair = BLI_mempool_alloc(eq_ctx->pool);
 					pair[0] = vprev;
 					pair[1] = vcur;
+
+#if 1
+					BLI_heap_insert(eq_ctx->q->heap,
+					                min_ff(len_squared_v3v3(eq_ctx->q->center, vcur->co),
+					                       len_squared_v3v3(eq_ctx->q->center, vprev->co)),
+					                pair);
+#else
 					BLI_heap_insert(eq_ctx->q->heap, dist_sq, pair);
+#endif
 				}
 
 				/* the two vertices in the pair are obliterated as part of the genus topology change, get a new




More information about the Bf-blender-cvs mailing list