Even if one vertex is collinear, the other one could be reflex;

triangle merging code was screwing up.

[git-p4: depot-paths = "//depot/solvespace/": change = 1744]
solver
Jonathan Westhues 2008-05-25 20:27:34 -08:00
parent c58dbf1676
commit d750344653
1 changed files with 2 additions and 2 deletions

View File

@ -120,9 +120,9 @@ void SMesh::Simplify(int start) {
bDot /= min(ab.Magnitude(), bc.Magnitude());
dDot /= min(cd.Magnitude(), de.Magnitude());
if(fabs(bDot) < LENGTH_EPS) {
if(fabs(bDot) < LENGTH_EPS && dDot > 0) {
conv[j] = c;
} else if(fabs(dDot) < LENGTH_EPS) {
} else if(fabs(dDot) < LENGTH_EPS && bDot > 0) {
conv[WRAP((j+1), convc)] = c;
} else if(bDot > 0 && dDot > 0) {
// conv[j] is unchanged, conv[j+1] goes to [j+2]