Tuesday, July 31, 2007

innerbonds including funky colors

So, at breakfast I was thinking about the best way/place to draw the innerbonds. After drawing a simple Benzene-molecule on paper I figured there are a lot of triangles which could be usefull to figure out the right place.
It seems to me that the innerbonds should always inside the triangle with an atom in 2 corners and the center of the ring in the other, giving the green/green/black triangle in the picture. The pink lines are orthogonal to the outerbonds. It seems logical to place the innerbond parallel to the outerbond.
After working this out in the code it seems like the idea works, the picture shows how the current code shows some molecules.



The current code can be found on this page.
The distance between the innerbond and outerbond can be easily changed. I think the distance is fine on the left 2 molecules, and a little too high at the right one. What should the default distance be?

2 comments:

Egon Willighagen said...

The lines pointing inwards are just for debugging, correct? I'm happy to see the atom labels working. You saw the IAtomColorer interface in cdk.renderer.color, I think. If you do not use that yet, please do. That allows users to set a coloring scheme via the renderer2Dmodel.

BTW, Arial/Verdana/Helvetica font is better (zonder de 'schreef' :); see IUPAC recommendation, which discourages Times New Roman.

Egon Willighagen said...

For documentation purposes, here's the link to that screenshot again.

http://www.thermo.com/com/cda/article/general/1,,412,00.html

Note the location of the charges, and the possibility to label molecules with either a name or m/z as in this situation.