#9741 - TODO | Feature: Improve atom placement layout algorithm#9815
Open
St-Permiakov wants to merge 5 commits into
Open
#9741 - TODO | Feature: Improve atom placement layout algorithm#9815St-Permiakov wants to merge 5 commits into
St-Permiakov wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Ketcher’s internal atomForNewBond placement logic to reduce overlaps in crowded structures by adding an angle-optimization step that scores candidate directions using both angular “blocked sectors” and spatial collision penalties against nearby atoms/bonds.
Changes:
- Added angle utilities and a new optimization routine to pick a direction near the preferred angular gap while penalizing collisions.
- Extended environment analysis for placement by collecting “blocked” directions, nearby atoms, and nearby bond segments.
- Kept existing special-case behavior (zig-zag for a single neighbor, and 180° placement for certain bond-type sequences).
added 4 commits
May 13, 2026 14:52
…nder one config constant
2aa2ae4 to
b3f3d9a
Compare
Collaborator
|
@copilot resolve the merge conflicts in this pull request |
Contributor
Conflicts are resolved by merging Included in commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How the feature works? / How did you fix the issue?
Improve New Atom Placement to Avoid Overlaps
Enhanced the atomForNewBond algorithm to consider both angular gaps and true spatial collisions.
This results in cleaner, less-overlapping structures when adding new atoms to crowded or branched molecules.
Added focused unit coverage for
atomForNewBondplacement logic. The tests build minimal molecular structures and assert that the generated new-atom position avoids nearby visible atoms and bond segments, chooses the widest available sector for branched atoms, and preserves existing special-case behavior for 180 degree multiple-bond extension and zig-zag chain growth.This helps catch regressions in the new collision-avoidance scoring without relying on full editor interaction tests.
Check list
#1234 – issue name