trimesh_geodistance

trimesh_geodistance(M, source, method='exact')[source]

Compute the geodesic distance from a source point to all vertices.

Calculates the geodesic distance from a single source vertex to all other vertices in the mesh using either exact or heat method.

Parameters:
Mtuple[list[list[float]], list[list[int]]]

A mesh represented by a tuple of (vertices, faces) where vertices are 3D points and faces are triangles

sourceint

The index of the source vertex.

methodstr, optional

The method to use for geodesic distance computation. Options: * ‘exact’: Use exact geodesic algorithm * ‘heat’: Use heat method (faster but approximate) Default is ‘exact’.

Returns:
list[float]

The geodesic distances from the source to all vertices.

Raises:
NotImplementedError

If method is not one of {‘exact’, ‘heat’}.