Given a set of points, is it possible to get a surface that best fits the points? Similar to finding the best line or polynomial function that minimizes square error (in this case distances from the points to the square). Ideally, the simpler the better (to follow the analogy, it would be great to choose the degree of polynomial, rather than some degree=1000 that overfits to a ton of points)

I saw some CATIA videos where people select the mesh, then get a surface from the selected faces (though I think itās the points the faces are made of that mattered)

Although I have to say I stopped working on it at some point. Also there was plugin called VSR which you canāt use anymore. It had a function to fit a surface to a mesh. From a practical standpoint you can only use such algorithm if it yields a proper curve/surface, and this has more to do with smoothing instead of fitting. Grasshopper is not the right tool for proper surface modelling. Almost any fundamental modelling tool is missing, meaning that fitting a surface is pointless if you cannot do more with it.

You find an okish algorithm in āThe Nurbs Bookā from Tiller and Piegl

Thanks very much for your detailed reply Tom! I want to say that your project in the thread is a very important one! What Iām describing would be absolutely broken in the right situations

GH came to mind because of the coding part (also Rhinoās UI is way too hard for me). I was thinking more of points-in, surface-out algorithm so, I suppose thereās no surface modeling in the sense of adjusting the curves by hand. Certainly, having on access to important matrix tools like numpy, to say the least, has always been limiting.

Iām not sure if smoothing is the best way since it alters the input dataāI will elaborate in the following reply.

I will do some homework on the book (thanks for pointing me to that!) to see what I can find in the meantime

Consider a discretization of an NURBS surfaceāall vertices from a dense tri-remesh of an original. And letās say maybe 5% of the points are moved out of place at random.

With these points as input, I want to get the original NURBS back as much as possible. Thatās why some form of fitting came to mind

Constructing NURBS manually requires (sometimes many) curves so, thatās often plenty trial-and-error to minimize the visual discrepancy. Thatās not super awesomeālike doing āhard surfaceā modeling in Blender (Iām sure thereās a simpler analogy here )

not exactly a polynomial regression in 3d space, but if you have a mesh, you could pass it to a quadremesh and pass that to a subd

you might also like to play around with shrinkwrap in R8

if youāre starting from a list of points, you could pass those to a delunay triangulation ā quadremesh ->subd

otherwise, if youād like to get a single polynomial surface, you can use any modern tool that calculates that regression (mathematica comes to mind right now) and you can probably reconstruct a nurbs approximation