@@ -23,8 +23,6 @@ std::vector<std::vector<size_t>> generate_knn(const std::vector<Vector3>& points
23
23
24
24
std::vector<Vector3> generate_normals (const std::vector<Vector3>& points, const Neighbors_t& neigh) {
25
25
26
- using namespace Eigen ;
27
-
28
26
std::vector<Vector3> normals (points.size ());
29
27
30
28
for (size_t iPt = 0 ; iPt < points.size (); iPt++) {
@@ -38,7 +36,7 @@ std::vector<Vector3> generate_normals(const std::vector<Vector3>& points, const
38
36
center /= nNeigh + 1 ;
39
37
40
38
// Assemble matrix os vectors from centroid
41
- MatrixXd localMat (3 , neigh[iPt].size ());
39
+ Eigen:: MatrixXd localMat (3 , neigh[iPt].size ());
42
40
for (size_t iN = 0 ; iN < nNeigh; iN++) {
43
41
Vector3 neighPos = points[neigh[iPt][iN]] - center;
44
42
localMat (0 , iN) = neighPos.x ;
@@ -47,8 +45,8 @@ std::vector<Vector3> generate_normals(const std::vector<Vector3>& points, const
47
45
}
48
46
49
47
// Smallest singular vector is best normal
50
- JacobiSVD<MatrixXd> svd (localMat, ComputeThinU);
51
- Vector3d bestNormal = svd.matrixU ().col (2 );
48
+ Eigen:: JacobiSVD<Eigen:: MatrixXd> svd (localMat, Eigen:: ComputeThinU);
49
+ Eigen:: Vector3d bestNormal = svd.matrixU ().col (2 );
52
50
53
51
Vector3 N{bestNormal (0 ), bestNormal (1 ), bestNormal (2 )};
54
52
N = unit (N);
0 commit comments