Open nojhan opened 4 years ago
Note: passing a convex_hull_2
instead of the initial polygon solves the issue.
However, I don't know why the clockwise precondition checks fails to detect the problem.
The precondition did not fail because it is an expensive precondition, which are not enabled by default, even in debug mode. You can enable expensive assertions with:
#define CGAL_CHECK_EXPENSIVE
and your input will indeed fail:
CGAL error: precondition violation!
Expression : orientation_2(f, l, t) == COUNTERCLOCKWISE
I understand the rationale. However, as a naive user I would have expected a Debug build to include expensive assertions, especially given that there is a CMake warning already in that mode. Maybe adding a CMake ENABLE_EXPENSIVE_ASSERTIONS
option would be a good compromise.
I understand the rationale. However, as a naive user I would have expected a Debug build to include expensive assertions, especially given that there is a CMake warning already in that mode. Maybe adding a CMake
ENABLE_EXPENSIVE_ASSERTIONS
option would be a good compromise.
It should be prefixed with CGAL
, so CGAL_ENABLE_EXPENSIVE_ASSERTIONS
.
@maxGimeno
Issue Details
While using
min_rectangle_2
on some quasi-rectangle polygons, the output is not a rectangle but a degenerated set of 4 points, two pairs of which are equals.A simple example is a polygon having two identical points, but I don't know if that's even considered as matching the preconditions, so I'll keep that one for later.
Anyway, there is some (supposedly) good quasi-rectangle polygons of 4 points which ends in a degenerated rectangle (see below).
Source Code
The following minimal test have been inspired from
Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_C.cpp
and can be build with the same command that the one produced by cmake on this file (see a minimal build script below).I had no success trying to bisect this bug, because of the drastic changes in the build system.
Minimal build & check script:
Environment