How to build parametrized structure using a script?


#1

hello people!!

I have a question. I need to build some very big structure but I know the parameters it should change from one to another. For instance: one structure is in (0.0) coordinates the next one should be (200,0) and rotated according the formula which depends on coordinates… and so on. So I need to do some script to fill the huge area with that objects. I tried to do it manually but it’s too much work.


Constructing Setup/Analysis Script using script commands
#2

Hi @dmitry.lev,

I’m taking the example of the photonic crystal array to show you how to adjust the design parameters using structure group and script command. You can insert the photonic crystal array with a hexagonal lattice (hex_pc) in the Object Libray on the right side of the FDTD Solutions window as you can see the below image.

The interdistance (a), origin, rotation of the hex_pc can be modified using “select” and “set”" commands in a controlled way as follow.

select('hex_pc'); %select the 'hex_pc' structure group
set('x',0); %set the origin of the array in x-axis
set('y',0); %set the origin of the array in y-axis
set('z',0); %set the origin of the array in z-axis
set('a',0.25e-6); %set the spacing between neighboring structures
set('first axis',2); %set the rotation axis: 1-none, 2-x, 3-y, and 4-z axis
set('rotation 1',90); %set the rotation angle for x-axis

I hope this can be a helpful guidance for you. If you have any question, please let me know.