An edge is given by two vertices in the 3D space,
named A
and B
. This is for example an edge of a Voronoï cell
of a 3D Delaunay tessellation.
Active bindings
A
get or set the vertex
A
B
get or set the vertex
B
idA
get or set the id of vertex
A
idB
get or set the id of vertex
B
Methods
Method new()
Create a new Edge3
object.
Usage
Edge3$new(A, B, idA, idB)
Method print()
Show instance of an Edge3
object.
Method plot()
Plot an Edge3
object.
Arguments
edgeAsTube
Boolean, whether to plot the edge as a tube
tubeRadius
the radius of the tube
tubeColor
the color of the tube
Examples
library(tessellation)
d <- delaunay(centricCuboctahedron())
v <- voronoi(d)
cell13 <- v[[13]] # the point (0, 0, 0), at the center
isBoundedCell(cell13) # TRUE
library(rgl)
open3d(windowRect = c(50, 50, 562, 562))
invisible(lapply(cell13[["cell"]], function(edge) edge$plot()))
Method stack()
Stack the two vertices of the edge (this is for internal purpose).
Examples
## ------------------------------------------------
## Method `Edge3$new`
## ------------------------------------------------
edge <- Edge3$new(c(1, 1, 1), c(1, 2, 3))
edge
#> Edge:
#> vertex A: 1, 1, 1
#> vertex B: 1, 2, 3
edge$A
#> [1] 1 1 1
edge$A <- c(1, 0, 0)
edge
#> Edge:
#> vertex A: 1, 0, 0
#> vertex B: 1, 2, 3
## ------------------------------------------------
## Method `Edge3$print`
## ------------------------------------------------
Edge3$new(c(2, 0, 0), c(3, -1, 4))
#> Edge:
#> vertex A: 2, 0, 0
#> vertex B: 3, -1, 4
## ------------------------------------------------
## Method `Edge3$plot`
## ------------------------------------------------
library(tessellation)
d <- delaunay(centricCuboctahedron())
v <- voronoi(d)
#> Voronoï diagram with one bounded cell.
cell13 <- v[[13]] # the point (0, 0, 0), at the center
isBoundedCell(cell13) # TRUE
#> [1] TRUE
library(rgl)
open3d(windowRect = c(50, 50, 562, 562))
invisible(lapply(cell13[["cell"]], function(edge) edge$plot()))