Skip to content

Commit ce15ef3

Browse files
committed
fix name conflict with latest Eigen
1 parent b1c0f8b commit ce15ef3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/cpp/point_cloud_utilities.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ std::vector<std::vector<size_t>> generate_knn(const std::vector<Vector3>& points
2323

2424
std::vector<Vector3> generate_normals(const std::vector<Vector3>& points, const Neighbors_t& neigh) {
2525

26-
using namespace Eigen;
27-
2826
std::vector<Vector3> normals(points.size());
2927

3028
for (size_t iPt = 0; iPt < points.size(); iPt++) {
@@ -38,7 +36,7 @@ std::vector<Vector3> generate_normals(const std::vector<Vector3>& points, const
3836
center /= nNeigh + 1;
3937

4038
// Assemble matrix os vectors from centroid
41-
MatrixXd localMat(3, neigh[iPt].size());
39+
Eigen::MatrixXd localMat(3, neigh[iPt].size());
4240
for (size_t iN = 0; iN < nNeigh; iN++) {
4341
Vector3 neighPos = points[neigh[iPt][iN]] - center;
4442
localMat(0, iN) = neighPos.x;
@@ -47,8 +45,8 @@ std::vector<Vector3> generate_normals(const std::vector<Vector3>& points, const
4745
}
4846

4947
// 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);
5250

5351
Vector3 N{bestNormal(0), bestNormal(1), bestNormal(2)};
5452
N = unit(N);

0 commit comments

Comments
 (0)