Fix #27888: Render artifacts in 2.58.1
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 9 Jul 2011 15:10:12 +0000 (15:10 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 9 Jul 2011 15:10:12 +0000 (15:10 +0000)
It was a regression introduced in rev36301. Average normal calcilation
used to fail due to triangular faces which are too slight.

Do not use triangles with too small area for average normal calculation.

source/blender/render/intern/source/convertblender.c

index 2c9aa4dece5385f7ed90761e629e64303c89f718..4c0ce24e3e756178aee0579f842f7300d683419b 100644 (file)
@@ -2932,8 +2932,10 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
                                                vlr->v3= RE_findOrAddVert(obr, startvert+index[2]);
                                                vlr->v4= NULL;
 
-                                               normal_tri_v3(tmp, vlr->v3->co, vlr->v2->co, vlr->v1->co);
-                                               add_v3_v3(n, tmp);
+                                               if(area_tri_v3(vlr->v3->co, vlr->v2->co, vlr->v1->co)>FLT_EPSILON) {
+                                                       normal_tri_v3(tmp, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+                                                       add_v3_v3(n, tmp);
+                                               }
 
                                                vlr->mat= matar[ dl->col ];
                                                vlr->flag= 0;