Since my microscope broke (and I’m still waiting for replacement parts), I decided to build a sim to continue my work in the mean time. While the v3
branch does have an elementary simulator, it doesn’t accurately mimic things like focus and lighting - which is important for the work I happen to be doing right now. The sim seems to work okay. I wrote it in C++ with an OpenGL rendering backend, and I pipe the contents to a v4l2 loopback device. This allows me to seamlessly plug it into software I have written, or existing software like the v3 branch of the OpenFlexure software. Here’s an image of it running in VLC:
The blurring is based on the optical simulation running in the OpenGL shader, which simulates a larger aperture in order to get a narrow focal point range (notice the blurring on the corners of the frame). The lighting is adjustable. The virtual stage and lighting controls are based on the command syntax of the sangaboard and are read from
stdin
of the program. The simulator also mimics step loss from the motors, to simulate drift.