DelaunayOnSphere: Spherical Delaunay triangulation

View source: R/delaunay.R

DelaunayOnSphereR Documentation

Spherical Delaunay triangulation

Description

Computes a spherical Delaunay triangulation.

Usage

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

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

See 2D Triangulations on the Sphere.

Value

A named list with four fields:

  • vertices, the matrix of vertices obtained by projecting the original vertices to the sphere;

  • faces, an integer matrix providing by row the indices of the faces of the triangulation;

  • solidFaces, an integer vector providing the indices of the solid faces; faces are either solid faces or ghost faces, see details

  • meshes, a list of meshes of the solid faces used for plotting in plotDelaunayOnSphere.

See Also

plotDelaunayOnSphere

Examples

library(sphereTessellation)
library(rgl)

if(require(cooltools)) {
vertices <- fibonaccisphere(30L)
del <- DelaunayOnSphere(vertices)
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.8)
plotDelaunayOnSphere(del)
}

if(require(uniformly)) {
# sample vertices on a hemisphere, so there will be some ghost faces
set.seed(421L)
vertices <- rphong_on_hemisphere(6L)
del <- DelaunayOnSphere(vertices)
# the ghost faces are not plotted
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.8)
plotDelaunayOnSphere(del)
}

sphereTessellation documentation built on July 9, 2023, 6:04 p.m.