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 = name  if 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 Anisotropy    mode.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.
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Errors Running Ring Modulator Example on Cluster
- INTERCONNECT – No results unless rerun simulation until it gives any
- Import material .txt file with script
- Help for qINTERCONNECT
- Trapezoidal ring
- Issues with getting result from interconnent analysis script
- How to measure transmission coefficients on a given plane .
- Topology Optimization Error
- Absorption cross-section of AuNR excited by prism-based TIR
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.