Showing posts tagged geometry

Creating curves with straight lines

Here is a video I recently made in response to Vi Hart’s great doodling game video. You take a curve, put dots evenly spaced (or however you want) along the line, and connect dots some predefined number apart. You can do this with any curve you want, but some results are more interesting than others. In some of the shapes, I highlighted the limiting envelope curve that is generated by the shapes. Enjoy!

And here is part of the video in gif form:

Playing with a Flowing Torus

A friend recently sent me a video that demonstrates a remarkable slinky-like object called a toroflux, designed by Jochen Valett:

It is a long ribbon of spring metal wrapped into a coil, except instead of coiling into a helix, as most springs do, this one coils through itself. It coils again and again, for the entire extent of the ribbon, where it is finally joined to the other end, creating a single loop of metal ribbon. Because the loop is passed through itself many times, the resulting shape is non-trivial in the knot-theoretic sense; it takes the form of a torus knot.

This spring behaves in an extraordinary way when manipulated. Because the spring is under tension, and is seeking the lowest energy state possible, when it is released, it prefers to open into a torus with the largest “minor radius” possible. That is, it becomes a horn torus, where the “hole” in the doughnut vanishes.

The force responsible for this then has a tendency to “grab” onto anything placed through the hole of the torus (like a stick), and if the object has enough friction, the toroflux will have good traction. The result is remarkable; the toroflux begins spinning, while simultaneously falling, creating the illusion of a silver bubble-like structure.

I was so excited by this that I had to purchase one for myself. If I had a ribbon of spring metal, I would have wanted to make my own, but unfortunately I couldn’t find anything that would suffice. Before it arrived, I made predictions about how such an object could work, and I have enjoyed playing with it. I would like to explain here how the toroflux works using an informal analogy, hopefully making it understandable.

Capturing the idea of “rolling” down

Let’s say we want to build a device that rolls down a vertical rope. When we think of rolling, the first thing that comes to mind is wheels. So we could accomplish the task by placing a number of vertical bicycle wheels radially in contact with the rope, each wheel connected to its neighbor via some framework. Here I have pictured two wheels for simplicity, but the principle could be generalized to many wheels. Provided that the device doesn’t slip off, and traction is maintained between the wheels and the rope, the assembly will fall, and the wheels will simultaneously turn as indicated by the blue arrows (relative to the falling frame).

This allows our apparatus to roll down straight. But what if we want the device to spin like the toroflux does? Well, just like when driving a car, you can guide a wheeled device in a certain direction by turning the wheels. In our case, we want the device to begin rotating. What would happen if we took these wheels and rotated the axis of each wheel some fixed angle about the radial direction? The adjacent diagram illustrates this with a top-down view of the wheel system, with the rope in cross-section. As the wheels “drive” down the rope, they have no choice but to make the whole assembly spin because of the way they are angled.

Now we have something that is much more similar to the toroflux. It not only rolls down a rope, but the whole system also rotates about the axis of the rope as it does so. The ratio of the downward velocity and the rotational velocity is determined by the angle of the wheels.

Doing away with the chassis

We now have a number of wheels held together by the support struts and also held tight to the rope with spring mechanisms to maintain traction. The support chassis is necessary for a simple reason: the wheels are not connected to one another. In the topological sense, the set of wheels is comprised of more than one connected component. We can rid ourselves of the chassis if we create a single wheel that locally (relative to the rope) looks identical to the wheels. That is, the rope should be unable to tell the difference between many tires touching it and a single, serpentine tire touching it and curving inward toward the rope in exactly the same way that the individual wheels did.

Here is a way to accomplish this. If you follow the curvature of a wheel, instead of curving around in a circle and reconnecting directly with itself, it must arc over toward the next wheel and join with it! This wheel will also do the same thing with its other neighbor, and this continues all the way around until we have only one spiraling wheel, all one piece. This does not interfere with the rolling of the wheels, because all the wheels spin in the same direction, so the “excess” tread from one wheel goes into the tread that is moving away on the neighboring wheel. Thus the physical result is essentially the same. (This forms a torus “knot” classified by {1,n}, signifying that in a single rotation around the rope, the coils spiral n times.) The above animation shows how the separate wheels are deformed and connected to each other to form a single coil-tire.

This is all fine and good, but we still require a great amount of tension in the spring to keep it pressed firmly enough on the rope to prevent slipping. As the device rotates faster, centrifugal force will pull the spring-tire apart, and it will begin to lose traction with the rope. We will see in the next section how to prevent this from happening.

Using centrifugal force to our advantage

Our device runs into some trouble when it starts spinning really fast. As the device spins, the coils pull apart and lose traction with the rope. We can put the coils under more tension, but there are practical limitations. There is a much more clever way to solve this problem, and it involves using centrifugal force against itself to achieve what we are looking for.

Instead of running the coil in the way I described earlier (as a {1,n} torus), we can loop the torus through itself, so that each coil wraps around the other side of the rope, so when the toroflux begins spinning rapidly, centrifugal force only pulls it tighter around the rope. In this way, we form a {n-1,n} knot, which is a true knot, so that upon orbiting the rope n-1 times, the coil winds n times. This knot resembles but is not actually equivalent to a single torus of circles of the Hopf fibration.

Hopefully this explanation makes clear how the toroflux works, and also helps illuminate the ingenuity and utter elegance of this invention. I also made a video to demonstrate it:

A recycled rhombicosidodecahedron

My friend Cody drinks a lot of Red Juice. When bought from Costco, two 96 fluid ounce bottles of Red Juice come paired like this:

That red connector between the bottles creates a handle for easy transportation. Most people dispose of these connectors and consume the Red Juice with the help of friends. Cody manages to drink this quantity of juice in a few days and sets the connectors aside, initially out of laziness but soon building a collection of them.

One day Cody asked me what the coolest kind of polyhedron was that one could build with 121 edges. Well, the rhombicosidodecahedron can be built with 120 same-sized edges. I had no idea what Cody had in mind  I expected he had obtained some kind of polyhedral construction kit — but instead he responded with a photo of his large collection of Red Juice connectors. After seeing the photo, I was genuinely worried for Cody’s well-being and what his dentist might have to say. But my concern for Cody’s health was soon outweighed by my excitement to begin the construction of a new rhombicosidodecahedron made from these edges!

What is a rhombicosidodecahedron?

A rhombicosidodecahedron is made of triangular (20), square (30), and pentagonal (12) faces. This animated gif (from Wikipedia) demonstrates the construction of one. First imagine placing a small explosive charge at the center of an icosahedron made by gluing triangles together — when the charge explodes, the faces blow outward. Then freeze time at the moment the shared edge of two neighboring triangles separates to a distance equal to one side of these triangles. Now connect these edges up again to form squares joining the triangles. At the same time, you will create 12 pentagons coming from where the vertices of the triangles used to be. The resulting solid is a rhombicosidodecahedron, and it is therefore no coincidence that it has the same number of triangles as the icosahedron, the same number of pentagons as the dodecahedron (the icosahedron’s evil arch-enemy), and the same number of squares as the number of edges on either of these polyhedra.

How many edges do we need?

Let’s find the number of connectors required to build such a structure, with the connectors acting as edges in the design.

  • 20 triangular faces (from icosahedron)
  • 12 pentagonal faces (from dodecahedron)
  • E squares, where E is the number of edges on either the dodecahedron or the icosahedron. Sometimes I forget this, but it can be obtained by Euler’s formula:

\( \chi=V-E+F=2,\)

where \(\chi\) is the “Euler characteristic”, which is 2 for all convex polyhedra. This means that the number of edges for either the icosahedron or the dodecahedron is

\(E=12+20-2=30.\)

So both the dodecahedron and the icosahedron have 30 edges, so the rhombicosidodecahedron also has 30 squares. Then the number of edges on the rhombicosidodecahedron can be computed by adding the total number of edges belonging to each face:

\(12\times 5+20\times 3+30\times 4=240,\)

but we have actually counted the edges exactly twice, since each edge is counted from both of the neighboring faces. This tells us that the rhombicosidodecahedron has 120 edges. Another way to compute the number of faces without needing Euler’s formula at all is to notice that every edge is a neighbor to either a pentagon and a square or a triangle and a square. So right away, the number of edges must be equal to

\(12\times 5+20\times 3=120,\)

which gives the same answer. In order to have a collection of 120 connectors, Cody must have consumed 240 Red Juices, since each connector holds two bottles. This comes down to about 180 gallons of juice. Granted, he has been collecting for quite some time now.

An interesting property of the rhombicosidodecahedron is that each vertex connects exactly four edges. I’ll talk about this later.

How to build the rhombicosidodecahedron?

While discussing our plan of attack, Cody brought up a concern: because these connectors would be stacked at the circular part that holds the neck of the bottle, some Red Juice connectors would stack in asymmetrical ways. That is, a particular connector might be stacked third-out from the center on one side, but only the first-out on the other side. Aside from the poor aesthetics of angled connections, this would lead to asymmetries in the final product, as some connectors would be skewed and therefore not extending their true distance. A mathematical question comes to mind: is it possible to connect these in such a way that there isn’t any warping? Above is an illustration of a single vertex, showing which layer each connector occupies. If one of these connectors is on a different layer on a neighboring vertex, there will be warping.

My solution to this problem was to reduce it to another common mathematical problem: edge coloring. Since each vertex has exactly four edges radiating from it, we can ask if there is a way to color the edges of the rhombicosidodecahedron with exactly four colors in such a way that no two colors are adjacent. In this way, each of the four colors represents one of the four layers. It is tempting at this point to exclaim that it can certainly be done according to the four color theorem, but unfortunately we cannot apply that immediately here, because we are coloring edges and not vertices of a graph. We could also try to use Vizing’s Theorem, which states that the chromatic index of a graph is either \(\Delta\) or \(\Delta+1\), where \(\Delta\) is the largest vertex degree of the graph. Unfortunately, this does not help us here, since our maximum vertex degree is already four, so we cannot say right away whether we can color our graph with only four edges.

I decided that since I would end up needing a constructive solution anyway, I might as well find one. I began with a planar projection of the rhombicosidodecahedron (as seen on the right), beginning from the center and working my way outward.

Occasionally, I would come to an edge where I simply could not give it any color; all of my four colors were already taken by neighboring edges. At this point, I would just decide on a color for the new edge, and fix whichever edge was now conflicting. After fixing this edge, there would be exactly one other edge with a problem. This created a cascading effect that was relatively managable because the number of areas did not branch off exponentially. I continued following the chain reaction, edge by edge, until the problem got pushed off to the frontier of the area on which I had been working, at which point there were no more problems remaining. It was then safe to continue. After a bit of tedious work, I was happy to find that the entire graph was properly colored, and no edges remained. I was left with this:

At this point, I couldn’t help but make a 3D model of this, so it would be easier to see how this wrapped onto the polyhedron:

The construction process

Finally Cody visited me and remembered to bring the Red Juice connectors. We purchased some cable ties to hold it all together.

Success!

Printing the impossible…in 3D

In light of my last post, I began thinking about other shapes I could 3D print using Shapeways. Since my last piece was somewhat flat, I decided to go for a more volumetric structure this time, and I was especially taken by the idea of a shape that links with itself. But I wanted to achieve this with a model made of one piece instead of a chain with jangling disconnected pieces — to create a seemingly impossible object with one contiguous ladder-like structure.

How might I create something like this? I was surfing YouTube one day and I came across this puppy:

This is the kind of structure I would like to make. Other people have also made linked mobius torus structures with varying materials:

  

I would like mine to be based on this shape but look more interesting. Like most problems I try to solve in mathematics, trying to make something more interesting usually is the same as trying to generalize it. When I try to generalize (say the concept of an equilateral triangle), I look for the following criteria:

  1. Is there a quantity inherent to the situation at hand that can be increased? (The triangle has three sides, but what would shapes look like with more than three sides?)
  2. Is there a constraint being imposed that we can remove to allow more interesting behavior? (What would it look like if each side need not be the same length?)
  3. Is there a context that the object is inherently using in its existence that can be modified? (The triangle is flat, but what if we allowed the triangle to live on a curved surface like a sphere?)

I began my design by constructing the basic shape with Mathematica. This consisted of a essentially toroidal shape given by the following parameterization:

However, I wanted the cross-section to be hexagonal, so this would mean I would need my parameter v to be discrete; I would need six samples in a full 2π rotation. On the other hand, my parameter u would also need to be discrete; I wanted to have 22 individual links joining across the piece. I wrote a little Mathematica program that would take my parameterization and would in turn write a “.txt” file to my hard drive. By changing the extension of this file to “.obj”, I obtained a three dimensional toroidal shape with a hexagonal crossection. However, this wasn’t exactly what I wanted. I needed to add a twist to the whole thing, akin to how one would add a twist in a mobius strip. However, since the crossection is hexagonal, we apply a 60˚ rotation as opposed to a 180˚ rotation. This corresponds to each side of the hexagonal structure meeting with its neighbor when the two ends of the strip meet. The next step was to open the result up in TopMod to see what it all looked like.

Notice the wrinkle in the face loop close to the front! This is understandable; I began with a torus, and performed a twist on the vertices appropriately to create the rotation. But if you start with a standard belt of paper, you can’t expect to twist it without breaking and end up with a mobius strip! Consequently, all of that twisting had to “pile up” somewhere, and this is exactly where I will cut each wrinkled edge, and reapply the edges appropriately. This creates a perfectly and evenly twisted mobius torus. The changes in this procedure are shown with semi-transparent regions; look closely and you’ll see the wrinkles vanish!

Now that we have a perfect mobius twist base, I used TopMod’s wireframe modelling mode to create a wireframe:

 Then I deleted the crossbeams and put in my own crossbeams, which went diagonally across instead of around the perimeter to create a sort of linking effect. I decided that the most natural way to do this would be to rotate the crossbeams cyclically as shown in the figure. First, I would place a beam between corners 1 and 4, then from 2 to 5, then from 3 to 6. At this point I would repeat, laying down another beam from 1 to 4.

Once I was through with that business, I decided that it didn’t look quite organic enough, so I wrote a separate Mathematica program that would take an arbitrary 3D model and warp it according to a mathematical function. I wanted my shape to look less like a standard torus and more like a melted one (Dali style). Without getting too technical, this involved taking the model, projecting every vertex down to the torus’s “base circle” (the closest point on the circle going around the torus) then warping this base circle, carrying all of the projections with it, and then exploding the vertices back outward again via a rotated basis to account for the rotation that had taken place in the warping map. The result of all of this mess was good enough for me to render using Blender, a free, open source 3D content creation suite:

After finally having a result that I liked (on my first try I realized that my first model had an error with the cyclic pattern of bridges), I couldn’t contain myself, so I immediately uploaded my model to Shapeways to have it printed in “Winter Red Strong and Flexible,” and a couple weeks later my model arrived via UPS!

Here is a video of my model spinning to reveal the geometry more clearly. The trick is that there is a fine fishing line being used to hold up the model from the ceiling.

An experiment in additive manufacturing

For a while I have been considering making 3D printed objects with interesting patterns and shapes, especially after seeing the work of Nervous System, which produces jewelry and other useful items modeled with algorithms (including reaction-diffusion):

 

My friend Britta and I were thinking about ideas for what I should make, and consequently what service I should use. We decided on Shapeways, a personalized fabrication service capable of printing 3D parts. They charge according to amount of material, so it made sense to produce something very small and light. Britta commissioned a reaction-diffusion necklace, inspired by the necklace shown above. Since I already had some working Mathematica code for generating reaction-diffusion systems, I modified the parameters slightly to create worm-like shapes that would interlock as much as possible, as the necklace would have to be made from a single connected component so it would not fall apart.

I was determined to produce this necklace in the most unusual and perverse way possible. I used Mathematica, Photoshop, and Blender to produce a 3D model of a small, flat object suitable for wearing. Here is an image of the resulting pattern:

Invariably, the result was not made of only one piece, so I broke the image into connected components using Photoshop’s paintbucket tool:

I chose the one that was both the most interesting and also of the best dimensions. I leave it as an exercise for the reader to determine which component I chose. After isolating this component in Photoshop, I saved the image as a black and white JPEG and imported it back into Mathematica, where I wrote a small program to use the darkness of each pixel to determine by how much to extrude the 3D object at that point. 

My first attempts generated objects that were much too large or small, but finally after much labor, I managed to come up with something that was not rejected by Shapeways. I came up with this one, 3.3 inches wide and eligible for printing:

Very vermicular. Britta and I chose the material called “White, Strong, & Flexible” since its price, strength, robustness and appearance sounded good for a practical first-try object.

I ordered it from Shapeways (along with two more copies so that we reached the $25 minimum), but a couple weeks later I received an email saying that the model could not be printed because some elements were too thin. Frustrating! I emailed a Shapeways representative, and we figured out that some of the “neighboring” tubes had thin membranes connecting them when they got too close to one another — these were thinner than the machine’s tolerance.

I fixed my model, resubmitted it, and we waited two more weeks. And one very exciting day, I received a small box containing the objects and gave one to Britta. She bought some waxed white cord and tied a couple knots to make the necklace:

Success! Some of my friends have been complaining that it is a bit too flat compared to the possibilities of 3D printing, so I am determined to continue my 3D modeling adventure. I already ordered the Shapeways materials sample kit which will allow me to explore what kinds of materials are available for printing, as well as giving me something to play with until I decide what to make next.

Visualizing the magnetic fields of “buckyballs”

You can think of a magnetic field as a collection of invisible fibers that fill space. These fibers are produced and deformed by magnets, and these invisible lines represent how other magnets placed inside the lines will experience forces from the magnets that originally produced these fields. The forces can be modeled with simple vector calculus because the magnets can be treated as dipoles.

I have 216 small spherical metal balls containing rare earth magnets, called “buckyballs” in stores. I decided to look at some of the simplest modular structures that can be formed with the buckyballs: 

Here is my visualization of the “fibers” of the smallest triangle formable:

The two by two square formed with four buckyballs:

The triangle used to build a buckyball “icosahedron” or ball-shaped object:

And the hexagon module used to build a snowflake: 

Other people also enjoy making complex shapes with buckyball magnets, such as these examples:

There are a lot more on Flickr.