Jump to content
Sign in to follow this  
Masoud

Is there a way to fill a geometry with another one, without penetration?

Recommended Posts

Hi;

Is there a way to fill geometry with another one, without penetration?

 

Thanks for helping.

01.jpg

Share this post


Link to post
Share on other sites

Hi Masoud,

you can fill meshes with other meshes by copying them to VDB to spheres. Make sure to center and scale the copy mesh beforehand so it fits into a unit sphere.

image.png.6d1ded2f0a1932731648ce5ab68726ac.png

// center object
vector center = getbbox_center(0);
v@P -= center;
// maximum distance from center
float dist = length(v@P);
setdetailattrib(1, 'max_dist', dist, 'max');
// scale maximum distance to 1 
float scale = detail(0, 'max_dist', 0);
v@P *= 1.0 / scale;

 

fill_mesh.hipnc

  • Like 1

Share this post


Link to post
Share on other sites

Hi "Konstantin";

Your solution is great, but it uses a spherical boundary to separate objects, right?

Actually, I'm looking for a way to fill an object more precisely, without a big gap between them, something like the image below:

(The object in this sample scene is generated using Cinema4D.)

 

Thanks.

01.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×