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>2018-11-20 19:54:48 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-11-20 19:54:48 +0300
commitec851efda93ed19c9f7063c6167ae9437ed6803c (patch)
tree354ce7d5956e98c2347699f7f04e2ca977f48b4e /source/blender/bmesh
parentc9c6433a59549dbdf56298ae81a0b890639a6e0b (diff)
Fix T57923: Freeze in mesh vnors computation code with some degenerated geometry.
Second part of the fix: do not try at all to compute normals in degenerated geometry. Just loss of time and potential issues later with weird invalid computed values.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 7a63fa3c64f..3fe54b7229a 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -392,6 +392,11 @@ static void mesh_verts_calc_normals_accum_cb(void *userdata, MempoolIterData *mp
fac = saacos(-dotprod);
+ if (fac != fac) { /* NAN detection. */
+ /* Degenerated case, nothing to do here, just ignore that vertex. */
+ continue;
+ }
+
/* accumulate weighted face normal into the vertex's normal */
float *v_no = data->vnos ? data->vnos[BM_elem_index_get(l_iter->v)] : l_iter->v->no;