OpenVDB  1.1.0
Classes | Namespaces | Functions
ParticlesToLevelSet.h File Reference

This tool rasterizes particles (with position, radius and velocity) into a narrow-band level set. More...

#include <tbb/parallel_reduce.h>
#include <tbb/blocked_range.h>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <openvdb/util/Util.h>
#include <openvdb/Types.h>
#include <openvdb/Grid.h>
#include <openvdb/math/Math.h>
#include <openvdb/math/Transform.h>
#include <openvdb/util/NullInterrupter.h>
#include "Composite.h"

Go to the source code of this file.

Classes

struct  DualTrait< T >
 
class  ParticlesToLevelSet< GridT, ParticleListT, InterruptT, RealT >
 
class  Dual< RealT >
 
struct  DualTrait< Dual< T > >
 
class  ParticlesToLevelSetAndId< LevelSetGridT, ParticleListT, InterruptT >
 Use this wrapper class to convert particles into a level set and a separate index grid of closest-point particle id. The latter can be used to subsequently transfer particles attributes into separate grids. More...
 

Namespaces

namespace  openvdb
 
namespace  openvdb::v1_1_0
 
namespace  openvdb::v1_1_0::tools
 
namespace  openvdb::v1_1_0::tools::local
 

Functions

template<typename RealT >
std::ostream & operator<< (std::ostream &ostr, const Dual< RealT > &rhs)
 
template<typename RealT >
Dual< RealT > Abs (const Dual< RealT > &x)
 

Detailed Description

This tool rasterizes particles (with position, radius and velocity) into a narrow-band level set.

Author
Ken Museth
Note
This fast particle to level set converter is always intended to be combined with some kind of surface post processing, i.e. tools::Filter. Without such post processing the generated surface is typically too noisy and blooby. However it serves as a great and fast starting point for subsequent level set surface processing and convolution. In the near future we will add support for anisotropic particle kernels.

The ParticleListT template argument below refers to any class with the following interface (see unittest/TestParticlesToLevelSet.cc and SOP_DW_OpenVDBParticleVoxelizer for practical examples):

class ParticleList {
...
public:
openvdb::Index size() const;// number of particles in list
openvdb::Vec3R pos(int n) const;// world space position of n'th particle
openvdb::Vec3R vel(int n) const;// world space velocity of n'th particle
openvdb::Real radius(int n) const;// world space radius of n'th particle
};
Note
All methods are assumed to be thread-safe. Also note all access methods return by value since this allows for especailly the radius and velocities to be scaled (i.e. modified) relative to the internal representations (see unittest/TestParticlesToLevelSet.cc for an example).

The InterruptT template argument below refers to any class with the following interface:

class Interrupter {
...
public:
void start(const char* name = NULL)// called when computations begin
void end() // called when computations end
bool wasInterrupted(int percent=-1)// return true to break computation
};
Note
If no template argument is provided for this InterruptT the util::NullInterrupter is used which implies that all interrupter calls are no-ops (i.e. incurs no computational overhead).