Hi Tomek,
you could use smooth minimum functions: https://www.shadertoy.com/view/DlVcW1
Article: https://iquilezles.org/articles/smin/
Here is an example for Houdini:
float r = chf('radius');
function float smin(float a, b, k){
k *= 1.0/(1.0 - sqrt(0.5));
return max(k, min(a,b)) - length(max(k - set(a,b), 0.0));
}
float dists[];
int pts[] = pcfind_radius(1, 'P', 'pscale', 1.0, v@P, 10.0, 2, dists);
float d = smin(dists[0], dists[1], r);
f@dist = d;
metaball_2D.hipnc