Learn R Programming

sphereTessellation (version 1.2.0)

VoronoiOnSphere: Spherical Voronoï tessellation

Description

Computes a spherical Voronoï tessellation.

Usage

VoronoiOnSphere(vertices, radius = 1, center = c(0, 0, 0), iterations = 5L)

Value

An unnamed list whose each element corresponds to a Voronoï face and is a named list with three fields:

  • site, the coordinates of the Voronoï site of the face;

  • cell, a numeric matrix providing the coordinates of the vertices of the face;

  • mesh, a mesh of the face used for plotting in the function plotVoronoiOnSphere.

Arguments

vertices

vertices, a numeric matrix with three columns

radius

radius of the sphere, a positive number; the vertices will be projected on this sphere

center

center of the sphere, a numeric vector of length three; the vertices will be projected on this sphere

iterations

positive integer, the number of iterations used to construct the meshes of the spherical faces

Details

First the Delaunay triangulation is computed, then the Voronoï tessellation is obtained by duality.

See Also

plotVoronoiOnSphere

Examples

Run this code
library(sphereTessellation)
library(rgl)
if(require(cooltools)) {
vertices <- fibonaccisphere(150L)
vor <- VoronoiOnSphere(vertices)
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.8)
plotVoronoiOnSphere(vor, colors = "random")
}

Run the code above in your browser using DataLab