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

Evan Kao tossin at gmail.com
Tue Jul 26 12:43:19 EDT 2016


Ah, actually I think that was my problem.  I didn't consider that only the
active vectors were transformed.

Thanks,
Evan

On Mon, Jul 25, 2016 at 7:07 PM, Cory Quammen <cory.quammen at kitware.com>
wrote:

> Evan,
>
> I recall this being an issue that was reported on the bug tracker, but
> can't for the life of me find it. Mind filing a bug report?
>
> Note that it is probably only reasonable to transform the array that is
> designated as the "active vectors" array, as one could have multiple
> component arrays that do not represent a vector and therefore should not be
> transformed by the vtkTransformFilter.
>
> Thanks,
> Cory
>
> On Mon, Jul 25, 2016 at 7:06 PM, Evan Kao <tossin at gmail.com> wrote:
>
>> 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()
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160726/abd3c71f/attachment.html>
-------------- 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/20160726/abd3c71f/attachment.png>
-------------- 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/20160726/abd3c71f/attachment-0001.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/20160726/abd3c71f/attachment-0002.png>


More information about the vtkusers mailing list