Optiland GUI Quickstart#

Welcome to the Optiland Graphical User Interface (GUI)! This guide will help you get started with the basic features for interactive optical design and analysis.

What can the GUI do?#

The Optiland GUI provides a user-friendly way to:

  • Create new optical systems from scratch.

  • Save and load optical systems in Optiland’s native JSON format.

  • Visually inspect optical systems in 2D and 3D.

  • Edit system parameters, including surface data (radius, thickness, material, etc.), aperture, field points, and wavelengths.

  • Run various optical analyses (e.g., ray fans, spot diagrams, MTF).

  • View analysis results graphically.

  • Access an embedded Python terminal for advanced scripting and automation.

Note that not all features available in the Optiland Python API are exposed in the GUI, but many common tasks are easily accessible. New features are continuously being added, so keep an eye on future updates for more functionality.

Launching the GUI#

You can launch the Optiland GUI in a couple of ways:

  1. From the command line (recommended for most users): Open your terminal or console and type:

    optiland
    

    This command will start the main application window. If you have installed Optiland correctly, this should work seamlessly.

  2. From Python (useful for development or troubleshooting): Open your terminal or console and type:

    python -m optiland_gui.run_gui
    

Main Interface Components#

The navigation sidebar and workspace share one draggable separator. Drag it to adjust the sidebar width; the panels use the remaining workspace width.

When you first open the Optiland GUI, you’ll see a main window containing several panels. Here’s a brief overview:

Optiland GUI Overview
  • Main Window: Contains the main menu bar (File, Edit, View, Tools, Help), toolbars for quick actions, and manages the different panels.

  • Lens Data Editor: This is where you view and modify the surface-by-surface data of your optical system, such as radius, thickness, material, conic constants, and semi-diameters. Changes made here are reflected in other panels.

    Viewer Panel (2D/3D)
  • Viewer Panel: This panel provides visual representations of your optical system.

    • 2D View: Shows a 2D cross-section of the lens, with options to display rays.

    • 3D View: Renders a 3D model of the system (if VTK is installed and working).

    All 2D plots share the same direct controls: right-drag or middle-drag pans, and the mouse wheel zooms around the pointer. Ordinary left-click is available for selection where the plot supports it and does not pan. These defaults also apply to sag plots, analysis plots and optimizer candidate previews. There is currently no mouse-binding settings window.

    Select Zoom to rectangle (a magnifier over a dotted rectangle) and left-drag around the area to inspect. The drawing stays fixed until you release the mouse. The Pan tool enables left-drag panning. Right/middle panning and wheel zoom remain available with either tool selected; wheel zoom waits until any drag is finished. Escape exits the selected tool. Back and Forward navigate completed views. The 3D view has its own rotation and navigation controls.

    Viewer Panel (2D/3D)
  • Analysis Panel: Allows you to select, configure, and run various optical analyses. Results are typically displayed as plots within this panel. Note that you can run several analyses, each of which can be accessed using the numbered tabs on the right sidebar.

    Plot navigation controls follow the light or dark theme. Selected tools have an outlined border; keyboard focus uses a dashed border.

    Analysis Panel
  • System Properties Panel: Manage system-wide settings that are not tied to individual surfaces. This includes:

    • Aperture: Define the system aperture (e.g., Entrance Pupil Diameter, F-number).

    • Fields: Set up field points for analysis.

    • Wavelengths: Define the wavelengths and their weights for calculations.

    System Properties Panel
  • Sidebar: Located on the left, it provides quick navigation to show/hide the main panels like Lens Editor, Viewer, Analysis, etc.

  • Python Terminal (View > Python Terminal): An embedded IPython terminal for advanced users who want to interact with the optical system programmatically using Optiland’s Python API.

Command Palette (Ctrl+K)#

Optiland features a VS Code-style Command Palette that provides quick access to various tools, analyses, and layout actions.

  • Keyboard Shortcut: Press Ctrl+K to open the palette.

  • Functionality: Type to search for specific commands (e.g., “Open”, “Spot Diagram”, “Theme”). Use the arrow keys to navigate and Enter to execute the selected command.

Note

All windows are dockable and can be rearranged to suit your workflow. You can also save your layout for future sessions. These can be loaded by pressing “1” or “2” in the top toolbar, corresponding to the slot used for saving your layout.

Drag a panel’s title to detach or reposition it. A small movement remains a click; continue dragging to a window side or another panel to preview a docked split or tab group, then release to place it. Double-click the title, or use its Float panel / Dock panel button, to change floating state. The Close panel button hides the panel; reopen it from the View menu. When a floating panel is docked with its Dock panel button, its tab is selected. The Script Editor and Console use the same controls inside Scripts Terminal. Drag the separator between docked panels to resize them, or an edge or corner of a floating panel. Content minimum sizes limit how far a panel can shrink. Docking uses sides, splits and tabs; it does not align panels to a pixel grid. Use Reset Layout to return to the default arrangement.

