plotEdges: Plot some edges

View source: R/meshes.R

plotEdgesR Documentation

Plot some edges

Description

Plot the given edges with rgl.

Usage

plotEdges(
  vertices,
  edges,
  color = "black",
  lwd = 2,
  edgesAsTubes = TRUE,
  tubesRadius = 0.03,
  verticesAsSpheres = TRUE,
  only = NULL,
  spheresRadius = 0.05,
  spheresColor = color
)

Arguments

vertices

a three-columns matrix giving the coordinates of the vertices

edges

a two-columns integer matrix giving the edges by pairs of vertex indices

color

a color for the edges

lwd

line width, a positive number, ignored if edgesAsTubes=TRUE

edgesAsTubes

Boolean, whether to draw the edges as tubes

tubesRadius

the radius of the tubes when edgesAsTubes=TRUE

verticesAsSpheres

Boolean, whether to draw the vertices as spheres

only

integer vector made of the indices of the vertices you want to plot (as spheres), or NULL to plot all vertices

spheresRadius

the radius of the spheres when verticesAsSpheres=TRUE

spheresColor

the color of the spheres when verticesAsSpheres=TRUE

Value

No value.

Examples

library(MeshesOperations)
library(rgl)
mesh <- Mesh(
  mesh = truncatedIcosahedron,
  triangulate = TRUE, normals = FALSE,
  numbersType = "lazyExact"
)
# now we can plot the truncated icosahedron
tmesh <- toRGL(mesh)
open3d(windowRect = c(50, 50, 562, 562), zoom = 0.9)
shade3d(tmesh, color = "gold")
plotEdges(mesh[["vertices"]], mesh[["edges0"]], color = "navy")

stla/MeshesOperations documentation built on Oct. 23, 2022, 8:23 a.m.