reymond-group / smilesDrawer

A small, highly performant JavaScript component for parsing and drawing SMILES strings. Released under the MIT license.
https://smilesdrawer.rocks
MIT License
416 stars 66 forks source link

Triple bonds are bent near rings #185

Open xavierholt opened 2 months ago

xavierholt commented 2 months ago

There's a rendering inconsistency where triple bonds that appear before a ring in the input SMILES are drawn bent relative to the preceding bond, whereas triple bonds appearing after a ring are (correctly, I believe) shown as colinear. For example (the nitrogen doesn't affect things - it's simply to distinguish the branches):

C#Cc1ccccn1C#C
Screen Shot 2024-05-07 at 11 31 14 AM

Playing around with this a little further, I think the straightness check is off by one atom. Adding a couple more carbons to the previous example shows that the junction after the triple bond junction is drawn as straight when it shouldn't be:

CCC#Cc1ccccn1C#CCC
Screen Shot 2024-05-07 at 11 31 19 AM
xavierholt commented 2 months ago

The "lightning bolt" pattern after the triple bond in my second example appears to be a separate (but maybe related?) issue: #82.

xavierholt commented 2 months ago

And my report here is a duplicate of #39...