Save Layout Options Example
This example demonstrates how to use write
with options.
We read the output from the previous “Cheese” example and write it to a new file. In this case we will change the database unit and limit the number of polygon vertexes to 4. This generates a pretty blocky cheese:
Code:
import klayout.db as db
import math
ly = db.Layout()
ly.read("cheese.gds")
options = db.SaveLayoutOptions()
options.dbu = 0.01 # change database unit
options.gds2_max_vertex_count = 4 # fragment layout
ly.write("save_layout_options.gds", options)
Input cheese.gds
:
Result: