[vtkusers] colour mapping stress ellipsoids

Ugur BOZKAYA u.bozkaya at fmcon.com
Mon Jul 24 17:35:44 EDT 2006


Selam Mecit,

As far as I know, there is no class for this purpose in VTK currently. 
vtkTensorGlyph and vtkGlyph3D can be used for typical tensor 
visualization. But the tensors are shown only in one color(RGB is also 
possible I guess, but it will not solve your problem). If you are 
familiar enough with VTK, you can change these classes for your purpose. 
Those glyph shapes such as ellipsoids (deformed spheres) are already 
defined as vtkPolyData, so you can use other shapes.

I assume you are planning to use 3 orthogonal directions for coloring.  
You only need a vtkDataArray (e.g. vtkDoubleArray) with 3 components. So 
for each tensor location you will have 3 values.

I guess it will be easier to write your own class which looks simpler. 
You will have your output as vtkPolyData, which is actually composed of 
your tensors. May be you can have a function which calculates a 
tensorshape(multicolored vtkPolyData) for a given location then you can 
add the output of this function to your volume output for each location.

Good Luck,
Ugur

Mecit Yaman wrote:
> hi,
>
> i am trying to visualize second order tensors using stress ellipsoids with a
> different color mapping. the usual colouring is to map a scalar value, e.g.
> components, effective stress, trace or other scalars on the surface. i want
> to do a colouring where each point/polygon on the ellipsoid will be coloured
> differently. the color scheme is defined as follows:
>
> the color along direction n(i) of the ellipsoid is obtained from the angle
> between the n(i), direction vector, and the stress vector along n(i). (the
> stress vector along a direction can be obtained by multiplying the stress
> tensor, T(ij) with the direction vector, n(i)).  Thus:
>
> T(ij) 	tensor
> n(i) 	direction vector
>
> stress vector(i) = T(ij) . n(i)
>
> angle between stress vector and direction vector
>
> cos(angle) = stress vector (i) . n(i) / ( |stress vector(i)| | n(i)|)
>
> how does one colour map these angles, which are different for every
> direction on an ellipsoid? do I need to change stress ellipsoid into a
> polygonal data type? how do I calculate and store the angles in VTK?
>
> i am able to render the icons in Mathematica, and will be happy to share
> information with anyone interested.
>
> thanks,
>
> M Yaman
> University of Cape Town
>
>
>
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>   




More information about the vtkusers mailing list