#199 AtomPlacer cannot deal with placing a third atom

closed
9
2012-10-08
2004-04-16
No

The AtomPlacer has problems when adding a third
carbon to the center carbon of a propane (CCC)
molecule. The problem is around line 203 where the
'occupied direction' is calculated. In case of linear
molecules with equals bond lengths, this vector has a
zero length, and the AtomPlacer cannot determine a
good angle then.

Discussion

  • Christoph Steinbeck

    Logged In: YES
    user_id=54358

    I suggest a three step process:

    1. The procedure currently implements (place the new
      substituent away from the geometric center of the bonding
      partners).
      If the resulting vector is zero or too small:

    2. Do the same based on the geometric center of all atoms in
      a molecule (won't help you with you current CCC problem, but
      will help in some strange other cases).
      If resulting vector is too small or zero:

    3. take an arbitrary, already placed partner of the center
      atom and use it's coordinated to generate the newDirection
      vector (it will then point into the direction of the
      respective, already placed atom) and rotate it by 90 degrees.

    double angle = GeometryTools.getAngle(partnerAtom.getX2D() -
    atom.getX2D(), partnerAtom.getY2D() - atom.getY2D());

    double addAngle = Math.toRadians(90);

    angle += addAngle;
    Vector2d vec1 = new Vector2d(Math.cos(angle), Math.sin(angle));
    Point2d point1 = new Point2d(atom.getPoint2D());
    point1.add(vec1);

    or so :-)

     
  • Egon Willighagen

    Logged In: YES
    user_id=25678

    I'm a bit hesitative to address this problem: I've looked
    at it but don't feel comfortable enough with the source
    code... Chris, if you can find some time, could you please
    have a look at it?

     
  • Christoph Steinbeck

    Logged In: YES
    user_id=54358

    I will look at it as soon as I have some more time. Not
    likely to happen soon, but one never knows :-)

     
  • Christoph Steinbeck

    Logged In: YES
    user_id=54358

    Solved in CVS

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks