diff --git a/include/Neighbourhood.h b/include/Neighbourhood.h index dee081a..fbe3928 100644 --- a/include/Neighbourhood.h +++ b/include/Neighbourhood.h @@ -179,7 +179,9 @@ namespace CCCoreLib Verticality, EigenValue1, EigenValue2, - EigenValue3 + EigenValue3, + DegreeOfPlanarity, + DegreeOfLinearity }; //! Computes the given feature on a set of point diff --git a/src/Neighbourhood.cpp b/src/Neighbourhood.cpp index 4097017..2fbe851 100644 --- a/src/Neighbourhood.cpp +++ b/src/Neighbourhood.cpp @@ -849,6 +849,14 @@ double Neighbourhood::computeFeature(GeomFeature feature) case EigenValue3: value = l3; break; + case DegreeOfPlanarity: + if (std::abs(l3) > std::numeric_limits::epsilon()) + value = std::log(l1/l3); + break; + case DegreeOfLinearity: + if (std::min(std::abs(l2), std::abs(l3)) > std::numeric_limits::epsilon()) + value = std::log(l1/l2) / std::log(l2/l3); + break; default: assert(false); break;