T
T
trauus2018-04-01 19:30:06
Algorithms
trauus, 2018-04-01 19:30:06

How to generate a beautiful tile layout?

The task is just for fun: we have a hundred tiles of the same size, but with different decor, 14 types in total. Some decor more, some very little. We need to write a program that will make a uniform layout for an area of ​​M x N tiles.
First of all, I tried to solve it head-on - I went around the cells in order and filled them with random decor. It turned out badly, there are many repeating decors nearby:
5ac0ff6a111a8610378790.png
How to make decors not repeated and more or less distributed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
longclaps, 2018-04-01
@longclaps

just for fun:

  1. you come up with "potential energy" for the calculation:
    • identical tiles are repelled in inverse proportion to the square of the distance between them
    • different tiles ignore each other
    • but if any 2 tiles hit the same cell, they repel very strongly, well, just 100500 newton
  2. you find the minimum energy (for example, by annealing)
  3. in order not to bathe with the borders of the area, you consider it the surface of a donut

I
Ivan Klimenko, 2018-04-02
@yeswell

Hmm. At first I decided that I had nothing to answer this question, but then an idea appeared. Try manually for each tile to set those that look good close to it. And I use this to build a drawing just randomly. The results should be immediately good, without other tricks.
PS If you try - show what happened

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question