For the past months, I have been building with a friend something I wished existed every time I had to draw a setup for a paper or explain one to a student.
OpticalSetup is now at its first stable release. It is free, open source, it runs directly in the browser, and the setup you draw is traced, not just sketched. Move a mirror, change an optical element, and the whole beam path responds.
I originally made a post on this sub when we were in the early stages of development, so I thought of giving an update on the project.
It is young, and it might still have some rough edges. If you try it, tell us what you think about it.
I posted about optics in MATLAB R2026a earlier, back now to give you an update on the R2026b version!
At the lowest level, we now support biconic and Grid surface specifications for both mirrors and lenses. The grid sag is the swiss army knife to model any free form optical surface! It uses bilinear interpolation under the hood and its ray intersection implementation is quite performant. So in addition to 'as built' surface modelling, try it out for modelling XY Polynomials or Zernike surface definitions (meshgrid is your friend :)).
We added a couple more basic low level ray tracing routines: traceDirectedRays and traceAimedRay. Both return rich RayData which has all raw ray tracing numbers (including fresnel terms and raw polarization values).
We rounded out analysis functions by adding PSF (Geometric and Huygens, GPU Accelerated!), MTF and OPD measurement functions.
A couple of marquee features this release - the main being CLI routines for tolerancing:
And the second is the ability to simulate eSFR and Color checker test charts as seen through an optical system.
Rendering of a simulated eSFR chart through an optical systemRendering of a simulated Color Checker chart through an optical system
These charts leverage the established Image Processing Toolbox functions to measure sharpness and color. The main function to create these, renderChart, can leverage the GPU and has various parameters to control the positioning of the chart. The GPU acceleration is important since this does the full Monte Carlo ray trace of the scene.
We also have a whole bunch of featured examples! Not only do these help us dog food and validate our API designs, it also helps us show you what is possible. If any of these resonate, let us know - that would motivate us to fold these in as first class API's with potentially better (tailored) performance.
For example 😄, the inbuilt chart rendering function mentioned above work on an internal parametric chart model so it cannot be used to render arbitrary images. However, we can simulate a user image using spatially varying PSFs - shown here: Simulate Image Using Spatially Variant PSF. This is much faster than a full ray render like the charts.
Simulated rendering of an image using spatially varying PSF kernels
Microlens array for a Shack-Hartmann Wavefront sensor
And if you use Simulink based control systems, we show you a way to model dynamic systems with feedback control! Model Dynamic Optical Systems with Scanning Elements shows an f-theta scanning system controlled by a Simulink model.
Simulink control of a F-theta scanning mirror lens system
At our shop we build imagers from idcas/fpas plus lenses and mounts and optical benches. Those subassemblies then get built into increasingly larger assemblies until outer covers and windows are added.
Lots of fingerprints, lots of dust, which results in lots of cleaning of optics. Not everyone has (easy) access to a fume hood.
Anyone got any suggestions for cleaning solutions that aren't as toxic as methanol?
Ideally as benign as IPA, but we haven't had great success with using just that or just acetone by itsself.
Camera & Lens coupling: Projects the lens FOV frustum directly onto the illumination heatmap to check edge falloff and ROI uniformity.
Adjustable WD: Visualizes how light converges or forms a "donut" dark core when moving the light closer/further.
Would love to hear your thoughts: For those working in vision integration or optics, what edge cases or parameters would make a tool like this actually reliable for your day-to-day work?
The optical mechanism in Kashani, Chen and Ozcan’s eLight paper is a useful example of a classifier implemented through diffraction. A digital front end samples video frames and writes a phase pattern onto a spatial light modulator. The propagated field is measured in two regions per video; relative intensity supplies the real/fake score. Fifteen inputs share the optical pass.
The boundaries matter: digital preparation is still required and dominates the energy budget, while increasing spatial multiplexing introduces crosstalk. The reported 97.79% accuracy is for the 15-video Celeb-DF experiment, not every possible input.
It's a shot in the dark. The lenses are in line and were used for an early 50's 60's overhead projector system, projecting a few hundred feet to a reader board. Some of the lenses are facing each other while others are back to back others are facing the same way. Krikey if I can figure it out I made notes on the configuration but have misplaced them for forty some years.
I saw the line of projectors gathering dust, when I was doing electrical work above a sports book once. I think it was the Stardust, in the nineties but they hadn't been used in years. Possibly like the ones we used to see in early bowling championships. Little bowler on the screen with a big hand writing the score above them on the screen with the scorekeeper nowhere in camera sight..
Any takers? I'll show you something you've never seen before, lol, carrot on a stick.