Giter Club home page Giter Club logo

erodr's Issues

Build errors on windows

Hi Henrik,

I got the following error after compiling the exe and trying to run it:
image
Sorry for the German, it translates to "The procedure entry point GOMP_parallel could not be located in the dll [...]". I suspect I am missing some dll's, as I seemed to be missing "libgomp-1.dll" and "pthreadGC2.dll" when I foolishly executed erodr.exe in hope for a user interface... ^^

I got those DLL's covered, but to no avail. Running the program in powershell, nothing happens:
image

Do you have any clue what could be wrong? A friend successfully compiled the exe and runs the program just fine (he is a programmer, possibly has the required libraries?), but when transferring the .exe it still won't work for me.

Error in calculations

That's funny as hell, but the whole awesomeness of this algorithm relies on a floating point error. Take a look at this part of the code:

p.vel = sqrt(p.vel*p.vel + h_diff*params->p_gravity);
p.water *= (1 - params->p_evaporation);

h_diff is mostly negative and for small enough p.vel this results in NaN value for velocity. And there the magic starts: handling this NaN gracefully will ruin the algorithm since the particle will stop rolling and we need many more iterations or other parameters to have a good-looking erosion.

I found this bug while porting the algorithm to C# and it wasn't working since Math.Min checks for NaN values and returns NaN resulting in particle stopping, while fmin returns the number and particles move up for TTL steps or hitting the boundary.

To make the code work the same way I had to add the check if the value under the root is less than zero and if so, set the velocity to FLT_MAX. It's obviously wrong, although matches the original code.

Ported code:
https://github.com/Nomad1/ErodrSharp

test / verification data

Hi,

the project builds, and it does produce an output picture, but I'm not sure it's actually doing anything.

Can you maybe provide example input / output files to verify against?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.