Skip to content

Do curves intersect does not work with EPICK #9151

@LeoValque

Description

@LeoValque

Issue Details

When using EPICK, the function 'do_curves_intersect' may trigger the following assertion (or a segmentation fault in release mode). The input segments are extremely close to each other but remain valid and well-formed. The recent updates to the arrangement package intended to handle such cases are included.
CGAL ERROR: assertion violation! Expr: cv1.is_vertical() ? m_traits.is_in_y_range_2_object()(cv1, *ip) : m_traits.is_in_x_range_2_object()(cv1, *ip) File: /home/oem/CGAL/git/Float_2D_snap-GF/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h Line: 736

Source Code

test_float_snap_rounding_2.cpp of the following pull request #8797. Simply replace EPECK with EPICK in the test.

A minimal example:

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Surface_sweep_2_algorithms.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel     Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel>                      Arr_segment_traits_2;
typedef Arr_segment_traits_2::Point_2                           Point_2;
typedef Arr_segment_traits_2::Curve_2                           Segment_2;


int main(int argc,char *argv[])
{
  std::vector<Segment_2> segs;
  segs.emplace_back(Point_2(0.99999999999987266, -6.016984285966173e-13), Point_2(0.99999999999989209, -0.393957206677223));
  segs.emplace_back(Point_2(0.99999999999989209, -0.39424053387489644), Point_2(0.99999999999989209, -0.393957206677223));
  segs.emplace_back(Point_2(0.99999999999989209, -0.39424053387489644), Point_2(0.99999999999989275, -0.39469696969750989));

  std::cout << CGAL::do_curves_intersect(segs.begin(), segs.end()) << 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: main
  • Boost version: 1.83.0.1
  • Other libraries versions if used (Eigen, TBB, etc.):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions