Atom Posted November 7, 2017 Share Posted November 7, 2017 (edited) I have this oval shape that I would like to be more rounded. I have tried selecting some points and increasing the Soft Radius in the Edit SOP but that just does not give me the result I am looking for. Basically I would like to push the points out from the center sphereically. Can this be done with the Edit SOP or is there a better node for that? Edited November 7, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 7, 2017 Share Posted November 7, 2017 @P = normalize(@P); //turns your mesh into a sphere Quote Link to comment Share on other sites More sharing options...
Atom Posted November 7, 2017 Author Share Posted November 7, 2017 Thanks, that kind of works but it also kind of messes up some of the edges. Does this also remove scale? It seems like my overall size diminished quite a bit. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 7, 2017 Share Posted November 7, 2017 27 minutes ago, Atom said: Does this also remove scale? Yes, it places all points exactly one unit away from the world center. A compromise would be interpolating between the current state and a spherified shape. @P = lerp(@P, normalize(@P), chf('mix')); While it might lead to geometrical collisions, you can for sure create really cute baby pigs with it 1 Quote Link to comment Share on other sites More sharing options...
iamyog Posted November 7, 2017 Share Posted November 7, 2017 Not fixing the overlapping edges of course, but a revised version of the code could be vector _min, _max; getbbox(0, _min, _max); vector _ctre = _max - ((_max - _min) * 0.5); // compute centroid vector _size = _max - _ctre; // find longest distance to centroid float _radius = length(_size); @P -= _ctre; // realign to centre of the world @P = lerp(@P, normalize(@P) * _radius, ch("bias")); // spherify @P += _ctre; // reposition in world It will spherify any object wherever it is in the world while maintaining a sense of scale. 1 Quote Link to comment Share on other sites More sharing options...
Atom Posted November 7, 2017 Author Share Posted November 7, 2017 Cool, thank you both for those additional options. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 7, 2017 Share Posted November 7, 2017 1 hour ago, iamyog said: It will spherify any object wherever it is in the world while maintaining a sense of scale. Useful idea. I compressed the code a little.. vector center = getbbox_center(0); float size = max(getbbox_size(0)); vector sphere = center + normalize(@P - center) * 0.5 * size; @P = lerp(@P, sphere, chf('spherify')); Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 7, 2017 Share Posted November 7, 2017 (edited) btw: Another option would be offsetting the spherification center. vector center = getbbox_center(0) + chv('offset'); float size = max(getbbox_size(0)); vector sphere = center + normalize(@P - center) * 0.5 * size; @P = lerp(@P, sphere, chf('spherify')); Edited November 7, 2017 by konstantin magnus added screenshot 1 Quote Link to comment Share on other sites More sharing options...
Atom Posted November 8, 2017 Author Share Posted November 8, 2017 I like the addition of the vector. It is like having an invisible metaball influence you can move around. 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.