Ken Perlins gradient noise function.
More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
|
| PerlinSDF (const T a_noiseAmplitude, const Vec3T< T > a_noiseFrequency, const T a_noisePersistence, const unsigned int a_noiseOctaves) noexcept |
| Full constructor. More...
|
|
virtual | ~PerlinSDF () noexcept |
| Destructor (does nothing)
|
|
virtual T | signedDistance (const Vec3T< T > &a_point) const noexcept override |
| Signed distance function. Generates a distance on [0,curAmplitude]. More...
|
|
template<class URNG > |
void | shuffle (URNG &g) noexcept |
| Shuffle the permutation with the input RNG. More...
|
|
std::array< int, 512 > & | getPermutationTable () noexcept |
| Get the internal permutation table. More...
|
|
| SignedDistanceFunction ()=default |
| Disallowed, use the full constructor.
|
|
virtual | ~SignedDistanceFunction ()=default |
| Destructor (does nothing)
|
|
virtual T | value (const Vec3T< T > &a_point) const noexcept override final |
| Implementation of ImplicitFunction::value. More...
|
|
virtual Vec3T< T > | normal (const Vec3T< T > &a_point, const T &a_delta) const noexcept |
| Signed distance normal vector. More...
|
|
| ImplicitFunction ()=default |
| Disallowed, use the full constructor.
|
|
virtual | ~ImplicitFunction ()=default |
| Destructor (does nothing)
|
|
T | operator() (const Vec3T< T > &a_point) const noexcept |
| Alternative signature for the value function. More...
|
|
template<class BV > |
BV | approximateBoundingVolumeOctree (const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const noexcept |
| Compute an approximation to the bounding volume for the implicit surface, using octrees. More...
|
|
|
virtual T | lerp (const T t, const T a, const T b) const noexcept |
| Ken Perlin's lerp function. More...
|
|
virtual T | fade (const T t) const noexcept |
| Ken Perlin's fade function. More...
|
|
T | grad (const int hash, const T x, const T y, const T z) const noexcept |
| Ken Perlins grad function. More...
|
|
T | noise (const Vec3T< T > &a_point) const noexcept |
| Octave noise function. More...
|
|
template<class T>
class PerlinSDF< T >
Ken Perlins gradient noise function.
◆ PerlinSDF()
template<class T >
PerlinSDF< T >::PerlinSDF |
( |
const T |
a_noiseAmplitude, |
|
|
const Vec3T< T > |
a_noiseFrequency, |
|
|
const T |
a_noisePersistence, |
|
|
const unsigned int |
a_noiseOctaves |
|
) |
| |
|
inlinenoexcept |
Full constructor.
- Parameters
-
[in] | a_noiseAmplitude | Noise amplitude |
[in] | a_noiseFrequency | Spatial noise frequency along the three Cartesian axes |
[in] | a_noisePersistence | Noise amplitude drop-off and frequency increase for octave noise. Should be < 1 |
[in] | a_noiseOctaves | Number of octaves. Should be > 0 |
◆ fade()
template<class T >
virtual T PerlinSDF< T >::fade |
( |
const T |
t | ) |
const |
|
inlineprotectedvirtualnoexcept |
Ken Perlin's fade function.
- Parameters
-
◆ getPermutationTable()
template<class T >
std::array<int, 512>& PerlinSDF< T >::getPermutationTable |
( |
| ) |
|
|
inlinenoexcept |
Get the internal permutation table.
- Returns
- m_permutationTable.
◆ grad()
template<class T >
T PerlinSDF< T >::grad |
( |
const int |
hash, |
|
|
const T |
x, |
|
|
const T |
y, |
|
|
const T |
z |
|
) |
| const |
|
inlineprotectednoexcept |
Ken Perlins grad function.
- Parameters
-
[in] | hash | Input parameter |
[in] | x | Input parameter |
[in] | y | Input parameter |
[in] | z | Input parameter |
◆ lerp()
template<class T >
virtual T PerlinSDF< T >::lerp |
( |
const T |
t, |
|
|
const T |
a, |
|
|
const T |
b |
|
) |
| const |
|
inlineprotectedvirtualnoexcept |
Ken Perlin's lerp function.
- Parameters
-
[in] | t | Input parameter |
[in] | a | Input parameter |
[in] | b | Input parameter |
◆ noise()
Octave noise function.
- Parameters
-
◆ shuffle()
template<class T >
template<class URNG >
Shuffle the permutation with the input RNG.
URNG should be a uniform random number generator, e.g.
- Parameters
-
[in] | g | Uniform random number generator (e.g., std::mt19937) |
- Note
- When using parallel calculations it is exceptionally important that the input RNG is the same across all threads/ranks. Otherwise, the user must manually ensure that the permutation table is the same. Failure to do so implies that each thread/rank generates it's own gradient noise and there is correspondingly no single geometry.
◆ signedDistance()
template<class T >
virtual T PerlinSDF< T >::signedDistance |
( |
const Vec3T< T > & |
a_point | ) |
const |
|
inlineoverridevirtualnoexcept |
The documentation for this class was generated from the following file: