Estimates the tree trunk volume of a point cloud using the ashape3d package.

trunk_volume(cloud, max.height = NULL, alpha = 0.2, plot = TRUE, ...)

Arguments

cloud

A data.table with three columns representing the *XYZ* coordinates of a point cloud.

max.height

A numeric vector to contemplate points in the cloud lower than a specific height. If NULL, it performs the alpha-shape on the entire point cloud.

alpha

A numeric vector of length one passed to ashape3d to describes alpha. alpha = 0.20 as default since it seems to provide better estimations of the trunk volume. However, the alpha value may depends on the resolution of the point cloud.

plot

Logical. If TRUE, it uses plot.ashape3d to represent the alpha-shape.

...

General arguments passed to ashape3d.

Value

A numeric vector with the estimated trunk volume.

Details

This is an adaptation of the code develop by Lafarge & Pateiro-Lopez (2017) based on Edelsbrunner & Mucke (1994) for the quick extraction of the tree trunk volume. Therefore, if you use this code we kindly suggest to cite these documents in your research.

References

Lafarge, T., Pateiro-Lopez, B. (2017). Implementation of the 3D Alpha-Shape for the Reconstruction of 3D Sets from a Point Cloud. Available at https://CRAN.R-project.org/package=alphashape3d.

Edelsbrunner, H., Mucke, E. P. (1994). Three-Dimensional Alpha Shapes. ACM Transactions on Graphics, 13(1), pp.43-72.

Author

J. Antonio Guzmán Q.

Examples

data("pc_tree")

#Estimates the trunk volume of a height lower than 1.75.
trunk_volume(pc_tree, max.height = 1.75)
#> Device  1  : alpha =  0.2 
#> Trunk volume 
#>   0.07171184