[vtkusers] vtkUnstructuredGrid and Gouraud Shading

Luca Pallozzi Lavorante lplavorante at gmail.com
Tue Nov 29 06:57:44 EST 2016


Hi  vtkusers,

how can I display a vtkUnstructuredGrid using Gouraud shading? I have seen
two or three similar posts on the list but was unable to find any answer.
I have an unstructured grid with ~50000 3D cells (Triquadratic Hexahedra).
I need to extract its outer shape and visualize it with a smooth
appearance. I verified that the method
vtkActor::GetProperty()->SetInterpolationToGouraud() is of no avail on an
actor built directly from the grid's vtkDataSetMapper. So I though I should
convert the unstructured grid to a polygonal representation in order to
compute normals on it using vtkPolyDataNormals. Here I have another doubt.
I want to extract just the boundary faces from the unstructured grid
(something I have successfully done using a vtkDataSetSurfaceFilter fed
with a vtkStructuredGrid).
Which is the proper pipeline I should follow?
vtkUnstructuredGrid -> vtkDataSetSurfaceFilter -> vtkPolyDataNormals ?
Is vtkDataSetSurfaceFilter able to extract only the boundary faces from an
unstructured grid?
Also, is the polygonal conversion strictly necessary? I ask this because
this is probably computationally costly.

 Thank you in advance for any help,

          Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161129/bd144726/attachment.html>


More information about the vtkusers mailing list