I use CGAL to create a so-called area skeleton in Linf (L-infinity metrics). I have a bunch of successfully working cases, but the very simple case (one 4-corners polygon) causes an assertion and exception. In console window it looks like:
I tried to debug this issue and remove the assertion statement temporarily there. It works w/o an exception, but at last gives one incorrect edge - the edge from/to the point (0,0) is missing while I have two edges from/to (500, -500) (I would expect edges (0,0)->(400,200) and (500, -500)->(500, 100) but I have (500, -500)->(400, 200) instead of the first one.
Thanks in advance.
Source Code
// standard includes
#include <iostream>
// choose the kernel
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<int> K; // <double> sucks as well
// typedefs for the traits and the algorithm
#include <CGAL/Segment_Delaunay_graph_Linf_2.h>
#include <CGAL/Segment_Delaunay_graph_Linf_filtered_traits_2.h>
typedef CGAL::Segment_Delaunay_graph_Linf_filtered_traits_without_intersections_2<K> Gt;
typedef CGAL::Segment_Delaunay_graph_Linf_2<Gt> SDG2;
int main()
{
SDG2 sdg;
// vertices of the polygon
std::vector<Gt::Point_2> points;
points.emplace_back(0, 0);
points.emplace_back(600, 600);
points.emplace_back(1000, 0);
points.emplace_back(500, 100); // (500, -100) works fine. I guess this is because of the angle, bigger then 180 degrees
//segments of the polygon as a pair of vertex indices
std::vector<std::pair<std::size_t, std::size_t> > indices;
indices.push_back(std::make_pair(0, 1));
indices.push_back(std::make_pair(1, 2));
indices.push_back(std::make_pair(2, 3));
indices.push_back(std::make_pair(3, 0));
sdg.insert_segments(points.begin(), points.end(), indices.begin(), indices.end());
bool bValid = sdg.is_valid(true, 1);
std::cout << "CGAL success = " << (bValid ? "TRUE" : "FALSE") << std::endl;
// Draw the diagram
sdg.draw_skeleton(std::cout);
return 0;
}
Environment
Operating system (Windows/Mac/Linux, 32/64 bits): Windows
Compiler: Microsoft Visual Studio 2022 Version 17.8.1
Release or debug mode: Debug
Specific flags used (if any): none
CGAL version: 5.6.1
Boost version: 1.81
Other libraries versions if used (Eigen, TBB, etc.): none
Issue Details
I use CGAL to create a so-called area skeleton in Linf (L-infinity metrics). I have a bunch of successfully working cases, but the very simple case (one 4-corners polygon) causes an assertion and exception. In console window it looks like:
I tried to debug this issue and remove the assertion statement temporarily there. It works w/o an exception, but at last gives one incorrect edge - the edge from/to the point (0,0) is missing while I have two edges from/to (500, -500) (I would expect edges (0,0)->(400,200) and (500, -500)->(500, 100) but I have (500, -500)->(400, 200) instead of the first one. Thanks in advance.
Source Code
Environment