Superquadric source has y axis orientation but claims to provide z axis orientation. Patches included
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
From the source code documentation:
-
vtkCylinderSource.h states in line 18 that the axis of the cylinder is aligned along the global y-axis.
-
vtkSuperquadricSource.cxx states in line 50 and 277 that the default axis of symmetry is aligned along the global z-axis.
Different axes. Please consider the python code attached. It renders a cylinder and a superquadric source next to each other. Clearly, both sources have the same axis of symmetry.
The attached GNU Octave code - copy and pasted into GNU Octave shell - renders superquadrics with three different axes of symmetry. The definition of the superquadrics are taken from the paper Gordon Kindlmann. Superquadric Tensor Glyphs. In Proceedings IEEE TVCG/EG Symposium on Visualization 2004, pages 147-154, May 2004, http://www.cs.utah.edu/~gk/papers/vissym04/ Formulas (3) and (5) in http://www.cs.utah.edu/~gk/papers/vissym04/vissym04kindlmann.pdf
In the paper the definition range for phi is [0,pi] and for theta [0,2pi]. The present implementation in VTK uses different ranges: phi in [-pi/2,pi], theta in [-pi,pi] The formulas have been adapted accordingly.
Please find attached a patch that sets the axis of superquadric aligned to the global z-axis as claimed.
The remaining patches provide the pending code for alignment along the global y-axis as well as a method to set the desired axis of alignment.