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 http://davidbachmandesign.com. 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.)

hyphaelamp_185_large

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.

torusvines

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

BOBs!

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.

img_6886

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.

img_6882

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!

BOBs!

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.

1892177_orig

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

3D Printing Projects

Two weeks ago I finished teaching a semester course on the “Mathematics of 3D printing” with Tim Berg, Professor of Ceramics here at Pitzer College. Unfortunately, once the semester ended I went straight into teaching a 3 week intensive summer class in Multivariable Calculus. That didn’t leave much time for blogging!

This was the third time I taught (or cotaught) a class on 3D Printing. Each class turned out  very different. This time around we spent about two-thirds of the time learning how to write scripts to mimic (and subsequently modify) most of the built-in functions common in CAD programs. For example, one common CAD tool takes a curve drawn by the user and turns it into a tube. In Rhino3D this is the “pipe” tool. After reconstructing this tool in python code, a slight modification allowed the students to produce a tool to make a “wavy” pipe:

WavyPipe

The scripting portion of the class culminated with a project in which students had to write python code to generate a ring or bracelet. The parameters of the project specified some kind of braid, rope, or chain design, but some exceptions to this were granted. An important part of the project was to produce 3D-printable items to be fabricated by Shapeways, so students had to keep in mind a variety of constraints imposed on them by their material choices. Here are a few of the amazing things they made:

The second project was to use any combination of scripting and native Rhino tools to design a chair. In advance of this, each student was to choose a well-known designer and do some research about their style. The students’ chairs were supposed to reflect the style of their chosen designer. All chairs were then printed “in-house” on a plastic-extruding printer, which presented its own set of design constraints. I love the variety of what they produced!

I’m really proud of all of our students: Michael Barclay, Ben Bleier, Evan Bodell, Naomi Brooks, Si Cave, Rishov Chatterjee, Noah Christenson, Kendyl Douglas, Sanford Glickman, Joshua Guggenheim, Isabel Jones, David Menard, Christian Moniz, Roz Naimi, Sachi Watasi, and Emma Wenger. Well done, class!!

 

 

 

3D Printing Projects

Knot Theory with Rhino, Grasshopper and Kangaroo

Knots have always fascinated me. When I was young I used to get books about knot-tying from the public library and carry around some rope to practice. I enjoyed the challenge and beauty of tying a complicated decorative knot. Once when I was out in public a stranger saw me and said “If you like tying knots, you should be a topologist!”

I didn’t know what a Topologist was at the time. Now I know that it’s a branch of Mathematics that includes an area called “Knot Theory.” About 20 years after meeting that stranger I got a PhD in Topology.

Now that I’m thinking about the interactions between Math and Art, I’ve come full circle (so to speak) to revisiting knots as decorative objects. This time around I can leverage my knowledge of mathematics to help me create them. In a future post I’ll share more of my knot-based designs like the pendant pictured below, and how they were made.

625x465_7165574_2972052_1459322033Right now, though, I’m excited to talk about how the pendulum has swung back yet again: I’ve discovered that the software I use for my sculptural designs can be useful for studying Topology!

As I’ve mentioned before, most of my geometric modeling is done with Rhino3D, a CAD program used by most of the artists, architects, and academics I know who do this sort of thing. When the object is more mathematical (as most of mine are) I’ll usually turn to a Rhino plug-in called Grasshopper, which is essentially a visual programming language. Recently I’ve started playing with Daniel Piker’s Grasshopper add-on called “Kangaroo,” which gives Grasshopper objects physical properties such as elasticity, and allows you to apply many kinds of forces to them. A lot has been written about how this creates a new kind of design paradigm: rather than designing the finished product, you set up initial geometry and subject it to a set of physical rules which forces that geometry to evolve.

One of the ways in which Mathematicians study knots is to put them into a “nice” position. What that actually means, in practice, is a very difficult question. One strategy is to imagine the knot is made up of electrical charges that repel each other, so that the knot tries to spread itself out as much as possible, while keeping its total length fixed. I think this is how Rob Scharein’s software KnotPlot basically works.

An alternate strategy is to imagine keeping the radius of the rope used to tie the knot fixed, while shrinking its length as much as possible. This process is called “Rope Length Minimization.” After a few days of experimenting, I’ve been able to implement this with Rhino/Grasshopper/Kangaroo! Here’s a little animation of a randomly drawn knot shrinking to it’s rope-length minimizer:

If anyone out there wants to play with this, the Grasshopper definition can be found here.

The “Figure-8” knot is the second simplest knot you can draw. One of the basic facts about the Figure-8 knot is that it is amphichiral, meaning that it can be continuously deformed to look like its mirror image. (Surprisingly, the only simpler knot, the trefoil, does not have this property.) A test of any software is if it can detect whether two knots are the same or not, and in particular the Figure-8 and it’s mirror-image. Here’s a screen shot taken after applying my Roplength Minimizing grasshopper definition to both:

Screen Shot 2016-05-02 at 3.31.50 PM

The Grasshopper definition works by converting the knot into a set of straight lines (i.e. finding a polygonal approximation). Then it converts each of those lines to a spring with zero rest length. At the same time, a set of forces are applied that keep every segment of the knot at least one unit of distance away from every other segment (unless the two segments have a common endpoint). The program is then put into motion while the strength of each spring is gradually increased.

I’m excited to play with Kangaroo as a way to model topological phenomena. Next I’ll be moving on to hyperbolic surfaces, like the ones in Daniel Piker’s Kangaroo experiments shown here.

Knot Theory with Rhino, Grasshopper and Kangaroo