I’m searching for an algorithm for recalculation position of vectors which defines polygon which represents one tile.
I have pattern of tile — a polygon defined by 16 vertices which are in field of vertices.
For example, I have a square (or rhombus or any other polynom which can fit together with the same polygon).
x - x - x - x - x
| |
x x
| |
x x
| |
x x
| |
x - x - x - x - x
This pattern represents one tile. If I move with one vertex (change its position), I have to recalculate position of other vertex in order to have tile which fit together with other tiles.
1)Does any algorithm exist which already solves that?
2)What is a good basic pattern? Square is too simple.
I heard that is good to have symmetric shapes for patterns, cause it’s easier to recalculate it.
Edit:
Motivation is to draw tiles on some bitmap. It’s like tiles in your bathroom, they must also fit together.
If I understand your question: You start out with a square that passes through some vertices (horizontally- and vertically-symmetric) that you use for tiling. You move some of those vertices around, and want to know how to keep the resulting-shape tiled?
In that case, every time you move a vertex, move the vertically-and-horizontally-mirrored vertex in the same direction by the same amount.
For example, if you move the lower-right vertex down 2 and right 1, you should also move the upper-left vertex down 2 and right 1. This will create a “hole” in the upper-left that snugly fits the new pointy edge in the lower-right.