Modeling the paper Mobius Band

At some point, perhaps in grade school, most people encounter the Mobius band: a simple shape made from a rectangular strip of paper by giving one end a half-twist before looping it around and gluing it to the other. The resulting surface has many interesting properties, both aesthetic and mathematical. Perhaps the most famous artistic image of it is from MC Escher:

Last September I was contacted by someone interested in 3D printing a steel Mobius band. I said “no problem” and within a few minutes had written down an explicit parameterization (set of equations) and had one modeled. When I sent this to the client, he was unhappy. The band I had modeled was mathematically a Mobius band, but not the one you’d get if you made it out of paper. It was stretched in various places, which paper just won’t do without tearing. Here’s an image of the one I made, with the image of a gum wrapper added to it so you can see the stretching.

Once I understood the problem, I realized just how non-trivial it is. In fact, after asking lots of mathematicians, I now believe that it’s unknown how to explicitly find a parameterization for a Mobius band that you’d get from a strip of paper. Here’s a more general problem: Given a 3D curve in space, what shape would a rectangular strip of paper take on if it was bent so the line down its center followed the curve? (For the mathematicians: obvious conditions, such as having Gaussian curvature zero, or being a ruled surface, are not sufficient.)

To satisfy the client, I just virtually “hand”-modeled something that looked close to photos of a paper model. Here was the resulting piece, 3D printed in steel by Shapeways.

I didn’t think much more about this problem until about a month ago, when I was contacted by an artist who wanted to 3D-print various surfaces with a uniform grid of holes, to sew beads on. I realized immediately that the uniformity of the grid forced the kinds of surfaces she was interested to be those that could be made by bending a rectangular strip of paper!

This time I had more tools at my disposal. I’m now much more familiar with Kangaroo, a program for simulating objects endowed with physical properties. Kangaroo is a freely available extension of Grasshopper, a plug-in for Rhino 3D. (Rhino is a popular CAD package used primarily by architects, jewelry designers, artists and many of those mathematicians I know who do any 3D modeling.)

The way one works with Kangaroo is to define a set of geometric objects, and assign various forces to them. Those forces can be internal (e.g. turning line segments of the model into springs) or external (e.g. simulated gravity). After some internet searching I knew Kangaroo could be useful for the paper bending problem. Back in 2011 Marten Nettelbladt posted some videos with similar Kangaroo experiments. In particular, in this video he sets the positions of each end of the strip in space, and the program finds the position of the rest of it.  However, he doesn’t post his GH script there, and I was a little stuck figuring it out on my own (it turned out that was because I was trying to do it with Kangaroo2, when its much easier with the older Kangaroo.)

I then came across this discussion in the Grasshopper forum in which Daniel Gonzales Abalde shares a script that is very similar to what I was looking for. In that script he simulates the drooping of a sheet of paper with user-determined corner points. The key to making it work is the following:

  1. Triangulate the “paper” surface with a triangular grid of (roughly) equilateral triangles.
  2. For each internal edge, apply a relatively weak  “hinge force” to keep the adjacent triangles in roughly the same plane. This is what makes the extrinsic geometry similar to physical paper.
  3. Apply a strong spring force along each edge of the triangulation, with each spring having equal rest-length, to preserve the intrinsic geometry of the object.

The first step turned out to be the hardest, since there was no uniform triangular grid component in Grasshopper, or any of the zillions of plug-ins I have installed. But Gonzales’ post had some hints how to do this, and soon I was able to define such grids on cylinders and Mobius bands.

My first test was to try it out on a surface where I definitely knew the answer. The idea was to begin with a planar annulus (washer-shaped surface) and apply Kangaroo forces that would turn it in to something one could make from a rectangular strip of paper. If it worked, I knew I’d end up with a round cylinder. Once again, the graphic that is imprinted on the surface is there so you can see the internal distortion (stretching) of the surface initially, and how that distortion goes away in the final conformation.


When I was sure it worked, I moved on to the Mobius Band. The final frame in this video is precisely the Mobius band shape I had been after since last September: its the shape of a Mobius band made from a rectangular strip of paper.


Next, for fun, it only took a few seconds to change the initial definition of my object so that the Mobius band was made with three half-twists, instead of one (technically, its a Mobius band if it is made with any odd number of half-twists.) The resulting surface was precisely one of the ones the bead artist I’ve been working with was interested in.

You’ll notice in this video that the surface passes through itself before settling down on a stable configuration. While it’s possible to set up Kangaroo objects that avoid self-intersection, I didn’t bother. That actually led to an interesting experiment. In this final video I tried to find a paper-configuration of the 5-twisted Mobius band, but it just passed through itself and ended up identical to the singly-twisted band. While that’s not the effect I wanted, I  still think it’s interesting to watch.

For those interested, here’s what the GH script looks like. Once I understood how to do it, most of the work went in to the cluster on the left, where I set up a Mobius band with a triangular mesh. The script itself is posted here.

Finally, since my book is still very new, I can’t resist ending this post without some gratuitous advertising with this graphic provided by my publisher…

Modeling the paper Mobius Band

My New Grasshopper book is out!

In the next few posts I’ll briefly pause my discussion of organic modeling techniques, but I will come back to that soon (next up in the series will be on Diffusion Limited Aggregation… very cool stuff!).

Today’s post is simply a brief announcement, just in case anyone missed all of my twitter, facebook, and forum posts about it… My new Grasshopper book has just been published!!

In the first week it has quickly become the #1 new release in Amazon’s “3D Graphic Design” category, and has at times been as high as #3 in that category overall.

Here’s a little more about the content and intended audience than what’s on the publishers website. You can also find this in the discussion at the Grasshopper forum, here.

The book is in three distinct parts. The first part is a fairly basic introduction to the package, and is geared mostly toward beginners.  Here I present several of the most common components with a series of small examples. There are discussions of lists, data trees, data manipulation with components such as Cross Reference and Flip, conditional list processing with the Dispatch and Weave components, curve parameters, surface parameters, mapping geometry with Morph components, and manipulating Meshes.

In the second part I present four advanced tutorials so readers can see how to put together lots of ideas to make complex objects. My hope is that even experts will get something out of looking at these tutorials. They are all original, and experienced Grasshopper users may (hopefully) see Grasshopper get used here in ways they hadn’t seen before. Here’s one of the images from this part, in a tutorial on making custom bevel shapes with only native Grasshopper components:

As stated in the product description, the third pard is a component reference. Most of the work here was taking the help file descriptions of each component and typesetting (read: fighting with LaTeX) them in an easy-to-read format that might be useful for any Grasshopper user.

If the book does well, I’m planning a more advanced sequel. I’m very open to suggestions for content. One person has already suggested I include information on writing your own components, which is something that I think would be good to include. I was also planning on giving some information on the use of several common plug-ins (e.g. Kangaroo, Anemone, Mesh+, etc). Please post other suggestions here!

My New Grasshopper book is out!

Organic Modeling Techniques Part 2: Differential Growth

Before I begin, a quick news update. My Grasshopper book is now completely through the copyediting process, and is with the printer. I’m told it will be available some time in the next few weeks! In the meantime, I’m happy to share the cover art.

Now on to today’s post. As I said in my last post, my goal in this series is to describe modern approaches to modeling organic forms that you wouldn’t find in more classical treatments. So I’m not going to discuss here seashells (logarithmic spirals), sunflowers (phyllotaxis), etc.

I’m excited to write about my newest experiments creating organic forms by a differential growth algorithm. This kind of model is relatively new (as far as I know), but has certainly gained a lot of press for the variety of amazing forms you can generate. If you haven’t seen it yet, I encourage you to check out the amazing video here from Neri Oxman’s group at the MIT media lab. (Her TED talk is also worth watching.) Other great examples are the Floraform sculptures by Jessica Rosenkrantz and Jesse Louis-Rosenberg at Nervous System, like the one shown here:

I’ve long been interested in replicating these kinds of systems with Rhino3D and a Python script, Grasshopper script, or some combination of the two (because that’s the CAD package I know best). Many others have written in to the Grasshopper forum expressing a similar desire, but as far as I know there has been little progress, until now!

The earliest effort I know of in this direction was by Daniel Piker, author of the Grasshopper plug-in “Kangaroo,” originally posted in the discussion here. Kangaroo adds physics based modeling to Grasshopper, allowing the designer to define a variety of forces on a geometry and let the system evolve. The idea behind Piker’s algorithm was to first define a triangulation of a disk where the edges got smaller as you got closer to the outside.

Then he placed a relatively strong force at each vertex to move them away from each other, and a weak spring force along each edge to keep the whole thing together. Add in a little smoothing forces, and here’s the result:

This looks a lot like the Nervous System piece pictured above, but there’s a big difference in the algorithm. Once the edges of the disk are defined, the final form that will eventually evolve is essentially determined. In contrast, a typical differential growth algorithm will just keep growing and growing, adding more and more complexity.

Shortly after Piker posted his definition, Vicente Soler wrote a true differential growth algorithm in a Grasshopper script, described in his post here. However, the core of that script is a C# component containing 543 lines of code. I can read C# code, but I wasn’t about to decipher that. I also can’t really write C# code, so even if I understood his program, it wasn’t going to help me create new variants.

