Introduction: 3D Printing and CNCing Weird Freeform Lenses
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:
- How to design a lens using ray tracing software
- A process for 3D printing lenses
- How to make lenses using a CNC router (an alternative to 3D printing)
- My process for polishing printed and milled lenses
- 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:
- 240 grit, sand until there are no visible stripes on the lens. This may take half an hour or more.
- 320 grit
- 400 grit
- 600 grit
- 1000 grit
- 1500 grit
- 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:
- Use magnifying lenses to enlarge your friend's head
- Create your own eyeglasses
- Make a camera obscura
- Design a lens that decodes a secret message (by un-distorting it)
- 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.
36 Comments
1 year ago
so cool
Question 4 years ago on Introduction
the dropbox file is gone :( any chance you could upload it again? would be really appreciated!
thanks for the amazing tutorial
Answer 3 years ago
Sorry for the delay! I fixed it.
https://www.dropbox.com/sh/wzlsp1662yk1pnz/AAAbE2K_obMznVIzSgWkiTPTa?dl=0
Question 3 years ago
My 3D printer is being delivered in June. I was going to try to make some lenses to use to magnify the suns ray increasing the output on a solar panel. I got the idea from a clear magnifing sheet of plastic. It used concentric circles to produce the magnifing effect on a flat surface. Do you think that type of lens would work for my project?
Answer 3 years ago
Hi! That type of lens is called a Fresnel (pronounced freh-nell) lens. They are very precise objects that cannot be 3D printed due to the inability to get into the crevices to polish the surfaces. Most consumer printers are FDM, which use filament to make objects. These printers unfortunately cannot make lenses directly, as the resolution is too small and there are many small gaps in the object when printed. you would have to make a mold and cast your lenses out of resin or silicone. Another option is to use an SLA printer, such as the Form 3. Also, in order to increase the efficacy of a photovoltaic panel, your lens would have to me much larger than the panel. It would be much cheaper to buy a bigger panel, or to use mirrors.
https://en.wikipedia.org/wiki/Fresnel_lens
6 years ago
Wow. Thank you very much! I thought it is impossible and custom lenses are enormous expensive.
8 years ago on Introduction
So, this process could be used to make your own prescription lenses, if you have a current copy of your prescription?
Reply 8 years ago on Introduction
I am not certain, but my intuition is that the quality is too poor for that kind of application.
8 years ago on Introduction
WOW!!
8 years ago on Introduction
To help with the polishing process, you could make "tools". These are shaped to "fit" over the lens surface. For aspheric surfaces, you also need some sort of compliant layer. What I would do is cast Hydrocal plaster over the printed lens (after the first rough sanding). Put a piece of broomstick into the plaster to serve as a handle. After this is set, glue on some sort of foam for compliance, and then your sandpaper, cut in small squares. You work this "tool" over the lens, stroking toward and away from you, turning it a little each stroke (if the lens is rotationally symmetrical), as you slowly walk around the lens. (Mount it on a barrel so you can walk around it). The more aspheric the lens is, the more compliance you need (thicker foam). You can use loose abrasives and a cloth over the tool to finish up the polish.
The tool diameter should be about 5/6th the size of the lens, unless the curve is extremely aspheric. More aspheric surfaces finish better with smaller tools.
This process I describe is the one used to produce "real" lenses in industry. You can test the lens before it is fully polished by wetting it with soapy water.
The faceted convex lens can be polished with a tool 5/6ths the size of a facet, one facet at a time. This tool would want to be quite "hard".
8 years ago on Introduction
This is awesome! Try to enter in the 3D Printed Contest. I'll vote for you and I think you would earn a prize.
8 years ago on Introduction
Its sweet
8 years ago on Introduction
I've never tried it, but I would think you could do the same thing with clear casting resin. You could sculpt your lens shape out of modeling clay then cast a mold of that and then use the mold to cast your lens.
8 years ago on Introduction
Could this be adapted for a peephole on a door somehow?
Reply 8 years ago on Introduction
I haven't tried any multi-lens systems yet, but a giant peep hole would be pretty cool! I'm sure it is possible.
8 years ago on Introduction
I have been casting aspheric lenses in epoxy for some time now. I had dismissed the idea of CNC machining the blanks, but I see now that I'll have to give this a second look.
I am most impressed by your use of ray tracing software for optical simulation. I tried using POV-Ray for this, but I never found anyone else online that had described how they did it, and I never sorted out all the details myself. I should revisit this someday, too.
Reply 8 years ago on Introduction
Hey Noah, I added a video to the design step that might clarify the process i used a bit.
I never considered using epoxy, but I might give that a shot. I am ordering some optical silicone soon to play with that. The optics industry is starting to make squishy lenses for durability, and I want to see how they work.
Reply 8 years ago on Introduction
Yes! please send me some links and brand names that offer these products. This is something's I've been trying to find. I have been unable to find any optically transparent silicone or urethane rubbers except for the thick one-part crystal clear caulking used in fish tanks -- unsuitable for my needs. I need something I can cast with... I have come across a few of these rubber lenses in products like webcams and, once, in the 1D linear lens over the sensor array in a flatbed scanner.
My other unsolved challenge has been to find an easy and effective method for silverring plastic surfaces to make reflective lenses. I have cast some decent 12" parabolic reflector lenses, but I have not tried mirroring them yet. I'm going to experiment first with vapor deposition. After that I might try galinstan, although the examples I've seen hint that it works better as second surface mirror. The first surface always looks streaky and wer -- and it is wet since it stays liquid at room temperature.... Then I'll give the classic silver nitrate method a try, though I'm not sure if it works on plastic.
Reply 8 years ago on Introduction
I haven't tried it yet, but I am requesting samples of this silicone.
For mirroring, I intend to try this. They say it works on acrylic, but I haven't checked yet.
Add some images if you try some silicone! I'd love to see.
Reply 8 years ago
Yes, for high volume work, if you need a lot of identical lenses, you might consider printing a lens in reverse to form a mold. Then use your mold to cast lenses from epoxy or other resin. You'll need a vacuum chamber to degas to eliminate bubbles. A pressure chamber is also helpful. You can use either one alone or combine for super bubble free castings. If you are start with just one I'd go for vacuum -- It's easier to build a vacuum chamber than a pressure chamber.