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.
The first phase of the script shifts the initial point of the curve to lie half-way between two self-intersection points.
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.
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.
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.
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:
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.
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.
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:
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.
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.
Finally, to make a 3D-printable object, we must thicken each curve into a tube. This is achieved with the “pipe” component, pictured below.
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.
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!
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:
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!!
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.
Right 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:
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.
This week I describe an artistic exploration I went on after modeling as realistic looking of a seashell as I could using Rhino and Grasshopper (described here). That model was a surface defined by two different curves that were replicated, at increasingly smaller scales, around a logarithmic spiral.
Once I had done this, I decided to experiment. I wanted to create new forms by making this model more and more abstract. The first thing I did was to extract the curves that defined the model, and turn them into wires. Here’s the 3D printed result:
One of the two curves that define this shell form is bumpier than the other. The next step in abstraction was to create a similar wireframe structure, without the bumps. The resulting model is quite mesmerizing when it is spun!
I liked this design very much, so I played with it a bit. Shrinking it down to a smaller size turned out to make a nice pendant. Fabricated even smaller still, and paired with its mirror image, made a lovely pair of earrings.
Finally, I decided to try to triangulate it. This proved to be the most difficult task. Each triangle is flat, which is in conflict with the fact that the curvature of the model gets more and more extreme as you move toward its apex. The result is that somewhere along the line some compromises had to be made, and those compromises resulted in a form that is no longer clearly recognizable as a seashell. In some sense this was the ultimate goal: to create a truly new and unique form.
In a week or two I’ll write about my experiences fabricating a version of this triangulated model that was over 5 feet tall!! In the meantime, you can order any of the above models from Shapeways here.
This week I’ll describe one strategy for representing 4-dimensional objects in 3-dimensions, using both modern and traditional media. While more than three spatial dimensions is a foreign concept to most people, Mathematicians have been studying theoretical objects in four dimensions and more for over a century. (Some contemporary Mathematicians even think about infinite-dimensional things, whatever that means!).
Each new dimension simply gives you more freedom to move. For example, if I draw a figure-8 curve on a piece of paper without lifting my pen, then it necessarily crosses itself. However, by introducing a break at the intersection, our brain tricks us into interpreting the 2-dimensional picture as a representation of a 3-dimensional loop with a twist.
In the same way one can imagine a four-dimensional object. Our familiar three dimensions become like the paper. By introducing breaks, we can interpret one part of the surface as passing right through another, without intersecting it. The surface is not actually broken: it has just been temporarily lifted into the fourth dimension and returned, like the breaks in the drawing above.
The Klein Bottle is a classic four-dimensional mathematical object. There are various models used to help us visualize it. The most common one looks a lot like a vase with a bent “nose” that seems to intersect itself. Here is an image of some beautiful glass Klein bottles that you can buy from Cliff Stoll at Acme Klein Bottle. I highly recommend checking out his website!
The deficit of these models is that they intersect themselves (as they must in three dimensions), while the actual four-dimensional object has no self-intersections. These models are analogous to drawing the twisted loop pictured above as a figure-8 curve, without lifting your pen.
To create a representation of the Klein Bottle with no self-intersections, I used a different model. Another way to think about the Klein Bottle is to sweep a figure-8 (with a break at the crossing to avoid the self-intersection) around a circle, while rotating 180 degrees. It’s hard to visualize, because this can only be done in four dimensions. If we try to construct it in three dimensions, it will intersect itself. However, by representing a skeleton of the model, and making the wires inter-weave, one can avoid self-intersections. Here’s a Rhino render of my design (modeled with Grasshopper):
Here’s the 3D printed version, available at Shapeways in small and large versions.
In the close-up on the right you can see how the individual wires that define the model are interwoven, so that there is no place in the model where it actually intersects itself.
This model got me thinking about making things with more traditional fabrication techniques. At the same time I had an undergraduate thesis student, Joi Chu-Ketterer, who wanted to explore knitting and crocheting mathematical surfaces. This kind of thing has been done a lot for hyperbolic surfaces. See, for example, the magnificent coral reef of the Institute for Figuring. I’d also seen many knitted tori and spheres. Cliff Stoll has some neat knitted Klein bottle hats on his website, but I had never seen anyone try to knit the figure-8 Klein bottle. The nice thing about yarn is that you can interweave the strands, to achieve the same kind of avoidance of self-intersections. It’s a painstaking process to thread the strands through each other while knitting them, but Joi did it!