generate_point_cloud {fractalforest} | R Documentation |
Generate a Point Cloud from 2D trees data frame
Description
This function generates a point cloud based on the geometry of a tree or forest profile.
Usage
generate_point_cloud(tree_df, pt_distance = 0.3)
Arguments
tree_df |
A data.frame resulting from the |
pt_distance |
A numeric value specifying the distance between points in the generated point cloud. The default is 0.3. Smaller values will result in a denser point cloud. Small values may significantly increase the execution time of the function due to the larger number of points being generated. |
Details
This function processes the input tree_df
by creating lines from the tree's geometry and then buffers these lines to account for the tree's diameter. A grid is then created over the buffered geometry, and points are generated where the grid intersects the geometry. The result is a point cloud of 2D coordinates representing the tree's profile.
Value
A matrix of 2D coordinates representing the point cloud. Each row corresponds to a point in the cloud, with the columns representing the X and Y coordinates.