Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a293e31

Browse files
committed
Replace Holroyd by Bell
Gavin Bell appears to be the accurate reference/attribution, not Holroyd, replace it.
1 parent 686f0ca commit a293e31

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

doc/api/toolkits/mplot3d/view_angles.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ mouse movement (it is quite noticeable, especially when adjusting roll),
8383
and it lacks an obvious mechanical equivalent; arguably, the path-independent rotation is unnatural.
8484
So it is a trade-off.
8585

86-
Shoemake's arcball has an abrupt edge; this is remedied in Holroyd's arcball
87-
(``mouserotationstyle: Holroyd``).
86+
Shoemake's arcball has an abrupt edge; this is remedied in Gavin Bell's arcball
87+
(``mouserotationstyle: Bell``), originally written for OpenGL [Bell1988]_. It is used
88+
in Blender and Meshlab.
8889

8990
Henriksen et al. [Henriksen2002]_ provide an overview. In summary:
9091

@@ -122,7 +123,7 @@ Henriksen et al. [Henriksen2002]_ provide an overview. In summary:
122123
- ✔️
123124
- ✔️
124125
- ❌
125-
* - Holroyd
126+
* - Bell
126127
- ❌
127128
- ✔️
128129
- ✔️
@@ -142,7 +143,7 @@ You can try out one of the various mouse rotation styles using::
142143
.. code::
143144
144145
import matplotlib as mpl
145-
mpl.rcParams['axes3d.mouserotationstyle'] = 'trackball' # 'azel', 'trackball', 'arcball', 'Shoemake', or 'Holroyd'
146+
mpl.rcParams['axes3d.mouserotationstyle'] = 'trackball' # 'azel', 'trackball', 'arcball', 'Shoemake', or 'Bell'
146147
147148
import numpy as np
148149
import matplotlib.pyplot as plt
@@ -183,11 +184,14 @@ A size of about 2/3 appears to work reasonably well; this is the default.
183184
three-dimensional rotation using a mouse", in Proceedings of Graphics
184185
Interface '92, 1992, pp. 151-156, https://doi.org/10.20380/GI1992.18
185186
187+
188+
.. [Bell1988] Gavin Bell, in the examples included with the GLUT (OpenGL
189+
Utility Toolkit) library,
190+
https://github.com/markkilgard/glut/blob/master/progs/examples/trackball.h
191+
186192
.. [Henriksen2002] Knud Henriksen, Jon Sporring, Kasper Hornbæk,
187-
"Virtual Trackballs Revisited", in Proceedings of DSAGM'2002
188-
`[pdf]`__;
189-
and in IEEE Transactions on Visualization and Computer Graphics,
190-
Volume 10, Issue 2, March-April 2004, pp. 206-216,
191-
https://doi.org/10.1109/TVCG.2004.1260772
193+
"Virtual Trackballs Revisited", in IEEE Transactions on Visualization
194+
and Computer Graphics, Volume 10, Issue 2, March-April 2004, pp. 206-216,
195+
https://doi.org/10.1109/TVCG.2004.1260772 `[full-text]`__;
192196
193-
__ https://web.archive.org/web/20240607102518/http://hjemmesider.diku.dk/~kash/papers/DSAGM2002_henriksen.pdf
197+
__ https://www.researchgate.net/publication/8329656_Virtual_Trackballs_Revisited#fullTextFileContent

doc/users/next_whats_new/mouse_rotation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To try out one of the various mouse rotation styles:
2020
.. code::
2121
2222
import matplotlib as mpl
23-
mpl.rcParams['axes3d.mouserotationstyle'] = 'trackball' # 'azel', 'trackball', 'arcball', 'Shoemake', or 'Holroyd'
23+
mpl.rcParams['axes3d.mouserotationstyle'] = 'trackball' # 'azel', 'trackball', 'arcball', 'Shoemake', or 'Bell'
2424
2525
import numpy as np
2626
import matplotlib.pyplot as plt

lib/matplotlib/mpl-data/matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@
433433
#axes3d.yaxis.panecolor: (0.90, 0.90, 0.90, 0.5) # background pane on 3D axes
434434
#axes3d.zaxis.panecolor: (0.925, 0.925, 0.925, 0.5) # background pane on 3D axes
435435

436-
#axes3d.mouserotationstyle: arcball # {azel, trackball, arcball, Shoemake, Holroyd}
436+
#axes3d.mouserotationstyle: arcball # {azel, trackball, arcball, Shoemake, Bell}
437437
# See also https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html#rotation-with-mouse
438438
#axes3d.trackballsize: 0.667 # trackball diameter, in units of the Axes bbox
439439

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ def _convert_validator_spec(key, conv):
11331133
"axes3d.zaxis.panecolor": validate_color, # 3d background pane
11341134

