Introduction: 3D Printing and CNCing Weird Freeform Lenses

About: Robb was once an Artist-in-Residence at Autodesk's Pier 9. they went to Carnegie Mellon to study Art. they mostly do tangible artifacts that are often complex. they can be reached at www.robb.cc

The world of optics and lens manufacturing has traditionally been closed off to non-experts. It doesn't have to be that way. Using rapid prototyping tools like 3D printers and CNC routers, making a lens is easier than you might think.

You can use the technique outlined in this Instructable to make very large lenses, lenses that produce special effects, and sculptural lenses with freeform shapes. You'll need to know how to use a CNC router or have access to a nice 3D printer. With one of the two you'll be able to start making lenses right away.


Background

I made my first lens while building a projector for a robotic sculpture. I built the sculpture's projector assembly myself and was unable to find a projection lens that fit my requirements. Every commercially available lens was either too small or too expensive. I decided to try making my own lens instead (though I knew almost nothing about optics). I found a hunk of acrylic plastic and used a 3-axis CNC router to mill it into a lens shape. The lens cast a slightly blurry image, but it worked!

Since then I’ve become obsessed with perfecting this technique. I developed best practices for cutting lenses on CNC routers, learned how to print optics on 3D printers, and created a polishing technique to increase optical clarity. Most recently, I used the facilities at Autodesk's Pier 9 Workshop to fabricate a series of face-distorting lenses for a public art festival. I hope that by sharing what I’ve learned I can inspire others to make their own optics.


Included:

  1. How to design a lens using ray tracing software
  2. A process for 3D printing lenses
  3. How to make lenses using a CNC router (an alternative to 3D printing)
  4. My process for polishing printed and milled lenses
  5. Some ideas for how to use a custom lens

Step 1: Designing a Lens

Designing good lenses is hard, but designing fun lenses is easy! It helps to see how a lens design performs before getting your hands dirty with real objects.

Ray Tracing

Luckily, computers are good at simulating lenses. You can use any 3D modeling package with a ray tracing mode to test out your lens before you fabricate it.

There are many software packages out there that do ray tracing, including some free ones. I chose Rhino and Neon. It costs money, but its T-Splines plugin makes it dead simple to design smooth lens geometries. The 90-day trial is enough for most projects.

Any modeling software with ray tracing will do. You could use Fusion 360, Blender, Maya or whatever else the kids are using these days.

Getting Set Up

Read a tutorial for setting up a ray-traced glass material in your program. The steps may vary depending on what software you use. I found a Rhino blog post and used that.

The setup for your lenses will be the same as for glass except for one thing: the index of refraction. It turns out that plastic bends light differently than glass so you need to tweak this value.

You'll need to change the index of refraction on your material from 1.52 (glass) to something more appropriate for your lens. If you're following my milling tutorial, use 1.49 (acrylic). If you're 3D printing with Vero Clear, use 1.63.

Designing

Now that you're set up, start applying the material to different geometries and see the results. Put a familiar object like a face in the scene as a point of reference. Sometimes it helps to start with a simple shape and deform it using sculpting tools. I threw together a short tutorial of my process with T-splines in Rhino here.

If you're mathematically-oriented you can try applying different functions to deform surfaces, or read up on the mathematics of light. If you're not, try sculpting a lens to achieve a goal like making a person's eyes look close together.

When you're sculpting the deformations get weird pretty quick. I'd recommend making subtle deformations before going crazy.

Here is a video that outlines the process.

Step 2: 3D Printing

If you want to 3D print a lens you'll need a nice printer. Most resin and stereolithography-based printers will have the resolution necessary. If you want to try with a filament(Makerbot style) printer, you are going to have to cast transparent resin, which is totally doable.

While there are many ways to make a custom lens, 3D printing is perhaps the coolest. You can export a 3D model of a lens and watch it print without too much planning or physical labor. Additionally, additive manufacturing allows for more complicated lens designs with undercuts and double-sided geometry.

However, this flexibility comes at the cost of expensive material and lower optical clarity.


My Experience

Here at Autodesk's Pier 9 Workshop, we're lucky to have access to an Objet Connex 500 3D printer. I used this photosensitive resin printer along with VeroClear transparent material to create many of the lenses for Smaller and Upside Down.

Printing was simple. I just pressed print and let the lens accumulate overnight.

Even on our fancy printer, however, the lenses ended up dull and striated with artifacts from the layer-based printing process. 5 hours of sanding and polishing (covered in step four) was required to make the lenses transparent. Even then, the printed lenses don't match the optical clarity of milled ones.

Other people have been 3D printing optics too. A few months after I started printing lenses on our Objet, the team at Formlabs made an excellent step by step guide for 3D printing a monocle. A cool startup called Luxexcel prints lenses professionally using specialized machines.

Step 3: CNC Milling

CNC machining is complicated. Every tool path you program has hundreds of options and you can never really know what is going on.

I have milled 12 lenses, and have gotten some nice results.

3-axis milling is done with a ball-end mill from a thick acrylic sheet. (1/2" in image)

For your router bit, bigger is better. The bigger the radius of the tip, the less severe your scalloping will be. I usually go with a 1/2" ball end mill.

I set the step-over to 0.02", meaning that a 12" lens takes 300 concentric passes to cut! This can take a long time. I'm not going to get super-specific in this instructable, but I'll list some specifics.

Speeds and feeds are from this document, I take off about .01"in /tooth at 12000 rpm.

I do my CAM in Fusion 360, which is the friendliest CAM software I have ever seen. Parallel finishing, morphed spiral, and spiral are great tool strategies.

Here is a link to my latest Fusion file with a great toolpath applied. It is for the Big Eyes lens, which makes your eyes large like a cartoon character.

Step 4: Sanding and Polishing

Printing or milling leaves a lens's edges full of imperfections that make it cloudy. You will need to sand down your lens's ridges and polish until it's glassy smooth.

This is hard, tedious work, but it's worth it. Good finishing makes the difference between a clear lens and a cloudy one.

Every time you think you are done with a sanding step, sand some more. You can't know if you have done enough until the very end of the whole process, hours later. :-/

Sanding

Start with rough sandpaper to remove streaks and go progressively smaller to remove detail. Apply all sandpaper wet. Follow these steps in order:

  1. 240 grit, sand until there are no visible stripes on the lens. This may take half an hour or more.
  2. 320 grit
  3. 400 grit
  4. 600 grit
  5. 1000 grit
  6. 1500 grit
  7. 2000 grit, sand until everywhere looks shiny while wet

Polishing

After sanding, polish with Novus 2 Smooth Plastic polish. I use a rag or a clean buffing wheel on a drill press. This speeds things immensely. Read this document for more information on polishing acrylic. I don't recommend flame polishing, as it can warp your lens.

Step 5: Use It!

Some ideas about what to do with your new lens-making power:

  1. Use magnifying lenses to enlarge your friend's head
  2. Create your own eyeglasses
  3. Make a camera obscura
  4. Design a lens that decodes a secret message (by un-distorting it)
  5. Make a prism

Step 6: Appendix: Learning Optics

When designing lenses, it helps to have a basic understanding of optics to guide your intuition. Below are some optics resources that I found helpful.

Refraction 101

A solid understanding of refraction is crucial for optical design. You can learn about it on Wikipedia or in any physics textbook. Salman Khan's video series on waves and optics is brilliant as usual. I love his analogy between waves and cars, embedded below:



Lenses in Photography

A tremendous amount has been written about the lenses used in cameras. The terminology used by photographers is slightly different from physics, but the concepts are the same. Understanding how camera lenses work can make it easier to design your own.

Step 7: Appendix: Lens Designs

Plano-Convex Lenses

Plano-Convex lenses are flat on one side and outwardly curved on the other. They are easier to make, as we can just have one side of our material remain flat, which makes sanding and polishing much easier.

You can create these sort of lenses parametrically using the thin lens equations. Luckily I've already done the work and you can use my lens model on Thingiverse as a starting point. (Needs work, I'll gladly take any edits to the OpenSCAD program)

All of the lenses from the gallery up top are here as IGES solids and as STL meshes. STLs are a pain to CNC, but great for printing.

Great Artists Steal

Inspired in part by my fellow Artists in Residence's success in borrowing McMater Carr parts and printing them, I noticed that Edmund Optics has most of their lenses available for IGES download. This saves you from having to do any math. Optics math is hard, Aspheric Optics math is hard for math majors.

Step 8: Installation + Interaction

Max and I built our lenses as an engaging public art project to try and turn strangers into friends.

Our first venue for installation was the Market Street Prototyping Festival.

We drilled small holes in the lenses and suspended them from strings. We slung them over a pipe and had the strings configured so the height of each lens could be adjusted. We put it on Market Street in San Francisco for the three days of the festival, and folks had a lovely time. The above video includes interviews and footage of folks interacting with each other through these weird lenses.