| Edge3 {tessellation} | R Documentation |
R6 class representing an edge in dimension 3.
Description
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
Aget or set the vertex
ABget or set the vertex
BidAget or set the id of vertex
AidBget or set the id of vertex
B
Methods
Public methods
Method new()
Create a new Edge3 object.
Usage
Edge3$new(A, B, idA, idB)
Arguments
Athe vertex
ABthe vertex
BidAthe id of vertex
A, an integer; can be missingidBthe id of vertex
B, an integer; can be missing
Returns
A new Edge3 object.
Examples
edge <- Edge3$new(c(1, 1, 1), c(1, 2, 3)) edge edge$A edge$A <- c(1, 0, 0) edge
Method print()
Show instance of an Edge3 object.
Usage
Edge3$print(...)
Arguments
...ignored
Examples
Edge3$new(c(2, 0, 0), c(3, -1, 4))
Method plot()
Plot an Edge3 object.
Usage
Edge3$plot(edgeAsTube = FALSE, tubeRadius, tubeColor)
Arguments
edgeAsTubeBoolean, whether to plot the edge as a tube
tubeRadiusthe radius of the tube
tubeColorthe 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).
Usage
Edge3$stack()
Method clone()
The objects of this class are cloneable with this method.
Usage
Edge3$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Edge3$new`
## ------------------------------------------------
edge <- Edge3$new(c(1, 1, 1), c(1, 2, 3))
edge
edge$A
edge$A <- c(1, 0, 0)
edge
## ------------------------------------------------
## Method `Edge3$print`
## ------------------------------------------------
Edge3$new(c(2, 0, 0), c(3, -1, 4))
## ------------------------------------------------
## Method `Edge3$plot`
## ------------------------------------------------
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()))
[Package tessellation version 2.3.0 Index]