OpenVDB
12.0.1
|
#include <openvdb/tools/ParticlesToLevelSet.h>
Public Types | |
using | DisableT = typename std::is_void< AttributeT >::type |
using | InterrupterType = InterrupterT |
using | SdfGridType = SdfGridT |
using | SdfType = typename SdfGridT::ValueType |
using | AttType = typename std::conditional< DisableT::value, size_t, AttributeT >::type |
using | AttGridType = typename SdfGridT::template ValueConverter< AttType >::Type |
Public Member Functions | |
ParticlesToLevelSet (SdfGridT &grid, InterrupterT *interrupt=nullptr) | |
Constructor using an existing boolean or narrow-band level set grid. More... | |
~ParticlesToLevelSet () | |
void | finalize (bool prune=false) |
This method syncs up the level set and attribute grids and therefore needs to be called before any of those grids are used and after the last call to any of the rasterizer methods. More... | |
AttGridType::Ptr | attributeGrid () |
Return a pointer to the grid containing the optional user-defined attribute. More... | |
Real | getVoxelSize () const |
Return the size of a voxel in world units. More... | |
Real | getHalfWidth () const |
Return the half-width of the narrow band in voxel units. More... | |
Real | getRmin () const |
Return the smallest radius allowed in voxel units. More... | |
void | setRmin (Real Rmin) |
Set the smallest radius allowed in voxel units. More... | |
Real | getRmax () const |
Return the largest radius allowed in voxel units. More... | |
void | setRmax (Real Rmax) |
Set the largest radius allowed in voxel units. More... | |
bool | ignoredParticles () const |
Return true if any particles were ignored due to their size. More... | |
size_t | getMinCount () const |
Return the number of particles that were ignored because they were smaller than the minimum radius. More... | |
size_t | getMaxCount () const |
Return the number of particles that were ignored because they were larger than the maximum radius. More... | |
int | getGrainSize () const |
Return the grain size used for threading. More... | |
void | setGrainSize (int grainSize) |
Set the grain size used for threading. More... | |
template<typename ParticleListT > | |
void | rasterizeSpheres (const ParticleListT &pa) |
Rasterize each particle as a sphere with the particle's position and radius. More... | |
template<typename ParticleListT > | |
void | rasterizeSpheres (const ParticleListT &pa, Real radius) |
Rasterize each particle as a sphere with the particle's position and a fixed radius. More... | |
template<typename ParticleListT > | |
void | rasterizeTrails (const ParticleListT &pa, Real delta=1.0) |
Rasterize each particle as a trail comprising the CSG union of spheres of decreasing radius. More... | |
Static Public Attributes | |
static const bool | OutputIsMask = std::is_same<SdfType, bool>::value |
using AttGridType = typename SdfGridT::template ValueConverter<AttType>::Type |
using AttType = typename std::conditional<DisableT::value, size_t, AttributeT>::type |
using DisableT = typename std::is_void<AttributeT>::type |
using InterrupterType = InterrupterT |
using SdfGridType = SdfGridT |
using SdfType = typename SdfGridT::ValueType |
|
inlineexplicit |
Constructor using an existing boolean or narrow-band level set grid.
grid | grid into which particles are rasterized |
interrupt | callback to interrupt a long-running process |
If the input grid is already populated with signed distances, particles are unioned onto the existing level set surface.
The width in voxel units of the generated narrow band level set is given by 2×background/dx, where background is the background value stored in the grid and dx is the voxel size derived from the transform associated with the grid. Also note that −background corresponds to the constant value inside the generated narrow-band level set.
AttributeT
is not void
, attributes are generated only for voxels that overlap with particles, not for any other preexisting voxels (for which no attributes exist!).
|
inline |
|
inline |
Return a pointer to the grid containing the optional user-defined attribute.
AttributeT
is void
) or if finalize is not called, the pointer will be null.
|
inline |
This method syncs up the level set and attribute grids and therefore needs to be called before any of those grids are used and after the last call to any of the rasterizer methods.
It has no effect or overhead if attribute transfer is disabled (i.e., if AttributeT
is void
) and prune is false
.
|
inline |
Return the grain size used for threading.
|
inline |
Return the half-width of the narrow band in voxel units.
|
inline |
Return the number of particles that were ignored because they were larger than the maximum radius.
|
inline |
Return the number of particles that were ignored because they were smaller than the minimum radius.
|
inline |
Return the largest radius allowed in voxel units.
|
inline |
Return the smallest radius allowed in voxel units.
|
inline |
Return the size of a voxel in world units.
|
inline |
Return true
if any particles were ignored due to their size.
|
inline |
Rasterize each particle as a sphere with the particle's position and radius.
For level set output, all spheres are CSG-unioned.
|
inline |
Rasterize each particle as a sphere with the particle's position and a fixed radius.
For level set output, all spheres are CSG-unioned.
pa | particles with positions |
radius | fixed sphere radius in world units. |
|
inline |
Rasterize each particle as a trail comprising the CSG union of spheres of decreasing radius.
pa | particles with position, radius and velocity. |
delta | controls the distance between sphere instances |
|
inline |
Set the grain size used for threading.
|
inline |
Set the largest radius allowed in voxel units.
|
inline |
Set the smallest radius allowed in voxel units.