Heightfield 1.0
LayerFieldErosion Class Reference

A multi-layered height field with complex erosion algorithms. More...

#include <layersfielderosion.h>

Inheritance diagram for LayerFieldErosion:
LayerStack HeightFieldSediment Array2 Box2

Public Member Functions

 LayerFieldErosion ()
 Empty.
 LayerFieldErosion (const Box2 &, int, int)
 Create a terrain adapted to erosion simulations.
 LayerFieldErosion (const HeightField &)
 Create a terrain adapted to erosion simulations.
 LayerFieldErosion (const ScalarField2 &, const ScalarField2 &)
 Create a terrain adapted to erosion simulations.
 ~LayerFieldErosion ()
 Empty.
void SetEvaporation (const double &)
 Set the constant of evaporation.
void SetBordersFlow (const double &)
 Set the percentage of sand that would flow out of the domain when flow reaches border cells.
void ThermalImpactSlope (const double &)
 Globally transform a thin layer of bedrock into rocks.
void StabilizeRocksSand (const double &, int=1024)
 Iteratively stabilize the rocks and sand layers by redistributing unstable material.
bool StabilizeStep (const double &, int, int, ScalarField2 &, ScalarField2 &, ScalarField2 &)
 Compute one stabilization update for a single cell.
bool FlowOneStep (const double &)
 Perform one stream-power erosion step over the whole terrain.
bool FlowStep (const double &, int)
 Perform a set of flow.
bool WorldmachineStep (const double &)
 Perform one slope-proportional erosion step over the whole terrain.
bool WorldmachineSeveralStep (const double &, int steps=32)
 Repeatedly apply slope-proportional erosion for a fixed number of steps.
void HydraulicImpact (const double &)
 Add water all over the terrain.
void HydraulicWeatheringIterations (int)
 Run a fixed number of hydraulic weathering iterations.
void HydraulicWeatheringUntilStabilization ()
 Run hydraulic weathering iterations until every cell is stable.
bool HydraulicWeatheringStep (int, int, ScalarField2 &, ScalarField2 &, ScalarField2 &, ScalarField2 &)
 Compute one hydraulic weathering update for a single cell.
void HydraulicTransport (const QPoint &, const double &, const double &, double &, double &)
 Compute the sand and bedrock volumes transported by water at a cell.
void HydraulicEvaporate ()
 Evaporate water over the whole terrain.
void DynamicImpact (const double &)
 Add a uniform layer of rain water, 0.25 m deep, over the whole terrain.
void DynamicWeatheringIterations (int)
 Perform a given number of dynamic hydraulic weathering iterations.
void DynamicWeatheringUntilStabilization ()
 Perform dynamic hydraulic weathering iterations until no water moves anymore.
bool DynamicWeatheringStep (int, int, ScalarField2 &, ScalarField2 &, ScalarField2 &, ScalarField2 &)
 Compute the flow of water and the transport of sand from a cell to its lower neighbors.
void DynamicTransport (const QPoint &, const double &, const double &, double &, double &)
 Compute the amount of material transported from a cell by flowing water.
void LightningWeatheringIterations (int)
 Perform a given number of rock stabilization iterations.
void LightningWeatheringUntilStabilization ()
 Perform rock stabilization iterations until no rocks fall anymore.
bool LightningWeatheringStep (int, int, ScalarField2 &)
 Make rocks fall from a cell to its neighbors where the slope exceeds the angle of repose.
void VegetationDestruction ()
 Destroys the vegetation layer.
void VegetationGrowingStep ()
 Spread vegetation to adjacent cells by one growth step.
void GrassSeed ()
 Seed grass on a terrain.
void ProceduralVegetation ()
 Create vegetation.
void GrassOverall (const double &=0.5)
 Add grass over the entire terrain, regardless of the conditions of the environment.
void GrassSpawn ()
 Spawn grass on sand.
void GrassGrowingStep ()
 Grow grass by one step.
ScalarField2 BedrockDetachment () const
 Accumulated amount of detached (eroded) bedrock.