Last week I started experimenting with putting Kangaroo forces inside an Anemone loop. For those unfamiliar with Grasshopper, its a visual way of writing a computer program, where you don’t have to know any coding at all. The drawback of Grasshopper is that there are no provisions for looping, which means you can’t easily make recursive structures. Anemone is a plug-in for Grasshopper that enables looping ability.

My idea was to define some geometry, set it in motion for a very short time by subjecting it to some forces,  modify the geometry based on the resulting shape, and repeat. And here’s the result.

The Grasshopper script to create this is available on the Grasshopper forum, here.

Here’s a brief description of my algorithm:

  1. Begin with a  simple triangulation of a cube.
  2. Measure each edge. If any edge is longer than 2, then subdivide it. This is accomplished with three lines of Python code. (The hard part was figuring out how to write a Python script to take advantage of the Plankton half-edge data structure.)
  3. Place a spring along each edge whose rest-length is the length of the edge, additional forces at the vertices spreading them 2 units apart from each other, and a smoothing force.
  4. Evolve the mesh according to the forces by one unit of time.
  5. Go back to step 2.

The exciting thing (to me anyway) about this algorithm is its potential. By adding other forces (gravity, wind, etc) and constraints I can now “grow” a huge new variety of shapes. I’ve only just gotten started!

[UPDATE: I just figured out the way to grow a disk, instead of a sphere, getting me closer to Nervous System’s Floraform sculpture. Here’s a video:]


Organic Modeling Techniques Part 2: Differential Growth

Organic Modeling Techniques Part 1: Reaction-Diffusion

Before I get started with today’s post, I’m happy to announce the completion of my book, “Grasshopper: Visual Scripting for Rhinoceros 3D,” which is tentatively to be published March, 2017.  This a basic introduction on the use of Grasshopper for 3D modeling. I wrote it with the Rhino user in mind who would like to start using Grasshopper in their work-flow, although the presumed knowledge of Rhino is kept to a minimum. The book is organized in three parts: Part 1 is a basic run down on how to use Grasshopper, with simple examples to showcase use of the most basic components. In Part 2 contains a handful of more sophisticated examples, to show how you can combine the elements discussed in Part 1 to create complex forms. Part 3 is a reference guide for all of the Grasshopper components.

For those attending the Joint Mathematics Meetings in Atlanta, I’ll be giving a 20 minute presentation on Grasshopper tomorrow (Thursday, January 5th) at 2:00pm in the MAA invited paper session on “Technical Tools for Mathematical 3D Printing.”

2017 looks to be a busy year for me. My design consultancy business has started to take off, which has led to a number of really interesting projects that I’ll be writing about here. One of the topics I’d really like to delve deeper into this year are the ways in which one can mathematically model organic forms for the purpose of art and design work. This is a very old endeavor, but I’m hoping I can contribute in some way.   This series of posts are really my way of cataloging the different strategies I’ve found to attack the problem of organic modeling with mathematics.

Organic forms have inspired design work,  perhaps since “design” was a thing. Last summer, while visiting ICERM in Providence, I was on a tour of the Rhode Island School of Design’s nature lab. The variety of specimens they had was absolutely breathtaking, and all in service to their design students. There was an entire room of human skeletons, endless cases of coral and seashells, a whole lab full of microscopes for studying microscopic forms, etc.

Readers interested in organic forms can do no better than start with D’Arcy Wentworth Thompson’s classic work,  “On Growth and Form,” first published in 1917. As far as I’m concerned, everyone remotely interested in art, design, biology or mathematics should have a copy of this on their bookshelf. Given how old this work is, it’s shocking how much is there: logarithmic spirals and seashells, branching forms of antlers, polyhedra and cell structures, phyllotaxis and plant growth, etc.

I’ve written previously about the mathematics of seashells and branching (vein) structures. In this and future posts I’ll discuss some more modern topics that are now well known, but too new to have been included in Thompson’s book. This first one I’ll tackle is reaction-diffusion equations, which are commonly used to model things like leopard spots, tiger stripes, and finger-prints.

For the non-technical reader, reaction-diffusion equations are a system of differential equations. Typically there are two of them, and they model two competing populations in a 2-dimesnional region of the plane. The best explanation I’ve seen of the mathematics is by Karl Sims, found here. In that web page he describes a discretization of the reaction-diffusion equations called the Gray-Scott model.

The model begins with a 2-dimensional grid. At each grid point there are two numbers, which encode the concentration of chemicals A and B (or size of two populations, etc.). In Sims’ description, A represents food and B represents an organism that eats it. In the model, each grid cell is continually being given chemical A at some “feed rate”, and organism B eats it and reproduces. In places where there is not enough food, organism B dies off with some “kill rate”. Initially concentrations of A and B, and the feed and kill rates, determine the eventual behavior of the system.

