# \donttest{
#################################################################
# Example with a small high quality point cloud : using default #
# default parameters to detect fine architectural details #
#################################################################
# import a point cloud
tls=system.file("extdata","Tree_2_point_cloud.las",package = "aRchi")
tls = lidR::readLAS(tls)
# build an empty aRchi file and add the point cloud
aRchi = aRchi::build_aRchi()
aRchi = aRchi::add_pointcloud(aRchi,point_cloud = tls)
# plot the point cloud
plot(aRchi@pointcloud)
# build a skeleton from the point cloud
aRchi = skeletonize_pc(aRchi)
# smooth the skeleton
aRchi = smooth_skeleton(aRchi)
# plot the skeleton
plot(aRchi,show_point_cloud = TRUE)
##############################################################
# Example with a large point cloud with a lot of occlusion : #
# parameters selected for speed #
##############################################################
# import a point cloud
tls=system.file("extdata","Tree_1_point_cloud.las",package = "aRchi")
tls = lidR::readLAS(tls)
# build an empty aRchi file and add the point cloud
aRchi = aRchi::build_aRchi()
aRchi = aRchi::add_pointcloud(aRchi,point_cloud = tls)
# plot the point cloud
plot(aRchi@pointcloud)
# build a skeleton from the point cloud
aRchi = skeletonize_pc(aRchi, D = 0.5, cl_dist = 0.2, max_d = 1)
# smooth the skeleton
aRchi = smooth_skeleton(aRchi)
# plot the skeleton
plot(aRchi,show_point_cloud = TRUE)
# }
Run the code above in your browser using DataLab