From 166ad7c8c8eae5b22818cd9b3dc77d8c582cc81b Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 20 Oct 2020 14:47:32 +0200 Subject: [PATCH] Fix cases where V1 and V2 are collinear --- GraphicsView/include/CGAL/Buffer_for_vao.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index 51abd326430..a5d196bfb6d 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -433,11 +433,11 @@ public: // Is it possible that orientation==COPLANAR ? Maybe if V1 or V2 is very small ? } while(++id!=facet.size() && - (orientation==CGAL::COPLANAR || orientation==CGAL::ZERO)); + (orientation==CGAL::COPLANAR )); //Here, all orientations were COPLANAR. Not sure this case is possible, // but we stop here. - if (orientation==CGAL::COPLANAR || orientation==CGAL::ZERO) + if (orientation==CGAL::COPLANAR) { return false; } // Now we compute convexness @@ -454,6 +454,16 @@ public: if(local_orientation!=CGAL::ZERO && local_orientation!=orientation) { return false; } + // V1 and V2 are collinear + if(local_orientation==CGAL::ZERO ) + { + //TS and TU are opposite + if(CGAL::scalar_product(V1,V2) >=0) + return true; + //TS and TU have the same direction. + else + return false; + } } return true; }