I have a collection of points which I know lie exactly on a cylinder, but I don’t know the cylinder’s orientation, radius, or nationality. Using Fit Line, which i assume uses Least Squares, I get an axis but in comparing the result to an actual cylinder, there is a difference, though small. Fit Line is meant for a scatter of points, whereas I already know they are on a cylinder, so there is some regularity. It seems with that information I should be able to do even better. Then again, maybe not…
Very nice Adam! It works well with even far fewer points than in the example. Looks like insisting the radii are equal makes the difference. My actual points are generated iteratively and, strange as it sounds, all I do know is they lie around a cylinder. I’m working on an analytic expression for the radius, but until (unless) I do, this will suit me quite well. Ultimately, I want to orient the points along the z axis, which is why I needed the cylinder’s axis.
Wonderful solution there, Adam!
And you’re kinda right. Feature detection of cylinders in point clouds is a topic with a plethora of papers · written · about it.
But beware: The ‘solution’ is really math intense – your’s better I think (and also easier to grok).