Urgent.News

What's breaking now, across thousands of outlets.

Tech

Haskell diagrams: Tessellations

The source material discusses M.C. Escher's tessellation artworks, specifically focusing on how he covered surfaces with repeated animal shapes instead of the more common checkerboard pattern. It explains that creating tessellations is not difficult, but requires artistic skill to find meaningful shapes that fit together. The article then demonstrates how to reconstruct one of Escher's tessellations using Haskell programming.

To begin, the author explains the concept of a tessellation - covering a surface with repeated shapes, with a simple example being a checkerboard. The key is that the sides of adjacent tiles must match, even if they are replaced by curves. The Haskell code uses records to specify tessellations, and the Rasterific library to generate PNG images. The curves representing the sides of tiles are defined as open curves using the Trail Line V2 Double type, ensuring they have loose endpoints.

The article provides an example of creating a bird tile by sampling points from an original image using Inkscape and placing circles on the desired coordinates. The curves are defined using cubic splines, which create smooth shapes that pass through the specified points. The author notes the importance of having enough samples to avoid bizarre curve shapes.

To cover the entire plane with these tiles, the article outlines the steps needed, including defining a function to test if a tile is visible and calculating bounding boxes for efficient intersection testing. The code is made generic so that users can easily create their own tessellations without worrying about auxiliary functions.

Overall, the piece provides a detailed walkthrough of how to recreate Escher's tessellations using Haskell, highlighting the mathematical and artistic concepts involved in the process.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at mgarletmilani.com →

More in Tech

More from Tuesday 25 August →