Skip to contents

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)

Arguments

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

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

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).

Usage

Edge3$stack()


Method clone()

The objects of this class are cloneable with this method.

Usage

Edge3$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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()))