[vtkusers] vtkPolyDataNormals-access violation reading location..

Amy Squillacote ahs at cfdrc.com
Wed Mar 5 12:26:04 EST 2008


Hi Kiv,

Please keep the discussion on the vtkusers list.

Have you verified that arraynorm is non-NULL? This could happen if your 
input vtkPolyData has no polygons or triangle strips (e.g., if your 
vtkPolyData only has vertex cells).

- Amy

kývýlcým helhel wrote:
> Hi Amy,
> I had a stupid mistake there but the problem is not it.I tried to 
> access some elements manually such as nrm= arraynorm->GetTuple3(5);But 
> I hadsame exception every time.Have you any suggestion??
>
> Kiv
>
> */Amy Squillacote <ahs at cfdrc.com>/* wrote:
>
>     Hi Kiv,
>
>     Maybe this is just a typo, but you haven't set a condition where your
>     for loop will stop. Instead of "for(int i=0;k;i++)", try "for(int
>     i=0;i
>
>     - Amy
>
>     kıvılcım helhel wrote:
>     > 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.
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > This is the private VTK discussion list.
>     > Please keep messages on-topic. Check the FAQ at:
>     http://www.vtk.org/Wiki/VTK_FAQ
>     > Follow this link to subscribe/unsubscribe:
>     > http://www.vtk.org/mailman/listinfo/vtkusers
>     >
>
>     -- 
>     Amy Squillacote Phone: (256) 726-4839
>     Computer Scientist Fax: (256) 726-4806
>     CFD Research Corporation Web: http://www.cfdrc.com
>     215 Wynn Drive, Suite 501
>     Huntsville, AL 35805
>
>
>
> ------------------------------------------------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try 
> it now. 
> <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20> 


-- 
Amy Squillacote                    Phone: (256) 726-4839
Computer Scientist                 Fax: (256) 726-4806
CFD Research Corporation           Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL  35805





More information about the vtkusers mailing list