jiminy icon indicating copy to clipboard operation
jiminy copied to clipboard

WIP: [core] Add a unidirectional Perlin Ground HeightmapFunction

Open mwulfman opened this issue 9 months ago • 10 comments

I am proposing to add a unidirection Perlin ground HeightmapFunction. Multidirectional perlin ground can then be generated by using the sumHeightmaps function to generated terrains such as hills.

See image of unidirectionalPeriodicPerlin ground: periodicperlinground

It would be nice to add a quantization options to quantized the ground to only certain level.

In the current implementation, to avoid having to recreate the Periodic/RandomPerlinProcess and to set its seed at each call to operator() I propose to give it as argument of the unidirectionalPerlinGround. However, it gives the responsibility to the practitioner to keep their Periodic/RandomPerlinProcess in scope to avoid segfault, which is not ideal either.

I have also noticed that when using Python,

from jiminy_py.core import PeriodicPerlinProcess
ppp = PeriodicPerlinProcess(1, .5, 5)
ppp(0.0)

leads to floating point exception (core dumped). This is because the line

assert(period_ >= wavelength && "Period must be larger than wavelength.");

asserts to False. Is there a better way to handle this exception in python to be more explicit?

mwulfman avatar May 17 '24 16:05 mwulfman