Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-09-28 21:03:59 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-09-28 21:05:46 +0300
commit344a669c412a5eb5b71555a18aa85ef7a16b253f (patch)
treee8deae8bd8103040fff6ebb326abba95a3a808d9 /source/blender/blenlib/intern
parent0ec87f122721b13c747279703b963242bbc23998 (diff)
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.
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/polyfill2d_beautify.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/polyfill2d_beautify.c b/source/blender/blenlib/intern/polyfill2d_beautify.c
index 46f9251bea7..896177f436c 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 {