geodesic_distance#
- PolyDataFilters.geodesic_distance(start_vertex, end_vertex, use_scalar_weights=False, progress_bar=False)[source]#
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,
optional
If
True
, use scalar values in the edge weight (only supported with VTK>=9). This only works for point data.- progress_barbool,
optional
Display a progress bar to indicate progress.
- start_vertex
- 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.