Learn R Programming

Rvcg (version 0.24)

vcgDijkstra: Compute pseudo-geodesic distances on a triangular mesh

Description

Compute pseudo-geodesic distances on a triangular mesh

Usage

vcgDijkstra(x, vertpointer, maxdist = NULL)

Value

returns a vector of shortest distances for each of the vertices to one of the vertices referenced in vertpointer. If maxdist is in use (not NULL), the distance values for vertices outside the requested maxdist are not computed and appear as 0.

Arguments

x

triangular mesh of class mesh3d

vertpointer

integer: references indices of vertices on the mesh, typically only a single query vertex.

maxdist

positive scalar double, the maximal distance to travel along the mesh when computing distances. Leave at NULL to traverse the full mesh. This can be used to speed up the computation if you are only interested in geodesic distances to neighbors within a limited distance around the query vertices.

Examples

Run this code
## Compute geodesic distance between all mesh vertices and the first vertex of a mesh
data(humface)
geo <- vcgDijkstra(humface,1)
if (interactive()) {
require(Morpho);require(rgl)
meshDist(humface,distvec = geo)
spheres3d(vert2points(humface)[1,],col=2)
}

Run the code above in your browser using DataLab