nmwsharp / geometry-central

Applied 3D geometry in C++, with a focus on surface meshes.
https://geometry-central.net
MIT License
1.06k stars 149 forks source link

SurfaceMesh from Eigen #39

Closed hadhoryth closed 4 years ago

hadhoryth commented 4 years ago

Hi, Nick!

Thank you for sharing your library! [Question] Could you please explain how can I initialize SurfaceMesh with Eigen::MatrixXd (vertices and faces); and further use SurfaceMesh for geodesic distance calculation. I've looked through docs but didn't find it.

nmwsharp commented 4 years ago

Hi!

I just added a built-in helper to initialize a mesh from Eigen types in 8853709f8caf8d81f6a96c56b29688f228d8141e, since this is a very reasonable operation. There's an example in the docs here: http://geometry-central.net/surface/utilities/io/#factory-constructors

For geodesic distance calculation, check out this: http://geometry-central.net/surface/algorithms/geodesic_distance/#heat-method-for-distance . The example code snippets there should do just what you need.

Closing now; feel free to reopen if you have further questions.