plotDelaunay3D {tessellation}R Documentation

Plot 3D Delaunay tessellation

Description

Plot a 3D Delaunay tessellation with rgl.

Usage

plotDelaunay3D(
  tessellation,
  color = "distinct",
  distinctArgs = list(seedcolors = c("#ff0000", "#00ff00", "#0000ff")),
  randomArgs = list(hue = "random", luminosity = "bright"),
  alpha = 0.3,
  exteriorEdgesAsTubes = FALSE,
  tubeRadius,
  tubeColor
)

Arguments

tessellation

the output of delaunay

color

controls the filling colors of the tetrahedra, either FALSE for no color, "random" to use randomColor, or "distinct" to use createPalette

distinctArgs

if color = "distinct", a list of arguments passed to createPalette

randomArgs

if color = "random", a list of arguments passed to randomColor

alpha

opacity, number between 0 and 1

exteriorEdgesAsTubes

Boolean, whether to plot the exterior edges as tubes; in order to use this feature, you need to set exteriorEdges = TRUE in the delaunay function

tubeRadius

if exteriorEdgesAsTubes = TRUE, the radius of the tubes

tubeColor

if exteriorEdgesAsTubes = TRUE, the color of the tubes

Value

No value, just renders a 3D plot.

Examples

library(tessellation)
pts <- rbind(
  c(-5, -5,  16),
  c(-5,  8,   3),
  c(4,  -1,   3),
  c(4,  -5,   7),
  c(4,  -1, -10),
  c(4,  -5, -10),
  c(-5,  8, -10),
  c(-5, -5, -10)
)
tess <- delaunay(pts)
library(rgl)
open3d(windowRect = c(50, 50, 562, 562))
plotDelaunay3D(tess, color = "random")
open3d(windowRect = c(50, 50, 562, 562))
plotDelaunay3D(
  tess, exteriorEdgesAsTubes = TRUE, tubeRadius = 0.3, tubeColor = "yellow"
)

[Package tessellation version 2.3.0 Index]