Thanks David- that worked perfectly!<br><br><div class="gmail_quote">On Tue, Jun 26, 2012 at 2:35 PM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Use vtkDataSetAttributes::Get/SetNormals() to access the normals.<br>
Likewise use Get/SetTCoords() to access the texture coordinates.<br>
<br>
od = self.GetOutput()<br>
id = self.GetInput()<br>
od.GetPointData().ShallowCopy(id.GetPointData())<br>
innorm = od.GetPointData().GetNormals()<br>
onorm = innorm.NewInstance()<br>
onorm.DeepCopy(innorm)<br>
onorm.SetName("NewNormals")<br>
for x in range(0, onorm.GetNumberOfTuples()):<br>
a,b,c = onorm.GetTuple(x)<br>
print a,b,c<br>
a = -1*a<br>
b = -1*b<br>
c = -1*c<br>
onorm.SetTuple3(x, a,b,c)<br>
od.GetPointData().SetNormals(onorm)<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4909" value="+15188814909">518-881-4909</a><br>
</font></span><div class="im HOEnZb"><br>
<br>
On Tue, Jun 26, 2012 at 2:09 PM, Kathleen Schwarz <<a href="mailto:kas382@cornell.edu">kas382@cornell.edu</a>> wrote:<br>
</div><div class="HOEnZb"><div class="h5">> Hello,<br>
> I am trying to transform a surface using a programmable filter, and I am<br>
> unable to get the output to use the normals. Even the most basic filter:<br>
><br>
> output.PointData.append(inputs[0].PointData['Normals'], 'Normals')<br>
><br>
> results in the mesh being copied but the normals not being used. The<br>
> normals appear as a Data Array, but are not used in rendering. However,<br>
> using the copy arrays option in the properties of the programmable filter<br>
> lead to the normals being used correctly.<br>
><br>
> What I would like to do is to apply an affine transformation on the point<br>
> positions and normals (and visualize contours of a scalar field on a<br>
> uniform, nonorthogonal parallelepiped grid), so I can't just use the copy<br>
> arrays option.<br>
><br>
> Thanks in advance!<br>
> -Katie<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
</div></div></blockquote></div><br>