add assertions to ensure the origin is on the negative side of the input planes

This commit is contained in:
Sébastien Loriot 2015-05-15 10:15:26 +02:00
parent 50c8db347b
commit 46c2727ea9
2 changed files with 7 additions and 0 deletions

View File

@ -270,6 +270,10 @@ namespace CGAL
origin = boost::make_optional(interior.inside_point());
}
// make sure the origin is on the negative side of all the planes
CGAL_assertion_code(for(PlaneIterator pit=begin;pit!=end;++pit))
CGAL_assertion(pit->has_on_negative_side(*origin));
// compute the intersection of the half-space using the dual formulation
Hull_traits_dual_3 dual_traits(*origin);
Polyhedron_dual_3 dual_convex_hull;

View File

@ -146,6 +146,9 @@ namespace CGAL
// construct dual points to apply the convex hull
std::vector<Point> dual_points;
for (PlaneIterator p = pbegin; p != pend; ++p) {
// make sure the origin is on the negative side of all the planes
CGAL_assertion(p->has_on_negative_side(p_origin));
// translate plane
Plane translated_p(p->a(),
p->b(),