-
-
Notifications
You must be signed in to change notification settings - Fork 126
how to load a gds file, flatten it, and extract all polygons #42
Comments
Hello @enuinc, Loading a GDSII file can be done with import gdspy
lib = gdspy.GdsLibrary(infile='filename.gds')
main_cell = lib.top_cell()[0]
pol_dict = main_cell.get_polygons(by_spec=True)
polygons = pol_dict[(layer, datatype)] Note that in the last line I assume you know the layer and datatype numbers you're after. If the polygons in the layer you want have different datatypes, you'll have to iterate over therm and append to the Also note there's no need to |
Hi |
@egholami Yes, that's the correct command! import gdspy
lib = gdspy.GdsLibrary(infile='filename.gds')
main_cell = lib.top_level()[0]
pol_dict = main_cell.get_polygons(by_spec=True)
polygons = pol_dict[(layer, datatype)] |
@heitzmann By any chance can we plot these polygons? |
@vandhanasiva Each polygon in the list is simply an array of N vertices (a |
Hi
Great software and appear to have all the things I need. However, I can not figure out how to load a gds file (not very big, about 2MB), flatten its hierarchy, and extract all polygons in a given layer.
I am sorry for such an elementary question.
Thanks
enuinc
The text was updated successfully, but these errors were encountered: