Show HN: Evolving fractals with genetic algorithms

(github.com)

42 points | by atum47 1484 days ago

9 comments

  • gus_massa 1484 days ago
    Live version https://victorribeiro.com/randomFractal/ (it is linked somewhere, but it is easy to miss)

    Perhaps you can add a little more info about each fractal. One is the trunk and the other the general structure?

    Most of the examples of the live version are not nice, I have to click 5 or 10 times to get a nice one. Is it possible t generate 9 of them in a 3x3 grid or something, so I can choose the one I like better?

    Is it possible to add a permalink to the trees I get, something like https://victorribeiro.com/randomFractal/?a=3.24&b=2.73&c=-6,...

    • atum47 1484 days ago
      well, you just described what was my plan all along. To generate a population of fractals and have the user being the evaluate function (genetic algorithm) giving each new fractal a fitness score based on aesthetic. I just have been so busy lately with my job and a game I released that I just stop the project right where is at.

      tonight and this weekend I'll give some more attention to it .

  • atum47 1482 days ago
    Well, I end up implementing the thing I was originally thinking about and the project is awesome now. I was able to create beautiful fractals from the crossing of two.

    There's room for improvement and I'll implement the ability to view and share the rules that generate the fractals

    • atum47 1482 days ago
      the ones on the left, that you select, will be added to the mating pool and will have a chance to reproduce on the next generation
  • atum47 1481 days ago
    Hi everyone, I've pushed a cool update where you can view, render, adjust the zoom and the resolution of the selected fractals. You can learn more about it on my short video:

    https://youtu.be/DY5Me5hiQOc

    Anyways, have a nice time creating your very own fractals.

  • DEADBEEFC0FFEE 1482 days ago
    I have not heard much about Generic Algorithms for years. Oddly, this morning I saw a book on my shelf which I thought I might revisit, An Introduction to Genetic Algorithms.

    Are they called something else these days?

    • atum47 1482 days ago
      since they are classified as AI, the GA being a search algorithm, they call it AI. "AI learns how to play game" usually is a neural network evolving through GA
  • atum47 1482 days ago
    I've made a video showing the project and how it works:

    https://youtu.be/CBHweO03WqI

  • atum47 1481 days ago
    I got a Straight Barnsley fern.

    https://imgur.com/a/7E1zDIx

  • quantified 1483 days ago
    Nice, keep it going.
  • atum47 1483 days ago
    I have just updated the README with a picture from parentA and parentB, the ones I'm using on to cross fractals.
    • fogleman 1483 days ago
      You should explain what kinds of fractals these are (are they L-systems?) and how you go about crossing them.
      • danwills 1483 days ago
        It's IFS (Iterated Function Systems):

        https://en.wikipedia.org/wiki/Iterated_function_system

        IFS uses a set of affine transformations (translation, scale, rotation and shear, which can each be represented by a single matrix, and in the 2d case you can think of them as a set of rectangles/parallelograms).

        IFS are most often drawn by starting from a random location and then repeatedly selecting a random transform from the set, applying it to the previous position and then drawing a dot at the new position. You can also generate all the locations first (yielding a point-cloud) and then rasterize them to make an image. The same idea applies using 3d affine transforms with almost no extra effort. I think this is what Richard 'doc' Bailey (may he rest in peace) may have been doing in his awesome 'image savant/spore' work.

        Flame fractals (electric sheep) extended the same idea with non-linear transformations, and coloring methods to great effect!

        There is also some cool formulas in the isosurface-based 3d-fractal scene (one is called 'Kaleidoscopic IFS') where the drawing method is (of course) very different but the underlying repeated-transformation principle is the same.

        Indeed most kinds of fractals can be thought of in the same way: Repeatedly apply some geometric transformation or deformation (or synthesis in the case of 'fractal noise') in feedback.

      • atum47 1483 days ago
        I'm kinda promoting the book playing with chaos, I think people would learn better from it. Anyways, here's a link to a video from the author himself

        https://youtu.be/e0JaZuLfZ_0

  • atum47 1480 days ago
    if there's anyone following this thread, I was laid off work due to covid-19, so, I'm available to work on fun projects. My email is on my profile. God bless us all on this trying times.