Skip to content

Commit 62e8f35

Browse files
authored
change_angle was ignoring as_group=False
1 parent 6a82f40 commit 62e8f35

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

geometry.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4882,28 +4882,33 @@ def change_angle(
48824882
angle -= a2.angle(a1, a3)
48834883

48844884
# get target fragments
4885-
a1_frag = self.get_fragment(a1, a2)
4886-
a3_frag = self.get_fragment(a3, a2)
4887-
4885+
if as_group:
4886+
a1_frag = self.get_fragment(a1, a2)
4887+
a3_frag = self.get_fragment(a3, a2)
4888+
else:
4889+
a1_frag = [a1]
4890+
a3_frag = [a3]
4891+
48884892
# shift a2 to origin
4889-
self.coord_shift(-a2.coords, a1_frag)
4890-
self.coord_shift(-a2.coords, a3_frag)
4893+
# using center=a2 to be cleaner and consistent with change_dihedral
4894+
#self.coord_shift(-a2.coords, a1_frag)
4895+
#self.coord_shift(-a2.coords, a3_frag)
48914896

48924897
# perform rotation
48934898
if fix == 0:
48944899
angle /= 2
4895-
self.rotate(w, -angle, a1_frag)
4896-
self.rotate(w, angle, a3_frag)
4900+
self.rotate(w, -angle, a1_frag, center=a2)
4901+
self.rotate(w, angle, a3_frag, center=a2)
48974902
elif fix == 1:
4898-
self.rotate(w, angle, a3_frag)
4903+
self.rotate(w, angle, a3_frag, center=a2)
48994904
elif fix == 3:
4900-
self.rotate(w, -angle, a1_frag)
4905+
self.rotate(w, -angle, a1_frag, center=a2)
49014906
else:
49024907
raise ValueError("fix must be 0, 1, 3 (supplied: {})".format(fix))
49034908

49044909
# shift a2 back to original location
4905-
self.coord_shift(a2.coords, a1_frag)
4906-
self.coord_shift(a2.coords, a3_frag)
4910+
#self.coord_shift(a2.coords, a1_frag)
4911+
#self.coord_shift(a2.coords, a3_frag)
49074912

49084913
def change_dihedral(self, *args, **kwargs):
49094914
"""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy