Core 1.0
NoiseTurbulence Class Reference

Turbulence computed from a modified noise function. More...

#include <turbulence.h>

Inheritance diagram for NoiseTurbulence:
Noise AnalyticScalarField

Public Member Functions

 NoiseTurbulence (const double &=0.0, const double &=1.0, const double &=1.0, const double &=0.5, const double &=0.5, int=5, const Vector &=Vector::Null)
 Creates a turbulence field.
 
 ~NoiseTurbulence ()
 Destroys a turbulence instance.
 
double Value (const Vector &) const
 Computes the turbulence value at a given point.
 
Vector AtVector (const Vector &) const
 Computes a turbulence displacement vector at a given point.
 
double Omega () const
 Return the amplitude dampening coefficient.
 
double Lambda () const
 Return the wavelength dampening coefficient.
 
int Octaves () const
 Number of octaves.
 
double K () const
 Return the global Lipschitz constant.
 
double Maximum () const
 Computes the maximum of the turbulence.
 

Protected Attributes

double v0 = 0.0
 Base value.
 
double a0 = 1.0
 Base amplitude.
 
double l0 = 1.0
 Wavelength.
 
double alpha = 0.5
 Amplitude attenuation coefficient.
 
double lambda = 0.5
 Wavelength amplification coefficient.
 
int octaves = 8
 Number of octaves.
 
Vector t = Vector::Null
 Translation.
 
- Protected Attributes inherited from Noise
bool quintic = false
 Flag defining interpolation type: either cubic (false) or quintic (true).
 
- Protected Attributes inherited from AnalyticScalarField
bool sign = true
 Sign convention, used for normal computation.
 

Static Protected Attributes

static const Matrix R3 = Matrix::Rotation(Vector(4.0 * Math::Pi / 19.0, 3.0 * Math::Pi / 19.0, 2.0 * Math::Pi / 19.0))
 Random incremental rotation.
 
- Static Protected Attributes inherited from Noise
static double rtable [267]
 Random double table.
 
static const short hashTable [4096]
 Hash table.
 
- Static Protected Attributes inherited from AnalyticScalarField
static int ncubes = 0
 Number of cubes processed by polygonization algorithms.
 
static const double Epsilon = 1e-6
 Epsilon value for partial derivatives.
 

Friends

std::ostream & operator<< (std::ostream &s, const NoiseTurbulence &noise)
 Overloaded.
 

Additional Inherited Members

 Noise (bool=false)
 Create a noise function.
 
 ~Noise ()
 Empty.
 
Vector Gradient (const Vector &) const
 Compute the gradient of the noise function at a given point.
 
double AtGradient (const Vector &, Vector &) const
 Compute the gradient of the noise function at a given point.
 
Vector AtVector (const Vector &) const
 Vector version of Perlin-style noise function.
 
- Protected Member Functions inherited from AnalyticScalarField
bool Find (Vector &, bool, const Box &, int=10000, Random &=Random::R239) const
 Find a random sample point inside or outside the surface.
 
 AnalyticScalarField (bool=true)
 Constructor.
 
Matrix Hessian (const Vector &) const
 Compute the Hessian symmetric matrix of the field function.
 
virtual Vector Normal (const Vector &) const
 Compute the normal to the surface.
 
bool Inside (const double &) const
 Check if the value is considered as inside or outside.
 
virtual Color GetMaterial (const Vector &, const Vector &=Vector::Null) const
 Compute the color.
 
virtual Box GetBox () const
 Compute the bounding box of the scalar field.
 
void Curvature (const Vector &, double &, double &) const
 Compute the gaussian and mean curvatures.
 
Vector Cast (const Vector &, const double &, const double &=1e-6, int n=100) const
 Given a starting vertex x, project it onto the implicit surface following the gradient.
 
Vector Dichotomy (Vector, Vector, double, double, double, const double &=1.0e-4) const
 Compute the intersection between a segment and an implicit surface.
 
virtual bool GetSample (Vector &, const Box &, Random &=Random::R239) const
 Find a point sample on the implicit surface.
 
virtual int GetSamples (QVector< Vector > &, const Box &, int, Random &=Random::R239) const
 Find a set of random sample points on the implicit surface.
 
virtual QVector< VectorPoisson (double, int, Random &=Random::R239) const
 Compute a Poisson sphere distribution on an implicit surface.
 
virtual ScalarField2 Sample (const Rectangles &, int, int) const
 Compute the field function at the vertices a lattice.
 
virtual ScalarField2 Sample (const Quadrangle &, int) const
 Sample the scalar field on a quadrangle.
 
