From 08ebe1134ce533b5ae9d10f0d14ef5ad98d14b9b Mon Sep 17 00:00:00 2001 From: Jeffrey Wardman Date: Wed, 8 May 2024 14:51:07 +1000 Subject: [PATCH] handle empty axis for rotation --- vedo/transformations.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vedo/transformations.py b/vedo/transformations.py index f18d764d..01fdedef 100644 --- a/vedo/transformations.py +++ b/vedo/transformations.py @@ -423,12 +423,15 @@ def rotate(self, angle, axis=(1, 0, 0), point=(0, 0, 0), rad=False) -> Self: ``` ![](https://vedo.embl.es/images/feats/rotate_axis.png) """ + if all(axis == 0): + return self if not angle: return self if rad: anglerad = angle else: anglerad = np.deg2rad(angle) + axis = np.asarray(axis) / np.linalg.norm(axis) a = np.cos(anglerad / 2) b, c, d = -axis * np.sin(anglerad / 2)