Skip to content

The lib is used to study the ideal behavior of metasurface. For classic optics, there are good ray tracing python libraries that support classic optics, like RayTracing (https://github.com/DCC-Lab/RayTracing#raytracing) and rayoptics (https://ray-optics.readthedocs.io/en/latest/).

License

Notifications You must be signed in to change notification settings

airPeter/meta_rayoptics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray tracing for 2D ideal metasurface

Support3 optical elements: freespace, pupil and ideal meta-lens.
Will support arbitrary phase modification in future.
No installation needed. copy the MetaRay directory to your code dir or add the absolute path of MetaRay to your sys.path.
No paraxial approximation, large NA is supported.

Example: ideal flat lens with oblique incidence.

metalens_visualize_optical_path.png

import sys
#module path: the absolute path of the MetaRay directory.
module_path = 'C:/Users/94735/OneDrive - UW-Madison/My Projects/meta_rayoptics/'
sys.path.insert(1, module_path)
from MetaRay import *
import math

optical_path = OpticalPath()
#propagate distance
optical_path.add(freespace(d = 30))
#focal lens and aperature radius
optical_path.add(meta_lens(f = 20, r = 20))
optical_path.add(freespace(d = 30))

radius = 30
N = 30 # number of rays.
y = np.linspace(-radius, radius, N)
theta_deg = 15 
theta = np.ones((N,)) * math.radians(theta_deg)
ray_in = Ray(y, theta)
ray_out = optical_path.run(ray_in)

optical_path.vis_path(y_lim = [-radius * 2, radius * 2])

About

The lib is used to study the ideal behavior of metasurface. For classic optics, there are good ray tracing python libraries that support classic optics, like RayTracing (https://github.com/DCC-Lab/RayTracing#raytracing) and rayoptics (https://ray-optics.readthedocs.io/en/latest/).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages