Skip to content

Commit

Permalink
Watch out for shallow (and now sharp) bond angles when slanting wedges.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Dec 13, 2016
1 parent 4c2e39f commit 5111604
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ IRenderingElement generateBoldWedgeBond(IAtom from, IAtom to, List<IBond> toBond

final double theta = refVector.angle(unit);

if (theta > threshold) {
if (theta > threshold && theta + threshold + threshold < Math.PI) {
c = intersection(b, newUnitVector(b, c), toPoint, refVector);
d = intersection(a, newUnitVector(a, d), toPoint, refVector);

Expand Down Expand Up @@ -444,7 +444,8 @@ IRenderingElement generateHashedWedgeBond(IAtom from, IAtom to, List<IBond> toBo
}

// only slant if the angle isn't shallow
if (refVector.angle(unit) > threshold) {
double theta = refVector.angle(unit);
if (theta > threshold && theta + threshold + threshold < Math.PI) {
hatchAngle = refVector;
}
}
Expand Down

0 comments on commit 5111604

Please sign in to comment.