Commit: 344a669c412a5eb5b71555a18aa85ef7a16b253f
Author: Bastien Montagne
Date:   Wed Sep 28 20:03:59 2016 +0200
Branches: master
https://developer.blender.org/rB344a669c412a5eb5b71555a18aa85ef7a16b253f

Fix T49478: triangulate of face hangs Blender.

Another case of float imprecision leading to endless loop. INcreasing a bit 
'noise threashold' seems to work OK.

Not a regression, but might be nice to have in 2.78a.

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

M       source/blender/blenlib/intern/polyfill2d_beautify.c

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

diff --git a/source/blender/blenlib/intern/polyfill2d_beautify.c 
b/source/blender/blenlib/intern/polyfill2d_beautify.c
index 46f9251..896177f 100644
--- a/source/blender/blenlib/intern/polyfill2d_beautify.c
+++ b/source/blender/blenlib/intern/polyfill2d_beautify.c
@@ -239,8 +239,9 @@ static void polyedge_beauty_cost_update_single(
                const float cost = polyedge_rotate_beauty_calc(coords, tris, e);
                /* We can get cases where both choices generate very small 
negative costs, which leads to infinite loop.
                 * Anyway, costs above that are not worth recomputing, maybe we 
could even optimize it to a smaller limit?
-                * See T43578. */
-               if (cost < -FLT_EPSILON) {
+                * Actually, FLT_EPSILON is too small in some cases, 1e-6f 
seems to work OK hopefully?
+                * See T43578, T49478. */
+               if (cost < -1e-6f) {
                        eheap_table[i] = BLI_heap_insert(eheap, cost, e);
                }
                else {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to