From 92e01ee5b90209a2a5f583313fe694c16ec95e3b Mon Sep 17 00:00:00 2001 From: Pablo Garzon Date: Fri, 28 Jul 2023 17:28:32 +0200 Subject: [PATCH] #3532 Split and order contours (Rotating Plane) --- bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx index bbac782..46998f9 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx @@ -894,7 +894,6 @@ void ShowNPoints_Tools::SeparateSplines() std::vector> pointsOver = pointsAroundPlane[0]; std::vector> pointsUnder = pointsAroundPlane[1]; std::vector> pointsOn = pointsAroundPlane[2]; - //Calculate points where splines should intersect double middlePoint[3]; if(intersectionTop.empty() && intersectionBottom.empty()){ @@ -1017,9 +1016,11 @@ std::vector>> ShowNPoints_Tools::GetOrderedPoint pointsOn.push_back(point); } } + //////// /// Check direction of points and reverse if needed. /// Always follows axis vector direction + /// remove points if size is less than or equal to 2 //////// if(pointsUnder.size() > 2){ vtkMath::Subtract(pointsUnder.front(), pointsUnder.back(), vector1); @@ -1031,6 +1032,10 @@ std::vector>> ShowNPoints_Tools::GetOrderedPoint } } } + else{ + pointsUnder.clear(); + } + if(pointsOver.size() > 2){ vtkMath::Subtract(pointsOver.front(), pointsOver.back(), vector1); double dot = vtkMath::Dot(vector1, rotAxis.data()); @@ -1041,6 +1046,9 @@ std::vector>> ShowNPoints_Tools::GetOrderedPoint } } } + else{ + pointsOver.clear(); + } std::vector>> results = {pointsOver, pointsUnder, pointsOn}; return results; -- 2.47.1