OpenVDB 13.0.0

Loading...
Searching...
No Matches
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::NullInterrupter * | interrupter = nullptr

## Detailed Description

Various settings for the neighborhood analysis of point distributions.

## Member Data Documentation

## ◆ allowedAnisotropyRatio

float allowedAnisotropyRatio = 0.25f

Parameters

  allowedAnisotropyRatio | the maximum allowed ratio between the components in each ellipse' stretch coefficients such that: const auto s = stretch.sorted(); assert(s[0]/s[2] >= allowedAnisotropyRatio); openvdb::v13_0::points::PcaSettings::allowedAnisotropyRatio float allowedAnisotropyRatio Definition PrincipalComponentAnalysis.h:98 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.

## ◆ averagePositions

float averagePositions = 1.0f

Parameters

  averagePositions | the 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.

## ◆ interrupter

util::NullInterrupter* interrupter = nullptr

Parameters

  interrupter | optional interrupter

## ◆ maxSourcePointsPerVoxel

size_t maxSourcePointsPerVoxel = 8

Parameters

  The | maximum 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.

## ◆ maxTargetPointsPerVoxel

size_t maxTargetPointsPerVoxel = std::numeric_limits<size_t>::max()

Parameters

  The | maximum 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 transform 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.

## ◆ neighbourThreshold

size_t neighbourThreshold = 20

Parameters

  neighbourThreshold | number 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 transformation.

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.

## ◆ nonAnisotropicStretch

float nonAnisotropicStretch = 1.0

Parameters

  nonAnisotropicStretch | The 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).

## ◆ searchRadius

float searchRadius = 1.0f

Parameters

  searchRadius | the 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.

Note
  This value is used to normalize, so you should not use maximum limit values to try and include all points. If, for example, you want include every point against eachother, consider computing the extents of the grid and using that as the searchRadius.

Warning
  Valid range is [0, inf). Behaviour is undefined when outside this range.