Smoothing / fairing surfaces - how?

i am in interested in both - the vanilla rhino commands and possible c# scripting approaches. - this is why i choose Rhino category…

(left)
a surface interpolated ( Rhino: _SrfPtGrid , Rhinocommon NurbsSurface CreateThroughPoints ). the input points is a fixed x,y grid with z being sin(xfactor) + cos(yfactor).
= the reference surface

(mid)
added random noise in z-direction (+/- 0.3 mm)
= the input to be smoothed

(right)
trying to smooth the input (mid) to come as close as possible to the left.

my approach

i use Rhino _fair RhinoCommon Curve.Fair
and apply it once in V Direction, once in U Direction…

question

Which methods / workflows do we have to smooth out surfaces and give them a nice flow, maybe even eliminate minimal radius, limit changes of convex / concave …
i am not asking about manually moving CV’s and looking at curvature-Graph.
I know _smooth - which is limited… ( or i am missing the secret to get the right parameters ?)
thanks for hints to other commands / workflows / easy to implement algorithms, that hopefully can also be automated / scripted.

sin_noise_smooth_00.3dm (3.8 MB)

kind regards -tom

maybe i am missing something but Rebuild works very well. lower the amount of points in both directions till its as smooth as you want, the outcome is an averaged smooth surface
i am on an older laptop right now having only v7 installed, so i rescued the file to get the surfaces back i guess it worked, my settings were


FitSrf also kind of works but here you have to use a rather unorthodox tolerance setting, try 0.5 the result is similar to rebuild but it keeps some funky edges so i definitely would use rebuild.

@Tom_P Can you add more examples of what you’re trying to accomplish? As you might expect, there are many approaches to smoothing surfaces. :slight_smile: How well they work depends on what you want to do.

I have a given sub-set of a mesh, a four sided patch defined by the user.
I need a single nurbs surface out of it.
the max deviation is given.
i use a helper surface to define the edges / isocurve orientation.

Patch with the mesh as the objects to fit the surface thorugh, and the “helper surface” as the starting surface. The choice of number for spans for the start surface is critical. Too few spans the result will not be able to follow the mesh close enough. Too many spans and the result will be follow the randomness of the mesh too much. I typically start with as simple a starting surface as possible which follows the edges sufficiently close. If additional spans are needed by the starting surface I add them using InsertKnot where needed. InsertKnot does not change the shape of the surface.

thanks David.

it s a big pity patch with starting surface option is not supporting history - at least i did not get it to work.
do i miss something ?