[vtkusers] Possible bug: TransformFilter does not transform vectors for line polydata.

Evan Kao tossin at gmail.com
Mon Jul 25 19:06:03 EDT 2016


Hello all,

I attached a .vtp file of a line that has vector point data.  When I apply
a transform filter (code is provided below), the points are transformed
properly, but the vectors are not:

Original
Transformed
[image: Inline image 2]   [image: Inline image 3]

It turns out the vectors weren't transformed at all for some reason:

Before                                                      After
[image: Inline image 4]

However, the vectors do transform properly when I'm transforming a 3D
unstructured grid with tetrahedral and hexahedral cells.  I thought the bug
might be related to the topology, but when I put the polyline through a
vtkDelauany3D filter, the transform still didn't work correctly.  What's
going on here?

I should mention I tested this in both VTK (v7.0) and Paraview (v5.0).

Thanks,
Evan Kao




Code:

import vtk


tf = (-0.0040248411422550, 0.9994518507299456, 0.0328602910252758,
-0.0002179778201077,

-0.9998799178301331, -0.0045139785455129, 0.0148247737823206,
0.2103193900724151,

0.0149649782420806, -0.0327966777307833, 0.9993500024295978,
-0.0002392083616021,

0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000)


transform = vtk.vtkTransform()

transform.SetMatrix(tf)


transformFilter = vtk.vtkTransformFilter()

transformFilter.SetInputData(input)

transformFilter.SetTransform(transform)

transformFilter.Update()

output = transformFilter.GetOutput()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160725/c314e3b5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: original geometry and vectors.png
Type: image/png
Size: 8638 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160725/c314e3b5/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Spreadsheet comparison.png
Type: image/png
Size: 18448 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160725/c314e3b5/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transformed geometry and vectors.png
Type: image/png
Size: 7671 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160725/c314e3b5/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: line.vtp
Type: application/octet-stream
Size: 15782 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160725/c314e3b5/attachment.obj>


More information about the vtkusers mailing list