fillhexa: Fills hexahedrons with a regular point raster (3D)

Description Usage Arguments Details Value Examples

Description

A hexahedron is a three dimensional shape that is defined by 6 faces and 8 corner points. fillhexa allows to fill such a shape with a regular point raster.

Usage

1
fillhexa(hex, res)

Arguments

hex

dataframe with three columns and eight rows to define a hexahedron by its corner point coordinates x, y and z

res

numeric value > 0 and <= 1 for the resolution of the point raster

Details

See https://stackoverflow.com/questions/36115215/filling-a-3d-body-with-a-systematic-point-raster for a description of the function and how it was developed.

Value

data.frame with the spatial coordinates of the resulting points of the grid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
hexatestdf <- data.frame(
  x = c(0,1,0,4,5,5,5,5),
  y = c(1,1,4,4,1,1,4,4),
  z = c(4,8,4,9,4,8,4,6)
)

cx = fillhexa(hexatestdf, 0.1)

#library(rgl)
#plot3d(
# cx[,1], cx[,2], cx[,3],
# type = "p",
# xlab = "x", ylab = "y", zlab = "z"
#)

recexcavAAR documentation built on May 1, 2019, 6:48 p.m.