From efbe47f9cdb60761ade99094af3cb8f997c3255d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 15 Feb 2017 15:21:15 +0100 Subject: [PATCH] Fix T50662: Auto-split affects on smooth mesh when it sohuldn't Seems to be a precision error comparing proper floating point normal with the one coming from short. --- source/blender/blenkernel/intern/mesh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 42b6a841da0..6da86e3d151 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2172,7 +2172,7 @@ void BKE_mesh_split_faces(Mesh *mesh) MVert *mv = &mvert[ml->v]; float vn[3]; normal_short_to_float_v3(vn, mv->no); - if (!equals_v3v3(vn, lnors[mp->loopstart + loop])) { + if (len_squared_v3v3(vn, lnors[mp->loopstart + loop]) > FLT_EPSILON) { /* When vertex is adjacent to two faces and gets split we don't * want new vertex counted for both faces. We tag it for re-use * by one of the faces. @@ -2240,7 +2240,7 @@ void BKE_mesh_split_faces(Mesh *mesh) MVert *mv = &mvert[ml->v]; float vn[3]; normal_short_to_float_v3(vn, mv->no); - if (!equals_v3v3(vn, lnors[mp->loopstart + loop])) { + if (len_squared_v3v3(vn, lnors[mp->loopstart + loop]) > FLT_EPSILON) { if ((mv->flag & ME_VERT_TMP_TAG) == 0) { /* Ignore first split on vertex, re-use it instead. */ mv->flag |= ME_VERT_TMP_TAG;