TAGGED: Polygon Objects, python-scripting
-
-
October 25, 2024 at 9:35 amm.hoormannSubscriber
Hello,
I am trying to create a polygon with tilted sidewalls in python. I have adapted the script that is given as an example in the artical: Tips for adding sidewall angles to simulation objects – Ansys Optics
My python code does look like this:
name = "Angled WG"vertices_1 = np.array([[Epi["Total t"], -Data["Angled WG"]["w"]/2],[Epi["Total t"] + Data["Angled WG"]["t"], -Data["Angled WG"]["w"]/2],[Epi["Total t"] + Data["Angled WG"]["t"], Data["Angled WG"]["w"]/2],[Epi["Total t"], Data["Angled WG"]["w"]/2]])mode.addpoly()mode.set("vertices", vertices_1)vertices = mode.get("vertices")# print(vertices)mode.addlayerbuilder()mode.set("name", "WG")mode.set("geometry", {"1:0": vertices})mode.set("gds sidewall angle position reference", "Bottom")n_GaN = [n_e_GaN, n_o_GaN, n_o_GaN]material = nameif mode.getmaterial(name) == str("The material, " + name + ", is not available."):mode.setmaterial(mode.addmaterial("(n,k) Material"), "name", material)mode.setmaterial(material, "Anisotropy", 1) # Diagonal Anisotropymode.setmaterial(material, {"Refractive Index": np.array(n_GaN), "Imaginary Refractive Index": 0})mode.addlayer("WG Layer")mode.setlayer("WG Layer", "layer number", "1:0")mode.setlayer("WG Layer", "thickness", Data["Angled WG"]["t"])mode.setlayer("WG Layer", "pattern material", material)mode.setlayer("WG Layer", "sidewall angle", Data["Angled WG"]["angle"])The code runs, however, the polygon with the sidewalls is not created via the layer builder
Could you help me with fixing this issue?
Kind regards,
Matthias Hoormann
-
October 29, 2024 at 1:04 amKirillAnsys Employee
Hello Matthias,
It seems you are not able to complete the layer setting with
mode.set("geometry", {"1:0": vertices})
Try to usemode.set("geometry", {"1:0": [vertices]})
instead and see if it helps.
Also, since you're calculating the vertices yourself, you can pass them directly to the LayerBuilder without the need to create an extruded polygon.
Best regards,
Kirill
-
- You must be logged in to reply to this topic.
-
1051
-
447
-
374
-
225
-
201
© 2024 Copyright ANSYS, Inc. All rights reserved.