Surfaces in pyOpTools¶
The basic object to create optical components in pyOpTools are the surfaces. They are used to define the border that separates 2 materials (for example air-glass) in an optical component.
Below are some of the Surface Objects supported by pyOpTools.
[ ]:
from pyoptools.all import *
from numpy import pi
Plane Surface¶
The Plane surface is the most simple surface class in the library. It is defined as an ideal infininite
plane, located at
. To define the Plane limits, its constructor receives as an argument a sub-class of Shape. This sub-classes (Circular, Rectangular,
Triangular, etc ) define the limits of the Surface (plane in this case).
Some Plane examples¶
Below are some examples of Plane surfaces limited by different shapes.
[ ]:
P1 = Plane(shape=Circular(radius=(25)))
Plot3D(P1, center=(0, 0, 0), size=(60, 60), rot=[(0, 0, 0)], scale=6)
[ ]:
P2 = Plane(shape=Rectangular(size=(50, 50)))
Plot3D(P2, center=(0, 0, 0), size=(60, 60), rot=[(0, 0, 0)], scale=6)
[ ]:
P3 = Plane(shape=Triangular(coord=((0, 25), (25, -25), (-25, -25))))
Plot3D(P3, center=(0, 0, 0), size=(60, 60), scale=6)
Spherical Surface¶
The Spherical surface is another very useful Class to define optical components. It is used to define an spherical cap that has its vertex located at the origin (
). The normal to the spherical cap at
and
is the vector
. As it was the case with the Plane surface, it is used with a Shape subclass to define its edges.
Spherical surface limited by a circular shape example¶
[ ]:
S = Spherical(curvature=1 / 200.0, shape=Circular(radius=145.0), reflectivity=0)
Plot3D(S, center=(0, 0, 0), size=(400, 400), scale=1)
Cylindrical Surface¶
pyOpTools has 2 different types of cylindrical surfaces. The first one is the Cylinder , as its name implies defines a closed cylinder. It is mainly used to define the border of a lens. For example a plano-convex lens can be defined as one circular-limited plane, one circular limited spherical surface, and one cylindrical surface.
Below is an example of a cylindrical surface. Please note that this surface does not receive a Shape subclass.
[ ]:
S3 = Cylinder(radius=36, length=100, reflectivity=1)
Plot3D(S3, center=(0, 0, 0), size=(100, 100), rot=[(0, pi / 32, 0)], scale=4)
The second class is the Cylindrical.
[ ]:
S1 = Cylindrical(shape=Rectangular(size=(50, 100)), curvature=1 / 20.0)
Plot3D(S1, center=(0, 0, 0), size=(150, 150), rot=[(pi / 4, 0, 0)], scale=2)
[ ]:
S2 = Cylindrical(shape=Circular(radius=(50)), curvature=1 / 100.0)
Plot3D(S2, center=(0, 0, 0), size=(150, 150), rot=[(-pi / 4, 0, 0)], scale=2)
Aspherical Surface¶
[ ]:
%%latex
$$Z=\frac{(Ax*x^2+Ay*y^2)}{(1+\sqrt{(1-(1+Kx)*Ax^2*x^2-(1+Ky)*Ay^2*y^2))}}+ Poly2D()$$
[ ]:
sa = Aspherical(
shape=Rectangular(size=(5, 5)),
Ax=0.2,
Ay=0.2,
Kx=0.1,
Ky=0.15,
poly=Poly2D((0, 0, 0, 0.5, 0, 0.5)),
)
Plot3D(sa, center=(0, 0, 5), size=(10, 10), rot=[(-3 * pi / 10, pi / 4, 0)], scale=40)
[ ]:
sa = Aspherical(
shape=Circular(radius=2.5),
Ax=0.2,
Ay=0.2,
Kx=0.1,
Ky=0.15,
poly=Poly2D((0, 0, 0, 0.5, 0, 0.5)),
)
Plot3D(sa, center=(0, 0, 5), size=(10, 10), rot=[(-3 * pi / 10, pi / 4, 0)], scale=40)
[ ]:
[ ]: