Two dimensional grid with signed distance values and level set boundary.

144 views
Skip to first unread message

Weston Ferrell

unread,
Apr 7, 2022, 8:56:40 PM4/7/22
to OpenVDB Forum

Hi,

I'm looking to work with a 2d SDF in OpenVDB and compute it's 0 level set curve as well as some intersections. Is there anything I can look to as an example for this? These 2d grid values would be set from fixed heights of a 3d grid. I'm a student messing around with computer aided manufacturing ideas and really appreciate any help. Thanks for all you do.

All the best,
Weston

wou...@wouterbijlsma.nl

unread,
Apr 8, 2022, 4:43:21 AM4/8/22
to OpenVDB Forum
I'm looking to do a similar thing. The approach I'm thinking about is to sample the height map values at the desired voxel resolution of the output grid, to get a uniform (x, y) grid of height values (z). The (x, y, z) coordinates of each sample correspond to voxels with an distance value of 0.0 in the required SDF, and can be used as the seed values for a fast-sweeping pass that extends distance values into a narrow band of voxels around the seed points. I think openvdb::tools::sdfToSdf can be used for this, but possibly it is required to use the lower-level FastSweeping API's directly to do this. This would give you an unsigned distance field, you would have to close it using some level-set CSG to make it a valid level-set SDF, e.g. pasting it on top of a box SDF and fixing the interior voxels.

I still need to work this out further and maybe there's an easier way, any help is appreciated!



Reply all
Reply to author
Forward
0 new messages