GDSII Import Issues



I have been attempting to calculate losses in bends of different geometries using mode monitors in 3D FDTD for the past few days.

I have run into an issue where if I use the gds import function in the scripting language (or manually for that matter) the index is automatically set to that of the background EVEN if a material is supplied. This can be updated manually afterwards but it is a significant issue as I have a large number of monitors and it is not really possible.

If I follow the standard syntax from the scripting language as given on the documentation page
gdsimport(“filename”, “cellname”, layer, “material”, zmin, zmax);
the material is set correctly but the index is still defined as background, this follows from the script given if you manually import the gdsii
if(%material%==‘Object defined dielectric’)

set(‘z span’,%z span%);

What is even more odd is that if you manually set the index, ie
gdsimport(“filename”, “cellname”, layer, “material”, zmin, zmax);
set(“index”, 2.5)

the index is set in the generated object but it makes Zero difference to the meshed field and calculated values.
After finding this I tried to see if there is a remove command which is the equivalent of set in the scripting interface, but apart from deleting the entire object I couldn’t see any commands for removing parameters from an object.

If anyone has got around this issue before I would be very interested to hear how, it kind of breaks the gdsii import through the scripting interface for the situation I have which I would have expected to have been noticed by now.



I got around this issue using the layer builder system instead of the gdsimport. It requires a bit more tweaking but it didnt have this index issue, if anyone is interested grab the required terms out of the layer builder script file on
If you don’t add a substrate layer you will have just the gdsii, giving an equivalent result to gdsimport but more flexibility of initial placement and also it works!



Hi @blair_morrison,

If you write and run the command line, [quote] gdsimport(‘GDS_export.gds’,‘Substrate’, 1); [/quote]
then, you can confirm the created structure group for the gdsimport function as below.

After mouse right click on the “GDS_LAYER_1” and select “Edit object”, you can observe the “Edit structure group” as seen following image.

This pre-defined “Edit structure group” consists of input parameters (index, mater, z span) in Properties tab and scrip commands line in Script tab. Because this stucture group already contains the pre-defined script command, you don’t need to re-write the script commands as below.[quote=“blair_morrison, post:1, topic:1299”]
if(%material%==‘Object defined dielectric’)
set(‘z span’,%z span%);set(‘z’,0);

After you use the gdsimport command, you can just modify the input pameters such as material, z-position, thickness of the materials (z span). If you want to create a Si layer having a 1um thickness based on the gdsimport command, you can write down commands as below (same script commands in KB contents).

Or, if you want to create some material with a refractive index 2.5 having a 2um thickness based on the gdsimport command, you can put down the script commands as below,

gdsimport(‘GDS_export.gds’,‘Substrate’, 1);
set(“z span”, 2e-6);
set(“index”, 2.5)

Please let me know if you have any questions or suggestions.

Thank you.



I’m glad to hear that the layer builder works well for you.

Just to clarify about how the “addimport” method works, the specified value for the “index” property is only used when the “material” property is set to “object defined dielectric”.

For example, if you used the following command and loaded a substrate structure with glass material:
gdsimport('GDS_export.gds','Substrate', 1,"SiO2 (Glass) - Palik",-0.5e-6,0.5e-6);

Then to change the refractive index of the object to 2.5 you would use the following commands:

set("material","<Object defined dielectric>");


Thank you both for your comments.

To expand on the issue I was having for clarity for other users; I am working with a script which automatically defines a geometry (either with gds or input parameters), places FDTD domain and monitors and looks for at a number of different modes. Having to manually edit the generated objects is not suitable in this case. For these simulations I am using an object defined dielectric based on imported values from some experimentally measured values.

@nlui What I found was that even if I did what you mentioned above [quote=“nlui, post:4, topic:1299”]
set(“material”,"<Object defined dielectric>");

the modesolver still seemed to use the background index for finding appropriate modes for source and monitors. I could see that in the generated object the index was changed however the when looking at the geometry while manually finding the mesh in the modesolver it only showed a uniform index.

In either case using the layer builder seems like a viable alternative and it has more options for relative gdsii placement anyway.

Thank you both again for your answers.
@nlui I havent used this knowledge board very much, can you comment on how you set the code to be greyed and different from the rest of the body text?



Hi @blair_morrison,

If you want to use the text with a grey backround, you can simply put down the below code:

Regarding the bbcode, you can refer to the Starting with KX - Step 3: Write your post or bbcode website.

Thank you.