# More intuitive behaviour for bond-centric manipulation tool

**URL:** <https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893>\
**Category:** Suggestions\
**Created:** [July 3, 2022, 7:54pm UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893 "2022-07-03T19:54:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [July 3, 2022, 7:54pm UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/1 "2022-07-03T19:54:06Z")

</div>

Sorry if this has been raised before, if it is planned, or even if it’s possible to do it already and I just don’t know how.

I was wondering if it would be possible to reimplement, or extend, the bond-centric manipulation tool in such a way as to make it more intuitive, and useful? To my mind, the natural default behaviour I would expect is that when I select a bond, and then drag one of those atoms in the bond, the whole fragment attached to that atom would move as one? I.e. not just one atom moves, as now. The structure should stay the same (i.e. all other internal coordinates stay the same) and only the selected bond length/angle should change, whereas at the moment moving an atom in this way has knock-on effects for other internal parameters.

Selecting a part of the molecule and using the normal manipulate tool moves the whole selected part as one, but relative to the xyz frame (also very useful!) rather than a bond.

Equally, it would be extremely useful to have a way to manually adjust dihedral angles/rotate whole substituents around a bond. The tool should do what we as chemists think of as bond rotation, i.e. rotation of a whole fragment around a bond. It should be possible to easily and intuitively adjust the rotation of a methyl group, or of the two rings in a biphenyl system, etc. Perhaps by choosing a bond using the tool, then clicking and dragging an adjacent atom (rather than a member of the bond).

Being able to manually adjust geometries around the internal coordinates in this way would be very helpful for converging an structure to a minimum, for example, as you often want to just slightly rotate a substituent or slightly lengthen a bond, if they are geometry changes associated with a remaining negative frequency. At the moment this doesn’t seem to be simple…

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [July 4, 2022, 4:46pm UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/2 "2022-07-04T16:46:20Z")

</div>

> [@matterhorn103](#):
>
> o my mind, the natural default behaviour I would expect is that when I select a bond, and then drag one of those atoms in the bond, the whole fragment attached to that atom would move as one? I.e. not just one atom moves, as now.

That’s how it works. What version are you using?

You click on a particular bond and then right-click or control-click on one of the atoms and the whole connected chunk will move (e.g., stretching a bond to 3.14Å)

 ![Screen Shot 2022-07-04 at 12.41.26 PM](https://discuss.avogadro.cc/uploads/default/original/2X/6/61713f7683d93addcb12104349a568dd8e87ff75.jpeg)

> [@matterhorn103](#):
>
> Equally, it would be extremely useful to have a way to manually adjust dihedral angles/rotate whole substituents around a bond.

Yes, that’s again exactly how the tool works.

In v1.x you could also do this through the Bond Property, Angle Property, Torsion Properties tables (e.g., type a specific value). That’s [not yet supported](https://github.com/OpenChemistry/avogadrolibs/pull/913) but basically, I’m re-using the same code from the bond-centric manipulation tool.

It sounds like you’re either using the manipulate tool (i.e., atoms and XYZ chunks) or there’s a bug.

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [July 5, 2022, 10:09pm UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/3 "2022-07-05T22:09:48Z")

</div>

Ah, so I just tested various situations again. Indeed, for the butane example it also works as you describe and as I would expect. Which is possibly why I never noticed the problem until a couple of days ago.

However, it seems that if one of the atoms in the bond is a member of a ring (regardless of whether the ring is sp2 or sp3) then it stops working as behaved, and only the atom that is clicked can be moved - nothing else moves with it. A ring behaves as expected if it is attached to one of the atoms in the selected bond, only not if it contains the atom in the bond. The easiest example to test for yourself is a biphenyl system I suppose. Trying to change the Ph-Ph bond length or the angle between the rings highlights the problem.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [July 6, 2022, 1:18am UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/4 "2022-07-06T01:18:16Z")

</div>

Perfect, that helps a lot. It’s checking the atoms for ring membership, not the bond itself. Should be solvable.

I filed a bug report:

> <https://github.com/OpenChemistry/avogadrolibs/issues/1000>
>
> When using the bond-centric manipulate tool, bonds between two rings should be a…djustable.
> 
> At the moment, if you try to adjust the bond between rings in biphenyl, just one atom moves:
> \<img width="801" alt="Screen Shot 2022-07-05 at 9 16 51 PM" src="https://user-images.githubusercontent.com/41128/177444589-c435d9b3-9d11-41ee-afc3-c9539bb3b238.png"\>

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [July 6, 2022, 10:13pm UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/5 "2022-07-06T22:13:24Z")

</div>

Perfect, thanks for filing the bug report! Though note that it is not restricted to biphenyl systems, it happens with any atom within any ring, in case I wasn’t clear

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [July 7, 2022, 2:51am UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/6 "2022-07-07T02:51:00Z")

</div>

Manipulating ring bonds is very tricky. That’s why when you move a “ring bond” it should only move that atom. In this case, the definition of “ring bond” is wrong. It’s flagging a “ring bond” when it’s simply between two atoms in rings.

Otherwise, I’m clear that it’s not just biphenyl… That just happens to be a very clear test case. 🙂

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [July 7, 2022, 6:09pm UTC](https://discuss.avogadro.cc/t/more-intuitive-behaviour-for-bond-centric-manipulation-tool/3893/7 "2022-07-07T18:09:55Z")

</div>

Okay, I have an initial fix here:

> <https://github.com/OpenChemistry/avogadrolibs/pull/1006>
>
> Fixes #1000
> 
> Signed-off-by: Geoff Hutchison \<geoff.hutchison@gmail.com\>
> 
> Dev…eloper Certificate of Origin
> Version 1.1
> 
> Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
> 1 Letterman Drive
> Suite D4700
> San Francisco, CA, 94129
> 
> Everyone is permitted to copy and distribute verbatim copies of this
> license document, but changing it is not allowed.
> 
> 
> Developer's Certificate of Origin 1.1
> 
> By making a contribution to this project, I certify that:
> 
> (a) The contribution was created in whole or in part by me and I
> have the right to submit it under the open source license
> indicated in the file; or
> 
> (b) The contribution is based upon previous work that, to the best
> of my knowledge, is covered under an appropriate open source
> license and I have the right under that license to submit that
> work with modifications, whether created in whole or in part
> by me, under the same open source license (unless I am
> permitted to submit under a different license), as indicated
> in the file; or
> 
> (c) The contribution was provided directly to me by some other
> person who certified (a), (b) or (c) and I have not modified
> it.
> 
> (d) I understand and agree that this project and the contribution
> are public and that a record of the contribution (including all
> personal information I submit with it, including my sign-off) is
> maintained indefinitely and may be redistributed consistent with
> this project or the open source license(s) involved.

Looks like it does what you want now - thanks for the report!
