Skip to content

Avogadro Gets Some Sweet POV-Ray Goodness

It has been a while since I last posted about progress with Avogadro. I have been doing a lot of under the hood improvements which has been really frustrating at times and hard to blog about. Hey I just spent all day refactoring the Painter base class and everything still works the same as it did before! At last I have some real output and have just committed the code to the repository.

Ray traced molecule exported by Avogadro and ray traced by POV-Ray

The above image is one of the first I have produced and ray traced in POV-Ray. The abstracted painter stuff seems to be working really well and the engines no longer care whether they are painting onto an OpenGL context or to a file with POV-Ray objects in it. I think this is one of the most exciting aspects of the work I have been doing - the painting code has been somewhat abstracted away from the engines allowing for multiple painter devices.

I haven't just been coding though. I had a lot to think about after aKademy and have been reading a great deal about Qt and API design. I have also been reading the book that Google sent me about producing open source software. One suggestion I really like and I think most projects should be using is of code review, where each commit is reviewed by other members of the project. At times I think I would find it tough to review the code of other project members but I can see how it can really improve the quality of the code and help us see what other people are doing in the project.

I need to run as it is my nephews birthday today and I am expected. Hope you like the image. The POV-Ray export is extremely rough right now and needs a lot of things to be done before I would consider it ready for prime time. The philosophy of maintaining minimal local revisions also appeals to me though and so I am trying to stick to that too. I hope to be making much nicer images soon.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

Rich Apodaca on :

Rich ApodacaLooks very nice. Are there any scripting language interfaces (esp. Ruby)?

Marcus D. Hanwell on :

Marcus D. HanwellIt is on my list of things I would like to implement. Initially I think it will be in the form of QtScript as that is given to us by Qt 4 but I was also going to look into other ways in which the framework can be scripted. As always I am open to suggestions and if other languages could be added reasonably easy then I would consider it. It is also a case of considering what to expose and how. I do agree that scripting is an important addition to any powerful application like this if it is to become more widely used.

Geoff Hutchison on :

Geoff HutchisonSince much of Avogadro is built on top of Open Babel, all of that is already available through SWIG.

Before everything hit me with the wedding and move, I had hoped to get initial SWIG wrappers for Avogadro and a simple scripting extension. The latter would make it extremely easy to handle computational modeling tasks like submitting a job to Gaussian or GAMESS or whatever, and then re-reading any output file.

Of course if Marcus or Donald or someone else implements it first, so much the better. I'm quite sure we can have good access from Ruby, Python, and Perl, much like Open Babel -- it might just not be until September at this rate.

Geoff Hutchison on :

Geoff HutchisonMarcus, I think even a crude POV-Ray output like this is great, since it represents the abstract interface. As you said in private e-mail, SVG, PS/PDF, etc. are all possible now.

As far as code review, it's definitely a good idea, although in practice I find adding quality comments, internal documentation, and unit tests more useful. The challenge is often not just the code review, but being able to come back to your own (or other) code weeks or months later and knowing quickly what it's supposed to do. :-)

Marcus D. Hanwell on :

Marcus D. HanwellYes I think it is a good demonstration of the abstraction achieved in the interface to drawing. It opens up a number of new possibilities for Avogadro.

I certainly agree that quality code comments, internal documentation and unit tests are also useful. I attended a talk on the unit test framework available to Qt and KDE applications and saw how powerful it could be.

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5


You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.