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:
authorCampbell Barton <ideasman42@gmail.com>2013-11-27 04:24:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-11-27 04:26:19 +0400
commit3f5b59cd90c961d9737e7dbf8999c5030b7ccadf (patch)
tree8e90010e186ab7fc2162579972ad1d868f536f69 /source/blender/bmesh
parent406289497f700cb68c99f6bae66d124a4bd13497 (diff)
Fix T37121: decimate works badly with flat surfaces
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/tools/bmesh_decimate_collapse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
index 99d46559ca5..3ee238ad54f 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
@@ -250,6 +250,9 @@ static void bm_decim_build_edge_cost_single(BMEdge *e,
}
// print("COST %.12f\n");
+ /* note, 'cost' shouldn't be negative but happens sometimes with small values.
+ * this can cause faces that make up a flat surface to over-collapse, see [#37121] */
+ cost = fabsf(cost);
eheap_table[BM_elem_index_get(e)] = BLI_heap_insert(eheap, cost, e);
}