Documentation

User Guide

Everything about using OpticSketcher on desktop or tablet, from placing your first lens to building complete optical systems and sharing them with others.

Getting Started: Your First Optical System

This five-minute walkthrough builds a classic focusing setup: a collimated laser beam passing through a lens and landing on a sensor. No account is needed, so just open the workspace and follow along.

1
Add a light source
In the Parts Library on the left, click Beam (a collimated source). It appears at the center of the workspace, already selected, and its rays are traced immediately. You never press a "run" button; the simulation is always live.
2
Add a lens
Click Lens in the library, or drag it from the library and drop it in front of the beam. The rays refract through it in real time and converge toward the focal point.
3
Position the elements
Drag the lens with the mouse to move it along the beam. Watch the focus shift as you move it. To move in a straight line, hold Shift while dragging to constrain movement to one axis. Drag the circular rotation handle around a selected element to rotate it.
4
Fine-tune in the Inspector
With the lens selected, the Inspector on the right shows all of its properties: focal length, diameter, thickness, glass material, lens shape and more. Type exact values or use the sliders, and the ray trace updates as you edit.
5
Add a sensor and inspect the result
Add a Sensor from the library and place it near the focal point. Select it and click View sensor data in the Inspector to open the analysis window: a spot diagram of every ray hitting the sensor, with intensity, wavelength and polarization statistics.
Want a head start?
The Gallery contains ready-made classic systems: Keplerian and Galilean telescopes, a Newtonian reflector, a 4f relay, prism spectroscopes and more. In the workspace, File → Examples loads the same library (classic forms and tutorials) without leaving the editor. Open one and take it apart to learn how it works. You can also type a plain-text description into AI Scene Assistant (top of the Parts Library) and let the AI build the system for you.

Interface Overview

The workspace is built around a live 3D canvas with a parts library on the left and an inspector on the right. Everything updates in real time; there is no separate "simulate" step.

OpticSketcher desktop workspace, annotated12345
1Top toolbar: File menu (including Examples and What’s new), project name, undo / redo, 2D / 3D toggle, units (mm / in), axis height, grid & snapping, Rays (show/hide traces), live rays, section cut, shadows, labels, theme, share and cloud.
2Parts Library (left): All light sources, optics and sensors. Click to add at the center, or drag onto the canvas. Also holds the AI Scene Assistant button. Collapse it with the round arrow on the canvas edge.
3Canvas: The 3D workspace where you place, move and rotate elements. Rays are traced live as you edit; here, white light dispersing through a prism onto a detector.
4View controls (top-right): Iso / Top / Front / Side presets, zoom in / out and reset view.
5Inspector (right): Scene overview tree (click a row to select), all numeric properties of the current selection, and the AI system analysis. Toggle it with the round arrow on the right canvas edge.

The top toolbar in detail

  • File menu: new design, Examples (classic systems and tutorials loaded into the workspace), save / load a local .json file, import Zemax .zmx or OpTaliX .otx, export (PNG, SVG, OBJ, STL, PLY, GLB, ZMX), and Help (What’s new, quick guide, About).
  • Project name: click to rename; the name is used for cloud saves, share links and exported file names.
  • Undo / Redo: step back and forward through every edit (Ctrl/Cmd + Z / Ctrl/Cmd + Shift + Z).
  • 2D / 3D: switch between a flat schematic-style view and a full 3D perspective view of the same scene.
  • Units (mm / in): every numeric field in the app switches between millimeters and inches.
  • Axis Height: the global optical-axis height; new elements are placed at this height so systems stay aligned.
  • Grid & Pos Snap: show / hide the grid and snap element positions to it while dragging.
  • Rays: show or hide the traced rays without changing the design. Use this for a cleaner look at the hardware; the simulation still runs.
  • Live rays + angle snap: toggle continuous ray tracing while dragging, and choose the rotation snap increment (e.g. 1°) used by rotation handles and angle sliders. This is separate from the Rays visibility toggle.
  • Section: cut the scene with a clipping plane to look inside thick glass elements.
  • Shadows / Labels: toggle rendered shadows and floating element name labels.
  • Share & Cloud: generate share links and save designs to your cloud account (see Files, Cloud & Sharing).
  • Theme: switch between dark and light workspace themes.

Panels

  • Parts Library (left): all sources, optics and sensors, plus the AI Scene Assistant. Collapse or open it with the round arrow button on the left edge of the canvas.
  • Inspector (right): when nothing is selected it shows the Scene Overview tree (click any row to select that element, expand groups with the arrow) and the AI system analysis. When an element is selected it shows every editable property of that element. Toggle the panel with the round arrow on the right edge.
  • Mode hint: the small "i" chip at the bottom of the canvas summarizes what the mouse buttons do in the current view mode; hover it for the full list.
  • Help: the round "?" button on the canvas opens the built-in quick guide. File → What’s new lists product changes since your last visit (returning users only; first-time visitors are not interrupted).

Adding & Editing Parts

Adding parts

  • Click a part in the library: a new instance is placed at the default workspace position and selected.
  • Drag a part from the library onto the canvas: the preview follows the pointer and drops exactly where you release.
  • Custom meshes: the custom mirror, prism and beam-blocker entries can import your own geometry from .obj, .stl or .ply files, which then behave as real optical elements in the ray trace.

Selecting

  • Click an element to select it; click empty space to deselect.
  • Shift + click: add or remove elements from the selection.
  • Shift + right-drag: box (marquee) selection of everything inside the rectangle.
  • Ctrl/Cmd + A: select all elements.
  • Click a row in the Scene Overview tree (Inspector) to select that element, useful in crowded scenes.

Moving & rotating

  • Drag a selected element to move it. With Pos Snap on, it snaps to the grid.
  • Shift + drag: constrain movement to a single axis.
  • Drag the circular rotation ring around a selected element to rotate it; rotation snaps to the angle increment chosen in the toolbar.
  • Arrow keys: nudge the selection in small steps for precise placement.
  • For exact values, type position and rotation (pitch / yaw / roll) directly in the Inspector.

Visibility & labels

  • Show object in the Inspector hides the part on the canvas; it stays in the scene list so you can select it again.
  • Show label hides just the floating name. You can pin the label above, below, left or right, or drag it on the canvas to a clearer spot.

Editing properties

Every element type has its own set of Inspector controls. For example, a lens Construction is Thin (ideal focal length only), Singlet (radii, thickness, glass, and a bending slider that keeps power while changing form), or Cemented doublet (two glasses, three surfaces, no air gap). Spherical or cylindrical applies to all three. A source exposes wavelength (with a live color preview) - enter one value, or several comma-separated wavelengths such as450, 532, 633 to launch those lines at once - plus ray count, beam width, divergence and polarization. Changes apply instantly to the ray trace.

Groups & locking

  • Ctrl/Cmd + G groups the selection so it moves and rotates as one unit (e.g. a multi-element objective); Ctrl/Cmd + Shift + G ungroups. Groups appear as expandable folders in the scene tree.
  • Lock prevents an element from being moved or rotated on the canvas, handy for reference elements you don't want to disturb. Lock and unlock from the context menu or Inspector.

Copy, paste & duplicate

  • Ctrl/Cmd + D: duplicate the selection in place (with a small offset).
  • Ctrl/Cmd + C / X / V: copy, cut and paste through the system clipboard. The clipboard uses structured JSON, so you can copy elements in one browser tab and paste them into a different design in another tab.
  • All of these are also available in the right-click context menu on the canvas.
Example: a cemented doublet
Add a Lens, then in the Inspector set Construction to Thin, Singlet, or Cemented doublet. Switching forms keeps the same focal length. Cemented doublet swaps in two glasses (front / rear) and a shared cement radius. Spherical or cylindrical still applies. Catalog pairs such as N-BK7/N-SF2 are the safest starting point.

Keyboard Shortcuts

Shortcuts are ignored while your cursor is inside a text field or numeric input. On Mac, use Cmd instead of Ctrl.

Delete / Backspace
Delete the current selection.
Ctrl + A
Select all elements.
Ctrl + D
Duplicate the selection (with a small offset).
Ctrl + Z
Undo the last edit.
Ctrl + Shift + Z / Ctrl + Y
Redo.
Ctrl + G
Group the selection.
Ctrl + Shift + G
Ungroup the selected group.
Ctrl + C
Copy the selection to the system clipboard (structured JSON; works across browser tabs).
Ctrl + X
Cut: copy to the clipboard, then remove from the scene.
Ctrl + V
Paste from the clipboard. Pasted items get new IDs and a small offset. Also accepts a plain JSON array in the saved-design format, and a URL to a .zmx lens file (e.g. a Thorlabs link), which triggers a direct ZMX import.
Arrow keys
Nudge the selection in small steps.
Shift (held while dragging)
Constrain movement to one axis.
Esc
Close open dialogs.

Views & Display Options

2D vs 3D

The 2D mode renders the scene as a flat, schematic-style drawing, ideal for classic optical-bench layouts and publication figures. The 3D mode shows the same scene with full perspective, shadows and depth, which matters for systems with out-of-plane folds or cylindrical optics. Switching modes never changes your design, only how it's drawn.

View presets

The floating strip at the top-right offers Iso (isometric), Top, Front and Side orthographic presets, plus zoom in / out and a home button that resets the camera to fit the whole scene. In flat presets (Top / Front / Side), dragging on empty space pans; in Iso and 3D it orbits.

Display toggles (toolbar)

  • Grid: show or hide the reference grid.
  • Pos Snap: snap dragged elements to the grid.
  • Rays: show or hide traced rays on the canvas without changing the design.
  • Live rays: keep tracing rays continuously while you drag; the adjacent dropdown sets the rotation snap angle (e.g. 1°). This is separate from Rays visibility.
  • Section: enable a clipping plane that cuts the scene open, letting you see ray paths inside thick lenses and prisms. The adjacent dropdown selects the cut plane.
  • Shadows: toggle rendered shadows in 3D.
  • Labels: show or hide floating element name labels on the canvas.
  • Axis Height: the global optical-axis height (all new parts are placed at this height).
  • mm / in: switch every field in the app between metric and imperial units.
  • Theme: dark or light workspace (the sun / moon button at the top-right).
Ray colors are physical
Rays are drawn in the true color of their wavelength: a 532 nm source traces green rays, 633 nm traces red, and a white-light source through a prism fans out into a full spectrum. You can also list several discrete wavelengths in the source field (comma-separated, e.g. 450, 532, 633) to launch those lines together. Ray brightness reflects intensity, so beamsplitters, polarizers and absorbing elements visibly dim the transmitted and reflected beams.

Files, Cloud & Sharing

Local files

The File menu saves your design as a local .json file and loads it back later: a fully self-contained snapshot you can keep, version or email. Guests (without an account) can work entirely with local files; the current sketch is also kept in the browser between visits.

Examples

File → Examples lists classic forms and tutorials from the same library as the public Gallery. Choosing one replaces the current sketch (you will be asked to confirm if you have unsaved work) so you can explore a working system immediately.

Cloud designs

  • Sign in and use the cloud button in the toolbar to save designs to your account and open them from any device.
  • Each design keeps a revision counter: if the same design was changed on another device, you'll get a conflict prompt instead of silently overwriting your work.
  • The cloud picker shows a thumbnail preview of every saved design.

Sharing

  • Temporary link: a self-contained snapshot of the current design; anyone with the link can open it for 14 days. No account needed on either side.
  • Permanent link: linked to a cloud design; it always opens the latest saved version and never expires. Requires the design to be saved to the cloud.

Import & export formats

