[vtkusers] Bug in vtkMeshQuality::TriangleMinAngle()

Sebastien.Valette at creatis.insa-lyon.fr Sebastien.Valette at creatis.insa-lyon.fr
Thu Jan 17 16:39:54 EST 2008


Hi,

We found a bug in vtk 5.0.3, in the method
vtkMeshQuality::TriangleMinAngle().
the method computes the 3 triangle angles : alpha, beta and gamma, but the
last one is incorrectly computed. I think it computes PI-gamma instead of
gamma. This bug can sometimes result in a  minimal angle greater than 60
degrees, which is impossible.

I saw that the class vtkMeshQuality has changed a lot in the current CVS,
but the following patch could come handy for an update of vtk 5.0.3:

RCS file: /cvsroot/VTK/VTK/Graphics/vtkMeshQuality.cxx,v
retrieving revision 1.31
diff -r1.31 vtkMeshQuality.cxx
670c670
<   gamma = acos(vtkMath::Dot(a,b) / sqrt(a2 * b2));
---
>   gamma = acos(-vtkMath::Dot(a,b) / sqrt(a2 * b2));

Cheers,

Sebastien



More information about the vtkusers mailing list