From 6b6e2a4019b84edb31d7efa3be5e05db7e8a7da1 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 18 Dec 2008 17:32:01 +0000 Subject: [PATCH] MEDMEM Industrialization 2008 do not compute baryCenter if no intersection --- src/INTERP_KERNEL/TriangulationIntersector.txx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.39.2