Documentation

Understanding light

Lenses & focus

A lens is just a piece of glass with curved faces. Refraction at those curves is enough to gather a parallel beam into a point — and almost enough to do it perfectly.

Focal length

Parallel light entering a converging lens meets at the focal point. The distance from the lens to that point is the focal length f, and it comes from the glass and the two curvatures:

1/f = (n − 1) · ( 1/R₁ − 1/R₂ )The thin-lens form. R is positive when the surface's centre of curvature lies downstream, so a symmetric biconvex lens has R1 > 0 and R2 < 0.

Real lenses have thickness, which moves the focus slightly:

1/f = (n − 1) · [ 1/R₁ − 1/R₂ + (n − 1)·t / (n·R₁·R₂) ]Photonica shows this value live as 'EFL' in the Build panel when a lens is selected, for red, green and blue separately.

Converging and diverging

PartShapeDoes
Convex lensFat in the middleConverges light to a real focus
Concave lensThin in the middleDiverges light; the focus is virtual, behind the lens
Plano-convexOne flat faceConverges; the cheapest useful lens
Custom lensBoth radii yoursMeniscus shapes, deliberately odd designs
Cylindrical lensCurved in one direction onlyFocuses to a line instead of a point

A diverging lens shows a negative focal distance in the Measure panel, flagged virtual.

Why a single lens is never perfect

Chromatic aberration

Because n depends on wavelength, f does too. Blue focuses closer than red. The size of the effect is set by the Abbe number:

longitudinal colour error ≈ f / VA 100 mm BK7 lens (V = 64) splits its red and blue focus by roughly 1.6 mm. The Measure panel shows this directly as 'Blue − red focus'.

Fixing it needs two glasses working against each other — see lens design for building an achromat.

Spherical aberration

A spherical surface is easy to grind but is the wrong shape: rays through the edge of the lens focus closer than rays through the middle. The blur it leaves grows as the cube of the aperture — halve the beam width and the spot shrinks eightfold. (Photonica measures that exponent as 3.06 against a theoretical 3.)

Two cures: stop the beam down, or change the shape. Setting a surface's conic constant k turns the sphere into a conic section, and one specific value removes spherical aberration entirely:

k = −n²A hyperboloid on the exit face of a plano-convex lens, with the flat face toward the incoming collimated beam. The Build panel offers this as 'Perfect focus'.

Coma and astigmatism

Off-axis light suffers differently: a point source away from the axis smears into a comet shape (coma) or focuses at two different distances in two directions (astigmatism). Tilt a lens with R / T and watch the spot on the screen lose its symmetry.