diff --git a/src/Mod/Mesh/App/Core/Elements.cpp b/src/Mod/Mesh/App/Core/Elements.cpp index d1f0c4aca..fdceea3b0 100644 --- a/src/Mod/Mesh/App/Core/Elements.cpp +++ b/src/Mod/Mesh/App/Core/Elements.cpp @@ -390,12 +390,6 @@ void MeshGeomFacet::Enlarge (float fDist) bool MeshGeomFacet::IsDegenerated(float epsilon) const { - // if we do a strict test then compute the area - if (epsilon == 0) { - float fArea = Area(); - return fArea < epsilon; - } - // The triangle has the points A,B,C where we can define the vector u and v // u = b-a and v = c-a. Then we define the line g: r = a+t*u and the plane // E: (x-c)*u=0. The intersection point of g and E is S. @@ -415,16 +409,16 @@ bool MeshGeomFacet::IsDegenerated(float epsilon) const // BTW (u*u)*(v*v)-(u*v)*(u*v) is the same as (uxv)*(uxv). Base::Vector3f u = _aclPoints[1] - _aclPoints[0]; Base::Vector3f v = _aclPoints[2] - _aclPoints[0]; - float eps = epsilon; - float uu = u*u; - if (uu < eps) + double eps = epsilon; + double uu = u*u; + if (uu <= eps) return true; - float vv = v*v; - if (vv < eps) + double vv = v*v; + if (vv <= eps) return true; - float uv = u*v; - float crosssqr = uu*vv-uv*uv; - if (crosssqr < eps*std::max(uu,vv)) + double uv = u*v; + double crosssqr = uu*vv-uv*uv; + if (crosssqr <= eps*std::max(uu,vv)) return true; return false; }