TAGGED: inverse-design, Lumerical-FDTD
-
-
January 26, 2022 at 12:14 am
noumanzia
SubscriberHi,
How can I visualize the polygon in the python environment of Lumerical when I am making y splitter geometry. Should I use matplotlib to plot the polygon ?
January 27, 2022 at 8:59 pmTaylor Robertson
Ansys Employee
It is important to avoid any self-intersecting geometries, and so checking the shape of geometry is important. Using matplotlib is the easiest way. Something like the following python code would work for FunctionDefinedGeometry.
import matplotlib.pyplot as plt
...
def shape_function(params):
...
return polygon_points
...
points = shape_function(initial_parameters)
x , y =points[:,0], points[:,1]
plt.plot(x, y, 'b-')
plt.show If you are using ParameterizedGeometry then you will need to use lumapi to start a session and have the lumerical GUI draw the structure. Maybe copy your function to a new file, and add a main. That is what I would do anyway.
...
def func(params, fdtd_handle, only_update = True):
...
return
...
if __name__ == "__main__":
with lumapi.FDTD() as fdtd:
fdtd.eval('coupler;') #Set-up script in same directory
params = np.array([()] ) # Test params
func(params, fdtd) #Eval your function
input('Press enter..') #Wait so you can inspect the design
February 1, 2022 at 8:35 amnoumanzia
SubscriberThank you! I will check that and get back if there is still an issue.
Viewing 2 reply threads- The topic ‘Inverse design y branch visulizaing initial geometry’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3432
-
1057
-
1051
-
896
-
892
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-