################### # Example 1: circle ################### R = 1e-6; # radius res = 100; # number of points used for circle x = R*cos(linspace(0,2*pi,res)); y = R*sin(linspace(0,2*pi,res)); V = [x,y]; add2dpoly; set("name","2d circle"); set("vertices",V); ################# # Example2: ring ################# Rin = 0.5e-6; # inner radius Rout = 1e-6; # inner radius res = 100; # number of points used for circle xin = Rin*cos(linspace(0,2*pi,res)); yin = Rin*sin(linspace(0,2*pi,res)); xout = Rout*cos(linspace(0,2*pi,res)); yout = Rout*sin(linspace(2*pi,0,res)); V = [xin,yin; xout,yout]; add2dpoly; set("name","2d ring"); set("vertices",V); ########################### # Example 3: circular hole ########################### x_span = 4e-6; # x span of structure y_span = 4e-6; # y span of structure R = 0.5e-6; # radius of hole x = R*cos(linspace(0,2*pi,res)); y = R*sin(linspace(0,2*pi,res)); V = [x,y; x_span/2,0; x_span/2,-y_span/2; -x_span/2,-y_span/2; -x_span/2, y_span/2; x_span/2, y_span/2; x_span/2,0]; add2dpoly; set("name","2d circular hole"); set("vertices",V); ######################## # Example 4: cross hole ######################## x_span = 2e-6; # x span of structure y_span = 2e-6; # y span of structure W = 1e-6; # width of arm L = 0.4e-6; # length of arm x = [W/2;L/2;L/2;-L/2;-L/2;-W/2;-W/2;-L/2;-L/2;L/2;L/2;W/2]; y = [L/2;L/2;W/2;W/2;L/2;L/2;-L/2;-L/2;-W/2;-W/2;-L/2;-L/2]; V = [x,y; W/2,0; x_span/2,0; x_span/2,-y_span/2; -x_span/2,-y_span/2; -x_span/2, y_span/2; x_span/2, y_span/2; x_span/2,0; W/2,0]; add2dpoly; set("name","2d cross hole"); set("vertices",V);