v0.3.0 coming soon, with field curvature, image simulation, and the all-new Education tab! Get your free license key →

Professional optical design
that doesn't cost a fortune.

Available in your browser and as a native desktop app. Trefoila runs ray tracing, MTF, wavefront analysis, optimization, and tolerance analysis for $49/month, and it's free while we're in public beta.

Free during beta (until Apr 30) Then $49/month, cancel anytime No quotes, no sales calls
Trefoila full workflow: 2D layout, lens data editor, and MTF analysis simultaneously
Multi-Threaded Rust Engine
MTF · PSF · Wavefront · OPD
macOS · Windows · Linux
Instant Download
No Quotes · No Sales Calls
Trefoila full workflow: glass catalog picker, 2D layout, and MTF analysis
Core Workflow

A prescription table that updates your 2D layout as you type.

You enter your lens prescription in a row-and-column format with surface type, radius, thickness, glass, and semi-diameter, and the 2D layout redraws live alongside the table as you type.

  • Spherical, conic, aspheric, Zernike freeform, and 8 surface types
  • Full Schott, Ohara, Hoya, CDGM glass catalog: 1,000+ materials
  • Live paraxial update: EFL, BFL, f/#, NA, cardinal points
  • Surface solves: marginal ray height, chief ray height, quick focus
2D lens layout view 1
2D lens layout view 3
System Visualization

Real-time 2D layout. Redraws in milliseconds as you edit.

The 2D cross-section layout renders multi-field ray bundles in real time and redraws in milliseconds whenever you change a parameter, and you can pick which field angles and wavelengths to display.

  • Multi-field, multi-wavelength ray fan overlay
  • Vignetting visualization (see exactly which rays are clipped)
  • Aperture stop and pupil location markers
  • Frame System and Frame All for instant navigation
  • Floating popup panel, drag and resize alongside your table
MTF analysis showing polychromatic MTF curves for multiple field angles
MTF analysis second view
Performance Analysis

Polychromatic FFT MTF for any number of field angles.

MTF is the industry-standard measure of lens resolution, and Trefoila computes polychromatic MTF for any number of field angles (tangential and sagittal, against the diffraction limit) in seconds.

  • FFT wave-optics MTF (the most accurate method)
  • Multi-field, multi-wavelength in a single computation
  • Polychromatic weighted PSF summation
  • Through-focus MTF to find the best image plane
  • Export data as CSV for post-processing
Spot diagram grid showing ray scatter for multiple wavelengths and field positions with RMS radius labels
Wavefront OPD analysis showing Zernike decomposition
Image Quality

Spot diagrams, wavefront, and Zernike decomposition.

Spot diagrams show where rays land at the image plane for each wavelength and field angle, while wavefront analysis shows the phase error that limits diffraction performance, and both update live when you change the prescription.

  • Full spot grid: any field × wavelength combination
  • Per-wavelength coloring: F, d, C lines at a glance
  • RMS radius, geometric radius, and Airy disk overlay
  • Wavefront OPD fan plots (tangential and sagittal)
  • Zernike fitting: 11 Noll-ordered terms, Strehl ratio
Optimization panel showing variables, operands, and Differential Evolution optimizer running with progress bar
Optimization Engine

DLS and global search, sharing the same merit function.

Most problems just need DLS, but harder problems need a global search that can climb out of local minima, and Trefoila includes both so you can switch optimizers without rebuilding your merit function.

  • Damped Least Squares (Levenberg-Marquardt), the industry standard
  • Differential Evolution for robust global search
  • Nelder-Mead simplex
  • Composable merit function with weighted operands
  • Edge thickness, center thickness, and clearance constraints
Analysis Suite

Paraxial, PSF, MTF, Seidel, wavefront, and tolerancing are all in one app.

Everything computes from the same prescription table with no import/export step and no switching between separate tools.

PSF

Wave-optics Point Spread Function computed via FFT of the pupil with OPD phase, and the Strehl ratio comes directly from PSF peak intensity.

Ray Fan Diagrams

Tangential and sagittal ray fans for any field point, with chromatic fans overlaying all wavelengths to show longitudinal and lateral color simultaneously.

Paraxial Analysis

EFL, BFL, f/#, NA, entrance and exit pupil locations, cardinal points, and magnification, all computed from paraxial ray trace.

Seidel Aberrations

All five primary Seidel coefficients (spherical, coma, astigmatism, field curvature, distortion) with surface-by-surface breakdown.

Wavefront / OPD

OPD fan plots with Zernike decomposition (11 Noll terms), piston and tilt removal, and RMS wavefront error in waves.

Tolerance Analysis

Monte Carlo over 5 tolerance types (radius, thickness, tilt, decenter, and index), with sensitivity ranking and inverse sensitivity allocation included.

How We Compare

The same analyses you'd get from enterprise tools, minus the procurement process.

Ray tracing, MTF, wavefront, optimization, and tolerancing are all covered, the same as the enterprise tools, but you just download, enter a license key, and start working.

Feature Trefoila Enterprise Software
Price $49/month Contact sales for quote
Instant download
Multiple optimization methods (DLS, DE, Nelder-Mead) Unique
Ray tracing engine
MTF analysis
Wavefront / OPD
Tolerance analysis
Optimization engine
macOS support
Linux support
No enterprise procurement

* Enterprise software typically requires a quote process. Trefoila pricing is listed on the page; buy online instantly.

Simple Pricing

One plan, one price.

$49/month gets you the full app with no feature tiers, no annual commitment, and no sales call required to find out what it costs.

Trefoila
$49
per month · cancel any time
  • Full ray tracing engine (8 surface types)
  • Complete glass catalog (1,500+ materials)
  • MTF, PSF, spot diagrams, wavefront, OPD
  • Seidel aberrations, ray fans, paraxial
  • Damped Least Squares & global optimization
  • Monte Carlo tolerance analysis
  • Sensitivity + inverse sensitivity + budget
  • macOS, Windows, and Linux
  • All future updates included
Get Your Free Beta Key

Free until April 30, 2026. Then $49/month, cancel any time.

Free during public beta.

Professional optics software without the quote.

It's free during the public beta, so grab a key, download, and start designing; after April 30, 2026, it's $49/month and you can cancel any time.

Get Your Free Key
Complete Feature Reference

What's included.

Lens Editor
  • Spherical, conic, aspheric surfaces
  • Zernike freeform surfaces
  • 8+ surface types total
  • Row-and-column prescription editor
  • Live paraxial update (EFL, BFL, f/#, NA)
  • Entrance & exit pupil, cardinal points
  • Surface solves: marginal ray, chief ray, quick focus
Glass & Materials
  • 1,500+ glasses: Schott, Ohara, Hoya, CDGM, Hikari
  • Sellmeier dispersion model
  • Interactive nd–Vd glass map (Abbe diagram)
  • Wavelength transmission curves
  • Custom glass entry
  • Multi-wavelength ray tracing (F, d, C + custom)
2D Visualization
  • Real-time 2D cross-section layout
  • Multi-field, multi-wavelength ray fan overlay
  • Vignetting visualization
  • Aperture stop & pupil location markers
  • Frame System and Frame All navigation
  • Floating, resizable popup panel
Image Quality Analysis
  • MTF: FFT wave-optics, polychromatic
  • Through-focus MTF
  • PSF: wave-optics via FFT, Strehl ratio
  • Spot diagrams: full field × wavelength grid
  • RMS radius, geometric radius, Airy disk overlay
  • Wavefront OPD fan plots (tangential & sagittal)
  • Zernike decomposition: 11 Noll terms
  • Ray fan diagrams: chromatic, tangential, sagittal
  • Seidel aberration coefficients: surface by surface
Optimization
  • Damped Least Squares (Levenberg-Marquardt)
  • Differential Evolution (global search)
  • Nelder-Mead simplex
  • Hybrid DE+DLS
  • Composable merit function
  • Weighted operands
  • Edge thickness, center thickness constraints
  • Clearance constraints
Tolerancing
  • Monte Carlo simulation (1,000+ trials)
  • 5 tolerance types: radius, thickness, tilt, decenter, index
  • Sensitivity analysis: ranked bar chart
  • Inverse sensitivity: automatic budget allocation
  • Yield estimation from Monte Carlo histogram
  • Manufacturing-ready tolerance reports
Platform & Integration
  • macOS, Windows, Linux
  • Export data as CSV
  • .trf project files: plain JSON, diff-friendly
  • Instant download, no procurement
  • Free updates included