-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polygon_2 intersection precondition violation #7598
Labels
Comments
Use an exact construction exa t predicate kernel!!!
…On Fri, Jul 14, 2023, 13:40 James Marsh ***@***.***> wrote:
Issue Details
When performing an intersection of two Polygon_2 objects I get a
precondition violation with no other information other than reporting the
bug.
Source Code
void bug_repro()
{
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
CGAL::Polygon_2<Kernel> polygon1;
polygon1.push_back(Kernel::Point_2{-647.57122802734375, -96.856353759765625});
polygon1.push_back(Kernel::Point_2{-649.41784667968750, -94.705856323242188});
polygon1.push_back(Kernel::Point_2{-648.98065185546875, -96.118194580078125});
polygon1.push_back(Kernel::Point_2{-648.97912597656250, -96.121437072753906});
polygon1.push_back(Kernel::Point_2{-648.97521972656250, -96.124404907226562});
CGAL::Polygon_2<Kernel> polygon2;
polygon2.push_back(Kernel::Point_2{-649.41784667968750, -96.856353759765625});
polygon2.push_back(Kernel::Point_2{-649.04852294921875, -96.856353759765625});
polygon2.push_back(Kernel::Point_2{-649.04852294921875, -94.705856323242188});
polygon2.push_back(Kernel::Point_2{-649.41784667968750, -94.705856323242188});
std::vector<CGAL::Polygon_with_holes_2<Kernel>> intersecting;
CGAL::intersection(polygon1, polygon2, std::back_inserter(intersecting));
}
Runtime output:
CGAL error: precondition violation!
Expression : (m_traits.compare_y_at_x_2_object()(p, cv) == EQUAL) && compare_xy(cv.left(), p) == SMALLER && compare_xy(cv.right(), p) == LARGER
File : C:\repos\project\out\build\x64-debug\vcpkg_installed\x64-windows\include\CGAL\Arr_segment_traits_2.h
Line : 610
Explanation:
Refer to the bug-reporting instructions at https://www.cgal.org/bug_report.html
Environment
- Operating system: Windows 64bit
- Compiler: MSVC in VS 2022 version 17.6.5
- Release or debug mode: Debug
- Specific flags used (if any): using C++latest
- CGAL version: 5.5.1 (installed through vcpkg)
- Boost version: 1.81 (installed as a dependency automatically through
vcpkg)
- Other libraries versions if used (Eigen, TBB, etc.): N/A
—
Reply to this email directly, view it on GitHub
<#7598>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVBNOCIC6Z4Y6UQGEIGLWLXQEO3HANCNFSM6AAAAAA2KE7I74>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yeah that works. Would be nice having a proper error message though. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Details
When performing an intersection of two Polygon_2 objects I get a precondition violation with no other information other than reporting the bug.
Source Code
Runtime output:
Environment
The text was updated successfully, but these errors were encountered: