Logo
Toggle Menu
  • home
  • blog
  • about
    • about this site
    • contact
    • privacy policy
  • cinema 4d
    • plugins
    • creating c4d plugins
    • plugin cookbook
    • software
  • models
    • nodes
    • plants 1
    • other models - 1
    • other models - 2
  • osl
    • writing osl shaders
  • x-particles
    • book

Tessellation

A bit of a departure from Cinema 4D here, at least at first. I've been interested in tessellation for years. Probably many graphics programmers have, because the combination of graphics and mathematics is fascinating. By tessellation, I mean the covering of a surface by repeating shapes with no gaps or overlaps. This leads to a huge amount of art based on tessellated shapes, notably Islamic art, which makes extensive use of this principle. For this article I've drawn on a book called 'Introduction to Tessellations' which is well worth a read if you're interested. The full reference is at the foot of this page.

When you look into this, you find there are some interesting rules. For example, any triangle, any four-sided shape, and regular* hexagons will always tessellate on their own: you can fit identical shapes together so that they don't overlap and don't leave any gaps. On the other hand, regular pentagons can never tessellate on their own. That's why a football (American: soccer ball) composed of pentagons must also use hexagons. The combination tessellates correctly, but to do so and to create a sphere (technically, a spherical polyhedron) it must use 12 pentagons and 20 hexagons. In fact a football is a classic buckyball, a shape with 12 pentagons and 20 hexagons.

* A regular polygon is one in which all internal angles are the same and all sides the same length.

Anyway, one artist who made great use of tessellation was, of course, M.C. Escher. His work has always fascinated me, but it raises a question: how did he make irregular shapes such as his famous work 'Lizard' tessellate perfectly? You can see this and other examples of his work here - 'Lizard' is on page 17.

I looked at this a long time ago, with the aim of seeing if this could be done using C4D - was it possible to make irregular objects tessellate in the manner of Escher? Well of course, it was since all we are doing is tessellating a 2D shape then making it 3D by extruding it. Actually tessellating a shape in three dimensions would be a whole lot harder, so I'm not going down that road yet. (It is possible though. The main issue is that only certain 3D shapes will tessellate and, apart from a cube, which isn't very exciting, they tend to be complex.)

The end result of my research back in the day was a grid of interlocking shapes modelled closely on Escher's lizards. I found an old file (we're talking 2009!) the other day and it revived my interest - except that I couldn't recall how it was done. So I relearnt it ready to have another go. For a start, here's the result of the old file (click the image for a larger version). The image on the right is a close-up of a single lizard object:

  • Tessellated lizards
  • A single lizard
  • Tessellated lizards
    Lizard objects tessellated, derived from the original work "Lizard" by MC Escher.
  • A single lizard
    The lizard object which tessellates with others in the main image.

As you can see, this unashamedly uses Escher's work as a source of inspiration! There are two lizard objects, one black and one white, perfectly interlocking with each other. So how is it done?

There are several ways to make shapes tessellate, but for a simple example I'll stick with one method - modification by translation. In this example there is no attempt to produce a recognisable object, it's a simple abstract demonstration.

First, we start with a rectangle as a guide. In fact, any quadrilateral will tessellate, but this simple method requires a square or rectangle (a parallelogram would work too). In this case I'll use a rectangle measuring 1000 x 600. I like to use the viewport grid in Top view to do this, but that's just a personal preference.

Our object will be constructed from four spline segments. The first thing to do is create the first spline, which will be on the left-hand edge of the rectangle. The spline pen tool is ideal for this. I created a geometric shape, since I'm not much of an artist, but it can be entirely organic as long as you stick to the rules (see the end of this page). In this image, the guide rectangle is shown in red and the spline segment is yellow:

I've snapped the start and end points of the spline to the corners of the guide rectangle, which are circled in blue in the image, but that isn't essential. The spline itself doesn't have to be located entirely inside or outside the rectangle, it can poke out or be indented as shown in the image above.

Now we can duplicate this spline object and move it to the right-hand edge of the rectangle. Importantly, this method only works if the two sides of the rectangle are parallel and the same length and that the same is true of the top and bottom of the rectangle. For non-parallel and/or non-equal length sides other methods will be needed. Now we have this result:

I've hidden the guide rectangle for clarity.

Now we create a third spline along the top of the rectangle:

Then finally that spline is duplicated and moved to the bottom of the rectangle. We now have four splines and these need to be joined into one if we want to drop it into an Extrude object. Note that if you use the object manager 'Connect Objects' command you get a single spline object but at the four corners you will have duplicate points.You need to fix these duplicate points - it's simple enough to select each pair of duplicates in turn then use the 'Weld' tool to get a single point instead. Also, you need to turn on 'Close Spline' in the spline's attributes.

Now we can add it to the Extrude object and get this:

If you duplicate the object you will see that it tessellates perfectly, as shown in this image:

And even use a Cloner to tessellate lots of them:

So that is tessellation of an apparently irregular object by using simple translation of the spline segments. Of course, it's the simplest method but it will always work if you follow these two rules:

  • the left and right sides of the guide rectangle must be of equal length and parallel to each other
  • the same is true of the top and bottom edges

You will already have realised that it works because the spline segments on the left and right sides, and the top and bottom sides, are identical. What if you want an object to tessellate where this is not true? I'll return to that in another article.

I hope this is of interest. This sort of pattern generation I find fascinating and I may return to it in future with a look at other methods, including rotation, which is how Escher produced his 'Lizard' image.

References

  1. Seymour D, Britton J.Introduction to Tessellations. 1989, Palo Alto: Dale Seymour Publications.
  2. Grunbaum B, Shephard GC. Tilings and Patterns, 2nd ed. 2016, New York: Dover Publications.
  3. The Topology and Combinatorics of Soccer Balls. American Scientist
  4. M. C. Escher. University of the National Education Commission, Krakow

Page last updated June 23rd 2025

Blog articles

Shader writing with OSL - 3 (July 11th 2025)

Tessellation (June 23rd 2025)

Creating plants for C4D (June 15th 2025)

Adobe alternatives (May 28th 2025)

Using Graswald assets in C4D (May 7th 2025)

Which Mac for plugin development? (May 3rd 2025)

Why do plugin writers do it? (April 11th 2025)

Updating StarScape (February 26th 2025)

Using Cinema 4D shaders in Redshift (January 31st 2025)

PHP and MySQL (December 19th 2024)

Shader writing with OSL - 2 (November 11th 2024)

Shader writing with OSL (October 29th 2024)

StarScape (September 25th 2024)

Converting plugins from C4D 2024 to 2025 (September 16th 2024)

Cinema 4D 2025 and macOS plugins (September 15th 2025)

© 2021-2025 Microbion. All Rights Reserved.