TheWebMonks / meshmonk

Open mesh-to-mesh registration framework
Apache License 2.0
70 stars 25 forks source link

Got error when compile Meshmonk on Mac OS #9

Closed prophecy closed 5 years ago

prophecy commented 5 years ago

Error log

src/NeighbourFinder.hpp:102:19: error: no matching constructor for initialization of 'nanoflann::KDTreeEigenMatrixAdaptor<Matrix<float, -1, 6, 0, -1, 6> >' ...= new nanoflann::KDTreeEigenMatrixAdaptor(*_inSourcePoints, ^ ~~~~~ src/CorrespondenceFilter.cpp:34:22: note: in instantiation of member function 'registration::NeighbourFinder<Eigen::Matrix<float, -1, 6, 0, -1, 6>

::set_source_points' requested here _neighbourFinder.set_source_points(_inTargetFeatures); ^ /usr/local/include/nanoflann.hpp:1318:3: note: candidate constructor not viable: no known conversion from 'const Eigen::Matrix<float, -1, 6, 0, -1, 6>' to 'const int' for 1st argument KDTreeEigenMatrixAdaptor(const int dimensionality, cons... ^ /usr/local/include/nanoflann.hpp:1329:3: note: candidate constructor not viable: requires 1 argument, but 2 were provided KDTreeEigenMatrixAdaptor(const self_t&); ^ After short investigating, here is the found line in NeighbourFinder.hpp _kdTree = new nanoflann::KDTreeEigenMatrixAdaptor<VecMatType(*_inSourcePoints, _leafSize);

prophecy commented 5 years ago

Fixed by swap the argument to _kdTree = new nanoflann::KDTreeEigenMatrixAdaptor<VecMatType(_leafSize, _inSourcePoints);

please consider to merge

prophecy commented 5 years ago

I have fixed, and tested on Matlab using the following line. Will make a pull request soon. : ) _kdTree = new nanoflann::KDTreeEigenMatrixAdaptor<VecMatType>(_numDimensions, *_inSourcePoints);

prophecy commented 5 years ago

Close this issue, made a pull request