gplugins.klayout.dataprep.regions.RegionCollection

gplugins.klayout.dataprep.regions.RegionCollection#

class gplugins.klayout.dataprep.regions.RegionCollection(gdspath, cell_name: str | None = None)[source]#

A RegionCollection can load a GDS file and make layer operations on it.

It is a dictionary of layers with Region objects.

Parameters:
  • gdspath – to read GDS from.

  • cell_name – optional top cell name to edit (defaults to the top cell of the layout if None).

d = RegionCollection(gdspath)
d[LAYER.SLAB90] += 2 # grow slab by 2um
d[LAYER.SLAB90] -= 2 # shrink slab by 2um
d[LAYER.SLAB90].smooth(1000) # smooth slab by 1um points
d[LAYER.DEEP_ETCH] = d[LAYER.SLAB90] # copy layer
d[LAYER.SLAB90].clear() # clear slab150
d.write_gds("out.gds", keep_original=True)
__init__(gdspath, cell_name: str | None = None) None[source]#

Methods

__init__(gdspath[, cell_name])

get_kcell([keep_original, cellname])

Returns kfactory cell.

plot()

Plot regions.

show([gdspath])

Show gds in klayout.

write_gds([gdspath, top_cell_name, ...])

Write gds.