Skip to content
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

Wrong result for do_intersect between a segment and a triangle if segment degenerate #8146

Open
LeoValque opened this issue Apr 16, 2024 · 0 comments

Comments

@LeoValque
Copy link

Issue Details

The do_intersect function returns the wrong result between a segment and a triangle if the segment is degenerate. I tried it on my colleague's machine to make sure the error didn't come from mine.
The expected result is "000" or a precondition violation and the output is "010". A precondition is probably missing.

Source Code

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/intersections.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Point_2 Point_2;
typedef K::Triangle_2 Triangle_2;
typedef K::Segment_2 Segment_2;

int main(){
Triangle_2 tr_normal(Point_2(-1,0),Point_2(0,0),Point_2(1,7));
Point_2 p(0.5,-1);

Segment_2 seg_normal(p,Point_2(0.5,2));
Segment_2 seg_deg(p,p);

std::cout << CGAL::do_intersect(tr_normal,seg_normal)<< std::endl;
std::cout << CGAL::do_intersect(tr_normal,seg_deg)<< std::endl;
std::cout << CGAL::do_intersect(tr_normal,p)<< std::endl;
return 0;

}

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): Linux 64bits
  • Compiler: gcc
  • Release or debug mode: both
  • Specific flags used (if any):
  • CGAL version: master
  • Boost version:1.71.0
  • Other libraries versions if used (Eigen, TBB, etc.):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant