<div dir="ltr"><div>Ah, actually I think that was my problem. I didn't consider that only the active vectors were transformed.<br><br></div><div>Thanks,<br></div>Evan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 25, 2016 at 7:07 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Evan,<div><br></div><div>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?</div><div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jul 25, 2016 at 7:06 PM, Evan Kao <span dir="ltr"><<a href="mailto:tossin@gmail.com" target="_blank">tossin@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hello all,<br><br></div>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:<br><br></div><div>Original Transformed<br><img alt="Inline image 2" src="cid:ii_156244d076e56769" height="561" width="472"> <img alt="Inline image 3" src="cid:ii_156244d5cdcc3615" height="561" width="484"><br><br>It turns out the vectors weren't transformed at all for some reason:<br><br></div><div>Before After<br></div><div><img alt="Inline image 4" src="cid:ii_156244db070cf447" height="354" width="496"><br><br>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?<br><br>I should mention I tested this in both VTK (v7.0) and Paraview (v5.0).<br><br></div>Thanks,<br>Evan Kao<br><br><br><br><br></div>Code:<br><br><span style="font-family:monospace,monospace"><span style="font-weight:600;color:rgb(0,128,0)">import</span> <span style="font-weight:600;color:rgb(0,0,255)">vtk</span>
</span><pre style="margin:0px;text-indent:0px;font-weight:600;color:rgb(0,0,255)"><span style="font-family:monospace,monospace"><br></span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">tf <span style="color:rgb(102,102,102)">=</span> (<span style="color:rgb(102,102,102)">-0.0040248411422550</span>, <span style="color:rgb(102,102,102)">0.9994518507299456</span>, <span style="color:rgb(102,102,102)">0.0328602910252758</span>, <span style="color:rgb(102,102,102)">-0.0002179778201077</span>, </span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace"><span style="color:rgb(102,102,102)">-0.9998799178301331</span>, <span style="color:rgb(102,102,102)">-0.0045139785455129</span>, <span style="color:rgb(102,102,102)">0.0148247737823206</span>, <span style="color:rgb(102,102,102)">0.2103193900724151</span>, </span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace"><span style="color:rgb(102,102,102)">0.0149649782420806</span>, <span style="color:rgb(102,102,102)">-0.0327966777307833</span>, <span style="color:rgb(102,102,102)">0.9993500024295978</span>, <span style="color:rgb(102,102,102)">-0.0002392083616021</span>, </span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace"><span style="color:rgb(102,102,102)">0.0000000000000000</span>, <span style="color:rgb(102,102,102)">0.0000000000000000</span>, <span style="color:rgb(102,102,102)">0.0000000000000000</span>, <span style="color:rgb(102,102,102)">1.0000000000000000</span>)</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace"><br></span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">transform <span style="color:rgb(102,102,102)">=</span> vtk<span style="color:rgb(102,102,102)">.</span>vtkTransform()</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">transform<span style="color:rgb(102,102,102)">.</span>SetMatrix(tf)</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace"><br></span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">transformFilter <span style="color:rgb(102,102,102)">=</span> vtk<span style="color:rgb(102,102,102)">.</span>vtkTransformFilter()</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">transformFilter<span style="color:rgb(102,102,102)">.</span>SetInputData(input)</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">transformFilter<span style="color:rgb(102,102,102)">.</span>SetTransform(transform)</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace">transformFilter<span style="color:rgb(102,102,102)">.</span>Update()</span></pre><span style="font-family:monospace,monospace">
</span><pre style="margin:0px;text-indent:0px"><span style="font-family:monospace,monospace"></span><span style="font-family:monospace,monospace"></span><span style="font-family:monospace,monospace">output = transformFilter<span style="color:rgb(102,102,102)">.</span>GetOutput()</span><span style="font-family:monospace,monospace"></span><br></pre></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</font></span></div>
</blockquote></div><br></div>