Edge3 | R Documentation |
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.
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
new()
Create a new Edge3
object.
Edge3$new(A, B, idA, idB)
A
the vertex A
B
the vertex B
idA
the id of vertex A
, an integer; can be missing
idB
the id of vertex B
, an integer; can be missing
A new Edge3
object.
edge <- Edge3$new(c(1, 1, 1), c(1, 2, 3)) edge edge$A edge$A <- c(1, 0, 0) edge
print()
Show instance of an Edge3
object.
Edge3$print(...)
...
ignored
Edge3$new(c(2, 0, 0), c(3, -1, 4))
plot()
Plot an Edge3
object.
Edge3$plot(edgeAsTube = FALSE, tubeRadius, tubeColor)
edgeAsTube
Boolean, whether to plot the edge as a tube
tubeRadius
the radius of the tube
tubeColor
the color of the tube
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()))
stack()
Stack the two vertices of the edge (this is for internal purpose).
Edge3$stack()
clone()
The objects of this class are cloneable with this method.
Edge3$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## 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()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.