From bae38624391680a755485da05abf7341bb3da13a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 24 Jun 2006 15:14:13 +0000 Subject: [PATCH] Fix for bug #4448: - Degenerate triangle issue for LSCM with reported .blend. --- source/blender/src/parametrizer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c index de854a3c43e..9548410b513 100644 --- a/source/blender/src/parametrizer.c +++ b/source/blender/src/parametrizer.c @@ -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; }