odforce123 Posted March 12 Share Posted March 12 Hey, I'm looking for a way to create a setup that behaves like metaball but on curves, so basically my idea is to create a setup like in the reference images, where I scatter random points and copy circle shapes to points that have a pscale set based on the distance to a closest point to avoid intersection, and these circles are somehow combined with a distort form between them, like in metaball. I am very curious how you would approach something like this and thank you in advance for any advice! In the attachment I'm sharing the images I found in simillar setup but done in Rhino. Quote Link to comment Share on other sites More sharing options...
Librarian Posted March 13 Share Posted March 13 How to feed into this Code pscale for points from 2 input ? int pntcnt = npoints(1); float accum = 0; for(int i=0; i<pntcnt; i++) { vector tarpos = point(1, "P", i); float dist = distance(tarpos, @P); float falloff = fit(dist, ch('start') , ch('end') , 1,0); accum = max(falloff,accum) ; } @Cd = set(accum, 0, accum/4); Quote Link to comment Share on other sites More sharing options...
dleonhardt Posted March 13 Share Posted March 13 I would start with actual 3D metaballs and take a slice of them to get curves. dl_2d_metaballs.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Librarian Posted March 13 Share Posted March 13 (edited) @odforce123 More Control This and This . Edited March 13 by Librarian REZULTAT Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted March 13 Share Posted March 13 (edited) 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 Edited March 13 by konstantin magnus 2 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted September 14 Share Posted September 14 Another example using COPernicus' SDF tools. circles_metaball_02.hip 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.