- Gallery of Triangluar mesh images
I have been dropping in lately on the Reddit genart group to learn more about generative art and for inspiration. A few weeks ago a Reddit user, Jos Vromans, made an interesting post on generating attractive patterns by recursively splitting triangles into two smaller triangles. That is, a triangle is split in two by adding a line from one of its vertextes to the midpoint of the the opposite side. Then those two triangles are each split in two by the same means, repeating the process for a fixed number of iterations. The vertex from which each triangle is split varies with the iteration but the same vertex is used for every triangle in a given iteration. The result is an intricate and nicely textured mesh of tiny triangles of various shapes inside the starting triangle.
Jos Vromans provides a wonderfully clear description and analysis of the algorithm at: https://www.josvromans.com/blog/2021/1/triangle-subdivisions/
Here is an example of a pattern he uses in the above explanation (but generated by me). The full image is formed by replicating the triangular mesh produced in the area between two adjacent corners and the center three more times to fill out a square area.
I was immediately attracted to these patterns because I love intricate and symmetrical mandala like figures. (E.g. see my spirograph blog post and gallery of spirograph images.) Although the textures produced by the varying line densities are wonderful, I also love rich and detailed colors and immediately wondered how I could add color.
The first approach I thought of turned out nicely (I think) and is as simple as the original splitting alogorithm: calulate the eccentricity of each triangle (the ratio of the longest to shortest sides) in the final mesh and use that to get a color from a colormap. The triangle's lines are then drawn in that color. The colormaps I borrowed from the Python Matplotlib library. I tried filling the triangles' interiors with color but did not like the results; because they do not overlap the final image looked flat. Drawing just the triangles' outlines allows alpha blending of the lines in high density areas and maintains the sense of texture present in the original black and white version.
Here are some images with the exact same triangle geometry as the black and white image above but with the addition of color derived from different color mappings:
The above images are at half size. To see them and other images at full size take a look at the Gallery of Triangle Mesh images.