In the Fall of 2016 I had an independent study student, Sachi Watase, work with me on the problem of translating the Gray-Scott model to work on an arbitrary mesh. The first step was to code the Gray-Scott model in Python/Rhino3D (later this was done in Python/Processing). Here are some images Sachi generated.

The idea for the project was to take a 2D mesh with any topology, assign concentrations of A and B at each vertex point, and then evolve the system. It was a very computationally demanding project, since the fate of A and B at each vertex depends on a linear combination of the concentrations of A and B at all neighboring vertices.   Exactly which linear combination to choose proved to be a difficult task, especially for meshes with vertices of varying degree (i.e. different numbers of edges coming into each vertex).

Visualization of the results was done in a number of ways. One strategy was to use the level of B as a gray-scale value to color the mesh. Another was to use B as a variable offset amount to add texture, as in the two images above. Below is the result of a reaction-diffusion equation implemented on a toroidal mesh.

In the end we had the most success with a quad mesh with valence four at each vertex (necessarily a torus, for topological reasons), as in the image above. However, I’m hoping this project continues, and sometime this year I’ll be able to share images of interesting textures/colorings on meshes with lots of different topologies.


Organic Modeling Techniques Part 1: Reaction-Diffusion

Vein Structures

In honor of Halloween, I thought I’d post some spooky pictures and discuss how they were made. But first, please take a minute to check out my newly redesigned website, which is up and running at A special thank you goes out to my friend, Ben Benjamin, for his advice on the design.

Anyone who is interested in 3D printing, art, design, and mathematics has most likely come across the work of Jessica Rosekrantz and Jesse Louis-Rosenberg at their company, Nervous System. Many of their designs for lamps, clothing, furniture, etc are generated with biologically inspired algorithms. One of my favorites is a series of lamps they call “Hyphae”. (Photo shown here with permission.)


As they explain here on their website, these lamps were made from their implementation of an algorithm to simulate the veins in a leaf, detailed in the paper  “Modeling and visualization of leaf venation patterns” by Adam Runions & co. (available here). For anyone interested in understanding this algorithm, I highly recommend watching the animation of it on the Nervous System website.

After spending some time understanding this algorithm myself, I decided to try my own implementation. I was interested in growing veins on a meshed surface of arbitrary topology, which turned out to require some significant modification of the original algorithm. After a month or so of fiddling, I finally started to get some results I was happy with, like the veins on this skull:

And this “eyeball”: eyeballsideview

My algorithm is mostly implemented in a Python box of a larger Grasshopper script. Before the algorithm is run the user selects a vertex of the mesh to be the “root,” and a collection of vertices to be the “sources.” These selections are accomplished with the “Select Mesh Vertices” component of the Grasshopper Mesh+ plugin. (As an aside, my Grasshopper textbook is well underway. Look for an announcement in the next few months!)

Here’s a brief description of my algorithm, with a few simplifications at each step to (hopefully) make it understandable. Feel free to contact me for more details. My apologies for any incomprehensible technical jargon. If you get bored, just scroll down to the end for one more picture! In each iteration of the algorithm we decide how to grow a tree (initially the root vertex) toward the sources.

  1. Compute the shortest path from each source to the tree. Each vertex of the tree at the endpoint of at least one such path is a “growth site.” In the next steps, we determine in which direction to grow from each growth site.
  2. Weight the edges adjacent to each growth site so that an edge picks up one unit of weight if it is the initial edge of a shortest path between the tree and some source.
  3. Find the edge emanating from the growth site closest to the “weighted center” of all of the edges adjacent to it.
  4. “Grow” the tree in the direction of this edge by adding it to the tree.
  5. If the new edge touches a source, remove that source from the collection of sources.
  6. Repeat until all sources are gone.

The above algorithm creates a polygonal tree through the mesh edges. To get a nice veiny structure, only the vertices of each branch are kept track of, together with the total of the edge weights at each. Those vertices are used to construct NURBS curves, and a tapered pipe is made around each curve with radii proportional to the weights.

Unfortunately, the algorithm is very time consuming. The detail of the resulting vein system is limited by how fine of a mesh is used, but in a finer mesh the shortest-path computations, which have to get re-run with every iteration, take much longer. This is why the vein systems I show here are nowhere near as intricate as the one in the Nervous System photo above.


There’s been a lot of beautiful work creating tree structures in Grasshopper. For example, there are really nice forum discussions featuring an algorithm of Daniel Gonzales Abalde and various experiments with it, primarily by Nik Wilmore. While these algorithms produce some amazing results in 2 and 3 dimensions, the kinds of trees they produce are structurally different than the ones I’ve shared here. Shortly I will post my own implementation of that algorithm to arbitrary meshes and compare the results.

