Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions include/shot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 9 additions & 9 deletions src/shot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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;


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;


Expand Down Expand Up @@ -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)
Expand Down