Hi, Mohammad,
You can try using vtkCleanPolyData
(https://vtk.org/doc/nightly/html/classvtkCleanPolyData.html#details) to make sure your mesh forms a water tight polyhedron. There’s an example here: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/CleanPolyData .
As for the geodesic path, you can try CGAL if you still get stuck: CGAL 5.2 - Triangulated Surface Mesh Shortest Paths: User Manual .
regards,
Paulo