A desktop app to create tilings using convex regular polygons.
- Running
- Compiling
- Keybindings
- Some math: Vertex tilings
- How the app determines if edges overlap
- Linux dependencies
On linux, run:
./release/mainTo run on windows, checkout branch windows and build using Visual Studio.
This project uses CMake. On linux, run:
cd release
cmake .. -D CMAKE_BUILD_TYPE=Release
cmake --build .
./mainTo compile on windows, checkout branch windows and build using Visual Studio.
Del removes all the polygons.
Move the edge cursor by pressing Tab or Shift+Tab.
Add a polygon on the edge cursor by pressing keys 3 to 9 (keys on the numpad also work).
Keys 0 to 2 create polygons with 10 to 12 sides.
Pressing Shift adds 10 sides to the polygon (so pressing Shift and 0 creates a polygon with 20 sides),
but only on Linux.
Backspace removes the last polygon.
Note that this won't work if the last polygon filled a blank (ie if all of its edges overlap with already existing ones).
Mouse movements move the camera.
Use + and - on the numpad to zoom in and out.
You can surround a point with regular convex polygons only if their interior angles sum up to 360° or
For instance let's consider squares (with interior angles of 90° or
There's a simple formula that allows to compute the interior angle of a regular n-gon. Intuitively, at each vertex, the n-gon has to be "closed" by some amount by straying away from the straight line. These
An interesting fact to know when making tilings is that there are only 21 possible vertex tilings shown on the picture below.
Note that all vertex tilings can't tile the plane. Namely, it's impossible to use 42-gons, 24-gons, 20-gons, 18-gons, 15-gons, 10-gons or 5-gons (pentagons) to tile the plane. It's only possible to tile the plane using triangles, squares, hexagons, octogons and dodecagons (or 12-gons).
This app uses a very crude method to determine whether edges overlap : it checks that the distance between both pairs of vertices is smaller than 1e-3 (edges have a length of 0.2). Using a smaller threshold would mean that the first non-recognized overlap happens sooner.
I didn't encounter a situation where the system mistakenly says there's an overlap: however such a situation might exist.
Non-exhaustive list:
cmake build-essential libgl1-mesa-dev libglfw3-dev libglm-dev