diff --git a/include/shot.h b/include/shot.h index ef06e1a..9496384 100644 --- a/include/shot.h +++ b/include/shot.h @@ -39,13 +39,13 @@ #define EQUAL_ZERO_TH 1e-15f -#define DEG_45_TO_RAD 0.78539816339744830961566084581988f -#define DEG_90_TO_RAD 1.5707963267948966192313216916398f -#define DEG_135_TO_RAD 2.3561944901923449288469825374596f -#define DEG_168_TO_RAD 2.7488935718910690836548129603696f +#define DEG_45_TO_RAD 0.78539816339744830961566084581988 +#define DEG_90_TO_RAD 1.5707963267948966192313216916398 +#define DEG_135_TO_RAD 2.3561944901923449288469825374596 +#define DEG_168_TO_RAD 2.7488935718910690836548129603696 -#define DEG_180_TO_RAD 3.1415926535897932384626433832795f -#define DEG_360_TO_RAD 6.283185307179586476925286766558f +#define DEG_180_TO_RAD 3.1415926535897932384626433832795 +#define DEG_360_TO_RAD 6.283185307179586476925286766558 /*! * \brief Check if val1 and val2 are equals. diff --git a/src/shot.cpp b/src/shot.cpp index 22f1bb7..a1e7595 100644 --- a/src/shot.cpp +++ b/src/shot.cpp @@ -219,7 +219,7 @@ void getSHOTLocalRF(vtkPolyData *cloud, vtkIdList *NNpoints, double radius, int { - if(NNpoints->GetId(ne) != index) { // perch� il KdTree restituisce anche il punto origine + if(NNpoints->GetId(ne) != index) { // perchè il KdTree restituisce anche il punto origine currPoint = cloud->GetPoint(NNpoints->GetId(ne)); @@ -627,11 +627,11 @@ void SHOTDescriptor::interpolateSingleChannel(vtkPolyData* cloud, vtkIdList* NNp // To avoid numerical problems afterwards - if (std::abs(yInFeatRef) < 1E-30) + if (std::abs(yInFeatRef) < 1E-15) yInFeatRef = 0; - if (std::abs(xInFeatRef) < 1E-30) + if (std::abs(xInFeatRef) < 1E-15) xInFeatRef = 0; - if (std::abs(zInFeatRef) < 1E-30) + if (std::abs(zInFeatRef) < 1E-15) zInFeatRef = 0; @@ -702,7 +702,7 @@ void SHOTDescriptor::interpolateSingleChannel(vtkPolyData* cloud, vtkIdList* NNp assert(inclination >= 0.0 && inclination <= DEG_180_TO_RAD); - if( inclination > DEG_90_TO_RAD || (std::abs(inclination - DEG_90_TO_RAD) < 1e-30 && zInFeatRef <= 0)){ + if( inclination > DEG_90_TO_RAD || (std::abs(inclination - DEG_90_TO_RAD) < 1e-15 && zInFeatRef <= 0)){ double inclinationDistance = (inclination - DEG_135_TO_RAD) / DEG_90_TO_RAD; if(inclination > DEG_135_TO_RAD) @@ -785,11 +785,11 @@ void SHOTDescriptor::interpolateDoubleChannel(vtkPolyData* cloud, vtkIdList* NNp double zInFeatRef = (delta[0] * rf[6] + delta[1] * rf[7] + delta[2] * rf[8]); // To avoid numerical problems afterwards - if (std::abs(yInFeatRef) < 1E-30) + if (std::abs(yInFeatRef) < 1E-15) yInFeatRef = 0; - if (std::abs(xInFeatRef) < 1E-30) + if (std::abs(xInFeatRef) < 1E-15) xInFeatRef = 0; - if (std::abs(zInFeatRef) < 1E-30) + if (std::abs(zInFeatRef) < 1E-15) zInFeatRef = 0; @@ -881,7 +881,7 @@ void SHOTDescriptor::interpolateDoubleChannel(vtkPolyData* cloud, vtkIdList* NNp assert(inclination >= 0.0 && inclination <= DEG_180_TO_RAD); - if( inclination > DEG_90_TO_RAD || (std::abs(inclination - DEG_90_TO_RAD) < 1e-30 && zInFeatRef <= 0)){ + if( inclination > DEG_90_TO_RAD || (std::abs(inclination - DEG_90_TO_RAD) < 1e-15 && zInFeatRef <= 0)){ double inclinationDistance = (inclination - DEG_135_TO_RAD) / DEG_90_TO_RAD; if(inclination > DEG_135_TO_RAD)