Lumerical脚本——创建基本结构
一、矩形、梯形以及环形的构建
switchtolayout;
selectall;
delete;
um = 1e-6;
nm = 1e-9;
addrect();
set("x min",0);
set("x max",4*um);
set("y min",0);
set("y max",2*um);
set("z",0);
set("z span",2*um);
addpoly();
w1 = 2*um;
w2 = 3*um;
l = 2*um;
# 选取参考点
set("x",4*um);
set("y",0*um);
set("z",0);
set("z span",2*um);
# 以参考点为参考,选取顶点,顺时针创建
V=[0,w1;l,w2;l,0;0,0];
set("vertices",V);
set("material","SiO2 (Glass) - Palik");
addring();
# 选取参考点
set("x",6*um);
set("y",-2*um);
set("z",0);
set("z span",2*um);
set("inner radius",2*um);
set("outer radius",5*um);
set("theta start",0);
set("theta stop",90);
二、 S弯曲、90°弯曲及Y分支
2.1 S弯曲
switchtolayout;
selectall;
delete;
um = 1e-6;
nm = 1e-9;
# S弯曲
addwaveguide();
w = 2*um;
l = 4*um;
#选取参考点
set("x",0);
set("y",0);
set("z",0);
V = [-l,-w;0,-w;0,w;l,w];
set("poles",V);
set("base width",3*um);
set("base height",3*um);
set("base angle",45);
2.2 90°弯曲
switchtolayout;
selectall;
delete;
um = 1e-6;
nm = 1e-9;
# 90°弯曲
addwaveguide();
r = 6*um;
a = 0.6;
#选取参考点
set("x",0);
set("y",0);
set("z",0);
V = [0,r;r*a,r;r,r*a;r,0];
set("poles",V);
set("base width",3*um);
set("base height",3*um);
set("base angle",90);
2.3 Y分支
switchtolayout;
selectall;
delete;
um = 1e-6;
nm = 1e-9;
# Y分支
# 上半部分
addwaveguide();
l = 10*um;
w = 2*um;
#选取参考点
set("x",4*um);
set("y",2*um);
set("z",0);
V = [-l,-w;0,-w;0,w;l,w];
set("poles",V);
set("base width",1*um);
set("base height",1*um);
set("base angle",90);
# 下半部分
addwaveguide();
#选取参考点
set("x",4*um);
set("y",-2*um);
set("z",0);
V = [-l,w;0,w;0,-w;l,-w];
set("poles",V);
set("base width",1*um);
set("base height",1*um);
set("base angle",90);