Learn R Programming

Rvcg (version 0.12.2)

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)

Arguments

mesh
triangular mesh of class 'mesh3d'
unique
logical: if TRUE each edge is only reported once, if FALSE, all occurences are reported.

Value

  • returns a dataframe containing:
  • vert1integer indicating the position of the first vertex belonging to this edge
  • vert2integer indicating the position of the second vertex belonging to this edge
  • faceptinteger pointing to the (or a, if unique = TRUE) face adjacent to the edge
  • borderinteger indicating if the edge is at the border of the mesh. 0 = no border, 1 = border

Examples

Run this code
require(rgl)
data(humface)
edges <-vcgGetEdge(humface)
## 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