The plot method for objects of class "voxels" created using the voxels function.

plot_voxels(
  voxels,
  add.points = TRUE,
  add.voxels = TRUE,
  border = TRUE,
  points.size = 1,
  points.col = "black",
  fill.col = "forestgreen",
  line.lwd = 0.5,
  line.col = "black",
  alpha = 0.1,
  ...
)

Arguments

voxels

Object of class "voxels" from voxels.

add.points

Logical, if TRUE it adds the original points used to perform the voxelization. TRUE as default.

add.voxels

Logical, if TRUE it adds the voxels created. TRUE as default.

border

Logical, if TRUE it adds a line on the borders of each voxel. TRUE as default.

points.size

The points size, a positive number to use if plot add.points = TRUE.

points.col

A character defining the color of the points to use.

fill.col

A character vector defining the color to fill the voxels, it could be a range of colors or a solid color.

line.lwd

The line width, a positive number, defaulting to 0.5.

line.col

A character defining the color of the border lines to use.

alpha

A positive numeric vector describing the transparency of the voxels to fill. This value most be between 0.0 (fully transparent) .. 1.0 (opaque).

...

General arguments passed to rgl.

Value

A 3D plot of a point cloud and voxels.

Author

J. Antonio Guzmán Q.

Examples

data("pc_tree")

###Create cubes of a size of 7x7x3.5.
vox <- voxels(pc_tree, edge_length = c(7, 7, 3.5))
plot_voxels(vox)