OpenVDB 13.0.0

Loading...
Searching...
No Matches
PointRasterizeSDF.h File Reference

Various transfer schemes for rasterizing point positions 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"`
`#include "impl/PointRasterizeEllipsoidsSDFImpl.h"`

Go to the source code of this file.

## Classes
struct | SphereSettings< AttributeTs, RadiusAttributeT, FilterT >
| Generic settings for narrow band spherical stamping with a uniform or varying radius and optionally with closest point attribute transfer of arbitrary attributes. See the struct member documentation for detailed behavior. More...
struct | SmoothSphereSettings< AttributeTs, RadiusAttributeT, FilterT >
| Smoothed point distribution based sphere stamping with a uniform radius or varying radius and optionally with closest point attribute transfer of arbitrary attributes. See the struct member documentation for detailed behavior. More...
struct | EllipsoidSettings< AttributeTs, RadiusAttributeT, FilterT >
| Anisotropic point rasterization based on the principal component analysis of point neighbours. See the struct member documentation for detailed behavior. More...

## Namespaces
namespace | openvdb
namespace | openvdb::v13_0
namespace | openvdb::v13_0::points

## Functions
template<typename PointDataGridT, typename SdfT = typename PointDataGridT::template ValueConverter<float>::Type, typename SettingsT>
GridPtrVec | rasterizeSdf (const PointDataGridT &points, const SettingsT &settings)
| Perform point rasterzation to produce a signed distance field.

## Detailed Description

Various transfer schemes for rasterizing point positions 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 currently three main transfer implementations:

- Rasterize Spheres

  Performs trivial narrow band stamping of spheres for each point. This is an extremely fast and efficient way to produce both a valid symmetrical narrow band level set and transfer attributes using closest point lookups.

- Rasterize Smooth Spheres

  Calculates an averaged position of influence per voxel as described in: [Animating Sand as a Fluid - Zhu Bridson 2005].

  This technique 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 this method can be prone to temporal instabilities (that is, given a sequence of frames, consecutive frames may not generate surfaces that transition as smoothly) due to changes in point distributions resulting in more abrupt surface changes. It may also 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.

- Rasterize Ellipsoids.

  Rasterizes anisotropic ellipses for each point by analyzing point neighborhood distributions, as described in: [Reconstructing Surfaces of Particle-Based Fluids Using Anisotropic Kernel - Yu Turk 2010].

  This method uses the affine matrix attributes from the points::pca() method which model these elliptical distributions using principal component analysis. The ellipses create a much tighter, more fitted surface that better represents the convex hull of the point set. This technique also allows point to smoothly blend from their computed ellipse back to a canonical sphere, as well as allowing isolated points to be rasterized with their own radius. Although the rasterization step of this pipeline is relatively fast, it is still the slowest of all three methods, and depends on the somewhat expensive points::pca() method if you're not providing your own transformations. Still, this technique can be far superior at producing fluid surfaces where thin sheets (waterfalls) or sharp edges (wave breaks) are desirable.

  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