EgtGeomKernel 2.2a5 :

- miglioria a Collinear di Triangulate.
This commit is contained in:
Dario Sassi
2020-01-28 18:27:25 +00:00
parent 7d1f87e901
commit ece85acc2d
3 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -648,7 +648,11 @@ Triangulate::SameDirection( const Point3d& ptA, const Point3d& ptB, const Point3
bool
Triangulate::Collinear( const Point3d& ptA, const Point3d& ptB, const Point3d& ptC, double dToler)
{
return ( abs( TwoArea( ptA, ptB, ptC)) < dToler * dToler) ;
double dSqDistA = SquareDist( ptA, ptB) ;
double dSqDistB = SquareDist( ptB, ptC) ;
double dSqDistC = SquareDist( ptC, ptA) ;
double dTwoArea = abs( TwoArea( ptA, ptB, ptC)) ;
return ( dTwoArea * dTwoArea < dToler * dToler * max( { dSqDistA, dSqDistB, dSqDistC})) ;
}
//----------------------------------------------------------------------------