cylinderFit | R Documentation |
Fits a cylinder on a set of 3D points.
cylinderFit(
las,
method = "ransac",
n = 5,
inliers = 0.9,
conf = 0.95,
max_angle = 30,
n_best = 20
)
las |
LAS normalized and segmented las object. |
method |
method for estimating the cylinder parameters. Currently available: |
n |
number of points selected on every RANSAC iteration. |
inliers |
expected proportion of inliers among stem segments' point cloud chunks. |
conf |
confidence level. |
max_angle |
used when |
n_best |
estimate optimal RANSAC parameters as the median of the |
vector of parameters
# Define the cylinder attributes
npts = 500
cyl_length = 0.5
radius = 0.2718
# Generate the X,Y,Z values
Z=runif(n = n, min = 0, max = cyl_length)
angs = runif(n, 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.