News for hackers. Stuff that matters.
Re:Show HN: I built a tool to generate triangulated art from... by kamranjon on Thursday April 22, 2021 @08:47AM (#26902117)
This reminds me of a project I found by Antirez (the creator of Redis) recently called shapeme: https://github.com/antirez/shapeme - which uses simulated annealing: https://en.wikipedia.org/wiki/Simulated_annealing to approximate an image using triangles. It took me down a really interesting rabbit hole: "The name of the algorithm comes from annealing in metallurgy, a technique involving heating and controlled cooling of a material to increase the size of its crystals and reduce their defects."

I thought it was really interesting that a useful algorithm like this was created and possibly influenced by a natural process. I wonder if this repo uses the same type of algorithm?

Re:Show HN: I built a tool to generate triangulated art from... by rh12503 on Thursday April 22, 2021 @08:53AM (#26902170)
Triangula uses a modified genetic algorithm which I wrote about on the wiki here [1]. The reason I didn't use simulated annealing is because I ran some tests and found it was generally less effective for my case.

[1] https://github.com/RH12503/Triangula/wiki/Explanation-of-the...

Re:Show HN: I built a tool to generate triangulated art from... by ad404b8a372f2b9 on Thursday April 22, 2021 @11:07AM (#26903599)
Do you have a specific initialization scheme? The example gif goes very fast but it seems to find very fit individuals in the first generation which seems too good to be random.
Re:Show HN: I built a tool to generate triangulated art from... by rh12503 on Friday April 23, 2021 @03:56AM (#26912235)
Actually, the initialization is completely random. The reason why it might seem too optimal is because the algorithm chooses the colors most similar to the image when rendering the triangles.