Mathematica Tea Light Holder

3D Design in Mathematica: Tea Light Holders

  • Written by Christopher Hanusa
    Nov 12, 2018
  • Category:
    / Education

Let me share the story of two tea light holders I created that were featured during the Construct3D conferences in 2017 and 2018.

Part 1: Holey tea light holder

Last year I created the holey tea light holder.

   

construct3d_2017

I was inspired by an example provided by the entry for RegionPlot from the Wolfram Documentation Center.

   

region_plot

We can think of this as only showing the tops of the hills on the graph of the function

z = sin(x) sin(y), shown here:

   

plot3D

I modified the image by removing the valleys of the landscape so that the region would be connected and I also rotated the holes to be diagonally oriented, which I did by applying the transformation (x,y)→(x+y,x-y):

   

region_plot

I then wanted to add in more complexity, which I did by applying a parabolic transformation. I also added in additional options to give better resolution to the holes.

   

regionPlot

Some algorithmic coloring led to the following piece of art:

   

art

Next I wanted to wrap this two-dimensional image around a unit cylinder with height π. So I first changed the function a little bit so that its bounds would work with the parametrization and also reduced the size of the central horizontal and vertical bands to better feature the holes.

   

regionPlot

We're now ready to wrap this around the cylinder and encode the holes with a RegionFunction command. We finish this model by adding a disk as the base and a ring to the top:

   

tea_light_holder

Click to view a 3D rendering on Sketchfab. You can download it at Thingiverse to print yourself.

Part 2: "Treelight" holder

This year I created the "treelight" holder, so named because it involves random binary trees.

   

construct3D_2018

This tea light holder is a generative sculpture. In other words, it was created using random numbers without complete knowledge of what the final object would look like. The sculpture was generated by way of five paths that emanate and branch out from the middle of the sculpture both upward and downward, forming a tree structure. An additional set of supporting braces was added to complete the piece.

We'll walk through the steps involved in the construction process. The basic principle for the branching structure is that at each level one special node branches into two and all nodes on either side of the special node are pushed outward. This way, one tree is completely determined by the sequence of special nodes at each level, which we generate for the upward branching tree and downward branching trees here:

   

boundsdown

The dynamics of the branching process are provided here:

   

pairsdown

And the following code visualizes this one double-growing tree through line segments.

   

allpairs

In order to give this tree depth, we use a ParametricPlot3D command for each line segment. This is in anticipation of the next step which involves curving the paths. An key construction is that we can parameterize every line segment by thinking of it as a linear interpolation between the two vertices. For example, if your points are (0,0,0) and (1,1,0), then the function

(λ,λ,0)=(1-λ)(0,0,0)+λ(1,1,0)

is a function that starts at the first point and ends at the second point. The following code applies a similar parametrization for every line segment given above.

   

show

Now we scale the tree horizontally and vertically and wrap it around a cylinder. The wrapping occurs by applying some trigonometry. If you travel a distance θ around a the boundary of a unit circle, you are in position (cos(θ),sin(θ)). We ensure that the radius of this tea light holder is 2 so we multiply the x- and y-coordinates by 2.

   

Adding trig

A quick Table command generates all five trees:

   

trees

We finalize the tree structure by adding spheres to the end of every line segment.

   

adding spheres

   

spheres added

To complete the tea light holder, we add in the base and curved rings that form the top and bottom of the piece:

   

base

I realized that the final result looked a bit sparse if I was going to put a tealight inside. I figured that the best way to rectify this would be to add in some bridges:

   

bridges

The file didn't print right, so I sent it to NetFabb repair, re-imported it into Mathematica, and resized it so that it was just the right size (50mm in diameter).

Import[NotebookDirectory[] <> "treelight.repaired.stl"];

Export[NotebookDirectory[] <> "treelightholder.stl", RegionResize[%, 50]];

Here is the Sketchfab rendering.

You can also download it at Thingiverse to print yourself. Do let me know how it looks!

Christopher Hanusa is a mathematician, mathematics educator, and mathematical artist. To learn more about his teaching, research, and art, visit his Queens College website. To learn more about his portfolio of 3D printed mathematical jewelry, visit: Hanusa Design.

Support