[Paraview] Changing calculator output from double array to float array?

Moreland, Kenneth kmorel at sandia.gov
Tue Aug 16 16:51:31 EDT 2011


I don't have an answer to your question, but I'm pretty sure your hunch is
wrong and there is no need to write out floats.  There should be no
problems with having normals that are doubles.

What is probably wrong is that nothing has set the normal attributes.  The
VTK mappers do not just take any field named "Normals" and assumes they
are the normals.  Rather, you have to assign special attributes to fields
in the vtkDataSetAttributes object.

There is no direct way (that I know of) to assign a particular array as
the normals.  However, you can force it by using the programmable filter
with the following script:

input = self.GetInputDataObject(0,0)
output = self.GetOutputDataObject(0)
output.ShallowCopy(input)
output.GetPointData().SetActiveNormals('Normals')

-Ken


   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********  
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel




On 8/16/11 10:38 AM, "Cory Quammen" <cquammen at cs.unc.edu> wrote:

>Is it possible to get the calculator in ParaView to output a float
>array instead of a double array? The vtkArrayCalculator class seems to
>support this, but it isn't exposed in the properties panel of the
>calculator filter.
>
>What I really want to do is generate a "Normals" array that will be
>used for lighting calculations. My hunch is that what I have isn't
>working because "Normals" are expected to be a float array instead of
>a double array.
>
>Thanks,
>Cory
>
>-- 
>Cory Quammen
>Research Associate
>Department of Computer Science
>The University of North Carolina at Chapel Hill
>_______________________________________________
>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 ParaView Wiki at:
>http://paraview.org/Wiki/ParaView
>
>Follow this link to subscribe/unsubscribe:
>http://www.paraview.org/mailman/listinfo/paraview
>




More information about the ParaView mailing list