Jump to content

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


Recommended Posts

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.


// 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;



  • Like 1
Link to comment
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.)




Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...