.json
Save / LoadNative design file: full scene, lossless.
.zmx
Import / ExportZemax sequential lens prescriptions. Import from a file, or simply paste a public ZMX URL (e.g. a Thorlabs product link) onto the canvas with Ctrl+V or the right-click menu. Export converts lens stacks on a straight axis back to ZMX.
.otx
ImportOptional OpTaliX / CODE V-style sequential file (rdy/thi/gla or S lines). Use this if you already have Handbook of Optical Systems designs — OpticSketcher does not bundle those ~339 files. Convert in OpTaliX-LT to ZMX if a command is not recognized.
.obj / .stl / .ply
Import / ExportImport custom meshes as mirrors, prisms or blockers; export the whole scene (or the selection) as solid geometry for CAD.
.glb
Export3D scene export for viewers and rendering tools.
.png / .svg
ExportPublication-ready images of the current view; SVG stays crisp at any scale.
.csv
ExportSensor hit data (position, intensity, wavelength, polarization) from the sensor analysis window.
Example: importing a real catalog lens
Find a lens on the Thorlabs website, copy the link to its Zemax file, click once on the OpticSketcher canvas and press Ctrl + V. The prescription is fetched, converted and placed as a ready-to-use lens (or lens group) in your scene.

Embedding a Design on a Website

Any design can be published as a live, ray-traced viewport inside another page - a lecture site, a lab wiki, a product page or a blog post. Visitors see the real simulation, not a screenshot: the same engine, the same optics and the same rays as in the editor, with only the interaction limited to what you allow.

Creating the embed code

1
Share the design
Press the share button in the toolbar and create a link. A temporary link carries a snapshot of the design and expires after 14 days; a permanent link stays in sync with the cloud copy, so every edit you save is reflected in the embed automatically.
2
Open the embed generator
In the share panel, choose "Get embed code for a website".
3
Choose how visitors may interact
Pick the interaction mode, the 2D or 3D view, a dark or light theme, and any parametric sliders you want to expose. Embedded viewports draw drop shadows like the editor unless you turn them off in the snippet. The preview code updates as you change the options.
4
Paste the snippet into your page
Copy the generated iframe tag and paste it into your HTML, or into any content editor that accepts embed code. The height in the snippet can be edited freely.

Interaction modes

Static view
Nothing - a live-rendered but fixed diagram. Best for figures inside text.
Camera only
Rotate, pan and zoom the scene. The optics themselves cannot be moved.
Draggable parts
Move the parts you name, optionally locked to a single axis. Everything else stays fixed.

In "Draggable parts" mode the generator lists every part in your design. Tick the ones a visitor may move, and choose Free, X only or Z only for each - an axis lock keeps a lens on the optical axis while still letting the visitor explore focus.

Parametric sliders

Sliders turn an embed into a teaching demo, and each slider is bound to one parameter of one specific part. The generator lists the parts in your design and, under each, exactly the parameters that part can expose: focal length or the two curvature radii of a lens, the radius of a spherical mirror, the yaw, pitch and roll of a prism or mirror, refractive index, wavelength, divergence, split ratio, polarizer or waveplate axis, Faraday rotation, grating density and more.

The rays retrace live as the visitor moves a slider, so a single embed can show how the image distance follows the focal length, how dispersion through a rotating prism changes with wavelength, or how a curvature change turns a collimated beam into a focus.

Embeds are read-only by design
No embed can add, delete, rotate or rename anything, and nothing a visitor does is written back to your design. An "Open in the editor" link can be shown so interested readers can continue from your setup in their own session.

AI Tools & Sensor Analysis

AI Scene Assistant

The button at the top of the Parts Library opens the AI scene assistant. Describe what you want in plain language - for example "a Keplerian telescope with 200 mm and 50 mm lenses", "set the lens focal length to 150 mm", "delete the prism", or "move the sensor to x=400". The assistant can add new parts, update pose or properties of existing elements, and delete elements you ask to remove. Changes are validated with the ray tracer before they are applied as a single undoable step, and everything remains fully editable afterwards. If something is selected on the canvas, the assistant prefers those elements when you say "this" or "the selected".

After a generation, you can ask for a revision of the last AI-added batch ("Request a fix"), or remove elements that session added. Always verify positions, orientations, and the traced rays.

Named classic designs (Cooke, Tessar, Planar, Distagon, Plössl, Cassegrain, and many Handbook-style aliases) are recognized by name, type, description and parameters. The assistant maps them onto a curated scalable form — it does not load the commercial ~339 HOS files. If EFL, F/# or object distance is missing or several names match, it asks a short clarifying question first. To place an exact OpTaliX prescription you already own, use File → Import OpTaliX (.otx).

Analyze current system (AI)

In the Inspector (with nothing selected), Analyze current system asks the AI to explain what your setup does: where the light goes, what each element contributes, and what the system as a whole achieves. You can ask follow-up questions. This feature is experimental: always verify its conclusions against the traced rays. Analysis does not change the scene - use the Scene Assistant to edit.

Sensor analysis window

  • Select a sensor and open its captured hits from the Inspector to see a spot diagram: a 2D scatter of every ray hit on the sensor face, colored by true wavelength, with pan and zoom.
  • The statistics tab shows intensity-weighted centroid and spread, wavelength distribution, degree of polarization (DoP) and Stokes parameters.
  • The hits table lists each individual ray with its position, intensity, wavelength and polarization state.
  • Export the plot as an image or the raw data as CSV for further analysis.
Example: measuring focus quality
Place a sensor at the focal plane of a lens, open the analysis window and watch the spot diagram. Now move the lens slightly and reopen; the spot grows as you defocus. With an aspheric lens, compare the spot size against a plain spherical lens to see spherical aberration disappear.

Parts Reference

Light sources

Point Source
Emits diverging rays from a single point over an adjustable cone angle. Models LEDs, fiber tips and point emitters. Wavelength (one value, or several comma-separated nm values), ray count and polarization are adjustable.
Collimated Beam
Parallel bundle of rays with adjustable width, ray count, wavelength (one value, several comma-separated nm values, or white light) and polarization. Models lasers and collimated illumination. Gaussian intensity profile supported.

Optics

Lens
Refractive lens with spherical, cylindrical, parabolic or aspheric surfaces (conic constant + higher-order terms). Construction: Thin, Singlet, or Cemented doublet (switching forms keeps focal length). Thin is an ideal lens defined only by focal length. A doublet is two glasses in contact (front, shared cement radius, rear) with no air gap; it can be spherical or cylindrical. Set focal length or radii, diameter, thickness (or two glass thicknesses), and glass from a real material catalog (including optical plastics). Cylindrical lenses focus in one axis; rotate (roll 90°) to switch the active axis. Spherical singlets have a bending slider that keeps focal length while changing shape. Catalog doublet pairs: N-BK7/N-SF2, N-SK16/F2, PMMA/PC.
Mirror
Flat, spherical or parabolic reflector, round or rectangular, with optional custom mesh geometry. Curved mirrors focus or expand beams like in reflective telescopes.
Beamsplitter
Cube splitter that divides each ray into transmitted and reflected parts by an adjustable ratio.
Polarizing BS
Polarizing beamsplitter cube. Transmits p-polarization and reflects s-polarization, splitting by polarization state.
Spectral Splitter
Dichroic-style cube that routes rays by wavelength: send red one way and blue another.
Prism
Refractive prism (equilateral, right-angle and more) with real dispersion. White light fans into a spectrum.
Diffraction Grating
Splits light into diffraction orders per the grating equation; line density and orders are adjustable.
Diffuser
Scatters incoming rays over an adjustable spread angle. Models ground glass and engineered diffusers.
Axicon
Conical lens that turns a collimated beam into a Bessel-like focal line or ring profile.
Birefringent Crystal (Calcite)
Splits rays into ordinary and extraordinary components with different refractive indices, walk-off included.
Waveplate
Retarder (half / quarter wave or custom) that transforms polarization, e.g. rotate linear polarization or convert it to circular.
Polarizer
Transmits only the component of light along its axis (Malus' law); intensity falls with the cosine squared of the angle.
Faraday Rotator
Rotates polarization non-reciprocally (Verdet constant), the building block of optical isolators.
Beam Blocker
Absorbs rays completely, a beam dump. Custom mesh shapes supported.
Aperture
Slab with a circular or square through-hole that clips the beam edges.

Sensors

Sensor
Captures every ray hitting its face and records position, intensity, wavelength and polarization. By default it measures both faces; turn off “Measure rays from both sides” in the Inspector to record only the front (the black back is ignored). Open View sensor data for spot diagrams, statistics and CSV export.