KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

About Layer Sources

KLayout implements a concept of "layer views". The layer list is made up of such layer views. A "view" is basically a specification of what is shown how. The "how" part is given by the colors, stipples, styles etc. The "what" part is given by the source specification.

The most important part of the source specification is the layer number or name. But the source specification is much more powerful. Basically the source specification offers the following capabilities:

Specifying the source layer

The source layer specifies from which actual data layer to take the drawn shapes from. The most simple form of a source specification is "layer/datatype" (i.e. "5/0") or the layer name, if an OASIS layer name (or a named layer in general) is present. This specification can be enhanced by a layout index. The first layout loaded in the panel is referred to which "@1" or by omitting this specification. The source specification "10/5@2" therefore refers to layer 10, datatype 5 of the second layout loaded in the panel.

Source specifications can be wildcarded. That means, either layer, datatype or layout index can be specified by "*". In this case, such a layer view must be contained in a group and the group parent must provide the missing specifications. For example, if a layer is specified "10/*" and the parent is specified "*/5", the effective layer looked for will be "10/5". Unlike the behaviour for the display styles, the children override (or specialize) the parent's definition in the case of the source specification.

For more information refer to Removing And Adding Layers To The Layer Set.

Transforming the layout

A geometrical transformation is specified by appending a transformation in round brackets to the layer/datatype source specification.

For example, "(r90)" specifies a rotation by 90 degree counter-clockwise. "(0,100.0 m45 *0.5)" will shrink the layout to half the size, flip at the 45 degree-axis (swap x and y axes) and finally shift the layout by 100 micron upwards.

Transformations accumulate over the layer hierarchy. This means, that if a layer is transformed and the layer is inside a group whose representative specifies a transformation as well, the resulting transformation is the combination of the layer's transformation (first applied) and the group representative's transformation.

Multiple transformations can be present. In this case, the layout is shown in multiple instances.

For more information refer to Transforming Views And Property Selectors.

Property filters

It is possible to specify a property filter. A property filter specifies an expression and only shapes for which that expression applies are shown. The expression operates on user properties and the syntax allows comparison of properties with a given key against a given value. Boolean operators are available. That way, complex expressions can be created.

The property filter is specified in square brackets. For example:

10/5 [#43==X]

With this source specification, the layer will show all shapes from layer 10, datatype 5 which have a user property with number 43 and value string "X".

For more information refer to Transforming Views And Property Selectors.

Overriding the hierarchy levels

By default, only the hierarchy levels that are selected in the hierarchy level selection boxes are shown, i.e. if levels 0 to 1 are selected, just the top level shapes and instances are shown. This selection can be modified for certain layers or layer groups. To specify a different hierarchy selection for a certain layer, use an optional source specification element, the hierarchy level selector.

For example:

#*Display all hierarchy levels
#0..1Display top level only
#..5Override upper level with 5
#2..Override lower level with 2
#..*Override upper level setting by "all levels"

For more information refer to Specifying Explicit Hierarchy Levels For One Layer Or A Layer Group.