[vtkusers] vtkNormal

David Doria daviddoria at gmail.com
Thu Feb 2 08:39:50 EST 2012


On Thu, Feb 2, 2012 at 4:43 AM, youpie <meriadegp at yahoo.fr> wrote:
> Hi, I want to know how I can compute normal from an unstructured grid.
> For a vtkPolyData, I use vtkPolyDataNormal and with four codes lines, that
> works.
> But for the unstructured grid, the only way I see is to complete a tab and
> use :
> this->getUnstructuredGrid()->GetPointData()->SetNormals(normals);
> But I have, me, to create the normals !
>
> See the difference :
> http://vtk.1045678.n5.nabble.com/file/n5450164/UGrid_whithout_normal.png
>
> and :
> http://vtk.1045678.n5.nabble.com/file/n5450164/UGrid_with_normal.png
>
> Thanks in advance.
>
> ps: of course I cannot use vtkPolyData instead of unstructured grid...

I don't understand the difference in the two images you posted?

Why can you not use vtkPolyData? What is your real data set like? In
your example, you just have a triangle, which can easily be stored in
a vtkPolyData.

David



More information about the vtkusers mailing list