crash on calc normal to a polygon in 3-D with less than 3 points
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I am using VTK 4.4.0 release. This also happend in the versions before.
vtkPolygon.cxx: "$Revision: 1.104 $"
void vtkPolygon::ComputeNormal(vtkPoints *p, int numPts, vtkIdType *pts, double *n)
In this function, sometimes I have int numPts == 1 !! That is why pts[1] equals -842150451 and I cannot get the correct point in line 92:
p->GetPoint(pts[1],v2);
And my application crashes. I tried something like: if ( numPts > 1 ) p->GetPoint(pts[1],v2); This works and my geometry looks good. But the loop afterwards for (i=0; i < numPts; i++) { ... } uses v2 !!
So, there should be some fix in this bug or even that the function is not called for numPts == 1.
best regards, Ingo