makeHexahedron {uniformly}R Documentation

Make hexahedron

Description

Make a hexahedron for usage in runif_in_hexahedron and other functions.

Usage

makeHexahedron(p0, p1, p2, p3, p4, p5, p6, p7)

Arguments

p0, p1, p2, p3, p4, p5, p6, p7

the eight vertices of the hexahedron, as in the figure shown below

Details

A hexahedron is a polyhedron having six quad faces. Its eight vertices must be placed as in the figure below.

hexahedron

Value

A matrix with eight columns, the vertices.

See Also

The function plotHexahedron is useful to check the hexahedron.

Examples

library(uniformly)
# a non-convex hexahedron
hexahedron <- makeHexahedron(
  p0 = c(1.5, 1.5, 0),
  p1 = c(2, 0, 0),
  p2 = c(2, 2, 0),
  p3 = c(0, 2, 0),
  p4 = c(0, 2, 2),
  p5 = c(0, 0, 2),
  p6 = c(2, 0, 2),
  p7 = c(2, 2, 2)
)
plotHexahedron(hexahedron)

[Package uniformly version 0.5.0 Index]