virtual ScalarField Sample (const Box &, int) const
 Sample the implicit surface to get a scalar field.
 
int Roots (const Ray &, const double &, const double &, const double &, double *, int=1, const double &=1.0e-4) const
 Find the intersections between a ray and an implicit surface on a given interval.
 
int Roots (const Ray &, const double &, const double &, const double &, const double &, const double &, double *, int=1, const double &=1.0e-4) const
 This functions searches the intersections between a ray and an implicit surface on a given interval.
 
virtual double K (const Box &) const
 Compute the local Lipschitz constant inside a box.
 
virtual double K (const Sphere &) const
 Compute the local Lipschitz constant inside a box.
 
virtual double K (const Segment &) const
 Compute the local Lipschitz constant along a segment.
 
virtual void Polygonize (int, Mesh &, const Box &, const double &=1e-4) const
 Compute the polygonal mesh approximating the implicit surface.
 
virtual void PolygonizeLucie (const Box &, Mesh &, bool, bool) const
 Implementation of the original continuation polygonization method.
 
virtual void PolygonizeLucie (const double &, Mesh &, bool, bool) const
 Wyvill's original marching cubes algorithm.
 
virtual void Dual (int, Mesh &, const Box &) const
 Dual polygonization.
 
virtual bool SphereTrace (const Ray &, const double &, const double &, const double &, double &, int &, const double &=1e-4) const
 Find the first intersection between a ray and an implicit surface on a given interval, using sphere tracing.
 
virtual void Polygonize (const Box &, QVector< Triangle > &, const double &=1e-4, bool=false) const
 Polygonize a cube.
 
virtual void Polygonize (const Tetrahedra &, QVector< Triangle > &, const double &=1e-4) const
 Polygonize a tetrahedral cell.
 
virtual Mesh PolygonizeOctree (const Box &, int, const double &=1e-4) const
 Compute the polygonal mesh approximating the implicit surface using an octree decomposition of space.
 
virtual void Voxelize (const Box &, int, Box &, QVector< Vector > &) const
 Voxelize the scalar field.
 
virtual void Voxelize (int, Voxel &, const Box &) const
 Voxelization.
 
virtual double Volume (int=5) const
 Computes the volume of the BlobTree.
 
virtual double Volume (const Box &, int) const
 Compute the volume of a BlobTree object.
 
virtual double Volume (const Box &, int, double &) const
 Compute the volume of an implicit surface.
 
virtual double StochasticVolume (const Box &, int) const
 Compute the volume of an implicit surface.
 
virtual Sphere Center (int) const
 Computes the gravity center of the BlobTree.
 
virtual Sphere Center (const Box &, int) const
 Compute the center of gravity of the BlobTree.
 
virtual void Colorize (const Mesh &, MeshColor &) const
 Colorize the vertexes of a mesh according to the analytic scalar field.
 
- Static Protected Member Functions inherited from AnalyticScalarField
static int Cubes ()
 Get the number of cubes processed.
 

Detailed Description

Turbulence computed from a modified noise function.

A turbulence field is characterized by the number of octaves, the attenuation of the amplitude of the noise summed at every step, and by the amplification of the wavelength.

Constructor & Destructor Documentation

◆ NoiseTurbulence()

NoiseTurbulence::NoiseTurbulence ( const double & v = 0.0,
const double & a = 1.0,
const double & l = 1.0,
const double & alpha = 0.5,
const double & lambda = 0.5,
int octaves = 5,
const Vector & t = Vector::Null )
explicit

Creates a turbulence field.

Parameters
v,a,lBase value, amplitude and wavelength.
alpha,lambdaAmplitude and wavelength attenuation (should be less than 1.0 in general).
octavesNumber of octaves.
tOffset vector.

Member Function Documentation

◆ AtVector()

Vector NoiseTurbulence::AtVector ( const Vector & p) const

Computes a turbulence displacement vector at a given point.

Sums a series of scaled noise displacement functions.

Parameters
pPoint.

◆ K()

double NoiseTurbulence::K ( ) const
virtual

Return the global Lipschitz constant.

See also
Noise::K()

Reimplemented from Noise.

◆ Maximum()

double NoiseTurbulence::Maximum ( ) const

Computes the maximum of the turbulence.

Sums the maximum of the terms of the series of scaled noise.

◆ Value()

double NoiseTurbulence::Value ( const Vector & p) const
virtual

Computes the turbulence value at a given point.

Sums a series of scaled noise functions.

Parameters
pPoint.

Reimplemented from Noise.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const NoiseTurbulence & noise )
friend

Overloaded.

Parameters
sStream.
noiseThe noise.