Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Epick convex_hull_3 assertion

Subject: CGAL users discussion list

List archive

[cgal-discuss] Epick convex_hull_3 assertion


Chronological Thread 
  • From: Marius Kintel <>
  • To:
  • Subject: [cgal-discuss] Epick convex_hull_3 assertion
  • Date: Sat, 3 Jan 2015 16:55:57 -0500

Hi all,

As the author of OpenSCAD, I get a lot of user testing of various CGAL
functions. I experience a lot of CGAL assertions, mostly due to malformed
data.
This one looks suspiciously like a CGAL bug though:

CGAL error: assertion violation!
Expression : orientation(v1,v2,vz) != COPLANAR
File :
/Users/kintel/code/OpenSCAD/libraries/install/include/CGAL/convex_hull_3.h
Line : 350

Looking at my minimal example below, it appears that CGAL is using two
different methods for determining whether three points are collinear; a
collinearity test and a coplanarity test involving a fourth point. The issue
seems to be that the second test is more strict than the first and this
second test is being used as an assert.
If you look at the vertices in my code, it’s clear that it’s possible to
select three non-collinear vertices if a more strict test was used, this
avoiding the assertion error.

Any idea how to fix or avoid this?

Cheers,

-Marius

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_3.h>

typedef CGAL::Epick K;

int main()
{
std::vector<K::Point_3> points;
points.push_back(K::Point_3(-71.199011502334841, 14.664467308583257,
32.003440443428268));
points.push_back(K::Point_3(-71.199011502334841, 26.092309142341527,
28.509598571991564));
points.push_back(K::Point_3(-71.199011502334841, 37.520150976099799,
25.01575670055486));
points.push_back(K::Point_3(-71.199011502334841, 0, 0));

CGAL::Polyhedron_3<K> r;
CGAL::convex_hull_3(points.begin(), points.end(), r);

return 0;
}




Archive powered by MHonArc 2.6.18.

Top of Page