Skip to content

Added perlin noise feature for topography#922

Open
TilmanMay wants to merge 9 commits into
GeodynamicWorldBuilder:mainfrom
TilmanMay:topo_noise
Open

Added perlin noise feature for topography#922
TilmanMay wants to merge 9 commits into
GeodynamicWorldBuilder:mainfrom
TilmanMay:topo_noise

Conversation

@TilmanMay
Copy link
Copy Markdown
Contributor

Add the option to include perlin noise for the topography

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 30, 2026

Pull Request Test Coverage Report for Build 23892686894

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 216 of 220 (98.18%) changed or added relevant lines in 2 files are covered.
  • 31 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.09%) to 98.297%

Changes Missing Coverage Covered Lines Changed/Added Lines %
source/world_builder/features/continental_plate_models/topography/perlin_noise.cc 106 108 98.15%
source/world_builder/features/oceanic_plate_models/topography/perlin_noise.cc 110 112 98.21%
Files with Coverage Reduction New Missed Lines %
source/world_builder/features/continental_plate_models/density/uniform.cc 1 97.56%
source/world_builder/features/fault_models/density/uniform.cc 1 96.97%
source/world_builder/features/mantle_layer_models/density/uniform.cc 1 97.56%
source/world_builder/features/oceanic_plate_models/density/uniform.cc 1 97.56%
source/world_builder/features/plume_models/density/uniform.cc 1 96.97%
source/world_builder/features/subducting_plate_models/density/uniform.cc 1 96.97%
source/world_builder/world.cc 5 92.51%
source/world_builder/parameters.cc 20 97.12%
Totals Coverage Status
Change from base Build 23748207793: -0.09%
Covered Lines: 11951
Relevant Lines: 12158

💛 - Coveralls

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 30, 2026

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.175 ± 0.007 (s=399) 1.181 ± 0.007 (s=367) +0.4% .. +0.7%
Slab interpolation curved simple none 1.306 ± 0.006 (s=314) 1.304 ± 0.007 (s=378) -0.3% .. +0.0%
Spherical slab interpolation simple none 1.158 ± 0.007 (s=391) 1.161 ± 0.008 (s=388) +0.1% .. +0.4%
Slab interpolation simple curved CMS 1.341 ± 0.012 (s=324) 1.338 ± 0.015 (s=351) -0.5% .. +0.0%
Spherical slab interpolation simple CMS 1.631 ± 0.010 (s=300) 1.626 ± 0.013 (s=255) -0.5% .. -0.1%
Spherical fault interpolation simple none 1.284 ± 0.008 (s=347) 1.280 ± 0.007 (s=358) -0.4% .. -0.1%
Cartesian min max surface 3.069 ± 0.015 (s=157) 3.058 ± 0.014 (s=139) -0.6% .. -0.2%
Spherical min max surface 8.594 ± 0.093 (s=56) 8.598 ± 0.090 (s=51) -0.7% .. +0.7%

@TilmanMay
Copy link
Copy Markdown
Contributor Author

TilmanMay commented Mar 30, 2026

topo_2

@danieldouglas92
Copy link
Copy Markdown
Contributor

@TilmanMay Very cool figure!! I can imagine that this will be super useful for landscape evolution modeling to have more control over the initial evolution of a model while still providing randomness. I'll review the code in a few minutes

Copy link
Copy Markdown
Contributor

@danieldouglas92 danieldouglas92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another cool extension of the Perlin Noise functionality! Once again only small comments about documentation and consistency between different features, but once these are addressed I think this is good to go.

In a follow up PR (after your cookbook gets merged), I think it would be great to add another section that documents how you would use this feature in that same cookbook as well.

Comment on lines +40 to +47
* Perlin noise based topography model for oceanic plates.
*
* This model generates topography using layered Perlin noise (octaves).
* Parameters exposed to input files are similar to the continental
* implementation: min/max depth, min/max topography, frequency,
* octaves, persistence, lacunarity and operation.
*/
class PerlinNoise final: public Interface
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc string is much better than the one you have for the continental .h file. I would copy this one and put it there too

Comment on lines +27 to +39
class PerlinNoise final: public Interface
{
public:
PerlinNoise(WorldBuilder::World *world);
~PerlinNoise() override final;

static void declare_entries(Parameters &prm, const std::string &parent_name = "");
void parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates) override final;

double get_topography(const Point<3> &position,
const Objects::NaturalCoordinate &position_in_natural_coordinates,
double topography) const override final;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing doc strings for these functions

Comment on lines +50 to +64
/**
* Constructor
* @param world pointer to the containing World instance
*/
PerlinNoise(WorldBuilder::World *world);

/**
* Destructor
*/
~PerlinNoise() override final;

/**
* Declare parameter entries used by this model to the Parameters system.
*/
static void declare_entries(Parameters &prm, const std::string &parent_name = "");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you have all the function documentation here that should be copied to continental_plate as well 😄

void
PerlinNoise::declare_entries(Parameters &prm, const std::string &)
{
// Document plugin. Unlike some topography plugins (e.g. DepthSurface)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Document plugin. Unlike some topography plugins (e.g. DepthSurface)
// Unlike some topography plugins (e.g. DepthSurface)

void
PerlinNoise::declare_entries(Parameters &prm, const std::string &)
{
// Document plugin. This model exposes min/max topography and Perlin
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Document plugin. This model exposes min/max topography and Perlin
// This model exposes min/max topography and Perlin

@danieldouglas92
Copy link
Copy Markdown
Contributor

Also please add a changelog entry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants