
Show HN: Evolving fractals with genetic algorithms - atum47
https://github.com/victorqribeiro/randomFractal
======
gus_massa
Live version
[https://victorribeiro.com/randomFractal/](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,...](https://victorribeiro.com/randomFractal/?a=3.24&b=2.73&c=-6,2$d=1.0)

~~~
atum47
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
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
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
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](https://youtu.be/DY5Me5hiQOc)

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

------
DEADBEEFC0FFEE
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
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
I've made a video showing the project and how it works:

[https://youtu.be/CBHweO03WqI](https://youtu.be/CBHweO03WqI)

------
atum47
I got a Straight Barnsley fern.

[https://imgur.com/a/7E1zDIx](https://imgur.com/a/7E1zDIx)

------
quantified
Nice, keep it going.

------
atum47
I have just updated the README with a picture from parentA and parentB, the
ones I'm using on to cross fractals.

~~~
fogleman
You should explain what kinds of fractals these are (are they L-systems?) and
how you go about crossing them.

~~~
danwills
It's IFS (Iterated Function Systems):

[https://en.wikipedia.org/wiki/Iterated_function_system](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
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.

