From: enk Date: Fri, 24 Jun 2005 11:46:41 +0000 (+0000) Subject: Some correction. X-Git-Tag: T3_0_0_a4~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c9ff5501e6032a540892a4d503f0bdf332ac74be;p=modules%2Fgui.git Some correction. --- diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index f6e19392a..3e22b42a6 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -192,10 +192,12 @@ bool IsConnectedFacesOnOnePlane( vtkUnstructuredGrid* theGrid, float b1 = vtkMath::Norm(vec_b1); float b2 = vtkMath::Norm(vec_b2); + float aCos = vtkMath::Dot(vec_b1,vec_b2)/(b1*b2); - float angle=180*acosf(vtkMath::Dot(vec_b1,vec_b2)/(b1*b2))/vtkMath::Pi(); + float angle=90.0; + angle = aCos>=1.0 ? 0.0 : 180*acosf(aCos)/vtkMath::Pi(); - if( angle <= FACE_ANGLE_TOLERANCE ) + if( angle <= FACE_ANGLE_TOLERANCE) status = true; if (MYDEBUG){ for(int k=0;k<4;k++){ @@ -205,7 +207,7 @@ bool IsConnectedFacesOnOnePlane( vtkUnstructuredGrid* theGrid, } cout << p[k][2] << ") "; } - cout << "angle="<