geodesic_distance

PolyDataFilters.geodesic_distance(start_vertex, end_vertex, progress_bar=False)

Calculate the geodesic distance between two vertices using Dijkstra’s algorithm.

Parameters
start_vertexint

Vertex index indicating the start point of the geodesic segment.

end_vertexint

Vertex index indicating the end point of the geodesic segment.

progress_barbool, optional

Display a progress bar to indicate progress.

Returns
float

Length of the geodesic segment.

Examples

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> length = sphere.geodesic_distance(0, 100)
>>> f'Length is {length:.3f}'
'Length is 0.812'

See Geodesic Paths for more examples using this filter.