Jump to content

Is there a way to find the outermost voxels in an SDF volume?


Recommended Posts


Is there a way to find the outermost voxels in an SDF volume (standard volumes or VDBs)? By outermost, I meant in a way that if you were to place a box for each of these voxels that has the same size as the voxel, you wouldn't be able to see the inside of the surface, or have any holes.

I did some experiments and it seems like using sqrt(2*voxelsize^2) doesn't include every outermost voxel. When I looked how the distances of voxel centers vary from the actual surface, it seems like some are being missed by a tiny amount which puts them great than 2 * voxelsize. So I am not sure if this can be done in a better way?

Thanks :)

Link to comment
Share on other sites

I found some info here:


But I am not sure how to do that. If I could find those points, I would use Volume Pos to Index VOP and then Volume Index to Pos VOP to get the center of the voxels. I just don't know how I can use the Divergence DOPs (?) to get those points and then bring it back into SOPs.

Any ideas from the volume experts? :)

Link to comment
Share on other sites

Thanks ikarus, I am glad to know about this SOP now. Though after examining the options, I don't think I can use it to do what I need unless I am missing something?

From my tests before which might be flawed, I couldn't find voxels with a value of 0 in an SDF volume.

I found a hacky way that works but not completely and requires the surface to be there as well. So if I have a geometry like a torus and then scatter say 1M points on it, then on another branch turn the torus into an SDF, I can check where those points are as voxels and they do give me the result I need since the points were on the surface of the geometry. But this requires me to scatter so many points to cover all the geometry, otherwise you will miss some voxels.

And this requires me to have the geometry around which I won't necessarily have.

There must be a much smarter way I am sure. I just can't think of it as I am not an expert in volumes :)

Link to comment
Share on other sites

Unless the surface lied exactly along the centers of the voxels why would you expect to find any actual 'zero' value? Geometric surfaces (in our context) are simply collections of infinitely thin, triangle-shaped planes.

Perhaps you should read up on how the marching cubes algorithm determines surfaces from grid data


Edited by ikarus
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...