Skip to contents

Get all vertices of a bounded cell, without duplicates.

Usage

cellVertices(cell, check.bounded = TRUE)

Arguments

cell

a bounded Voronoï cell

check.bounded

Boolean, whether to check that the cell is bounded; set to FALSE for a small speed gain if you know that the cell is bounded

Value

A matrix, each row represents a vertex.

Examples

library(tessellation)
d <- delaunay(centricCuboctahedron())
v <- voronoi(d)
#> Voronoï diagram with one bounded cell.
cell13 <- v[[13]]
isBoundedCell(cell13) # TRUE
#> [1] TRUE
library(rgl)
open3d(windowRect = c(50, 50, 562, 562))
invisible(lapply(cell13[["cell"]], function(edge){
  edge$plot(edgeAsTube = TRUE, tubeRadius = 0.025, tubeColor = "yellow")
}))
cellvertices <- cellVertices(cell13)
spheres3d(cellvertices, radius = 0.1, color = "green")