I didn’t set out to tie knots in Norman Foster’s Hearst Tower or wrinkle his Gherkin, but I got carried away. It’s one of the occupational hazards of working with Mathematica.

It started with an innocent experiment in lofting, a technique also known as “skinning” that originated in boat-building. I wanted to explore some three-dimensional forms, and a basic lofting function seemed like a quick ticket to results. I dashed off the function Loft , which takes a stack of three-dimensional contours and covers it with a skin of polygons.





Loft uses Mathematica‘s GraphicsComplex primitive to factor out the geometries of the polygons from their topologies. The contour point coordinates are collected in the first argument. The second argument is a list of Polygons whose coordinate values are replaced by integer indices into the coordinate list. My Loft function was straightforward to write, but required a little fancy footwork with indexing to get the polygons wired onto the points in the right way.

I tried out Loft by embedding it in a Manipulate , and was happily on my way discovering some interesting new forms. You can download the Demonstration to try it out yourself.

Even this trivial parameterization of a scaled and twisted half-sphere yields an amazing variety of forms, each of which suggests interesting avenues to explore.

The last of those forms brought to mind Norman Foster’s Swiss Re building in London, nicknamed by the locals “the Gherkin.”

I wondered how convincingly I could model the Gherkin in Mathematica. It was immediately obvious that my simple Loft function was not up to the task of replicating the white diagrid framing structure employed in the Gherkin, so I set out first to generalize Loft . One thing lead to another, and soon I had the much larger but much more flexible function Build , with which I could explore not only Foster’s Gherkin but a large number of other architectural forms based on the simple idea of hanging panes, panels, mullions, and framing members on grids of points.

My Build function works like Loft , but gives me much more flexibility in specifying elements like tubes and polygons and how they are repeated on the contour grid. Like Loft , Build ‘s first argument is a set of contours. The second argument is a Graphics3D -style primitive list whose primitives contain an extra argument that specifies how they should be repeated on the contour grid.

If you imagine the contours numbered from bottom to top and the points in the contours numbered from left to right, {point, contour} indices correspond to coordinates in an integer coordinate system. The primitive

Polygon [{{0,0},{1,2},{1,0}}] appears on a contour grid like this.

A primitive that has no extra repetition argument is automatically repeated to tile the grid. Explicit control over the tiling is had by specifying a pair of tiling translations, as in Polygon[{{0,0},{1,2},{1,0}},{{2,0},{1,1}}]. That polygon tiles the grid like this:

In linear primitives like Line and Tube , the repetition argument specifies the frequency with which the primitive is repeated horizontally, or for horizontal primitives, vertically. By combining repetitions of polygons, tubes, and lines, Build gives me great flexibility in describing assemblages of panes and structural members. Here’s an abstract structure I generated to exercise all of Build ‘s primitives.

With Build in hand, my next task was to determine the shape of the Gherkin’s profile and build a corresponding contour grid. Always on the lookout for easy results, I experimented first with skinny ellipsoids, and discovered that the top of the Gherkin is too pointed for an ellipsoid to model. No other simple mathematical candidate shape occurred to me, so I resorted to freeform design using splines.

I recalled this Potter’s Wheel Demonstration written by my colleague Yu-Sung Chang for modeling freeform solids of revolution. It was just what I needed.

With a reference photo of the Gherkin in a separate notebook, I dragged the control points of the spline profile until I had an acceptable approximation of the Gherkin’s shape.

When I was satisfied with the result, I used the Manipulate ‘s “Paste Snapshot” button to get the source code for the figure. From the source code, I cut the spline control-point coordinates and pasted them into a BSplineFunction that defines the profile.

The final step was to slice the profile curve into equally spaced horizontal sections. Mathematica‘s versatile meshing functions do the trick.

I extracted the mesh point coordinates from the plot output, appended the profile’s boundary points, and sorted in the y coordinate to obtain a list of points from which I could construct the Gherkin’s contour grid.

The contours themselves correspond to a solid of revolution, with the contour radii given by the x coordinates of the profile points, the elevations by the y coordinates, and the number of points around a contour by twice the number of glass panes around the Gherkin.

I did a quick test Build to see if my contour points seemed correct. Indeed, they did.

As a final step, I refined the contour points at the top to add the dome-like cap at the top of the Gherkin.

I won’t deny that from there it required a surprising amount of detailed work using Build to make a finished model. The Gherkin’s body, its cap, the topmost dome, the rings, and the boundaries of and transitions between the separate parts all required individual attention. To select material properties and lighting, I set up Manipulate rigs and exercised the sliders until I found the right values. Here is the result.

Once I had the completed model, I could begin to explore. One of the unique strengths of Mathematica is the ability to post-process structures using replacement rules. The output of the Gherkin model contains the colors I used for the dark and light panes of the body. By replacing those colors with new ones, I created this color variation inspired by the Union Jack.

Post-processing via replacement rules can operate on the geometry of an object as well as its appearance attributes. Because all of the coordinate data of my model resides in the first argument of GraphicsComplex , coordinate transformations are particularly easy. And since all of the graphics primitives are all wired to the same coordinates, the primitives automatically move in concert and remain connected when the coordinates are transformed.

Using that technique, I wrote this Manipulate to explore variations in the radial geometry of the Gherkin.

Now I could find the answers to some pressing questions. What if the Gherkin were two-sided rather than round? Three-sided? Four-sided?

What if the Gherkin’s dark ventilation shafts were recessed into the building? What if the recesses ran counter to the direction of the shafts? What if London were shaken by a really violent earthquake?

You can cover territory quickly with Mathematica‘s Manipulate . Surreality is a mere slider’s length away from reality. My explorations ended somewhere around this Dali-esque vision of the Gherkin tangoing with itself.

Energized by my results with the Gherkin, I turned my attention to another of Foster’s buildings that employs diagrid framing, the Hearst Tower in New York.

Compared to the Gherkin, modeling the Hearst Tower was a piece of cake. The only part that required much thought was generating the floor polygons, which undulate back and forth between two shapes. The rest was straightforward use of the Build function. Here is my model of the main tower structure, rendered with Mathematica‘s default lighting.

The tower structure is generated by repeatedly translating polygons. On a whim, I substituted rotations for translations, and after adding a few floors, generated this bent tower that wraps around on itself to form a torus.

On the theory that one good turn deserves another, I took a couple of seconds to add a second rotation about an axis perpendicular to the first and created this Möbius building. I love the beautiful rhythm set up by the interaction of the diagrid frame with the curved and winding Möbius surfaces.

On Earth, the Möbius building would be a difficult sell. But I imagine it floating in space, housing a gallery of the finest in cosmic art—a sort of orbital Guggenheim with a twist. Don your Velcro slippers and padded headgear a la 2001: A Space Odyssey and pay attention to artwork on the wall to your right. Once around the gallery, you’ll be hanging from the ceiling looking at the opposite wall, which of course is the same wall, the only wall in the gallery. Enjoy the backdrop of the Milky Way, and perhaps the Earth floating in the distance.

You can explore the universe of architectural possibilities with me at this year’s ACADIA conference on October 21 in Chicago, where I’ll be giving a one-day workshop on how to use Mathematica for parametric, algorithmic, and generative architectural design. Join me and your colleagues for a day of hands-on form exploration by registering for the conference.