[vtkusers] How to find specific point's normal....?

David Doria daviddoria+vtk at gmail.com
Thu Apr 8 10:01:19 EDT 2010


On Thu, Apr 8, 2010 at 9:32 AM, renlishen <renlishen at gmail.com> wrote:
>
> Hi everyone~
> I have a big problem on my code...
> After using
> 1.vtkMarchingCubes *mCubes = vtkMarchingCubes::New() ;
>   mCubes->ComputeNormalsOn() ;
>
> or
>
> 2.vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
>  skinNormals->ComputePointNormalsOn() ;
>
> I can get point's normal successful by
> (or skinNormals)
> vtkFloatArray *PointNormalArray = vtkFloatArray::SafeDownCast(
> mCubes->GetOutput()->GetPointData()->GetNormals() ) ;
>
> My question is
> how to get specific point's normal that I want...?
> does anyone can help me to solve this problem..?
> Thanks a lot!
>
>
> RenLi

I think you are just looking for this:

double n[3];
PointNormalArray->GetTuple(i, n);

Here is an example:
http://www.vtk.org/Wiki/VTK/Examples/PolyDataPointNormals

Thanks,

David



More information about the vtkusers mailing list