#' plot all border edges of a triangular mesh
#'
#' plot all border edges of a triangular mesh
#'
#'
#' @param mesh triangular mesh of class "mesh3d".
#' @param col color of lines.
#' @param lwd line width
#' @author Stefan Schlager
#'
#' @examples
#' \dontrun{
#' require(rgl)
#' require(Morpho)
#' data(nose)
#' plotBorder(shortnose.mesh)
#' wire3d(shortnose.mesh,col=3)
#' }
#' @export plotBorder
plotBorder <- function(mesh,col=2,lwd=2)
{
edges <- vcgGetEdge(mesh)
bord <- which(edges$border == 1)
bordmesh <- mesh
bordmesh$it <- rbind(edges$vert1[bord],edges$vert2[bord],edges$vert1[bord])
bordmesh$material$color <- NULL
wire3d(bordmesh,col=col,lwd=lwd,lit=F)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.