Filling below a surface

110 views
Skip to first unread message

Michael Cleaver

unread,
Nov 26, 2019, 1:59:44 AM11/26/19
to OpenVDB Forum
Hi everyone,

I've been using OpenVDB for the past few months for some geological modelling and have found it to be an amazingly useful and powerful library - thanks all for sharing it!

I mostly work directly with pre-voxelized data sets and use OpenVDB for processing and rendering however I also work with some mesh data of which we have two types which we call solids and surfaces.  The solids are closed volumes and convert perfectly to SDF grids from which I normally just extract an interior mask.  This process works perfectly and I couldn't be happier with the performance.  For the surfaces, which are not closed, and are always 2.5D meshes (typically obtained from surveying processes or point cloud triangulation) I couldn't find any existing feature in the library to extract an equivalent interior (i.e. below surface) mask.  I can create unsigned distance field grids fine but my objective is to select voxels from another grid which are below the surface.  

Does anyone know if OpenVDB has a suitable feature/tool? 

For these surfaces I could fall back to rasterizing a 2D height map and doing some iteration of nodes to accelerate processing of nodes which do not intersect the surface etc. but before I reinvent the wheel / head down the wrong path I thought I should ask other users.

Thanks again,
Mike

Jeff Budsberg

unread,
Jan 28, 2020, 1:02:28 PM1/28/20
to OpenVDB Forum
hey Mike,
A couple ideas off the top of my head:

1) build unsigned distance field UDF, rebuild as a signed distance field SDF (but offset the narrow band greater than zero).  This is the easiest solution, but unfortunately the surface now has thickness that doesn't exactly match your original mesh.

udf2sdf1.jpg


2) build USF, test the values against the normals on the closest point on the mesh to determine each voxels' sign (and flip as needed).  Rebuild to SDF (but keep the narrowband at zero).

udf2sdf2.jpg


I hope that helps!
Jeff
Reply all
Reply to author
Forward
0 new messages