From: eap Date: Thu, 18 Dec 2008 17:32:01 +0000 (+0000) Subject: MEDMEM Industrialization 2008 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6b6e2a4019b84edb31d7efa3be5e05db7e8a7da1;p=tools%2Fmedcoupling.git MEDMEM Industrialization 2008 do not compute baryCenter if no intersection --- diff --git a/src/INTERP_KERNEL/TriangulationIntersector.txx b/src/INTERP_KERNEL/TriangulationIntersector.txx index 9a2ae9653..c78dc4537 100644 --- a/src/INTERP_KERNEL/TriangulationIntersector.txx +++ b/src/INTERP_KERNEL/TriangulationIntersector.txx @@ -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 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::_printLevel >= 3)