MantisBT - VTK
View Issue Details
0011231VTK(No Category)public2010-09-14 06:552013-04-05 20:35
Sven Buijssen 
Sebastien Jourdain 
normalminoralways
closedfixed 
 
 
0011231: Superquadric source has y axis orientation but claims to provide z axis orientation. Patches included
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.
No tags attached.
? vtk_create_sources_cylinder_along_with_superquadric.py (1,306) 2010-09-14 06:55
https://www.vtk.org/Bug/file/8385/vtk_create_sources_cylinder_along_with_superquadric.py
? octave_superquadric.source.m (2,905) 2010-09-14 06:56
https://www.vtk.org/Bug/file/8386/octave_superquadric.source.m
patch 0001-BUG-Axis-of-symmetry-claimed-to-be-the-global-z-axis.patch (3,188) 2010-09-14 06:56
https://www.vtk.org/Bug/file/8387/0001-BUG-Axis-of-symmetry-claimed-to-be-the-global-z-axis.patch
patch 0002-ENH-Provide-code-for-aligned-of-axis-along-the-globa.patch (1,051) 2010-09-14 06:56
https://www.vtk.org/Bug/file/8388/0002-ENH-Provide-code-for-aligned-of-axis-along-the-globa.patch
patch 0003-ENH-Provide-a-method-to-set-axis-of-symmetry.patch (1,750) 2010-09-14 06:56
https://www.vtk.org/Bug/file/8389/0003-ENH-Provide-a-method-to-set-axis-of-symmetry.patch
patch 0001-BUG-Axis-of-symmetry-claimed-to-be-the-global-z-axis.updated.patch (3,974) 2010-09-23 17:04
https://www.vtk.org/Bug/file/8409/0001-BUG-Axis-of-symmetry-claimed-to-be-the-global-z-axis.updated.patch
patch 0002-ENH-Provide-code-for-aligned-of-axis-along-the-globa.updated.patch (1,384) 2010-09-23 17:04
https://www.vtk.org/Bug/file/8410/0002-ENH-Provide-code-for-aligned-of-axis-along-the-globa.updated.patch
png newSource.png (21,692) 2012-11-16 17:04
https://www.vtk.org/Bug/file/9342/newSource.png
png

png oldSource.png (21,084) 2012-11-16 17:04
https://www.vtk.org/Bug/file/9343/oldSource.png
png
Issue History
2010-09-14 06:55Sven BuijssenNew Issue
2010-09-14 06:55Sven BuijssenFile Added: vtk_create_sources_cylinder_along_with_superquadric.py
2010-09-14 06:56Sven BuijssenFile Added: octave_superquadric.source.m
2010-09-14 06:56Sven BuijssenFile Added: 0001-BUG-Axis-of-symmetry-claimed-to-be-the-global-z-axis.patch
2010-09-14 06:56Sven BuijssenFile Added: 0002-ENH-Provide-code-for-aligned-of-axis-along-the-globa.patch
2010-09-14 06:56Sven BuijssenFile Added: 0003-ENH-Provide-a-method-to-set-axis-of-symmetry.patch
2010-09-23 17:04Sven BuijssenNote Added: 0022338
2010-09-23 17:04Sven BuijssenFile Added: 0001-BUG-Axis-of-symmetry-claimed-to-be-the-global-z-axis.updated.patch
2010-09-23 17:04Sven BuijssenFile Added: 0002-ENH-Provide-code-for-aligned-of-axis-along-the-globa.updated.patch
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2012-11-12 11:13guestStatusexpired => tabled
2012-11-12 11:18guestStatustabled => todo
2012-11-12 11:19guestStatustodo => active development
2012-11-16 17:04Sebastien JourdainFile Added: newSource.png
2012-11-16 17:04Sebastien JourdainFile Added: oldSource.png
2012-11-16 17:10Sebastien JourdainNote Added: 0029744
2012-11-16 17:13Sebastien JourdainAssigned To => Sebastien Jourdain
2012-11-16 17:13Sebastien JourdainStatusactive development => todo
2012-11-16 17:13Sebastien JourdainResolutionopen => fixed
2012-11-16 17:14Sebastien JourdainStatustodo => backlog
2012-11-16 17:14Sebastien JourdainResolutionfixed => reopened
2012-11-18 18:08Sebastien JourdainStatusbacklog => todo
2012-11-18 18:08Sebastien JourdainResolutionreopened => fixed
2012-11-18 18:08Sebastien JourdainStatustodo => active development
2012-11-18 18:09Sebastien JourdainStatusactive development => gatekeeper review
2012-11-18 18:09Sebastien JourdainNote Added: 0029745
2012-11-18 18:09Sebastien JourdainStatusgatekeeper review => customer review
2012-11-18 18:11Sebastien JourdainNote Added: 0029746
2013-04-05 20:35Berk GeveciStatuscustomer review => closed

Notes
(0022338)
Sven Buijssen   
2010-09-23 17:04   
I've identified an additional problem with the original implementation: the location of poles of a superquadric was assumed to be independent of the axis of symmetry. The problem merely became evident for the parameter subspace with toroidal = 0, theta = 1, phi < 1 and a superquadric symmetric to the x-axis: the poles got positioned at the center of gravity of the superquadric. A planar capping is intended, though.
I'll upload again the first two patch files that have been updated accordingly.
(0029744)
Sebastien Jourdain   
2012-11-16 17:10   
I've reverted to patch as they were backward incompatible regarding the angle management.
Therefore, to move forward, either the generated source should remain identical as before or discuss the reason of the changes on the mailing list and managed to be approved by the ARB.

I've created a gerrit topic that could be apply if we want to move forward.

http://review.source.kitware.com/#/t/1745/ [^]

I've attached some image of a ParaView test that illustrate the change in the Source generation. (pv.ColorEditor2)

I'll let you take over Sven... Once the community and the ARB approve I'll be able to integrate it, but for now, I can not do it as it might brake some existing code.
(0029745)
Sebastien Jourdain   
2012-11-18 18:09   
Merged into master
(0029746)
Sebastien Jourdain   
2012-11-18 18:11   
commit 2e6bb23adac980e866fd248bdecd1974e68a97ad
Merge: c550908 8d0ada1
Author: Sebastien Jourdain <sebastien.jourdain@kitware.com>
Date: Sun Nov 18 17:59:53 2012 -0500

    Merge topic 'proposition_of_improvement_of_super_quadric_source' into master
    
    8d0ada17 Bring back the old behavior
    56140286 Revert "Revert "Add code to support 'invalid' symmetric axis value""
    1c5e87c2 Revert "Revert "ENH: Provide a method to set axis of symmetry.""
    d96193b5 Revert "Revert "ENH: Provide code for aligned of axis along the global y-axis.""
    3afab72c Revert "Revert "BUG: Axis of symmetry claimed to be the global z axis, but was the y-axis.""