I am using vtkLookupTable() and vtkUnsignedCharArray() to re-color a mesh. The Array that contains the colors is modified several times interactively. The problem I have is that to show the actor with a smooth surface I am using vtkPolyDataNormals, as shown below, but I have to create vtkPolydataNormals() everytime I need to recolor the actor. I can create the mapper only once and modify it but it has not been possible to do the same with the vtkPolydataNormals().
Is there a way to achieve a smooth surface in an efficient manner?
Changing the appearance of the dataset via the mapper and/or actor is always more efficient than modifying the dataset itself. Modifying the dataset always requires that downstream filters have to re-execute.
To be more clear, what I’m saying is that the mesh scalars should be the efieldnorms, not the colors. The coloring can be applied (very efficiently) by the mapper.
Ok thank you! I will look into it. I just found examples using the LUT this way, since I am just coloring a circle that moves interactively on the surface of the mesh.
The mapper applies the LUT to the whole mesh, not just part of the mesh. So if you’re only recoloring part of the mesh, then what I suggested will not work.
Instead, you can generate the normals before recoloring the mesh, instead of after. The vtkPolyDataNormals filter can be used on meshes that have no scalars.