Auto-Add Hydrogens

I know that we’ve long wanted to automatically adjust the hydrogen
atoms when using the draw tool. We’re almost there. To try it out,
turn on the checkbox in the tool options:

  • Clicking on an atom to change the element works
  • Clicking on a bond to change the bond order works
  • Deleting an atom will delete all attached hydrogens
    • But doesn’t yet adjust the valence of any atoms bonded to the
      deleted atom
  • Deleting a bond will change the valence of attached atoms
  • If you just click and release to create one atom, it will have the
    right number of hydrogens.

The buggy part is interactive click-and-drag drawing:

  • It’s currently supposed to add hydrogens when you release the mouse
    button.
    • This solved a lot of strange bugs when moving atoms while the
      mouse was being dragged.
  • Somehow the valence isn’t updated correctly – I seem to end up with
    a bunch of extra H atoms at the origin…

That’s about what I can do for today. If anyone else is interested in
taking a crack, it’s in SVN right now.

Cheers,
-Geoff

On Feb 17, 2008 9:25 PM, Geoffrey Hutchison geoff.hutchison@gmail.com wrote:

I know that we’ve long wanted to automatically adjust the hydrogen
atoms when using the draw tool. We’re almost there. To try it out,
turn on the checkbox in the tool options:

  • Clicking on an atom to change the element works
  • Clicking on a bond to change the bond order works
  • Deleting an atom will delete all attached hydrogens
  • But doesn’t yet adjust the valence of any atoms bonded to the
    deleted atom

This works now.

  • Deleting a bond will change the valence of attached atoms
  • If you just click and release to create one atom, it will have the
    right number of hydrogens.

The buggy part is interactive click-and-drag drawing:

  • It’s currently supposed to add hydrogens when you release the mouse
    button.
  • This solved a lot of strange bugs when moving atoms while the
    mouse was being dragged.
  • Somehow the valence isn’t updated correctly – I seem to end up with
    a bunch of extra H atoms at the origin…

I had found the same solution for the problem :). Was just about to
commit when I saw you were first.

That’s about what I can do for today. If anyone else is interested in
taking a crack, it’s in SVN right now.

Cheers,
-Geoff

Tim


This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel