Skip to content

Commit 9475bde

Browse files
committed
Merge pull request #5096 from maxGimeno/GraphicsView-is_facet_convex-maxGimeno
GraphicsView: Fix is_facet_convex()
2 parents dcf4d86 + 166ad7c commit 9475bde

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

GraphicsView/include/CGAL/Buffer_for_vao.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,11 @@ class Buffer_for_vao
433433
// Is it possible that orientation==COPLANAR ? Maybe if V1 or V2 is very small ?
434434
}
435435
while(++id!=facet.size() &&
436-
(orientation==CGAL::COPLANAR || orientation==CGAL::ZERO));
436+
(orientation==CGAL::COPLANAR ));
437437

438438
//Here, all orientations were COPLANAR. Not sure this case is possible,
439439
// but we stop here.
440-
if (orientation==CGAL::COPLANAR || orientation==CGAL::ZERO)
440+
if (orientation==CGAL::COPLANAR)
441441
{ return false; }
442442

443443
// Now we compute convexness
@@ -454,6 +454,16 @@ class Buffer_for_vao
454454

455455
if(local_orientation!=CGAL::ZERO && local_orientation!=orientation)
456456
{ return false; }
457+
// V1 and V2 are collinear
458+
if(local_orientation==CGAL::ZERO )
459+
{
460+
//TS and TU are opposite
461+
if(CGAL::scalar_product(V1,V2) >=0)
462+
return true;
463+
//TS and TU have the same direction.
464+
else
465+
return false;
466+
}
457467
}
458468
return true;
459469
}

0 commit comments

Comments
 (0)