11351135
"axes3d.mouserotationstyle": ["azel", "trackball", "arcball",
1136-
"Shoemake", "Holroyd"],
1136+
"Shoemake", "Bell"],
11371137
"axes3d.trackballsize": validate_float,
11381138

11391139
# scatter props

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,7 @@ def _arcball(self, x: float, y: float, style: str) -> np.ndarray:
15131513
Convert a point (x, y) to a point on a virtual trackball.
15141514
15151515
This is either Ken Shoemake's arcball (a sphere) or
1516-
Tom Holroyd's (a sphere combined with a hyperbola).
1516+
Gavin Bell's (a sphere combined with a hyperbola).
15171517
See: Ken Shoemake, "ARCBALL: A user interface for specifying
15181518
three-dimensional rotation using a mouse." in
15191519
Proceedings of Graphics Interface '92, 1992, pp. 151-156,
@@ -1523,7 +1523,7 @@ def _arcball(self, x: float, y: float, style: str) -> np.ndarray:
15231523
x /= s
15241524
y /= s
15251525
r2 = x*x + y*y
1526-
if style == 'Holroyd':
1526+
if style == 'Bell':
15271527
if r2 > 0.5:
15281528
p = np.array([1/(2*math.sqrt(r2)), x, y])/math.sqrt(1/(4*r2)+r2)
15291529
else:
@@ -1587,12 +1587,12 @@ def _on_move(self, event):
15871587
nk = np.linalg.norm(k)
15881588
th = nk / mpl.rcParams['axes3d.trackballsize']
15891589
dq = _Quaternion(np.cos(th), k*np.sin(th)/nk)
1590-
else: # 'arcball', 'Shoemake', 'Holroyd'
1590+
else: # 'arcball', 'Shoemake', 'Bell'
15911591
current_vec = self._arcball(self._sx/w, self._sy/h, style)
15921592
new_vec = self._arcball(x/w, y/h, style)
15931593
if style == 'arcball':
15941594
dq = _Quaternion.rotate_from_to(current_vec, new_vec)
1595-
else: # 'Shoemake', 'Holroyd'
1595+
else: # 'Shoemake', 'Bell'
15961596
dq = _Quaternion(0, new_vec) * _Quaternion(0, -current_vec)
15971597

15981598
q = dq * q

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ def test_quaternion():
19441944

19451945

19461946
@pytest.mark.parametrize('style',
1947-
('azel', 'trackball', 'arcball', 'Shoemake', 'Holroyd'))
1947+
('azel', 'trackball', 'arcball', 'Shoemake', 'Bell'))
19481948
def test_rotate(style):
19491949
"""Test rotating using the left mouse button."""
19501950
if style == 'azel':
@@ -2008,13 +2008,13 @@ def test_rotate(style):
20082008
('Shoemake', 30, 0, 1): (-48.590378, -40.893395, 49.106605),
20092009
('Shoemake', 30, 0.5, c): (-25.658906, -56.309932, 43.897886),
20102010

2011-
('Holroyd', 0, 1, 0): (0, -60, 0),
2012-
('Holroyd', 0, 0, 1): (-60, 0, 0),
2013-
('Holroyd', 0, 0.5, c): (-48.590378, -40.893395, 19.106605),
2014-
('Holroyd', 0, 2, 0): (0, -126.869898, 0),
2015-
('Holroyd', 30, 1, 0): (25.658906, -56.309932, 16.102114),
2016-
('Holroyd', 30, 0, 1): (-48.590378, -40.893395, 49.106605),
2017-
('Holroyd', 30, 0.5, c): (-25.658906, -56.309932, 43.897886)}
2011+
('Bell', 0, 1, 0): (0, -60, 0),
2012+
('Bell', 0, 0, 1): (-60, 0, 0),
2013+
('Bell', 0, 0.5, c): (-48.590378, -40.893395, 19.106605),
2014+
('Bell', 0, 2, 0): (0, -126.869898, 0),
2015+
('Bell', 30, 1, 0): (25.658906, -56.309932, 16.102114),
2016+
('Bell', 30, 0, 1): (-48.590378, -40.893395, 49.106605),
2017+
('Bell', 30, 0.5, c): (-25.658906, -56.309932, 43.897886)}
20182018
new_elev, new_azim, new_roll = expectations[(style, roll, dx, dy)]
20192019
np.testing.assert_allclose((ax.elev, ax.azim, ax.roll),
20202020
(new_elev, new_azim, new_roll), atol=1e-6)

0 commit comments

Comments
 (0)