Vein Structures

3D scanning for fun and profit

Most of my posts so far have been about experiments or challenges in 3-dimensional design for 3D printing. However, it’s possible to get into 3D printing without knowing much about design software, if you have a 3D scanner. In theory, to create an object suitable for 3D printing you can just sculpt it by traditional methods (e.g. carve wood, chisel stone, build up clay, etc.), and scan it.

Unfortunately, in my experience this is often much harder than it sounds. The cheapest scanners are easy to use, but often do not capture enough detail. Slightly better scanners are not as user-friendly and professional grade scanners are out of my price range (they’re often over $10K). Here I’ll post my experience with the scanners I’ve used, and some tips I’ve picked up along the way for successful scanning.

The first scanner I tried was the Sense, by 3D Systems. It’s about $400, and is available for both Mac and PC. There is a newer model now than the one I used, and I don’t know how many improvements they’ve made since then. Basically, the one I used looks like an industrial stapler, and must be tethered to a computer. You aim it at an object, and walk around it. The software tracks the object in real-time, and tries to reconstruct its shape in 3D.

The best thing about the Sense is its cost. It’s cheap, and does a reasonable job with human-sized objects. However, it’s hard to walk around an object with the unit while you are tethered to your computer. It also loses its tracking about 60% of the time, and every time that happens you have to start over.  There are probably tricks to avoid this, but I never found anything that worked great.

With that all said, I did some fun projects with it. The one I like the best was when I scanned all of my family members and turned us into a chess set. I’m the king, my wife the queen, my two boys are the rook and bishop, my dog is the knight, and the Roomba that scurries around our house is the pawn (my son’s idea). With the exception of the Roomba, each was scanned, and accessories (stands, crowns, glasses, and a little dog house) were added afterwards on the computer.  The Roomba was modeled from scratch in Rhino.

An even cheaper low-end 3D scanner isn’t really a scanner at all. 123D Catch, by Autodesk, is a fantastic free smartphone app that often does the job quite nicely. At the time I made the above chess set this program was still giving fairly crude results. Since then it’s improved so much that it is now my go-to solution for quick, cheap scans of relatively large objects. The way it works is that you walk around your object and take lots of pictures. Those pictures get uploaded to Autodesk’s servers, which grind them through some presumably  very sophisticated image processing software. After a relatively short wait, they then provide you with a 3D file of your image. The cool thing is that scale is not an issue. You can scan things as big as a building, or as small as a person. However, very small items are tricky, as they will try to reconstruct everything that your camera has taken a photo of. This instructable has some great information on how to deal with this, although I’ve never personally had much success with using 123D catch to scan small objects.

In the last few years I’ve gotten a lot more serious about my design work, and have at times needed a professional quality scanner. As I mentioned above, most of those are well over $10K, which I just can’t afford. The first thing I tried was an ultra-cheap solution: the Ciclop scanner, a diy open source laser scanner by bq which can supposedly capture very fine details.  It uses two cheap lasers pointed at a small object on a turntable, and a webcam to capture the resulting pattern on the object. I spent hours getting it all put together and set up, but was never able to get a decent scan, so eventually I just gave up in frustration.

Finally, I decided I should bite the bullet and spend more than a few hundred bucks, but I still didn’t have near enough for a high-end machine. The best compromise I found is the Einscan-S, which sells for about $1000. This machine projects a changing white-light pattern on an object, and captures the result in stereo with two cameras. The model I bought came with a turntable, but I never found that very useful.

The Einscan software allows for a turntable mode and a free-scan mode. What I normally do is place an object on the turntable from the Ciclop scanner, and use free-scan mode to capture lots of images of it in different positions. Each time an image is captured, the software reconstructs more of its 3-dimensional form. It rarely loses tracking from one image to the next, and when it does you can just discard the last image. Here’s a scan I did recently of a bronze statue of Alice (from Alice in Wonderland), by the artist Karen Mortillaro. (More on my collaboration with her in a later post!).

Notice the white powder on the original bronze statue in the photo. That’s a standard trick in 3D scanning, where you evenly coat your object with baby powder so it gets picked up by the scanner’s cameras better.

You can see in the picture that the smallest details, like the texture of the hair, are not present in the scan. That may be the difference between a professional quality scanner and an almost-professional quality one, although those particular details may be too small even for the best scanners.

The Einscan-S is not as easy to use as, say, 123D catch. However, it definitely picks up a lot more detail. It does not detect color information, which is fine if you are like me, and only interested in 3D printing the resulting objects. The biggest drawback is the size limitations. I have only been able to get it to capture objects less than 12″ tall.

