# 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.

To open the view, use "Tools/2.5d View". 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.

## Setup

The 2.5d view needs a technology setup explaining the way the layers are transformed into planes. The setup is provided within a technology. Open the technology manager (File/Manage Technologies) and navigate to the "Z Stack (2.5d)" component. The setup is basically a list of entries listing the layer from which to take the shapes and the depth information.

Each entry is a single line. Empty lines are ignored. Everything after a '#' character is considered a comment.

Each specification line consists of a layer specification, a colon and arguments. The arguments are named (like "x=...") or in serial. Parameters are separated by comma or blanks. Named arguments are:

- zstart: The lower z position of the extruded layer in µm
- zstop: The upper z position of the extruded layer in µm
- height: The height of the extruded layer in µm

'height', 'zstart' and 'zstop' can be used in any combination. If no value is given for 'zstart', the upper level of the previous layer will be used.

If a single unnamed parameter is given, it corresponds to 'height'. Two parameters correspond to 'zstart' and 'zstop'.

Here are some examples:

    1: 0.5 1.5                    # extrude layer 1/0 from 0.5 to 1.5 vertically\n"
    1/0: 0.5 1.5                  # same with explicit datatype\n"
    1: zstop=1.5, zstart=0.5      # same with named parameters\n"
    1: height=1.0, zstop=1.5      # same with z stop minus height\n"
    1: 1.0 zstop=1.5              # same with height as unnamed parameter\n"

#### Variables

You can declare variables inside the setup files and use them in formulas for computed values. Variables are defined and set with the "var" keyword on a single line. The notation follows the "expression" syntax used in many other places inside KLayout ().

Here is an example:

    var hmetal = 0.48\n"
    7/0: 0.5 0.5+hmetal*2        # 2x thick metal\n"

#### Conditionals

For more flexibility, but of little practical use for now, conditionals are provided. "if", "else", "elsif" and "end" for as in other languages, e.g. Ruby:

    var thick_m1 = true
    if thickm1
      1: 0.5 1.5
    else
      1: 0.5 1.2
    end

## Navigating the 2.5d View

navigation
2.5d navigation

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:

- Dragging with the right mouse button down: change azimuth and elevation angle
- Dragging with the middle mouse button down: move the pivot up and down or left and right
- Mouse wheel: moves the pivot forward and backward
- Control key + mouse wheel: magnify or shrink the layout
- Press and hold shift key: switch to top level view (see below)
- Up/down keys: move the pivot forward or backward
- Left/right keys: move the pivot to the left or the right
- Control + up/down keys: change the elevation angle
- Control + left/right keys: change the azimuth angle

In top level view, the navigation is slightly different:

- Dragging with the right mouse button down: change azimuth angle
- mouse wheel: magnify or shrink the layout
- Up/down/left/right keys: move the pivot on the horizontal plane

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.