PolyDataFilters.geodesic_distance#
- PolyDataFilters.geodesic_distance(
- start_vertex: int,
- end_vertex: int,
- *,
- use_scalar_weights: bool = False,
- progress_bar: bool = False,
Calculate the geodesic distance between two vertices using Dijkstra’s algorithm.
- Parameters:
- start_vertex
int Vertex index indicating the start point of the geodesic segment.
- end_vertex
int Vertex index indicating the end point of the geodesic segment.
- use_scalar_weightsbool, default:
False If
True, use scalar values in the edge weight. This only works for point data.- progress_barbool, default:
False Display a progress bar to indicate progress.
- start_vertex
- Returns:
floatLength of the geodesic segment.
Examples#
Download Python source code | Download Jupyter notebook
>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> length = sphere.geodesic_distance(0, 100)
>>> f'Length is {length:.3f}'
'Length is 0.812'
Used In#
API Examples
Gallery Examples