I was able to achieve this with the def below but I am not a fan of Graph Mapper as it does not provide precise control. It is also not very intuitive.
For some reason I was not able to make the definition work with multiple surfaces.
So in summary I would like to: -Replace Graph Mapper with an actual formula/expression/script component -Make it work for multiple surfaces at the same time. -Added bonus would be to have individual amplitude and wavelength control for each attraction point.
For the Point2d, you have to create one yourself since this is not a geometry type that Grasshopper knows about: https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.point2d?version=8.x. Evaluating a surface at a set of uv-parameters only needs two parameter values (u and v), so we usually use a Point2d for that (a Point2d is the same as a Point3d except it only has 2 coordinates).
This code seems to work in your C# script:
var uv = new Rhino.Geometry.Point2d(uvP[0], uvP[1]);
Surface out_surface = Rhino.Geometry.Surface.CreateSoftEditSurface(srf, uv, vector, ulength, vlength, tolerance, false);
A = out_surface;
with uvP a Point3d input, and srf a NURBS surface.
Note that you need to use the fixEnds=false parameter in this function, otherwise control points on the boundary of the surface will stay fixed and in your case that fixes all the control points.
You would probably find it easier to use CreateSoftEditCurve, on the bottom edge of your surface only, then rebuild the surface as a loft from top to bottom edge. Otherwise, CreateSoftEditSurface will try to move the control points on the top edge and you will need to set them back to their original positions.
For the rest of the script, I made a very heavy-handed attempt at making the middle version with amplitudes work with multiple surfaces and control of amplitude for each attraction point. Iām building the data trees manually and rewriting paths a couple of times, so there is probably a smarter and more compact way to do that.
Replacing the graph mapper is just a question of writing the equation of a 0-centered Gaussian in an Expression component.