plotVoronoiOnSphere {sphereTessellation}R Documentation

Plot spherical Voronoï tessellation

Description

Plot a spherical Voronoï tessellation.

Usage

plotVoronoiOnSphere(
  vor,
  colors = "gradient",
  distinctArgs = list(seedcolors = c("#ff0000", "#00ff00", "#0000ff")),
  randomArgs = list(hue = "random", luminosity = "bright"),
  palette = "Rocket",
  bias = 1,
  edges = FALSE,
  sites = FALSE,
  ecolor = "black",
  lwd = 3,
  scolor = "black",
  sradius = NA,
  ...
)

Arguments

vor

an output of VoronoiOnSphere

colors

controls the filling colors of the triangles, either NA for no color, or a single color, or "random" to get multiple colors with randomColor, or "distinct" to get multiple colors with createPalette, or "gradient"

distinctArgs

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

randomArgs

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

palette

this argument is used only when colors="gradient"; it can be either a character vector of colors, or the name of a palette which will be passed to the palette argument of the function hcl.colors

bias

this argument is used only when colors="gradient"; it is passed to the bias argument of the function colorRamp

edges

Boolean, whether to plot the edges

sites

Boolean, whether to plot the Voronoï sites

ecolor

a color for the edges

lwd

graphical parameter for the edges, if they are plotted

scolor

a color for the sites

sradius

a radius for the sites, which are plotted as spheres (if they are plotted); NA for a default value

...

arguments passed to shade3d to plot the spherical faces

Value

No value is returned.

Examples

library(sphereTessellation)
library(rgl)
# take the vertices of the cuboctahedron and Voronoïze
vertices <- t(cuboctahedron3d()$vb[-4L, ])
vor <- VoronoiOnSphere(vertices)
# plot
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.8)
plotVoronoiOnSphere(vor, specular = "black", edges = TRUE)

# effect of the `bias` argument ###
library(sphereTessellation)
library(rgl)
vertices <- t(cuboctahedron3d()$vb[-4L, ])
vor <- VoronoiOnSphere(vertices)
open3d(windowRect = 50 + c(0, 0, 900, 300), zoom = 0.8)
mfrow3d(1, 3)
plotVoronoiOnSphere(vor, palette = "Viridis", bias = 0.5)
next3d()
plotVoronoiOnSphere(vor, palette = "Viridis", bias = 0.8)
next3d()
plotVoronoiOnSphere(vor, palette = "Viridis", bias = 1.1)

[Package sphereTessellation version 1.2.0 Index]