From: El Hadi Moussi Date: Tue, 6 Aug 2024 15:47:13 +0000 (+0200) Subject: Correct the computation of Cone properties X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c89f409aad5143691c43ec7f7c2d47b9f86ccbfc;p=tools%2Fmedcoupling.git Correct the computation of Cone properties The size of q1_indices and q2_indices can be different --- diff --git a/src/ShapeRecogn/Areas.cxx b/src/ShapeRecogn/Areas.cxx index 5c2559f8c..f3d274fdf 100644 --- a/src/ShapeRecogn/Areas.cxx +++ b/src/ShapeRecogn/Areas.cxx @@ -379,7 +379,8 @@ void Areas::computeConeProperties(mcIdType areaId) // std::vector heights(q1_indices.size(), 0.0); // std::vector distancesToApex(q1_indices.size(), 0.0); std::array p{0.0, 0.0, 0.0}; - for (size_t i = 0; i < q1_indices.size(); ++i) + size_t min_q_size = std::min(q1_indices.size(), q2_indices.size()); + for (size_t i = 0; i < min_q_size; ++i) { for (size_t j = 0; j < 3; ++j) p[j] = (projectedNodes[3 * q1_indices[i] + j] - projectedNodes[3 * q2_indices[i] + j]);