geodesic_curve.py 489 B

123456789101112131415
  1. """Dijkstra algorithm to compute the graph geodesic.
  2. Take as input a polygonal mesh and perform
  3. a shortest path calculation between two vertices."""
  4. from vedo import IcoSphere, Earth, show
  5. msh = IcoSphere(r=1.02, subdivisions=4)
  6. msh.wireframe().alpha(0.2)
  7. path = msh.geodesic([0.349,-0.440,0.852], [-0.176,-0.962,0.302])
  8. # path = msh.geodesic(36, 442) # use vertex indices
  9. # printc(geo.pointdata["VertexIDs"])
  10. show(Earth(), msh, path, __doc__, bg2='lb', viewup="z", zoom=1.3).close()