OpenVDB  12.1.0
Public Attributes | List of all members
PcaSettings Struct Reference

Various settings for the neighborhood analysis of point distributions. More...

#include <openvdb/points/PrincipalComponentAnalysis.h>

Public Attributes

float searchRadius = 1.0f
 
float allowedAnisotropyRatio = 0.25f
 
float nonAnisotropicStretch = 1.0
 
size_t neighbourThreshold = 20
 
size_t maxSourcePointsPerVoxel = 8
 
size_t maxTargetPointsPerVoxel = std::numeric_limits<size_t>::max()
 
float averagePositions = 1.0f
 
util::NullInterrupterinterrupter = nullptr
 

Detailed Description

Various settings for the neighborhood analysis of point distributions.

Member Data Documentation

float allowedAnisotropyRatio = 0.25f
Parameters
allowedAnisotropyRatiothe maximum allowed ratio between the components in each ellipse' stretch coefficients such that:
const auto s = stretch.sorted();
assert(s[0]/s[2] >= allowedAnisotropyRatio);
This parameter effectively clamps the allowed anisotropy, with a value of 1.0f resulting in uniform stretch values (representing a sphere). Values tending towards zero will allow for greater anisotropy i.e. much more exaggerated stretches along the computed principal axis and corresponding squashes along the others to compensate.
Note
Very small values may cause very thing ellipses to be produced, so a reasonable minimum should be set. Valid range is (0, 1]. Behaviour is undefined when outside this range.
float averagePositions = 1.0f
Parameters
averagePositionsthe amount (between 0 and 1) to average out positions. All points, whether they end up as ellipses or not, can have their positions smoothed to account for their neighbourhood distribution. This will have no effect for points with no neighbours.
Warning
This options does NOT modify the P attribute - instead, a world space position attribute "pws" (default) is created and stores the smoothed position.
Valid range is [0, 1]. Behaviour is undefined when outside this range.
util::NullInterrupter* interrupter = nullptr
Parameters
interrupteroptional interrupter
size_t maxSourcePointsPerVoxel = 8
Parameters
Themaximum number of source points to gather for contributions to each target point, per voxel. When a voxel contains more points than this value, source point are trivially stepped over, with the step size calculated as max(1, ppv / neighbourThreshold).
Note
There is no prioritisation of nearest points; for example, voxels which partially overlap the search radius may end up selecting point ids which all lie outside. This is rarely an issue in practice and choosing an appropriate value for this setting can significantly increase performance without a large impact to the results.
Warning
Valid range is [1, inf). Behaviour is undefined if this value is set to zero.
size_t maxTargetPointsPerVoxel = std::numeric_limits<size_t>::max()
Parameters
Themaximum number of target points to write anisotropy values to. When a voxel contains more points than this value, target point are trivially stepped over, with the step size calculated as: max(1, ppv / maxTargetPointsPerVoxel). default behaviour is to compute for all points. Any points skipped will be treated as being isolated and receive an identity rotation and nonAnisotropicStretch.
Note
When using in conjuction with rasterizeSdf for ellipsoids, consider choosing a lower value (e.g. same value as maxSourcePointsPerVoxel) to speed up iterations and only increase if necessary.
Warning
Valid range is [1, inf). Behaviour is undefined if this value is set to zero.
size_t neighbourThreshold = 20
Parameters
neighbourThresholdnumber of points in a given neighbourhood that target points must have to be classified as having an elliptical distribution. Points with less neighbours than this will end up with uniform stretch values of nonAnisotropicStretch and an identity rotation matrix.
Note
This number can include the target point itself.
Warning
Changing this value does not change the size or number of point neighborhood lookups. As such, increasing this value only speeds up the number of calculated covariance matrices. Valid range is [0, inf], where 0 effectively disables all covariance calculations and 1 enables them for every point.
float nonAnisotropicStretch = 1.0
Parameters
nonAnisotropicStretchThe stretch coefficient that should be used for points which have no anisotropic neighbourhood (due to being isolated or not having enough neighbours to reach the specified
See also
neighbourThreshold).
float searchRadius = 1.0f
Parameters
searchRadiusthe world space search radius of the neighborhood around each point. Increasing this value will result in points including more of their neighbors into their ellipsoidal calculations. This may or may not be desirable depending on the point set's distribution and can be tweaked as necessary. Note however that large values will cause the PCA calculation to become exponentially more expensive and should be used in conjunction with the max point per voxel settings below.
Warning
Valid range is [0, inf). Behaviour is undefined when outside this range.