Implementing "Morphing: A Guide to Mathematical Transformations for Architects and Designers"

Hi all - I just found the wonderful book Morphing: A Guide to Mathematical Transformations for Architects and Designers by Joseph Choma. It’s not Rhino/Grasshopper-specific, but I figured Grasshopper would be a good tool to use to implement the algorithms, and the content to be a good fit for this community.

That said, I’m baffled trying to implement all but the simplest of the algorithms described; no doubt due to my lack of familiarity with Grasshopper.

A useful snippet from the text as context for which Grasshopper functions to use…

Within shaping, the four starting shapes are introduced: a sine curve, circle, cylinder and sphere. A sine curve and circle are defined with two coordinates (x, y), while three-dimensional shapes (cylinder and sphere) are defined by x, y and z.

A sine curve is simply defined by a function of sine and u-parameter. A circle is defined by a function of sine and cosine. The v-parameter allows the circle to transform into a surface: a cylinder is an extruded circle, or a circle with a z-coordinate value of v.

The book gives no example code other than the math equations. Also, the visualizations are pretty hard to see, but from what I can tell it looks like the correct way to approach them is in extruded ‘slices’.

Also, as far as I can tell the ranges in the book are all typeset incorrectly (or in a different notation than I’m used to) -
printed: { u | 0 ≤ u ≥ 2π }
should be: { u | 0 ≤ u ≤ 2π }

With that said, here’s an image of one of the larger visualizations for clarity on what I mean by ‘slices’, and images some of the (many) equations that are baffling me.

Example 1:

Example 2:

Example 3:

Morphing- (27.0 KB)

The author provides an online tool for visualizing his equations, so in theory they all work, but I just can’t figure out how to Grasshopperify them.

I’d love to work through more of these at some point—they get quite beautiful—, but for now I can’t get past Chapter 1. Would love any pointers!

edit: here’s the only other reference I could find for implementations - it’s in openFrameworks, but perhaps it might help: Morphing/ofApp.cpp at master · jasonlevine/Morphing · GitHub


Hi Jon, something like this seems to work for example 3 - but I’m sure that @DavidRutten, @rajaa, @HS_Kim and many others here can correct me :sunglasses:

The notation in the book is called set-builder notation. There’s a few related concepts here you need to keep separate:

Interval: a continuous collection of numeric values, delineated by lower and upper limits. Depending on the underlying number system, an interval either contains infinitely many values or only a finite amount. Furthermore an interval can be either closed or open, which is denoted using square or round brackets respectively.

For example (0, 10] is an interval from (but not including) zero all the way to ten. If this interval is defined “over the integers”, then it contains the values 1, 2, 3, …, 10. If however it is defined over the rationals, it contains infinitely many values, among which you will find \frac{7}{4}, 0.00001, 9.99999, and indeed 10. If you apply it to the reals it will also include values such as \pi, \sqrt{17}, and so on.

Note that open intervals in the rational or real arena do not have smallest or biggest numbers. The example from above has no smallest value. It’s not 0.1 because 0.01 is smaller and still within the interval. It’s not 0.01 because 0.001 is smaller still but still within the interval. And so on ad infinitum.

Also note that computers use discrete number systems which means there’s always a finite amount of distinct values in any interval, and therefore the notion of an open interval is somewhat meaningless.

Sequence: a list of numeric values, usually computed using an algorithm. Famous sequences are the natural numbers 1,2,3,4,5,..., the Fibonnaci numbers 1,1,2,3,5,8,..., the “one-over-fractions \frac{1}{1},\frac{1}{2},\frac{1}{3},\frac{1}{4},\frac{1}{5},... and so on.

A sequence can be convergent meaning that successive values get closer and closer to some limit value, or divergent meaning they don’t.

Set: an unordered collection of unique values (not necessarily just numbers). A set is either defined as-is, for example \{0,1,2,6,245,1024\}, or using builder notation which defines membership by stating some rule, for example \{d \in \text{Dogs}|\neg\text{BarksAtNight}(d)\}. That last incantation defines the set of all good bois, as all those dogs which do not bark at night.

Mathematicians love sets, they are of limited use to programmers in their pure form.

1 Like

Beyond the replies from David and Wim above I don’t have a lot to add, but I always enjoy the use of equations in design and wanted to upload my take on this script. Points at regular intervals demonstrate the overall shape resulting from each formula, while the sphere highlights a point location of a combination of values in the domain of the solution. Thanks for the post, I bought the book!
Evaluate!.gh (10.3 KB)


I did a workshop with Joseph(the writter of morphing) and he provided the code he used to do this forms.
I translated it into a grasshopper script to animate the trasnformations between the forms. I hope it will be useful for someone. (35.3 KB) .

This is the animation:

Arquitetura Paramétrica (@arquiteturaparametrica) • Instagram photos and videos