[vtkusers] vtkTensorGlyph and eigenvalues, eigenvectors
Rustem Khabetdinov
rustem.khabetdinov at gmail.com
Sat Dec 17 14:58:58 EST 2016
Hello again, everyone.
I've found my mistake. I didn't use my eigenvalues to make normals instead
I used them as centre point.
Best Regards,
Rustem Khabetdinov
2016-12-16 20:09 GMT+03:00 Rustem Khabetdinov <rustem.khabetdinov at gmail.com>
:
> 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/20161217/2932326a/attachment.html>
More information about the vtkusers
mailing list