Drag the main window’s title background to move it. Drag an outer edge or corner to resize it, including where panel content reaches the window edge. Window controls and menu items retain their usual behavior. Supported platforms use the system’s window moving, resizing and snapping behavior. The fallback snaps to a screen’s left/right half or maximizes at its top edge on release; Escape cancels an active fallback move or resize.

The main window also retains its keyboard commands: Ctrl+Left and Ctrl+Right place it on the corresponding half of its current screen, subject to size constraints. Ctrl+Up maximizes it. Ctrl+Down restores a maximized window and otherwise minimizes it. Focused widgets receive these keys first; an unhandled key can reach the main window. These commands move the main window rather than rearranging its docked panels. Screen placement depends on support from the platform’s window manager.

Resizing analysis plots#

Complex analysis plots can show a temporary scaled view while resizing, then redraw sharply at the new size. Plot navigation and image saving use the current figure. Resizing preserves results and zoom without running the analysis again.

Notifications#

Notifications appear at the bottom-right of the main window. Click the notification card or its close button to dismiss it. You can also use Tab to focus the close button, labeled “Dismiss notification”, and press Space.

Error notifications stay visible until dismissed or replaced by newer notifications when the three-card stack is full. Information, success, and warning notifications disappear automatically after seven seconds.

Light theme and Dark theme#

The examples above show the default dark theme. If you prefer a light theme, you can easily switch to it under the View > Theme menu:

Theme Switch

Getting Started: Basic Actions#

Let’s try a few basic operations.

1. Opening an Existing Lens File#

Optiland supports loading and saving its native JSON format (.json). Several samples files are included with the installation and can be found in the optiland/docs/samples directory. For this quickstart, we will load the Cooke Triplet lens system:

  • Go to the menu: File > Open > Cooke_triplet.json.

  • The Cooke Triplet lens system will load, and you should see its data in the Lens Editor and a 2D/3D representation in the Viewer Panel.

Note

You can also load Optiland files that were saved using the Optiland Python API.

2. Viewing a Raytrace#

With the Cooke Triplet loaded:

  • In the Viewer Panel, ensure the 2D View tab is selected.

  • Experiment with the Matplotlib toolbar controls, such as zooming and panning.

  • Switch to the 3D View tab in the Viewer Panel to see the lens and rays in 3D. You can rotate, pan, and zoom this view.

Open Viewer Settings with the gear button in 2D Layout to choose the ray count and distribution. Num Rays is the total number of rays per field, including the chief ray, at the primary wavelength. A count of 1 displays only the chief for each field.

The chief ray follows the center of the beam through the entrance pupil, using the design’s configured ray aiming. It can leave the source at an angle in an off-axis or decentered system; it is not necessarily a zero-angle ray.

The available distributions use these counts:

  • line_x / line_y: odd totals, 1, 3, 5, …, with equal pairs around the chief. An even value rounds up to the next supported total.

  • hexapolar: complete bundles of 1, 7, 19, 37, 61 or 91 rays. This GUI count means rays, not rings: for example, 7 rays = the chief plus six surrounding rays. The arrows step between complete bundles; an intermediate value rounds up to the next bundle, so entering 8 gives 19.

  • random: the chief plus the remaining randomly sampled rays, all included in the displayed total.

The control shows the normalized count when you finish editing, within its displayed limits. Click Apply to use count or distribution changes. Each field receives its own bundle, and blocked rays can stop before reaching the image.

Highlight chief ray is enabled by default. It draws each chief in blue with a slightly thicker stroke above the other 2D rays, distinct from surface selection and hover in both themes. Unchecking it restores ordinary ray styling; it does not remove the chief or change the count. This checkbox takes effect immediately, without recalculating the layout or moving the view. Highlighting does not extend a blocked ray.

In 3D Layout, the chief uses ordinary ray styling and normal depth/occlusion. The 2D highlight checkbox does not place it in front of 3D geometry. These GUI count conventions do not change scientific analyses or the public Python pupil-distribution APIs.

3. Changing a Surface Parameter#

Let’s modify a surface and see the update:

  • In the Lens Editor Panel, find the row for Surface 1 (first surface after object).

  • Double-click on the cell containing its Radius value.

  • Change the value (e.g., from 22.0136 to 30.0) and press Enter.

  • Observe how the 2D and 3D views in the Viewer Panel update to reflect this change. The lens is now defocused.

4. Running an Analysis#

  • In the Analysis Panel, select RMS Spot Size vs Field from the list of available analyses. Or, choose another analysis if you prefer.

  • Click the triangular “Run” button to execute the analysis.

  • The results will be displayed in the Analysis Panel, showing a plot of RMS spot size against field angle.

Explore Further#

This quickstart covered only the very basics. The Optiland GUI has many more features for detailed optical design and analysis. We encourage you to explore the menus, right-click options in different panels, and consult the other sections of the Optiland documentation for more in-depth information on specific functionalities.

Note

For the latest and greatest features, the Optiland Python API generally must be used. The GUI does not currently expose all features available in Optiland.