Fix for bug #4448:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 24 Jun 2006 15:14:13 +0000 (15:14 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 24 Jun 2006 15:14:13 +0000 (15:14 +0000)
- Degenerate triangle issue for LSCM with reported .blend.

source/blender/src/parametrizer.c

index de854a3c43eb1404e59634c8ace4de46530a0496..9548410b513a1a274c55f0dd18270cd1b7b80355 100644 (file)
@@ -2898,7 +2898,7 @@ static PBool p_chart_lscm_solve(PChart *chart)
                }
 
                /* angle based lscm formulation */
-               ratio = (sina3 == 0.0f)? 0.0f: sina2/sina3;
+               ratio = (sina3 == 0.0f)? 1.0f: sina2/sina3;
                cosine = cos(a1)*ratio;
                sine = sina1*ratio;
 
@@ -2927,6 +2927,12 @@ static PBool p_chart_lscm_solve(PChart *chart)
                p_chart_lscm_load_solution(chart);
                return P_TRUE;
        }
+       else {
+               for (v=chart->verts; v; v=v->nextlink) {
+                       v->uv[0] = 0.0f;
+                       v->uv[1] = 0.0f;
+               }
+       }
 
        return P_FALSE;
 }