Avogadro: New Ring & Polygon Engines

I recently added a couple of new engines to Avogadro and the screen shot below shows them both. The ring engine finds all the rings of the molecule and draws a transparent plane through the ring. The polygon engine finds atomic centres with three or more atoms bonded and draws a polygon around that atom. This is only done for atoms that are not the common organic types.

Avogadro using the ring and polygon engines

I think these are useful engines that have been prompted by user requests. May be not as exciting as the ribbon engine or the surface support we are working on but useful to display certain structures. The ring engine has not been without its problems though as you can probably spot in the image below showing the ring engine rendering a carbon nanotube.

Avogadro using the ring engine to render a nanotube

The lighting just flips at certain points - the same happens as you rotate molecules that are using the ring or polygon engine. I guess the lighting is flicking on at certain angles. I would be interested if anyone with more OpenGL knowledge than I might know how I can improve the rendering. Some rings are near white and some of the back rings don't seem to be drawn - that could actually be drawing order though which is always tough to get right.

Comments and tips are always welcome. The big challenge right now is getting surface support added in. This is something I think we really need and I would use in my daily work as I am sure many others would. I have been reading up on marching cubes and stuff but would welcome tips in that area too!

Dax's Flight to the US

On Wednesday Dax, my overgrown German Shepherd dog, took his first ever flight. Originally they were supposed to fly him into Pittsburgh International Airport but apparently there were no carriers that could accommodate such an overgrown dog!

Dax

So eventually they gave up and told us that they couldn't get him to Pittsburgh as promised. I think it was Thursday night last week I had a voice mail left from what sounded like Dallas International Airport asking me to call them back and confirm that I would take delivery of Dax. I nearly had kittens of my own as I saw how far away this was!

It turned out that there is a Dulles International Airport, and the way it is pronounced sounds very much like Dallas. That was a much more manageable four hour drive away near Washington DC. So I hired a large pickup truck for Wednesday of this week.

Continue reading "Dax's Flight to the US"

Improved Ribbon Rendering

Over the last couple of days I have made a few commits to improve the ribbon support in Avogadro. Many thanks to Geoff for fixing some bugs we found in Open Babel and to Thomas Margraf for his helpful suggestions and for letting me take a look at a little of his code that renders ribbons.

Ribbon rendering in Avogadro

Right now the ribbon is drawn as a tube between the carbon atoms of the backbone and so isn't really a ribbon at all. Then I looked at the image and it is looking quite a bit like a ribbon. The code is checked in and so feel free to take a look at it. I am using NURBS but am far from an expert on their use. My laptop failure has lost some of the tuning I had done too - this is my first screenshot from Apple Mac OS X Leopard!

Points if you can tell me why the alpha helix looks pretty good despite me having not yet implemented anything to find the correct plane! Still needs some tuning but I hope you will agree that this is looking pretty nice now. It has also led to some optimisation of molecule loading but I am sure that there are lots of biologists who will tell me it still isn't quite right.

Update: Geoff has now shown me how to do screen capture and so here is a pretty video of Avogadro rendering ribbons in action!

My Laptop is Fried - Limited Development Activity

Since moving out to Pittsburgh I have been using my Acer Ferrari laptop at home for development, keeping in touch with people back home and trying to figure out some of the weirder rules out here such as driving licenses in this state. Last night I booted up when I got home and after logging in everything went a little funky - got I/O errors when typing ls for example.

I tried rebooting but it wouldn't even get to the GRUB prompt. So I got out an old Gentoo LiveCD which I had luckily left in my laptop bag. That got so far then failed to mount the drive. After a few reboots and a little wine (to calm my nerves ;-) ) I managed to access the drive. I thought I would try copying some stuff across to my external hard drive and ended up getting more I/O errors and some memory errors for good measure. Half the time when I booted from the LiveCD the kernel panicked when attempting to mount the hard drive partitions.

So today I am a very unhappy English man in Pittsburgh. Due to me having spent far more than I budgeted for moving out here, and then more again on flying my dog out, I don't foresee being able to replace it any time soon. This means my development activity will be limited. Not sure if compiling part of a KDE 4 checkout might have been what finished it off. Looks like some kind of motherboard issue. The trackpad stopped working months ago, now I am getting random memory and I/O errors and the CPU has been running hotter and hotter recently. It served me for just over two years which isn't great but I worked it pretty hard and it travelled a fair part of the globe with me too.

Still can't help being cheered up a little as I will be picking Dax, my overgrown German Shepherd dog up from Dulles Washington International Airport tomorrow (not Dallas as it sounded like on the message they left me which made me very unhappy when I first heard).

Update: My very nice and generous new boss has very kindly offered to let me use the group laptop in the interim. It is a MacBook Pro though using something called Mac OS X Leopard. I can keep hacking on Avogadro with it and I even know how to take screen shots with it now too! It is also capable of checking email and browsing the web so my Internet connection in the apartment won't go to waste. I am considerably happier now but will miss my KDE 4 and Linux fix ;-)