OpenVDB  9.0.1
MeshDataAdapter Interface Reference

Convert polygonal meshes that consist of quads and/or triangles into signed or unsigned distance field volumes. More...

#include <openvdb/tools/MeshToVolume.h>

Detailed Description

Convert polygonal meshes that consist of quads and/or triangles into signed or unsigned distance field volumes.

Note
Requires a closed surface but not necessarily a manifold surface. Supports surfaces with self intersections and degenerate faces and is independent of mesh surface normals.

Expected interface for the MeshDataAdapter class

size_t polygonCount() const; // Total number of polygons
size_t pointCount() const; // Total number of points
size_t vertexCount(size_t n) const; // Vertex count for polygon n
// Return position pos in local grid index space for polygon n and vertex v
void getIndexSpacePoint(size_t n, size_t v, openvdb::Vec3d& pos) const;
};
Parameters
meshmesh data access class that conforms to the MeshDataAdapter interface
transformworld-to-index-space transform
exteriorBandWidthexterior narrow band width in voxel units
interiorBandWidthinterior narrow band width in voxel units (set to std::numeric_limits<float>::max() to fill object interior with distance values)
flagsoptional conversion flags defined in MeshToVolumeFlags
polygonIndexGridoptional grid output that will contain the closest-polygon index for each voxel in the narrow band region