vendredi 20 avril 2012

Virtual Optics

Yesterday I put my hands again on the Virtual Optics project that I was telling about. I hadn't touched it in a month or so as I was busy with other things and I learned the hard way a very basic lesson of programming: cleaning and commenting the code is essential !!! Anyway I spent the last two days repairing my laziness and now it is a brand new project that I can work on, I reorganized all of my scripts and commented half of it, you can see the result in the video below:

 

It is not much, it is basically an ABCD matrix [1] program for a two lenses system. It allows to calculate the shape of a laser beam in such a system. The main goal of this project is at the end to be a possibility to quickly and interactively evaluate the feasibility and also some characteristics of an optical setup.

It is entirely written in python with pyglet and glydget libraries as only dependencies, the GUI window can be reduced to only display "Menu" and can be moved around. The frame rate displayed at the bottom left corner is only there for debug. To model the beam I used a parametric surface (altered function from the torus example of  pyglet).

That's it for the introduction, I spend approximatively a month coding it as a hobby but now I have a solid base to build on. In the near future I will redesign the components and implement others, I also want to make them pickable and It will be also great to be able to add or remove optical components on the fly.

More on this coming later... 
If interested I will happily give the code, it will be great for me to have feedbacks, just write me an email at: simulationplayground@gmail.com


Aucun commentaire:

Enregistrer un commentaire