Plane of best fit through a series of points?

Hi, we have a series of 3D points from a topographic survey. I’d like to calculate one plane which summarises / averages a subset of the points - is there an easy way to achieve this in Grasshopper?

What means subsets. In what sense?

Anyway for a given Pts collection there’s a native thing:
Screen Shot 104

based (I assume) to this RC Method

Or you mean: Cluster the pts in such a way where their deviation(s) from found fitted Planes is the min possible? I.e. do a first pass and try to sample pts where their max deviation is less than some value. Then repeat for the rest etc etc.

For instance:

  • Take 3 random points from the population
  • Calculate the plane defined by the 3 points
  • Sum the errors (distance to plane) for all of the points to that plane.
  • Keep the 3 points that show the smallest sum of errors (and fall within a threshold).

… blah, blah.

Thanks, I’ll give both of those a try. Much appreciated.

If you need a C# that does the Clustering (IF Clustering - as outlined above - is what you are after) notify. Very simple piece of code in fact. Shown against test random pts.