Einscan now has a “pro” version that looks a lot like the Sense. They claim it will capture even more detail than the “S” version, larger sizes, and color. I don’t know how many of their claims are accurate, and it costs about three times as much. If I ever get to play with one, I’ll post those results here!

3D scanning for fun and profit


I’m back from a long hiatus… The second half of the summer was busy with travel, and the beginning of the semester is always a difficult time. Only now are things settling down, and I can (hopefully) get back to regular posting.

In the last few months my design consulting business has really taken off, and I will be writing soon about some of those projects. Unfortunately, right now none of them are at a state that can be talked about, so I’m going to go back to one of my oldest experiments with 3D printing.

When he was about 6 or 7 my very creative son had made a little game for himself by taking wine corks and turning them into little characters. He’d stick toothpicks in them for arms and legs, use thumbtacks for shields or hats, etc. He called them “BOBs” (because they float!). Not many have survived in the intervening years, but recently my younger son was cleaning out his room and came across these.


These were made around the time I started experimenting with 3D printing, so it was natural to try 3D printed cork accessories. It was also before I started using Rhino3D. All modeling was done with Cheetah3D, an inexpensive  CAD program only available for Macs, which turned out to be surprisingly good for this sort of project.

I made two experiments: “Hiker BOB” and “Top Hat BOB”. Each had pants, a hat, and a little accessory. Hiker BOB’s accessory was a belt with a water bottle, and Top Hat BOB had a collar with a bow tie. Both were printed at Shapeways.


The ironic thing is that shortly after making these, my son stopped playing with his BOBs. One explanation is that he just outgrew this sort of toy. But I also wonder if I’d somehow spoiled it for him. Maybe the act of making his BOBs was the real fun, and by providing him with pre-made parts I had ruined it. I created an object that would sit on a shelf and be looked at, rather than played with. Or maybe he just discovered video games.

For years I contemplated trying to mass market my 3D printed BOBs. However, I don’t know the first thing about how to start that process, and I was more interested in other pursuits than trying to find out. Recently my wife came across a product called “Corkers,” which is basically the same thing: plastic accessories to turn corks into little characters. Oh well… I guess I missed the boat on that!


Alternating Knots

I can’t help myself starting this post with a shameless plug. Over the last few months I’ve been doing work for various people around the world, mostly helping them model things to be printed by Shapeways. I’ve been excited by the variety of interesting projects this has led to, giving me opportunities to hone my skills with Rhino, Grasshopper, T-splines, and Meshmixer. Among other things I’ve helped make earrings for a designer in London, a pendant for an artist in Maine, an engraved memorial ring for a doctor in Arizona, and some custom-shaped dice for a motivational speaker in Northern California.

Recently I’ve decided to make this little side-business official and incorporate with the state of California. So I am now proud to officially be “David Bachman Design, Inc.” You can find a little more information about this here.  Feel free to contact me with any design ideas!

Now on to today’s post…

There have been several occasions where I’ve wanted to model a knot for either decorative or functional purposes. The first was for a simple pendant which was a trefoil knot in a heart shape. Since then I’ve had to model more complicated knots, including Celtic knots and Chinese knots. In a previous post I discussed some experiments using Kangaroo to minimize the rope-length of a knot, and I needed some random-ish knots just to test my minimization algorithm.

Some knots (e.g. torus knots and Lissajous knots) are “easy” to make if you have a solid knowledge of trigonometry and parameterized curves. However, often I find these kinds of knots too restrictive.

Unfortunately, for mathematical reasons, “random” knots are hard to freehand draw. For one thing, it is difficult to guarantee that you haven’t made a “slip-knot” that will just come apart if the right strand is tugged on. One solution I’ve come up with is a Grasshopper script that will convert a free-hand drawn curve in the xy-plane to a knot by alternately lifting and lowering it at each place where it crosses itself. The result is called an alternating knot, and such knots are guaranteed to never come apart.

This script can be found here. I will briefly describe how it works. First, the user must draw a curve in the xy-plane, and set the left-most component of the script to reference it.

Screen Shot 2016-07-29 at 12.13.23 AM

The first phase of the script shifts the initial point of the curve to lie half-way between two self-intersection points.

Screen Shot 2016-07-29 at 12.16.28 AM

Then the fun starts. The script uses the “Curve|Self” component to make a list of all the places where the curve crosses itself. It then adds to this list a point on the curve between each pair of consecutive self-intersection points. The self-intersection points are then  alternately raised/lowered, while the points in between are kept at height 0. The final step is to create a new interpolated curve through this modified list of points, and put a tube around it.

Screen Shot 2016-07-29 at 12.16.57 AM

Here is the resulting knot for the initial curve shown above:

Finally, it’s nice to combine techniques. Here’s a pretty knot I made by using some trigonometry to parametrize a curve in the plane. I then used the above script to make it alternate.

Screen Shot 2016-07-29 at 9.54.56 AM

Alternating Knots

Illustrating Mathematics with Grasshopper

I’m currently attending a week-long conference on “Illustrating Mathematics” at the Institute for Computational and Experimental Research in Mathematics (ICERM) at Brown University, in Providence, RI. I was asked to give a workshop here on using the Grasshopper plug-in for Rhino, and thought my talk would make a good blog post.

This is the first time I’ve written a tutorial type of post. I’ll try to say something useful for beginners and experts alike, but first I should say a bit about what Grasshopper is and who its for. Rhino is a popular 3D modeling program. I have the sense that it dominates the architecture world, but the majority of the artists and mathematicians I know who do a lot of  3D modeling also use it. Grasshopper is a free plug-in for Rhino written by David Rutten that allows one to build Rhino objects using a visual scripting “language.” Building these scripts involves dragging and dropping various boxes around a virtual canvas, and drawing lines between them. For example, in the image below I’ve created a circle in the Rhino window (shown on the left) by connecting a circle box to a slider at the “radius” input.

Screen Shot 2016-06-30 at 10.05.01 AM

A word of caution is in order for mac users. Since 2007 Grasshopper was only available for the PC version of Rhino. For a long time the Rhino folks were saying that a mac version was a long way off, if it were to ever happen at all. Then, out of the blue, just a few months ago they released a beta version available for the current mac Rhino3D WIP. It consistently crashes on my mac, but several people I know have been using it without any problems. Presumably it’ll get more stable over the next few months. In the meantime, I use Rhino/Grasshopper in a virtual PC environment on my mac.

It’s worth contrasting the use of Grasshopper to build objects vs building them with a traditional programming language like python, which is another option for Rhino users. Grasshopper has two huge advantages: The first is that Grasshopper doesn’t require you to learn how to code. Second, and more importantly, Grasshopper scripts are interactive. All variables in a grasshopper script can be realized by sliders, allowing the user to see how changes in parameter values effect shape in real-time. This is crucial for making aesthetic choices in object design.

Where Grasshopper really loses to more traditional programming is any place where recursion is required. Grasshopper is generally a poor choice for fractal designs, for example (although there are some third-party work-arounds that function reasonably well, such as Hoopsnake).

