OpenVDB  12.0.0
Namespaces | Functions
PointRasterizeSDF.h File Reference

Transfer schemes for rasterizing point positional and radius data to signed distance fields with optional closest point attribute transfers. All methods support arbitrary target linear transformations, fixed or varying point radius, filtering of point data and arbitrary types for attribute transferring. More...

#include "PointDataGrid.h"
#include "PointTransfer.h"
#include "PointStatistics.h"
#include <openvdb/openvdb.h>
#include <openvdb/Types.h>
#include <openvdb/tools/Prune.h>
#include <openvdb/tools/ValueTransformer.h>
#include <openvdb/thread/Threading.h>
#include <openvdb/util/NullInterrupter.h>
#include <openvdb/util/Assert.h>
#include <unordered_map>
#include <tbb/task_group.h>
#include <tbb/parallel_reduce.h>
#include "impl/PointRasterizeSDFImpl.h"

Go to the source code of this file.

Namespaces

 openvdb
 
 openvdb::v12_0
 
 openvdb::v12_0::points
 

Functions

template<typename PointDataGridT , typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
SdfT::Ptr rasterizeSpheres (const PointDataGridT &points, const Real radius, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Narrow band sphere stamping with a uniform radius. More...
 
template<typename PointDataGridT , typename RadiusT = float, typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
SdfT::Ptr rasterizeSpheres (const PointDataGridT &points, const std::string &radius, const Real scale=1.0, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Narrow band sphere stamping with a varying radius. More...
 
template<typename PointDataGridT , typename AttributeTypes , typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
GridPtrVec rasterizeSpheres (const PointDataGridT &points, const Real radius, const std::vector< std::string > &attributes, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Narrow band sphere stamping with a uniform radius and closest point attribute transfer. More...
 
template<typename PointDataGridT , typename AttributeTypes , typename RadiusT = float, typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
GridPtrVec rasterizeSpheres (const PointDataGridT &points, const std::string &radius, const std::vector< std::string > &attributes, const Real scale=1.0, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Narrow band sphere stamping with a varying radius and closest point attribute transfer. More...
 
template<typename PointDataGridT , typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
SdfT::Ptr rasterizeSmoothSpheres (const PointDataGridT &points, const Real radius, const Real searchRadius, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Smoothed point distribution based sphere stamping with a uniform radius. More...
 
template<typename PointDataGridT , typename RadiusT = float, typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
SdfT::Ptr rasterizeSmoothSpheres (const PointDataGridT &points, const std::string &radius, const Real radiusScale, const Real searchRadius, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Smoothed point distribution based sphere stamping with a varying radius. More...
 
template<typename PointDataGridT , typename AttributeTypes , typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
GridPtrVec rasterizeSmoothSpheres (const PointDataGridT &points, const Real radius, const Real searchRadius, const std::vector< std::string > &attributes, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Smoothed point distribution based sphere stamping with a uniform radius and closest point attribute transfer. More...
 
template<typename PointDataGridT , typename AttributeTypes , typename RadiusT = float, typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename FilterT = NullFilter, typename InterrupterT = util::NullInterrupter>
GridPtrVec rasterizeSmoothSpheres (const PointDataGridT &points, const std::string &radius, const Real radiusScale, const Real searchRadius, const std::vector< std::string > &attributes, const Real halfband=LEVEL_SET_HALF_WIDTH, math::Transform::Ptr transform=nullptr, const FilterT &filter=NullFilter(), InterrupterT *interrupter=nullptr)
 Smoothed point distribution based sphere stamping with a varying radius and closest point attribute transfer. More...
 

Detailed Description

Transfer schemes for rasterizing point positional and radius data to signed distance fields with optional closest point attribute transfers. All methods support arbitrary target linear transformations, fixed or varying point radius, filtering of point data and arbitrary types for attribute transferring.

Author
Nick Avramoussis

There are two main transfer implementations; rasterizeSpheres and rasterizeSmoothSpheres. The prior performs trivial narrow band stamping of spheres for each point, where as the latter calculates an averaged position of influence per voxel as described in: [Animating Sand as a Fluid - Zhu Bridson 05].

rasterizeSpheres() is an extremely fast and efficient way to produce both a valid symmetrical narrow band level set and transfer attributes using closest point lookups.

rasterizeSmoothSpheres() produces smoother, more blended connections between points which is ideal for generating a more artistically pleasant surface directly from point distributions. It aims to avoid typical post filtering operations used to smooth surface volumes. Note however that rasterizeSmoothSpheres may not necessarily produce a symmetrical narrow band level set; the exterior band may be smaller than desired depending on the search radius. The surface can be rebuilt or resized if necessary. The same closet point algorithm is used to transfer attributes.

In general, it is recommended to consider post rebuilding/renormalizing the generated surface using either tools::levelSetRebuild() or tools::LevelSetTracker::normalize() tools::LevelSetTracker::resize().

Note
These methods use the framework provided in PointTransfer.h