# Designing the Brick Wall of the Future

July 9, 2009 — Christopher Carlson, Senior User Interface Developer, User Interfaces

I created this design for a brick wall in *Mathematica*. Constructing it would be tedious and technically demanding work indeed, requiring numerous jigs and repeated measurements, not to mention an unusually skilled mason. Or a robot.

A few groups have begun to experiment with the idea of robotically laid brick construction, most notably the Swiss firm Gramazio & Kohler (Facade Gantenbein Winery, Structural Oscillations), and recently, students at the Harvard University Graduate School of Design (On the Bri(n)ck). Inspired by these efforts, I set out to investigate the possibilities of robotic brick-wall construction with *Mathematica*.

In many ways, *Mathematica* is the ideal tool for exploring this domain. If you are moderately fluent in *Mathematica*, it’s straightforward to go from an idea of a wall construction to a *Mathematica* program that produces it. You can easily, interactively explore parametric variations of your ideas, and you can bring the wealth of functions built into *Mathematica* to bear on the problem, to explore ideas that are on, or beyond, the fringes of what would be possible with other programs.

There are lots of possible effects to investigate: displacing bricks, rotating them, leaving gaps between them, creating ledges of various depths for shadow effects, combining bricks of various colors, and so on. To warm up to the problem, I began by dashing off code for a brick screen of given dimensions.

From that starting point, the first effect I explored was varying the gaps between the bricks. Each brick in the wall above has a nominal horizontal position. By displacing the bricks from their nominal positions by an amount governed by a function of the bricks’ positions, I was able to generate a variety of interesting architectural screens. I used a combination of horizontal and vertical sinusoids to govern the displacements, and modified my previous code to make this `Manipulate`, with which I could experiment with the sinusoid frequencies.

Here are some of the resulting screens (click an image to enlarge it).

As I was thinking about the effects that could be achieved by slightly displacing bricks, it occurred to me that stereograms work similarly: by varying the displacements of corresponding points in left and right images, a stereogram gives the illusion of three dimensions. With the precision placement of bricks made possible by a robot, it ought to be possible to build a flat wall that would undulate in 3D when viewed as a stereogram. I prototyped the idea in a 2D view of such a wall with this code.

When you view the wall cross-eyed so that the black bricks fuse at the center, you’ll see the 3D surface that I plotted below. The effect is subtle, and it requires some patience and skill at free-viewing stereograms, but it’s unmistakable when you attain it. If you view the image "wall-eyed", the 3D surface will be inverted.

After the stereogram, I explored displacing bricks perpendicularly to the wall to produce wavy wall surfaces. For this experiment I took a different tack, after I realized the analogy of what I wanted to do to *Mathematica*‘s `Plot3D` function. `Plot3D` plots a surface with height given by a function of {*x*, *y*} position, as shown here:

I wanted to construct a brick wall with bricks displaced from the plane of the wall by an amount given by a function of the bricks’ positions. So I wrote a drop-in replacement for `Plot3D` called `BrickPlot` that plots a surface using bricks.

`BrickPlot` demonstrates why *Mathematica* is particularly well suited to this exploration. In order to position a brick in the wall, I need to know not only its displacement, but also the *slope* of the surface at that point. Because `BrickPlot` takes an arbitrary function as its argument, the slope is in general not an easy quantity to find. But *Mathematica*‘s symbolic differentiation makes this a trivial matter. You just form the surface function from `BrickPlot`‘s first argument and then take the (symbolic) derivative with respect to *x*. It’s just slightly harder than falling off a log.

I was interested in more architecturally useful designs than the blatantly mathematical surface above, so I began experimenting with other functions. This doubly curved wall derives its visual interest from the interactions of the horizontal and vertical curvatures as well as the patterns the bricks assume on the variously angled surfaces.

A surface function that is sinusoidal at the bottom and grades smoothly to a straight course of bricks at the top gives a pleasing curtain effect.

By randomizing the sinusoid at the bottom, I was able to achieve the effect of a curtain hanging in long folds. To create the randomized sinusoid, I took the sum of sinusoids of random frequencies.

Here’s the effect when it’s applied to the brick wall.

The variety of effects you can achieve is limited only by your inventiveness in creating surface functions, although if the displacement of the bricks is too large, the bricks will disengage and the wall will fall apart. More sophisticated methods of laying the bricks would permit greater displacement from the plane of the wall, but I wanted to keep things simple in this initial exploration.

Here are some examples of walls I explored. This wall uses the same idea as the previous one, but the straight part is at the midline rather than at the top.

This wall changes smoothly from one random sinusoid at the bottom to a different one at the top.

By randomizing the directions of the summed sinusoids as well as their frequencies, I generated walls with gently undulating, bumpy surfaces. In order to get a sense of the variety of this effect, I made a grid of random walls.

Somewhere along the course of this exploration, the phrase "the writing on the wall" popped into my head, and I wondered, could I do that? It turns out that it’s incredibly easy with *Mathematica*.

It’s so easy it’s practically a one-liner, but I’ll take it step-by-step so you can follow my thinking. It’s a great demonstration of how having so much functionality in one integrated system makes it possible to explore with *Mathematica* where other programs can’t go. My plan was to create a surface function that describes letters embossed in a surface, and feed that to `BrickPlot`.

First, I created an image by rasterizing some text.

Next, I blurred the image so that the edges of the letters in the surface would be rounded rather than abrupt steps. I converted that image from RGB to gray values and cropped to an aspect ratio of 1:2.

This image contains discrete gray level values, but for `BrickPlot`, I needed a continuous function of *x* and *y*. I created that function using `ListInterpolation` after applying `Transpose` to the image data to account for a difference in the treatment of rows and columns between `Image` and `Plot3D`. I added some extra padding to the domain of the function because `BrickPlot` does some calculation outside of the nominal domain.

Finally, I fed that surface function to `BrickPlot`, but I reduced the displacement of the bricks because I liked the idea of a subtle message that is revealed by the sun when it rakes across the wall at a shallow angle.

In order to explore the effect of the sun on the wall, I exported it as a DXF file and imported it into Google SketchUp.

Within SketchUp, I positioned the wall for maximum effect with respect to the path of the sun, and made this animation of the appearance of the wall in the course of a summer day.

That’s it. Five minutes from the conception of my writing-on-the-wall idea to an animation of its appearance. If only it were so easy to find a brick-laying robot.