Only generate voxels on one side of an open mesh #2063
-
|
Given an open mesh, i.e. a manifold and orientable mesh with one or more boundaries, is it somehow possible to restrict the generation of voxels to one side? That is, assuming we have consistent face normals (e.g. all CCW triangles), define the exterior as the direction of those face normals, and the interior as the opposite direction. For signed distance VDBs, I realise this would cause an issue in areas that are essentially co-planar with a boundary layer of the mesh, as the sign wouldn't be defined there. However, for unsigned distance VDBs or boolean VDBs, I don't see any problems. Looking at the documentation, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I ended up using the approach outlined in my last paragraph above, i.e. using an Although it's reasonably fast, I'd still be interested to hear whether there's a more efficient way to accomplish this. |
Beta Was this translation helpful? Give feedback.
I ended up using the approach outlined in my last paragraph above, i.e. using an
openvdb::Int32Grid::Ptr polygonIndexGridthat's populated bymeshToVolume(). Subsequently, runningevaluateInteriorTest()using a custom class w/ overloadedbool operator()— i.e. a functor, though a lambda would work as well — I indicate whether a voxel lies in the interior or exterior. Finally, iterating over all voxels, I usesetValueOff()to effectively remove voxels in the interior.Although it's reasonably fast, I'd still be interested to hear whether there's a more efficient way to accomplish this.