vcgGeodesicPath: Compute geodesic path and path length between vertices on a...

View source: R/vcgDijkstra.r

vcgGeodesicPathR Documentation

Compute geodesic path and path length between vertices on a mesh

Description

Compute geodesic path and path length between vertices on a mesh

Usage

vcgGeodesicPath(x, source, targets, maxdist = 1e+06)

Arguments

x

triangular mesh of class mesh3d from the rgl package.

source

scalar positive integer, the source vertex index.

targets

positive integer vector, the target vertex indices.

maxdist

numeric, the maximal distance to travel along the mesh edges during geodesic distance computation.

Value

named list with two entries as follows. 'paths': list of integer vectors, representing the paths. 'geodist': double vector, the geodesic distances from the source vertex to all vertices in the graph.

Note

Currently no reachability checks are performed, so you have to be sure that the mesh is connected, or at least that the source and target vertices are reachable from one another.

Examples

data(humface)
p = vcgGeodesicPath(humface,50,c(500,5000))
p$paths[[1]];   # The path 50..500
p$geodist[500]; # Its path length.

Rvcg documentation built on Sept. 30, 2024, 9:39 a.m.