]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
MEDMEM Industrialization 2008
authoreap <eap@opencascade.com>
Thu, 18 Dec 2008 17:32:01 +0000 (17:32 +0000)
committereap <eap@opencascade.com>
Thu, 18 Dec 2008 17:32:01 +0000 (17:32 +0000)
  do not compute baryCenter if no intersection

src/INTERP_KERNEL/TriangulationIntersector.txx

index 9a2ae9653aa3f2c7714c6e4970e60b4be6a222a4..c78dc45371d2b93a4c627c521e4aa000a5b22c37 100644 (file)
@@ -102,10 +102,11 @@ namespace INTERP_KERNEL
           INTERP_KERNEL::crossprod<2>(&inter[0],&inter[2*i],&inter[2*(i+1)],area);
           result +=0.5*fabs(area[0]);
         }
-        if ( baryCentre ) {
+        if ( baryCentre && nb_inter > 2) {
           std::vector<double> Bary=INTERP_KERNEL::bary_poly(inter);
           baryCentre[0] = Bary[0];
           baryCentre[1] = Bary[1];
+          //std::cout << "Bary: " << baryCentre[0] << ", " << baryCentre[1] << std::endl;
         }
         //DEBUG prints
         if(PlanarIntersector<MyMeshType>::_printLevel >= 3)