Photonics

Photonics

Topics related to Lumerical and more.

Shifting structure along z-axis by scripting

    • noumanzia
      Subscriber

      Hello,

      How can I shift the structure in Lumerical along the z-axis through script. I have multiple layers which I want to sweep for some variable and in each sweep I want to shift it along the z-axis with some offset value. I can also do that while making the geometry but is this possible to make the structure all at once and then shift the whole along z-axis offset.

      I found one way by forming the group and shifting and then breaking the group but there is no break group script command.

    • Guilin Sun
      Ansys Employee
      If you are sweeping the structure, the best way is to layer the structure. suppose you have thickness parameters d1,d2,d3, and begins from z0, then you know that
      for layer 1, zmin1=z0, zmax1=zmin1+d1;
      for layer 2, zmin2=zmax1,zmax2=zmin2+d2
      for layer 3, zmin3=zmax2, zmax3=amin3+d3
      therefore, you can use "setnamed" to set their parameters:
      setnamed("layer1","z min",zmin1);
      setnamed("layer1","z max"zmax1)
      setnamed("layer2","z min",zmin2);
      setnamed("layer2","z max"zmax2);
      setnamed("layer3","z min",zmin3);
      setnamed("layer3","z max"zmax3);

      So what you need to define is d1,d2,and d3 in structure group, and then you can sweep di so the structure will change automatically since the thicknesses are built-in for the layers. You can do a simple test by sweep 2 points.
      In this way, you can simultaneously sweep all of them, or nested sweep them without any issue.
      If the script is broken, you will need to check what line it breaks and what is the cause, for example by use questions mark:
      ?d1;
      ?zmax2
      etc to find which is wrong .

      If you want to break the script, you should be able to use "break". break - Script command

Viewing 1 reply thread
  • The topic ‘Shifting structure along z-axis by scripting’ is closed to new replies.