Skip to content

Commit dfcfa06

Browse files
committed
If more than 3 surface sites, don't connect sites that aren't neighbors.
Otherwise *CC(*)(C*)C* is misleading May undo this commit.
1 parent 9a95820 commit dfcfa06

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rmgpy/molecule/draw.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,10 @@ def _connect_surface_sites(self):
16701670
if not other_sites: break
16711671
# connect to the nearest site
16721672
site2 = min(other_sites, key=lambda a: len(find_shortest_path(site1, a)))
1673+
if len(find_shortest_path(site1, site2)) > 2 and len(sites) > 3:
1674+
# if there are more than 3 sites, don't connect sites that aren't neighbors
1675+
continue
1676+
16731677
bond = site1.bonds.get(site2)
16741678
if bond is None:
16751679
bond = Bond(site1, site2, 1)

0 commit comments

Comments
 (0)