ScalarField2 SandFlow () const
 Accumulated amount of eroded and transported sand.
ScalarField2 WaterFlow () const
 Accumulated water flow.
QImage Texture () const
 Create a texture image of the terrain, at the resolution of the grid.
Mesh CreateGeometry () const
 Create geometry.
QString GetStats () const
 Get statistics about the terrain as a string.
void Droplet (const Vector2 &, const double &)
 Erode the terrain using a single droplet.
void GlobalDropletErosion (const double &)
 Erode the terrain by distributing droplets all over the terrain.
void RandomDropletErosion (int, const double &)
 Erode the terrain using randomly distributed droplets.
void PointDropletErosion (const Vector2 &, int, const double &)
 Erode the terrain using a point source for generating droplets.
void Lightning (const Vector2 &, const double &)
 Lightning strike.
void LightningErosion (int, const double &)
 Erode the terrain using randomly distributed droplets.
void ThermalDropletErosion (int)
 Erode the terrain using randomly distributed droplets.
void ThermalDropletErosion (const Vector2 &, int)
 Erode the terrain using a point source for generating droplets.
Public Member Functions inherited from LayerStack
 LayerStack ()
 Create an empty terrain.
 LayerStack (const Box2 &, int, int)
 Create a terrain with different material layers.
 LayerStack (const ScalarField2 &)
 Create terrain.
 LayerStack (const ScalarField2 &, const ScalarField2 &)
 Create terrain.
 LayerStack (const ScalarField2 &, const ScalarField2 &, const ScalarField2 &, const ScalarField2 &, const ScalarField2 &, const ScalarField2 &, const ScalarField2 &, const ScalarField2 &)
 Create a layered terrain model.
 ~LayerStack ()
 Empty.
void Subdivide ()
 Double the resolution of the terrain.
Box GetBox () const
 Compute the bounding box of the terrain.
double Vegetation (const Vector2 &) const
 Return the vegetation density.
double Vegetation (int, int) const
 Return the vegetation density.
double Grass (const Vector2 &) const
 Return the grass density.
double Grass (int, int) const
 Return the grass density.
double Water (const Vector2 &) const
 Return the water depth (meters).
double Water (int, int) const
 Return the water depth (meters).
double Rocks (const Vector2 &) const
 Return the rocks layer thickness (meters).
double Rocks (int, int) const
 Return the rocks layer thickness (meters).
ScalarField2 & GetRock ()
 Access to the rock scalar field.
ScalarField2 & GetWater ()
 Access to the water scalar field.
ScalarField2 & GetSnow ()
 Access to the snow scalar field.
ScalarField2 & GetGrass ()
 Access to the grass scalar field.
ScalarField2 & GetVegetation ()
 Access to the vegetation scalar field.
ScalarField2 & GetAlpha ()
 Access to the alpha scalar field.
HeightField GetHeightField (bool=true, bool=true) const
 Convert the layered model into a simple heightfield.
void UpdateHeightField (HeightField &, const QRect &=QRect(), bool=true, bool=true) const
 Convert the layer model into a simple heightfield.
bool Intersect (const Ray &, double &, Vector &) const
 Compute the intersection between a ray and the surface of the terrain.
LayerStack Crop (const QPoint &, const QPoint &) const
 Crops a rectangular region in the terrain.
void WaterFlood (const double &)
 Fill the terrain with a water body.
void WaterFlood (const Vector2 &, const double &)
 Flood fills a region with water.
void WaterDry (const Vector2 &)
 Dries a connex region, removing water using a flood fill algorithm.
void SandOverall (const double &)
 Add sand over the terrain.
void RockOverall (const double &)
 Add rock over the terrain.
QVector< Vector > GetTrees () const
  <FONT COLOR="AA2222"><B>Warning</B></FONT>
Vector Vertex (int, int) const
 Compute the vertex corresponding to a given sample.
Vector Vertex (const Vector2 &) const
 Compute the elevation of a point, which is the sum of the bedrock, sand and rocks layers.
Vector Normal (int, int) const
 Compute the normal at a given sample.
Color GetColorVector (int, int) const
 Compute the vertex corresponding to a given sample.
double Height (const Vector2 &) const
 Compute the elevation of a point, which is the sum of the bedrock, sand and rocks layers.
Vector Normal (const Vector2 &, bool=false) const
 Compute the normal for a given position on the terrain.
void Scale (const double &)
 Scale the layer-field.
void Translate (const Vector2 &)
 Translate the layer-field.
void Save (const QString &) const
 Save structure as a set of images.
Mesh CreateWaterGeometry () const
 Create the geometry of the water on the terrain.
void CreateCubes (Box &, QVector< FrameScaled > &, QVector< FrameScaled > &, QVector< FrameScaled > &, QVector< FrameScaled > &, QVector< FrameScaled > &, QVector< FrameScaled > &, bool=true, bool=true, bool=true, bool=true, bool=true, bool=true) const
 Create a material stack representation of the model.
Public Member Functions inherited from HeightFieldSediment
 HeightFieldSediment ()
 Create an empty terrain.
 HeightFieldSediment (const Box2 &, int, int)
 Create a flat terrain with no sediments.
 HeightFieldSediment (const ScalarField2 &)
 Create a terrain with no sediments from an elevation field.
 HeightFieldSediment (const ScalarField2 &, const ScalarField2 &)
 Create a terrain with sediments.
 ~HeightFieldSediment ()
 Empty.
Array2 GetArray () const
 Return the array representing the grid domain.
ScalarField2 AlphaBlend () const
 Compute the alpha blending between sand and bedrock.
HeightField GetHeightField () const
 Convert the layered model into a simple heightfield.
bool Intersect (const Ray &, double &, Vector &) const
 Compute the intersection between a ray and the surface of the terrain.
void SmoothRock (int=1)
 Smoothes the bedrock layer.
HeightField & GetBedrock ()
 Access to the bedrock scalar field.
ScalarField2 & GetSand ()
 Access to the sand scalar field.
double Bedrock (const Vector2 &) const
 Compute the bedrock elevation.
double Bedrock (int, int) const
 Return the bedrock elevation.
double Sand (const Vector2 &) const
 Compute the sand thickness.
double Sand (int, int) const
 Return the sand thickness.
void Subdivide ()
 Double the resolution of the terrain.
void BedrockFlatten (const Vector2 &, const double &, const double &=0.25)
 Flatten the bedrock around the target point.
void BedrockLevel (const Vector2 &, const double &, const double &)
 Level the bedrock to the target elevation.
void BedrockUplift (const double &)
 Modify the bedrock using a uniform uplift.
void BedrockUplift (const ScalarField2 &)
 Uplift.
void ThermalImpact (const double &)
 Globally transform a thin layer of bedrock into sediments.
void ThermalImpactSlope (const double &)
 Globally transform a thin layer of bedrock into sediments.
void Stabilize (const double &, const double &=0.84)
 Stabilizes sediments over the entire terrain.
bool StabilizeStep (int, int, const double &, ScalarField2 &)
 Perform a stabilization step on the given layered cell.
int CheckFlowSlope (const QPoint &, FlowStruct &) const
 Compute the flow directions at a given point.
int CheckFlowDirectionsAngle (const QPoint &, const double &, QPoint *, double *, double *, double *) const
 Compute the flow directions at a given point.
bool SelectFlowDirection (const QPoint &, QPoint &, double &) const
 Select flow direction.
void ErodedMaterial (const QPoint &q, const double &slope, const double &V_T, double &V_T_S, double &V_E_R, double &V_E_S, double &V_D_S)
 Compute the transport-erosion-deposition budget for one cell and one flow direction.

Protected Attributes

ScalarField2 bedrockflow
 Detached bedrock (accumulated amount of eroded bedrock), see BedrockDetachment().
ScalarField2 sandflow
 Flowing sand (accumulated amount of eroded and transported sand), see SandFlow().
ScalarField2 waterflow
 Flowing water.
ScalarField2 suspended
 Suspended material.
double evaporation = 0.025
 Evaporation rate.
double flowouside = 0.0
 Percentage of sediment flowing outside of boundary.
Protected Attributes inherited from LayerStack
ScalarField2 rocks
 Rocks layer thickness (meters); included in Height() but not in Vertex(int, int).
ScalarField2 water
 Water depth (meters) above the ground.
ScalarField2 grass
 Grass density.
ScalarField2 vegetation
 Vegetation density.
ScalarField2 snow
 Snow layer, cleared by WaterFlood() below the water level; not added to the elevation.
ScalarField2 alpha
 Alpha layer, not used by the erosion algorithms; not added to the elevation.
Protected Attributes inherited from HeightFieldSediment
HeightField bedrock
 Bedrock.
ScalarField2 sand
 Sand, i.e., sediments.

Additional Inherited Members

Protected Member Functions inherited from HeightFieldSediment
void Evaporate (const double &, const double &, double &, double &, double &)
 Evaporate some water from the droplet.

Detailed Description

A multi-layered height field with complex erosion algorithms.

Constructor & Destructor Documentation

◆ LayerFieldErosion() [1/3]

LayerFieldErosion::LayerFieldErosion ( const Box2 & box,
int nx,
int ny )
explicit

Create a terrain adapted to erosion simulations.

Parameters
boxThe box.
nx,nyResolution.

◆ LayerFieldErosion() [2/3]

LayerFieldErosion::LayerFieldErosion ( const HeightField & t)

Create a terrain adapted to erosion simulations.

Parameters
tHeightfield.

◆ LayerFieldErosion() [3/3]

LayerFieldErosion::LayerFieldErosion ( const ScalarField2 & t,
const ScalarField2 & s )
explicit

Create a terrain adapted to erosion simulations.

Parameters
tBedrock.
sSediment layer.

Member Function Documentation

◆ Droplet()

void LayerFieldErosion::Droplet ( const Vector2 & p,
const double & e )

Erode the terrain using a single droplet.

The position is snapped to the nearest grid vertex with VertexInteger(), and the droplet is then simulated from this vertex by the private overload Droplet(QPoint, const double&).

Parameters
pPosition of the drop.
eWater elevation (in meters).

◆ DynamicImpact()

void LayerFieldErosion::DynamicImpact ( const double & )

Add a uniform layer of rain water, 0.25 m deep, over the whole terrain.

The parameter is not used.

◆ DynamicTransport()

void LayerFieldErosion::DynamicTransport ( const QPoint & p,
const double & s,
const double & wa,
double & dbedrock,
double & dsand )

Compute the amount of material transported from a cell by flowing water.

Only sand is transported, within the limit of the sand available at the cell: bedrock is never eroded.

Parameters
pInteger coordinates of the cell.
sSlope.
waAmount of water.
dbedrock,dsandReturned amounts of transported bedrock and sand, left unchanged if the cell has no sand.

◆ DynamicWeatheringIterations()

void LayerFieldErosion::DynamicWeatheringIterations ( int iterations)

Perform a given number of dynamic hydraulic weathering iterations.

At every iteration, DynamicWeatheringStep() is evaluated for every cell, and the variations of bedrock, sand and water are applied simultaneously at the end of the iteration.

Parameters
iterationsNumber of iterations.

◆ DynamicWeatheringStep()

bool LayerFieldErosion::DynamicWeatheringStep ( int x,
int y,
ScalarField2 & deltarock,
ScalarField2 & deltasand,
ScalarField2 & deltawater,
ScalarField2 & deltaflow )

Compute the flow of water and the transport of sand from a cell to its lower neighbors.

Water depths below 0.1 mm evaporate. Otherwise, water is distributed among the neighbors whose total elevation (bedrock, sand and water) is more than 1 cm lower, proportionally to the slope; the amount of water that moves is bounded by the smallest of these slopes. Sand is then carried in every direction according to DynamicTransport().

Parameters
x,yInteger coordinates of the cell.
deltarock,deltasand,deltawater,deltaflowReturned variations of bedrock, sand, water and accumulated flow.
Returns
True if no water moved from the cell, false otherwise.

◆ DynamicWeatheringUntilStabilization()

void LayerFieldErosion::DynamicWeatheringUntilStabilization ( )

Perform dynamic hydraulic weathering iterations until no water moves anymore.

Warning
The number of iterations is not bounded.

◆ FlowOneStep()

bool LayerFieldErosion::FlowOneStep ( const double & e)

Perform one stream-power erosion step over the whole terrain.

Computes the normalized stream power at each cell, erodes sand first (erosivity 1.0) then bedrock with remaining capacity (erosivity 0.1), and distributes the eroded material to downhill neighbours weighted by the MFD slope proportions. Updates bedrockflow and sandflow statistics.

Parameters
eBase erosion amount per unit of stream power (meters).
Returns
Always false (convergence detection not implemented).

◆ FlowStep()

bool LayerFieldErosion::FlowStep ( const double & e,
int n )

Perform a set of flow.

Parameters
eAmount of material.
nNumber of steps.

◆ GetStats()

QString LayerFieldErosion::GetStats ( ) const

Get statistics about the terrain as a string.

The string lists the size and resolution of the grid, the range of the total elevation (bedrock, rocks and sand) and of the bedrock, and the volumes of the layers, in thousands of cubic meters.

◆ GlobalDropletErosion()

void LayerFieldErosion::GlobalDropletErosion ( const double & e)

Erode the terrain by distributing droplets all over the terrain.

Parameters
eWater elevation (in meters).

◆ GrassGrowingStep()

void LayerFieldErosion::GrassGrowingStep ( )

Grow grass by one step.

Every cell covered with grass spreads 1% of its grass density to itself and to its eight neighbors, which are updated simultaneously.

◆ GrassOverall()

void LayerFieldErosion::GrassOverall ( const double & s = 0.5)

Add grass over the entire terrain, regardless of the conditions of the environment.

Parameters
sGrass density.

◆ GrassSpawn()

void LayerFieldErosion::GrassSpawn ( )

Spawn grass on sand.

The grass density is set to a smooth step of the sand thickness, from 0 under 5 cm of sand to 1 over 15 cm.

Warning
The previous grass layer is overwritten.

◆ HydraulicEvaporate()

void LayerFieldErosion::HydraulicEvaporate ( )

Evaporate water over the whole terrain.

On every cell, the water depth decreases by the evaporation rate (evaporation, in meters per call) without becoming negative. The water can then carry at most C_T_S times its depth of suspended sand: the excess falls and is added to the sand layer.

See also
HeightFieldSediment::Evaporate()

◆ HydraulicImpact()

void LayerFieldErosion::HydraulicImpact ( const double & r)

Add water all over the terrain.

Parameters
rWater elevation.

◆ HydraulicTransport()

void LayerFieldErosion::HydraulicTransport ( const QPoint & p,
const double & s,
const double & wa,
double & dbedrock,
double & dsand )

Compute the sand and bedrock volumes transported by water at a cell.

Determines how much sand (and, if no sand remains, bedrock) can be detached and carried away, limited by HydraulicAmountS and the available sand thickness. If the cell has no sand, neither dbedrock nor dsand are modified — callers must initialise them to 0.0 before the call.

Parameters
pCell coordinates.
sLocal slope (dimensionless).
waWater volume available at the cell (meters).
dbedrockOutput: bedrock volume detached (meters, positive).
dsandOutput: sand volume detached (meters, positive).

◆ HydraulicWeatheringIterations()

void LayerFieldErosion::HydraulicWeatheringIterations ( int iterations)

Run a fixed number of hydraulic weathering iterations.

Each iteration propagates water and suspended sediment downhill using a multiple-flow-direction (MFD) scheme, erodes bedrock, deposits sand, and applies evaporation. Delta fields guarantee order-independent updates.

Parameters
iterationsNumber of iterations to perform.

◆ HydraulicWeatheringStep()

bool LayerFieldErosion::HydraulicWeatheringStep ( int x,
int y,
ScalarField2 & deltarock,
ScalarField2 & deltasand,
ScalarField2 & deltawater,
ScalarField2 & deltasuspended )

Compute one hydraulic weathering update for a single cell.

If the cell carries water, it is distributed to all downhill neighbours weighted by MFD slope proportions. For each receiving neighbour the ErodedMaterial() computes how much bedrock is eroded and how much sand is deposited or suspended. The cell's water is fully removed; receiving cells accumulate water in deltawater.

Parameters
x,yInteger coordinates of the cell to process.
deltarockAccumulates bedrock elevation changes (meters).
deltasandAccumulates sand thickness changes (meters).
deltawaterAccumulates water depth changes (meters).
deltasuspendedAccumulates suspended material changes (meters).
Returns
true if the cell was already stable (no water), false otherwise.

◆ HydraulicWeatheringUntilStabilization()

void LayerFieldErosion::HydraulicWeatheringUntilStabilization ( )

Run hydraulic weathering iterations until every cell is stable.

Iterates HydraulicWeatheringStep over all cells. A cell is considered stable when it carries no water. The loop stops when no cell triggers further water movement. The number of iterations is unbounded; use HydraulicWeatheringIterations for a fixed budget.

◆ Lightning()

void LayerFieldErosion::Lightning ( const Vector2 & p,
const double & e )

Lightning strike.

Parameters
pPoint.
eStrength of the lightning.

◆ LightningErosion()

void LayerFieldErosion::LightningErosion ( int n,
const double & e )

Erode the terrain using randomly distributed droplets.

Parameters
nNumber of droplets.
eWater elevation (in meters).

◆ LightningWeatheringIterations()

void LayerFieldErosion::LightningWeatheringIterations ( int iterations)

Perform a given number of rock stabilization iterations.

At every iteration, LightningWeatheringStep() is evaluated for every cell, and the variations of the rocks layer are applied simultaneously at the end of the iteration.

Parameters
iterationsNumber of iterations.

◆ LightningWeatheringStep()

bool LayerFieldErosion::LightningWeatheringStep ( int x,
int y,
ScalarField2 & deltaRocks )

Make rocks fall from a cell to its neighbors where the slope exceeds the angle of repose.

The elevation is defined as the bedrock plus the rocks layer. Rocks fall towards every neighbor whose elevation difference is above the angle of repose (0.3) times the distance; at most 5 cm of rocks leave the cell, equally shared among these neighbors.

Parameters
x,yInteger coordinates of the cell.
deltaRocksReturned variation of the rocks layer.
Returns
True if no rocks moved from the cell, false otherwise.

◆ LightningWeatheringUntilStabilization()

void LayerFieldErosion::LightningWeatheringUntilStabilization ( )

Perform rock stabilization iterations until no rocks fall anymore.

Warning
The number of iterations is not bounded.

◆ PointDropletErosion()

void LayerFieldErosion::PointDropletErosion ( const Vector2 & p,
int n,
const double & e )

Erode the terrain using a point source for generating droplets.

Parameters
pSource.
nNumber of droplets.
eWater elevation (in meters).

◆ RandomDropletErosion()

void LayerFieldErosion::RandomDropletErosion ( int n,
const double & e )

Erode the terrain using randomly distributed droplets.

Parameters
nNumber of droplets.
eWater elevation (in meters).

◆ SetBordersFlow()

void LayerFieldErosion::SetBordersFlow ( const double & b)

Set the percentage of sand that would flow out of the domain when flow reaches border cells.

Parameters
bOut flow rate.

◆ SetEvaporation()

void LayerFieldErosion::SetEvaporation ( const double & v)

Set the constant of evaporation.

Parameters
vEvaporation volume.

◆ StabilizeRocksSand()

void LayerFieldErosion::StabilizeRocksSand ( const double & ae,
int n = 1024 )

Iteratively stabilize the rocks and sand layers by redistributing unstable material.

At each iteration, every cell whose combined bedrock+rocks+sand height exceeds the repose angle (tan 40° ≈ 0.84) relative to a neighbour sheds a fixed amount ae of material proportionally to all downhill neighbours. The loop stops when the terrain is fully stable or the iteration limit is reached.

Parameters
aeAmount of material transferred per unstable cell and iteration (meters).
nMaximum number of iterations.

◆ StabilizeStep()

bool LayerFieldErosion::StabilizeStep ( const double & ae,
int x,
int y,
ScalarField2 & deltaRock,
ScalarField2 & deltaSand,
ScalarField2 & deltaeboul )

Compute one stabilization update for a single cell.

Checks all eight neighbours. For each neighbour where the combined height difference (bedrock + rocks + sand) exceeds the repose angle threshold (tan 40° × cell length), the cell sheds ae of material. The shed volume is taken from rocks first, then from sand. It is distributed proportionally to all unstable neighbours and recorded in deltaeboul (éboulement/scree accumulation).

Parameters
aeAmount of material to shed when an instability is detected (meters).
x,yInteger coordinates of the cell to process.
deltaRockAccumulates rock thickness changes (meters).
deltaSandAccumulates sand thickness changes (meters).
deltaeboulAccumulates scree/éboulement volume (meters).
Returns
true if the cell was already stable, false if material was shed.

◆ Texture()

QImage LayerFieldErosion::Texture ( ) const

Create a texture image of the terrain, at the resolution of the grid.

The color of every cell is that of the topmost material: water, otherwise vegetation, otherwise sand, otherwise bedrock. Colors are shaded according to the normal of the bedrock and sand surface, with a vertical and a sun light; the water color also depends on the water depth.

◆ ThermalDropletErosion() [1/2]

void LayerFieldErosion::ThermalDropletErosion ( const Vector2 & p,
int n )

Erode the terrain using a point source for generating droplets.

Parameters
pSource.
nNumber of droplets.

◆ ThermalDropletErosion() [2/2]

void LayerFieldErosion::ThermalDropletErosion ( int n)

Erode the terrain using randomly distributed droplets.

Parameters
nNumber of droplets.

◆ ThermalImpactSlope()

void LayerFieldErosion::ThermalImpactSlope ( const double & s)

Globally transform a thin layer of bedrock into rocks.

This function takes into account the slope, vegetation and sand layers.

Parameters
sThickness (in meters)

◆ VegetationGrowingStep()

void LayerFieldErosion::VegetationGrowingStep ( )

Spread vegetation to adjacent cells by one growth step.

Each cell that already carries vegetation propagates a fraction (0.01) of its density to all eight neighbours. The result is written back into the vegetation layer.

◆ WorldmachineSeveralStep()

bool LayerFieldErosion::WorldmachineSeveralStep ( const double & e,
int steps = 32 )

Repeatedly apply slope-proportional erosion for a fixed number of steps.

Similar to WorldmachineStep but iterated steps times. Each iteration recomputes the slope from the current elevation, erodes sand (erosivity 1.0) then bedrock (erosivity 0.25), and distributes eroded material to downhill neighbours via MFD slope proportions.

Parameters
eBase erosion amount per unit of slope (meters).
stepsNumber of iterations (default 32).
Returns
Always false.

◆ WorldmachineStep()

bool LayerFieldErosion::WorldmachineStep ( const double & e)

Perform one slope-proportional erosion step over the whole terrain.

Similar to FlowOneStep but uses the average slope clamped to [0,1] as the erosion driver instead of normalized stream power. Sand erosivity is 1.0 and bedrock erosivity is 0.25. Eroded material is distributed to downhill neighbours via MFD slope proportions.

Parameters
eBase erosion amount per unit of slope (meters).
Returns
Always false (convergence detection not implemented).