the fair gds editor FresnelZonePlateMacro

Fresnel Zone Plate Lens Macro

zone plate example design A zone plate is a device used to focus light. Unlike lenses however, zone plates use diffraction instead of refraction. Created by Augustin-Jean Fresnel, they are sometimes called Fresnel zone plates in his honor. The zone plate's focusing ability is an extension of the Arago spot phenomenon caused by diffraction from an opaque disc.

A zone plate consists of a set of radially symmetric rings, known as Fresnel zones, which alternate between opaque and transparent. Light hitting the zone plate will diffract around the opaque zones. The zones can be spaced so that the diffracted light constructively interferes at the desired focus, creating an image there.(from wikipedia)

Lens Generator Macro

This macro generates a such fresnel zone plate lens. The required parameter will be asked via a dialog. The shapes will be added to the active layer. An identical device is also available in the shape library.

Download: zoneplate.layout

   1 #!/usr/bin/layout
   2 #name=zoneplate
   3 #help=generate a fresnel zone plate lens
   4 
   5 int databaseunits(string s){
   6 // return database units of the string s
   7 int i;
   8 double convert=0.001; //default mm if no units;
   9 if (s.contains("mm")){
  10         convert=0.001;
  11         s.remove("mm");
  12         }
  13 if (s.contains("um")){
  14         convert=0.000001;
  15         s.remove("um");
  16         }
  17 if (s.contains("µm")){
  18         convert=0.000001;
  19         s.remove("µm");
  20         }
  21 if (s.contains("nm")){
  22         convert=0.000000001;
  23         s.remove("nm");
  24         }
  25 if (s.contains("cm")){
  26         convert=0.01;
  27         s.remove("cm");
  28         }
  29 if (s.contains("dm")){
  30         convert=0.1;
  31         s.remove("dm");
  32         }
  33 if (s.contains("m")){
  34         convert=1;
  35         s.remove("m");
  36         }
  37 double d=s.toDouble()*convert/layout->drawing->databaseunits;
  38 element e;
  39 i = e.round(d);
  40 return i;
  41 }
  42 
  43 int main(){
  44 string s;
  45 s=layout->getText("fresnel zone plate lens","Enter wavelength:","500nm");
  46 double lamda=databaseunits(s);
  47 s=layout->getText("fresnel zone plate lens","Enter focus:","1mm");
  48 double focus=databaseunits(s);
  49 s=layout->getText("fresnel zone plate lens","Enter radius:","100um");
  50 int radius=databaseunits(s);
  51 s=layout->getText("fresnel zone plate lens","Start with a shape at center?","yes");
  52 bool b=false;
  53 if (s=="Yes") b=true;
  54 if (s=="yes") b=true;
  55 if (s=="Y") b=true;
  56 if (s=="y") b=true;
  57 if (s=="Ja") b=true;
  58 int n=0;
  59 int r=0;
  60 int rLast=0;
  61 while (r<radius){
  62   n++;
  63   r=math::sqrt((lamda*focus*n)+(lamda*lamda*n*n)/(4));
  64   if (r>radius) r=radius;
  65   if (b){
  66     if (n==1){
  67         layout->drawing->point(0,0);
  68         layout->drawing->point(r,0);
  69         layout->drawing->circle();
  70     }
  71     else {
  72         layout->drawing->point(0,0);
  73         layout->drawing->point(0,rLast);
  74         layout->drawing->point(0,r);
  75         layout->drawing->polygonArc();
  76     }
  77   }
  78   b= (!b);
  79   rLast=r;
  80 }
  81 }

See also


CategoryMacro


FresnelZonePlateMacro (last edited 2011-02-24 19:15:23 by dslb-092-074-059-143)