Computer Aided Contact Lens
Design & Fabrication Based on Spline Mathematics*
BY BRIAN A. BARSKY, PH.D.
APR. 1996
Dr. Barsky is a professor of computer science and an affiliate professor of
optometry and vision science at the University of California at Berkeley. He is a member of the Bioengineering Graduate Group.*patent pending
Powerful mathematics could be the tool that enables the contact lens industry to provide the most sophisticated lens designs yet.This is an article about lens design and manufacturing not keratoconus, but as someone with unilateral keratoconus, I have struggled for years with different contact lenses that have consistently compromised the epithelium of my cornea. The severity has ranged from superficial punctate keratitis to full thickness corneal erosions.
At first I was told that such problems were due to hypoxia, but since the breaks in the epithelial surface were at the apex of the cone, it seemed to me that a more likely culprit was the pressure and especially the rubbing of the contact lens against the apex. Thus began my quest for a contact lens that would vault the apex of the cone.
As lens after lens disrupted my epithelium, I began to ask the clinicians if each new lens had clearance at the apex; but each lens demonstrated some bearing. It became apparent that obtaining a lens that would vault the apex of the cone was a difficult goal. This seemed surprising to me.
CURVES AND SURFACES
Ironically, my primary field of research for almost 20 years has been the mathematical specification of curves and surfaces. Thus, it was natural for me to apply those principles to this problem. From that perspective, this is an issue of geometry: What is the precise shape of a patient's cornea and how can techniques be developed to design and fabricate a contact lens whose form will accommodate that shape? This is a broad question, encompassing a wide range of issues including how to obtain, process and display corneal topographic data. My investigation of these issues began by examining the state-of-the-art in the geometry of contact lenses.
Currently, the most complex posterior surface designs of a contact lens are based on two or three surface zones. They are usually spherical or sometimes aspherical. Although "aspherical" literally means "not a sphere," this term is used in the contact lens field in a more limited sense, referring only to surfaces of revolution of conic sections or toric surfaces. Although these simple designs of the posterior surface might be adequate for many corneas, they are too limited for the more complex shapes such as those found in keratoconic or postsurgical corneas. Now I understood why it had been so difficult to obtain a contact lens to vault the apex of my cone!
More powerful mathematics is needed. There are many aspheric representations of curved surfaces that are more sophisticated than the conic/toric geometry. These surfaces occur in applications as diverse as biomedical imaging, automobile bodies, naval architecture, airplane fuselage and airfoil designs, turbine engine blades, bottles and shoe lasts. What is common to these applications is the need to represent very complex and general irregular shapes in a very precise manner.
Automotive design is a prime example. The smooth, flowing shapes of some recent stylish luxury automobiles such as the Infiniti J30, the Lexus SC 400 and the Aurora/Riviera must be precisely specified for engineering analysis and manufacture. It would be impossible to adequately represent these forms if we had only conic/toric geometry available in our mathematical toolbox.
SPLINES
What kind of mathematical formulations could we use to represent curves and surfaces if we look beyond conic/toric geometry? A relatively simple example is a polynomial, but a polynomial can have some undesirable properties such as excessive oscillations. One of the most suitable mathematical formulations comes from the theory of splines. Splines provide a rich set of potential curves and surfaces which have wonderful flexibility and generality, and are capable of representing very complex shapes.
The car body illustrated in Figure 1 was designed in 1978 on an interactive computer-aided geometric design system that I developed at that time. It seems fair to say that this car more closely resembles a 1995 Riviera than a 1978 automobile. The smooth, aerodynamic surface design was facilitated by the use of spline mathematics.
What is a spline? Before there were mathematical splines, there were physical splines. The physical spline is a flexible plastic or wooden lath used by a draftsperson to produce a smooth curve through a set of points. This can be mathematically modeled resulting in a formulation known as the natural cubic spline. An important property of this representation is that it produces curves and surfaces that are "smooth" or "pleasing."
Although the natural cubic spline is probably the most common spline form, it is really the "vanilla" flavor of splines insofar as it lacks many desirable features of other spline forms. There is a wide variety of splines, each possessing advantages and disadvantages.
The one salient attribute of all types of splines is their piecewise nature. Rather than defining an entire curve or surface by a single mathematical expression, the shape is subdivided into separate pieces, each possessing its own mathematical specification. With this subdivision, there must be an associated set of constraints that controls the assembly of the elements into a coherent form. Such constraints generally address the issue of "smoothness" of the curve or surface.
Splines provide a mechanism by which the smoothness between adjacent zones can be accurately specified. The pieces must be mathematically "stitched" together with complete mathematical specification and fine precision so that where they join is imperceptible. I coined the term geometric continuity for mathematically modeling such smoothness. This investigation has been my primary field of research for many years.
Having derived specific constraints to represent geometric continuity, I developed the Beta-spline formulation which possesses shape parameters that can be used in a geometric modeling system. By adjusting the values of the shape parameters, a designer can use them as additional means for shape control and produce predictable and intuitive changes in shape. Figure 2, a computer-generated image of five pewter goblets, illustrates the shape change that results from interactively adjusting a single shape parameter. This precise control over the degree of flattening of the surface shape could be very useful in both rigid and soft contact lens design. We use similar ideas to control the flattening of the transition zone of a contact lens, which will be described later.
Similar concepts formed the underpinning of the derivation of the spline developed in DeRose and Barsky, 1988. This technique was used to create the baby (Fig. 3) in Pixar's computer-animated film "Tin Toy," which won the Oscar for Best Animated Short in 1988 and was a precursor to their recently released feature film "Toy Story." The flexibility and precision of spline mathematics has made it the method of choice in creating synthetic images in computer graphics.
A mathematical model of complex shape is a powerful tool. The model forms the basis for computer algorithms and software that could revolutionize the contact lens industry. This would enable clinicians to truly design contact lenses to fit a patient's cornea, instead of the present approach that forces a patient's cornea to adapt to one of a fixed set of spherical or conic/toric contact lens designs. With the new fitting approach proposed here, the lens would be custom-made based on the patient's corneal topography. This approach could even be automated as we develop a deeper understanding of fitting techniques.
RESISTANCE TO THIS TECHNOLOGY
There is some resistance to such ideas, as is often the case with new concepts. It took the automotive industry more than a decade to embrace spline technology, so this feels like déjà vu. Let me address some of the common arguments:
- This mathematics is too complicated. Just because the mathematics is more powerful does not necessarily imply that the fitting procedure will be more complicated. On the contrary, good spline algorithms can do some of the work, thereby creating a simpler yet more precise fitting process. Clinicians will not need to know the mathematics any more than a person needs to understand the workings of an internal combustion engine to drive a car.
- This requires precise information about the corneal contour. Even with nothing more than standard slit lamp biomicroscopy, a clinician can be stymied trying to fit an irregular cornea using the contact lenses available today. Spline mathematics enables the design of a wider range of shapes than would otherwise be possible.
- Corneal topography devices don't provide adequate data. Although there are some deficiencies in the state-of-the-art in corneal topography devices, this technology is still in its infancy, has already made great strides in only a few years, and will undoubtedly improve significantly in the future. My colleagues and I at U.C. Berkeley have developed a new algorithm for videokeratography which seems more reliable than those found in current videokeratographs.
- More complex posterior surfaces will mean that the optics will be too difficult to determine. We have derived a technique that yields the anterior surface required for given optics and general complex posterior surfaces.
- Complex surfaces are only relevant for rigid lenses. Hydrogel lenses drape over the cornea and result in poor optical surfaces for irregularly shaped corneas. Spline mathematics would allow the determination of surface shape so that the hydrogel lens placed on the cornea would provide optical correction.
- These complex shapes can't be fabricated. Although this is the case for many manual lathes, CNC (computer numerical control) technology can produce general irregular complex surfaces. Computer-controlled machining moves a cutting tool along a path on a part according to a mathematical model.
- Making custom shapes is impractical and costly -- "one size fits all" is the only economical method. The advent of CNC machining shatters some of our deeply held beliefs about manufacturing and should cause us to rethink them. In the traditional manufacturing process, the notions of mass production and economies of scale are predicated on the assumption of producing many identical copies of a product, but these ideas date from the industrial revolution. Nowadays, automobiles are manufactured efficiently despite the fact that each one that rolls out the factory door has a unique permutation of a dizzying array of options. Levi Strauss & Co. is experimenting with such mass customization by manufacturing their pants to their customers' measurements. With CNC, each contact lens can be automatically produced to custom specifications; the computer simply uses the particular set of values of the parameters of the mathematical model for each unit. Concerns about minimizing the number of different stock keeping units (SKUs) could be a thing of the past by embracing concepts of just in time manufacturing.
These last two points are interesting for the following reason. Not only do CNC machines enable the fabrication of complex surfaces, and the variation from one unit to the next, but they require that a powerful mathematical model such as the spline be used. In the evolution from traditional manual machining to automated CNC technology, all details must be specified completely and precisely. Splines provide an ideal mechanism for this.
EXAMPLES
The problem of discontinuities at the junction between zones of a contact lens is addressed by polishing; however, this process alters the specifications of the surface shape in an unknown, unpredictable and unrepeatable way. This new spline method replaces the discontinuous junction with a specially designed transition zone inserted between the two zones, with the important property of joining both zones smoothly. Furthermore, we can precisely quantify the degree of smoothness where the transition zone joins each adjacent zone.
Mathematically, the geometry of a conventional lens surface, at a junction, will be discontinuous in slope or curvature. Usually, the adjacent zones are both spherical, but of different radii, and the centers of curvature lie along the axis of symmetry of the lens (Fig. 4). This results in a discontinuity in slope and curvature at the junction. In the more complex case where one relaxes the constraint of coaxial centers of curvature, it is possible to achieve a continuous slope. It is a common misconception that a continuous slope is always sufficient for smoothness. Note, however, how the curvature will necessarily remain discontinuous at the junction.
Consider two conic (elliptical) zones, both shown in green in Figure 5(i). Our system automatically replaces the discontinuous junction with a smooth, spline-blended transition zone. In keeping with the spirit of shape parameters illustrated by the goblets in Figure 2, both the "width" and "flatness" of the zone can be independently controlled by the user, if desired. Our system allows these parameters to be adjusted interactively and displays the resulting shape in real time. Figures 5(ii)-(iv) show several possible transition zones; for illustration purposes, the new transition zones are shown in yellow. In each of these three figures, there are three alternative transition zones corresponding to different "flatness values." Figures 5(ii)-(iv) show small, medium and large "width" transition zones, respectively. In all cases, this transition zone is guaranteed to maintain continuous slope and curvature with the adjacent zones. In Figure 5(v), the transition zone is shown in the same color as the adjacent zones, illustrating that one cannot detect where the transition zone joins its neighboring zones. In light of the resistance mentioned above, I was gratified to see such ideas given credibility in a recent clinical study by Rosenthal and Cotter even though their technique has no shape parameters or curvature continuity.
The spline model may also be used to design the edge of the contact lens. Since edge design is critical for comfort, this is an important application. Figure 6 shows the design of a spline edge; the shape is specified by a mathematical description that is complete, precise and repeatable. In this example, the edge is guaranteed to maintain continuous slope and curvature with the peripheral curve of the posterior surface as well as with the anterior surface.
We have been developing a software system that designs the entire contact lens exclusively with splines.
A VISION OF THE FUTURE
The development of computer algorithms and software, in concert with the explosion in computer processing power at consumer-level pricing will have profound effects on the methodology used for the future design and fabrication of contact lenses. To gain some perspective, note that the image of the automobile body shown in Figure 1 was computed in 1978 on a DEC PDP-11/50 that had 64 kilobytes of main memory, was larger than a refrigerator, and had to be housed in an air-conditioned environment. Today, I could perform these calculations easily on my laptop computer.
Microprocessors will become ubiquitous. CNC machines and computer-based corneal topography devices will probably be commonplace. These systems will be linked via computer networks on the Internet. Patients could have their corneal topography analyzed in one location and a contact lens could be fabricated simultaneously at a remote location. Both the corneal topography and the contact lens design could be displayed on the computer screen. Figure 7 illustrates a pilot system for such a multi-window display.
Since corneal analysis devices use a video camera attached to a computer, clinicians and researchers in remote locations could also share the video data. The development of compression techniques and real time display of video over networks for such applications as interactive television, video on demand and video conferencing could also be exploited to enable inexpensive distribution of corneal data to clinicians consulting from remote locations. Software implementing novel, collaborative multimedia paradigms will allow groups of clinicians to review patient data and reach team decisions on patient care.
There are many potential applications for splines in contact lens design and fabrication. For patients whose vision cannot be corrected satisfactorily with spectacles and who cannot be fitted successfully with contact lenses, the only remaining alternative today is penetrating keratoplasty. Being able to design and fit more complex-shaped contact lenses -- both rigid and soft -- will enable practitioners to offer some of these patients vision correction with contact lenses instead of surgery. Even relatively expensive contact lenses would be viable when compared to the costs and risks of surgery.
Ironically, the patients whose vision cannot be adequately corrected by spectacles but who instead need contact lenses are often the same ones whose corneas are the most challenging to fit. This can occur for astigmatism that is severe or irregular (non-orthogonal) and any corneal distortions that might arise from keratoconus, pellucid marginal degeneration, ectasia such as keratoglobus, posttrauma, micropsia, pterygium, and scarring from ulcerative keratitis. This is also the case for postsurgical corneas including PK grafts and corneal refractive surgery failures. There are about 40,000 PK grafts performed each year in the United States, a quarter of which are left with irregular astigmatism. Last year, there were over 250,000 RK procedures performed in the United States, and with the FDA's recent approval of PRK, there is a potential for millions of patients to undergo this procedure.
In cases where corneal refractive surgery does not result in satisfactory visual acuity, the postsurgical cornea is left with a shape that is difficult to fit with current contact lens designs. Furthermore, many of these patients experienced discomfort from contact lenses prior to surgery and consequently would prefer hydrogel lenses rather than rigid lenses, yet present day soft lenses do not provide satisfactory optical correction. Regardless of the source of the problem, these corneas have complicated shapes which are not served well by current methods of contact lens design and fabrication. Fitting the complex shapes of these corneas would be greatly facilitated by spline-based contact lenses.
Only 18 percent of people who require visual correction wear contact lenses. More sophisticated lens designs and fabrication techniques will improve comfort, fit, corneal health and visual acuity and could provide suitable contact lenses to new patients as well as to dissatisfied former contact lens wearers.
I hope that in the future the contact lens field will incorporate spline mathematics, computer-based corneal topography devices, CNC machining and computer networks to provide sophisticated contact lenses that will help people overcome some of their difficult vision problems. CLS
The author would like to thank Irving Fatt, Ph.D., Jerome A. Legerton, O.D., M.S., Robert B. Mandell, O.D., Ph.D., Sheldon Wechsler, O.D., and his students Dan Garcia, Hye-Chung (Monica) Kum, Roger Kumpf, Jonathan Kung, Vivek Verma and Zijiang Yang.
Dr. Barsky's e-mail address is: barsky@cs.berkeley.edu
WWW home page: http://http.cs.berkeley.edu/~barsky/
References are available upon written request to the editors at Contact Lens Spectrum. To receive references via fax, call 1-800-239-4684 and request Document #12. (Be sure to have a fax number ready.)