A radial basis function (RBF) accumulates all point positions of the input curves and weights them by an exponentially decreasing squared distance to the mesh surface.
float a = chf('a');
float w = 0.0;
vector pos = 0.0;
for(int i = 0; i < npoints(1); i++){
vector pos_pt = point(1, 'rest', i);
float r = distance2(v@P, pos_pt);
float weight = exp(-a * r * r);
w += weight;
pos += pos_pt * weight;
}
v@P = pos / w;