[vtkusers] Bug in vtkPolyDataNormals?
    danimede 
    danimede at tiscali.it
       
    Thu Dec 20 11:45:46 EST 2012
    
    
  
Hi All,
I have found a weird computation in vtkPolyDataNormals.cpp. The issue is in
the follow piece of code:
for (i=0; i < numNewPts; i++) {
      newNormals->GetTuple(i, vertNormal);
      length = vtkMath::Norm(vertNormal);
      if (length != 0.0) {
          for (j=0; j < 3; j++) {
              n[j] = vertNormal[j] / length * flipDirection;
          }
      }
      newNormals->SetTuple(i,n);
}
In the code if we have a length equal to zero we set in the i-th tuple the
normal values of the (i-th)-1 point!
Is it a bug or maybe there are some hypothesis like consecutive index points
can have the same normal vector? 
Probably the solution is to set the normal to {0.0 , 0.0 , 0.0} if we have a
length equal to zero.
Regards,
Daniele
--
View this message in context: http://vtk.1045678.n5.nabble.com/Bug-in-vtkPolyDataNormals-tp5717683.html
Sent from the VTK - Users mailing list archive at Nabble.com.
    
    
More information about the vtkusers
mailing list