Fortunately, one doesn’t really have to choose between Grasshopper vs more traditional scripting (python, C#, VB). A Grasshopper box can be a user-defined python script, for example, with inputs that are realized by sliders. This gives you the best of both worlds: it simultaneously makes your python scripts interactive, and allows for “easy” recursion in  Grasshopper.

My idea for the workshop was to go through the design process that I used to create my re-usable coffee sleeve/bracelet/very-small-dog collar (available here on Shapeways).

It’s hard to see this in the pictures, but the curves in opposite directions are woven, reminiscent of the old “Chinese finger trap.” This allows it to form-fit to many cup shapes, and makes it fun to just play with. 3D-printing is the only technology I know of that can produce this design in plastic.

The woven aspect of the design was beyond the scope of a 45-minute workshop. At some point I’ll dedicate an entire blog post to various strategies to achieve a woven effect in Rhino/Grasshopper. Here I’ll just describe one way to make a shape, and create slanting curves on it in each direction. The construction I’ll give is not the most efficient way to do this, but it will illustrate a lot of the important concepts of Grasshopper design. First, examine the following image:

Screen Shot 2016-06-30 at 11.09.09 AM

From left to right: First you see a slider that will determine the eventual height of the object. This gets fed into a component that defines an interval of real numbers. That interval is then passed to a box that is set to choose 10 values in it. Those values are finally passed to the z-coordinate of a point (with the x- and y-coordinates being set to 0 by default). One important thing to note is that there is a double line connecting the third and fourth components, whereas the other components are connected by a single line. A single line represents a single piece of data being passed between components; the double line represents a list of data.

Screen Shot 2016-06-30 at 11.16.17 AM

Once the points are defined we feed them to a component that create horizontal planes centered at each point. Those planes are then given to a circle component to define a family of horizontal circles.

Screen Shot 2016-06-30 at 11.23.11 AM

After defining the circles, we choose 10 points on each. Those points then form a list-of-lists, represented by a dashed double line leaving the box. If we feed each of these lists of points in to a component that makes an interpolated curve through them, we just get the horizontal circles back. Compare that to the following:

Screen Shot 2016-06-30 at 11.26.51 AM

Here I’ve inserted a “flip matrix” box. This component re-organizes the data, creating a new list-of-lists. The first one is comprised of the first elements of all of the input lists, the second list is all of the second elements, etc. Now if we create curves through the points in these lists we get the vertical arcs shown at left.

Screen Shot 2016-06-30 at 11.31.52 AM

To make diagonal lines, we introduce a shift.  This is done with the introduction of two new boxes. The first just produces a list of integers between 0 and 9. Those are fed to a component that shifts each list of points. Note the little up-arrow by the word “shift” in the second component. That represents a “graft,” so that the first input list is shifted by 0, the second list shifted by 1, the third shifted by 2, etc. This sort of data-matching is the hardest thing to learn about when using Grasshopper.

One more thing is required to make the desired diagonal cross-crossing pattern. The reason the lines slope one way instead of the other is that we’ve shifted each list by +1. That’s controlled by the “step” input in to the “series” component shown above (the default value is 1). In the image below you see two copies of this collection of components. The lower copy is the same as before, while the upper copy uses a shift of -1. Together, you see that they give the desired effect.

Screen Shot 2016-06-30 at 11.38.44 AM

Finally, to make a 3D-printable object, we must thicken each curve into a tube. This is achieved with the “pipe” component, pictured below.

Screen Shot 2016-06-30 at 12.01.01 PM

Illustrating Mathematics with Grasshopper

Making Big Art with 3D Printing

As I’ve learned more about what people recognize as “fine art,” I’ve come to realize that there are inherent problems in using 3D printing for the direct production of art. I’m not talking about philosophical questions, like whether “real art” should have hand-built elements to it. In this post I’ll discuss more a more technical question: scale vs economics.

In Mathematics, scale is rarely part of the definition of an object. The Mathematical definition of “cube,” for example, makes no mention of how tall it is. However, there is a very real visceral difference in our experience of a physical cube when it is one inch tall, versus when it is ten feet tall. A lot of artwork plays on this. As my friend, Clare Graham would say, larger objects have a certain “gravitas.” An inflatable bunny that’s 10″ tall probably won’t be considered art. These HUGE bunnies by Amanda Parer are.

Scale is one of the biggest obstacles to producing art by 3D Printing.  Home printers top out at about 12″ in capacity, and won’t have the quality to make anything recognized as fine art. These days you’ll hear news articles about giant cement-extruding printers making houses, but someone like me doesn’t have access to that technology. There’s a company called Materialize that has a “Mammoth Stereolithography” machine, but they charge so much to use it that only the highest end artists and designers like Janne Kyttanen can charge enough for their artwork to justify this technology.

The best solution I’ve been able to come up with to the scale problem is to create  triangulated modular designs. I decided to try this to create a large version the seashell model I wrote about in this post.

The larger version I ended up making is about 5.5 feet long. It consists of 153 sticks and 59 nodes. Each stick is a different length and each node is unique. I wrote a grasshopper script to model each node and emboss numbers on them near each “socket,” so I knew which stick went into which node/socket.

Screen Shot 2016-06-10 at 11.54.56 AM

I then printed out a spreadsheet with all of the stick lengths, and hand-cut clear PVC pipes to those lengths with my chop-saw. As I cut them I wrote their number on each end with a marker that I could later wipe off. Then it was a matter of matching up the end of a stick with a particular number with the socket that had the same number, and gluing them together.

It took a few weeks of 3D printing nodes to get through all of them, a week for cutting and labeling PVC sticks, and another week or two to assemble and glue. Here’s the final piece.


It came out ok, but not really “fine art” quality. I would have had to use more permanent materials than ABS plastic and PVC. The goal of the project was really to see if I could leverage the power of 3D-Printing and still make something of a decent size. I didn’t want to spend much, since I had no idea if any of it was going to work. I believe I spent less than $100 on materials.

I’m not sure this is a viable solution to the fine-art vs scale vs 3D-printing problem. If I were to really try to sell this as a piece of artwork I would have Shapeways print each node in steel and use some kind of metal tubing for the sticks. All connections would have to be welded or soldered instead of glued. Shapeways would charge me an average of $50 to print each steel node, so the printing cost alone could be as much as $3K. That much metal tubing could also be pricey, depending on its quality. And then there’s the fact that I’d either have to learn how to weld, or hire someone to do it for me. (I’m fine with soldering, but it might not be strong enough.) In a high-end gallery such a sculpture might sell for $10K, but as much as half that would go to the gallery. You can see that the numbers start to look dicey very fast.

If anyone reading this has any thoughts on the scale vs 3D-printing problem, please share in the comments!

Making Big Art with 3D Printing