forked from bartvdbraak/blender
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.
This commit is contained in:
parent
0ec87f1227
commit
344a669c41
@ -239,8 +239,9 @@ static void polyedge_beauty_cost_update_single(
|
|||||||
const float cost = polyedge_rotate_beauty_calc(coords, tris, e);
|
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.
|
/* 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?
|
* Anyway, costs above that are not worth recomputing, maybe we could even optimize it to a smaller limit?
|
||||||
* See T43578. */
|
* Actually, FLT_EPSILON is too small in some cases, 1e-6f seems to work OK hopefully?
|
||||||
if (cost < -FLT_EPSILON) {
|
* See T43578, T49478. */
|
||||||
|
if (cost < -1e-6f) {
|
||||||
eheap_table[i] = BLI_heap_insert(eheap, cost, e);
|
eheap_table[i] = BLI_heap_insert(eheap, cost, e);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user