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

The 2.5d View

The "2.5d view" offers a semi-3d view of the layout. It's not a full 3d view as the layers are only extruded vertically into layers with a certain thickness. The view cannot model process topology, but it can visualize wiring congestions in a three-dimensional space or the vertical relative dimensions of features of the process stack.

Currently, the performance is limited, a rough number for a practical limit is around 100k polygons. The 2.5d view is only available, if KLayout was compiled with OpenGL support.

In order to use the tool, you will need a script generating the material stack. Such a script is a variant of a DRC script (see Design Rule Check (DRC)). The DRC language is used to import or generate polygon layers which are then extruded and placed on a certain z level.

To create a new script, use "Tools/2.5d View/New 2.5d Script". This will create a new script in the macro editor.

A simple script is this one. It takes two layers - 1/0 and 2/0 - and extrudes then in a stacked fashion, the first with 200nm thickness and the second one with 300nm:

z(input(1, 0), zstart: 0.1.um, height: 200.nm)  # extrudes layer 1/0 to a height of 200nm starting at z=100nm
z(input(2, 0), height: 300.nm)                  # adds layer 2/0 for the next 300nm

To run the script, use the "Run" button from the macro IDE or pick the script from the script list in the "Tools/2.5d View" menu. If your script is not shown in that menu, check if it is configured to be bound to a menu item.

After the script was executed, the 2.5d window is displayed. If you closed that window, you can re-open it with "Tools/2.5d View/Open Window". The window will show the layout section visible in the layout view. To refresh the scene - also after changing the script - either run the script again from the macro IDE or use the green "re-run" button in the upper left corner of the 2.5d view window.

2.5d Script Anatomy

As mentioned, a 2.5d script is a variant of a DRC script. You can basically use all features of DRC, specifically boolean operations. Some practical restrictions exist:

2.5d scripts utilizes the DRC language with these two additional functions:

"z" Function (plane extrusion)

The layer argument of the function is a DRC layer which is rendered as an extruded sheet. Further arguments control the height, z location and colors. When used inside the "zz" block, the color options of the "z" calls are ignored and taken from "zz" instead.

Options for this function are:

Examples for the extrusion options:

z(layer, 0.1 .. 0.2)                extrude layer to z = 0.1 to 0.2 um
z(layer, zstart: 0.1, zstop: 0.2)   same as above
z(layer, zstart: 0.1, height: 0.1)  same as above, but with height instead of zstop
z(layer, height: 200.nm)            extrude layer from last z position with a height of 200nm

Examples for display options:

z(..., color: 0xff0000)             use bright red for the material color (RGB)
z(..., frame: 0xff0000)             use bright red for the frame color (combine with "fill" for the fill color)
z(..., fill: 0x00ff00)              use bright green for the fill color along (combine with "frame" for the frame color)
z(..., like: "7/0")                 borrow style from layout view's style for layer "7/0"
z(..., name: "M1")                  assigns a name to show for the material 

"zz" Function (material groups)

The "zz" function forms a display group which clusters multiple "z" calls. The basic usage is with a block containing the "z" calls. As DRC scripts are Ruby, the notation for the block is either "do .. end" or curly brackets immediately after the "zz" call:

zz( display options ... ) do
  z(layer1, extrusion options ... )
  z(layer2, extrusion options ... )
  ...
end

The "z" calls do not need to have colors or other display options as they are taken from "zz".

Material groups allow forming more complex, stacked geometries. Here is an example forming a simple FinFET geometry using boolean and a sizing operation:

gate = input(1, 0)
active = input(2, 0)

z(active, zstart: 0, height: 20.nm, name: "ACTIVE")

zz(name: "GATE", like: "1/0") do
  
  active_sized = active.sized(10.nm)
  gate_over_active_sized = active_sized & gate
  
  z(gate - active, zstart: 0, height: 10.nm)
  z(gate_over_active_sized - active, height: 10.nm)
  z(gate_over_active_sized, height: 10.nm)

end

Which renders this result:

Navigating the 2.5d View

The navigation is based on the movement of the camera while the scene is formed by the extruded layout. The scene can be scaled to provide zoom features. Scaling and rotation is relative to the pivot point which is indicated by the compass icon on the ground plane.

This is a short list of the navigation controls which act on the camera:

In top level view, the navigation is slightly different:

Note: if the Shift key does not switch to top level view, click into the scene view once.

Colors in the 2.5d View

While the 2.5d view window is open, the layout view is still active. Layer colors are applied also to the 2.5d view. Changing the fill color will change the 2.5d view's face color. The frame color will be applied to the wire frame. If a hollow stipple is selected, only the wire frame is shown. If a layer is made invisible in the layout view, the corresponding blocks will also be made invisible in the 2.5d view.

Other Controls

The left zoom slider changes the overall scale factor. The right slider only changes the z (height) axis zoom factor. This is useful as in many cases, the real height profile will result in a rather flat arrangement. Increasing the z zoom factor will exaggerate the vertical axis hence making height variations more pronounced.

The edit boxes next to the scale sliders allow entering the scale factors manually.

The button bar at the top right side holds the view presets. Use them to reset the window to front view, top view etc.

Material Visibility

Using the check boxes from the material view right of the scene view you can disable materials, so they are no longer rendered. From the material list's context menu, you can hide or show all materials or just the selected ones.