Skip to content

Commit

Permalink
Correct atom placer, for co-linear chains just place the atoms as the…
Browse files Browse the repository at this point in the history
…y are.
  • Loading branch information
johnmay committed Dec 13, 2016
1 parent 5111604 commit 93af028
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,14 @@ public Vector2d getNextBondVector(IAtom atom, IAtom previousAtom, Point2d distan
logger.debug("Arguments are atom: " + atom + ", previousAtom: " + previousAtom + ", distanceMeasure: "
+ distanceMeasure);
}

final Point2d a = previousAtom.getPoint2d();
final Point2d b = atom.getPoint2d();

if (isColinear(atom, molecule.getConnectedBondsList(atom))) {
return new Vector2d(b.x-a.x, b.y-a.y);
}

double angle = GeometryUtil.getAngle(previousAtom.getPoint2d().x - atom.getPoint2d().x,
previousAtom.getPoint2d().y - atom.getPoint2d().y);
double addAngle = Math.toRadians(120);
Expand Down

0 comments on commit 93af028

Please sign in to comment.