[vtkusers] vtkTensorGlyph and eigenvalues, eigenvectors

Rustem Khabetdinov rustem.khabetdinov at gmail.com
Fri Dec 16 12:09:34 EST 2016


Hello,
I have eigenvectors and eigenvalues and when I use them to create tensor it
never shows up as an ellipsoid. Here's my code:

vectors = [-0.99912958,  0.04171436,  0,  0,  0, 1, -0.04171436,
-0.99912958, -0]
values = [ -5.05684034e+14,   5.09855264e+14,   6.13882990e+14]
points = vtk.vtkPoints()
points.InsertNextPoint(values)
poly_data = vtk.vtkPolyData()
poly_data.SetPoints(points)
tensor_data = vtk.vtkDoubleArray()
tensor_data.SetNumberOfTuples(1)
tensor_data.SetNumberOfComponents(9)
tensor_data.InsertTuple(0, vectors)
poly_data.GetPointData().SetTensors(tensor_data)

sphere = vtk.vtkSphereSource()
sphere.SetThetaResolution(8)
sphere.SetPhiResolution(8)
sphere.Update()

tensor = vtk.vtkTensorGlyph()
tensor.SetInputData(poly_data)
tensor.SetSourceData(sphere.GetOutput())
tensor.SetScaleFactor(10)
tensor.ClampScalingOn()
tensor.ThreeGlyphsOff()
tensor.ExtractEigenvaluesOff()
tensor.Update()

Am I doing something wrong?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161216/73afc5e5/attachment.html>


More information about the vtkusers mailing list