Layer

GDS layer identity defined by a (number, datatype) pair.

Every polygon, path, and text element in a GDS file belongs to a layer. Layer encodes the two integers that GDS uses to identify layers: a layer number and a datatype. By convention, datatype defaults to 0.

silicon = Layer(1, 0)   # Silicon waveguide layer
metal = Layer(10, 0)    # Metal routing layer
text = Layer(100)       # Text annotations (datatype defaults to 0)

Layer objects are hashable and can be used as dictionary keys or in sets.

Attributes

attributenumberint

GDS layer number (0--999).

attributedatatypeint

GDS datatype (0--999). Defaults to 0.

Methods

func__init__(number, datatype=0) -> None

Create a new Layer.

Example

Layer(1, 0)   # Explicit number and datatype
Layer(1)      # Equivalent — datatype defaults to 0
paramnumberint

GDS layer number.

paramdatatypeint
= 0

GDS datatype. Defaults to 0.

Returns

None

On this page