OpenVDB 5.1.0

Namespaces | Functions
points/PointScatter.h File Reference

Various point scattering methods for generating VDB Points. More...

`#include <type_traits>`
`#include <algorithm>`
`#include <thread>`
`#include <random>`
`#include <openvdb/openvdb.h>`
`#include <openvdb/Types.h>`
`#include <openvdb/tree/LeafManager.h>`
`#include <openvdb/tools/Prune.h>`
`#include <openvdb/util/NullInterrupter.h>`
`#include "AttributeArray.h"`
`#include "PointCount.h"`
`#include "PointDataGrid.h"`
`#include <tbb/parallel_sort.h>`
`#include <tbb/parallel_for.h>`

Go to the source code of this file.

## Namespaces
| openvdb
| openvdb::v5_1
| openvdb::v5_1::points
| openvdb::v5_1::points::point_scatter_internal

## Functions
template<typename GridT , typename RandGenT = std::mt19937, typename PositionArrayT = TypedAttributeArray<Vec3f, NullCodec>, typename PointDataGridT = Grid< typename points::TreeConverter<typename GridT::TreeType>::Type>, typename InterrupterT = util::NullInterrupter>
PointDataGridT::Ptr | uniformPointScatter (const GridT &grid, const Index64 count, const unsigned int seed=0, const float spread=1.0f, InterrupterT *interrupter=nullptr)
| The free functions depend on the following class: More...
template<typename GridT , typename RandGenT = std::mt19937, typename PositionArrayT = TypedAttributeArray<Vec3f, NullCodec>, typename PointDataGridT = Grid< typename points::TreeConverter<typename GridT::TreeType>::Type>, typename InterrupterT = util::NullInterrupter>
PointDataGridT::Ptr | denseUniformPointScatter (const GridT &grid, const float pointsPerVoxel, const unsigned int seed=0, const float spread=1.0f, InterrupterT *interrupter=nullptr)
| Uniformly scatter a fixed number of points per active voxel. If the pointsPerVoxel value provided is a fractional value, each voxel calculates a delta value of how likely it is to contain an extra point. More...
template<typename GridT , typename RandGenT = std::mt19937, typename PositionArrayT = TypedAttributeArray<Vec3f, NullCodec>, typename PointDataGridT = Grid< typename points::TreeConverter<typename GridT::TreeType>::Type>, typename InterrupterT = util::NullInterrupter>
PointDataGridT::Ptr | nonUniformPointScatter (const GridT &grid, const float pointsPerVoxel, const unsigned int seed=0, const float spread=1.0f, InterrupterT *interrupter=nullptr)
| Non uniformly scatter points per active voxel. The pointsPerVoxel value is used to weight each grids cell value to compute a fixed number of points for every active voxel. If the computed result is a fractional value, each voxel calculates a delta value of how likely it is to contain an extra point. More...
template<typename PointDataGridT , typename GridT >
PointDataGridT::Ptr | initialisePointTopology (const GridT &grid)
| initialise the topology of a PointDataGrid and ensure everything is voxelized More...
template<typename PositionType , typename CodecT , typename RandGenT , typename LeafNodeT >
void | generatePositions (LeafNodeT &leaf, const AttributeSet::Descriptor::Ptr &descriptor, const Index64 &count, const float spread, RandGenT &rand01)
| Generate random point positions for a leaf node. More...

## Detailed Description

Various point scattering methods for generating VDB Points.

Author
  Nick Avramoussis

All random number calls are made to the same generator to produce temporarily consistent results in relation to the provided seed. This comes with some multi-threaded performance trade-offs.