[vtkusers] vtkPolyDataNormals-access violation reading location..

kývýlcým helhel kvlcm_helhel at yahoo.com
Wed Mar 5 06:09:39 EST 2008


Hi everyone,
I wrote the code below to reach the normals one by one,


vtkPolyDataNormals *norm= vtkPolyDataNormals::New();
    norm->SetInput(pd);
    norm->FlipNormalsOff();
    norm->SetComputePointNormals(1);
    norm->Update();
    vtkPolyData *vtknorm=norm->GetOutput();
    vtkPointData *normpoints=vtknorm->GetPointData();
    vtkDataArray *arraynorm= normpoints->GetNormals();
    int k=vtknorm->GetNumberOfPoints();
    for(int i=0;k;i++)
    {   
        double* nrm= arraynorm->GetTuple3(i);
        //nrm=arraynorm->GetTuple3(i);
        printf("%f %f %f \n",(float)nrm[0],(float)nrm[1],(float)nrm[2]);
    }

k is 307200, ý have 307200 points in vtkPolyData structure.
but in this  double* nrm= arraynorm->GetTuple3(i); I have access violation exception.I must  find the normals of each point.Please help me

Kiv

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080305/51144648/attachment.htm>


More information about the vtkusers mailing list