Learn R Programming

Rvcg (version 0.24)

vcgGetEdge: Get all edges of a triangular mesh

Description

Extract all edges from a mesh and retrieve adjacent faces and vertices

Usage

vcgGetEdge(mesh, unique = TRUE)

Value

returns a dataframe containing:

vert1

integer indicating the position of the first vertex belonging to this edge

vert2

integer indicating the position of the second vertex belonging to this edge

facept

integer pointing to the (or a, if unique = TRUE) face adjacent to the edge

border

integer indicating if the edge is at the border of the mesh. 0 = no border, 1 = border

Arguments

mesh

triangular mesh of class 'mesh3d'

unique

logical: if TRUE each edge is only reported once, if FALSE, all occurences are reported.

Examples

Run this code
require(rgl)
data(humface)
edges <-vcgGetEdge(humface)
if (FALSE) {
## show first edge
lines3d(t(humface$vb[1:3,])[c(edges$vert1[1],edges$vert2[2]),],col=2,lwd=3)
shade3d(humface, col=3)
## now find the edge - hint: it is at the neck.
}

Run the code above in your browser using DataLab