# \donttest{
# Define the cylinder attributes
npts = 500
cyl_length = 0.5
radius = 0.2718
# Generate the X,Y,Z values
Z=runif(n = npts, min = 0, max = cyl_length)
angs = runif(npts, 0, 2*pi)
X = sin(angs)*radius
Y = cos(angs)*radius
# Creation of a LAS object out of external data
cloud <- LAS(data.frame(X,Y,Z))
# Fit a cylinder and retrun the information
cyl_par = spanner::cylinderFit(cloud, method = 'ransac', n=5, inliers=.9,
conf=.95, max_angle=30, n_best=20)
# }
Run the code above in your browser using DataLab