diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-02-15 17:21:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-02-15 17:21:15 +0300 |
commit | efbe47f9cdb60761ade99094af3cb8f997c3255d (patch) | |
tree | cd5d2a645df0ac1ba80dab55d7f69ddac4fcc430 /source | |
parent | fe47163a1eb9db8c977e6aad7711d3e585387e17 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 4 |
1 files 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; |