[vtkusers] vtkUnstructuredGrid and Gouraud Shading

Luca Pallozzi Lavorante lplavorante at gmail.com
Tue Nov 29 10:05:34 EST 2016


Hi Ken, thank you very much for your reply. I will follow the suggested
pipeline.


  Luca

On Tue, Nov 29, 2016 at 12:33 PM, Ken Martin <ken.martin at kitware.com> wrote:

> You need normals for smooth shading. So yes, something like
>
> vtkUnstructuredGrid -> vtkGeometryFilter (with merging on) ->
> vtkPolyDataNormals
>
> Do you have to convert to polydata? Technically no, you could volume
> render the 3D cells using ProjectedTetrahedra but the most common approach
> is to extract some sort of polygonal surface and render that.
>
>
>
>
>
>
> On Tue, Nov 29, 2016 at 6:57 AM, Luca Pallozzi Lavorante <
> lplavorante at gmail.com> wrote:
>
>> 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
>>
>> _______________________________________________
>> 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 VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Ken Martin PhD
> Chairman & CFO
> Kitware Inc.
> 28 Corporate Drive
> Clifton Park NY 12065
> 518 371 3971
>
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee.  Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message.  Thank you.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161129/b776459a/attachment.html>


More information about the vtkusers mailing list