Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: Problems with CGAL SegmentDelaunay Graph.

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Problems with CGAL SegmentDelaunay Graph.


Chronological Thread 
  • From: Pablo Miranda Carranza <>
  • To: <>
  • Subject: [cgal-discuss] Re: Problems with CGAL SegmentDelaunay Graph.
  • Date: Mon, 7 Nov 2011 15:44:18 +0100

Hi, I should first thank everyone involved in CGAL for a fantastic library.
I am researching on a spatial analysis tool for architecture and urban
planning which uses skeletons. I am at the moment employing the "2D Segment
Delaunay Graphs" package in CGAL for calculating the Medial Axis. It works
very well, and after some fiddling it has been no problem to draw the voronoi
using conics and straight lines, as well as extracting all the information
for my analysis. I found that one of my test polygons produced a CGAL::error,
while using Segment_Delaunay_graph_filtered_traits_without_intersections_2. I
am not sure if this is a bug, or simply expected behavior of
Segment_Delaunay_graph_filtered_traits_without_intersections_2 (most likely)
. Anyway, if it is not a bug, I guess that it may be useful to have a test
example of a simple polygon that fails with the filtered traits (I have
simplified the original input). I wonder also if anyone has any suggestions
on how to handle failures (I am planning eventually to catch the exception
and only use exact numbers when the filtered traits fails?) . Thanks!


OUTPUT:

processing 0 of 9
processing 1 of 9
processing 2 of 9
processing 3 of 9
processing 4 of 9
processing 5 of 9
processing 6 of 9
CGAL error: assertion violation!
Expression : v_type == PSS
File :
/Developer/SDKs/MacOSX10.7.sdk/usr/local/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_new_C2.h
Line : 1243
Explanation:
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html
terminate called throwing an exception




SETTINGS:

Hardware:
-MacBook Pro, 2.93 GHz Intel Core 2 Duo, 4Gb Memory.
OS, CGAL version and compiler:
-CGAL 3.9, GMP through Macports, version 5.0.2, OS X Lion (gcc version 4.2.1)



CODE:


#include <iostream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Segment_Delaunay_graph_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_2.h>
#include <CGAL/Segment_Delaunay_graph_hierarchy_2.h>


//THIS PRODUCES THE ERROR WITH THE DATA BELOW
typedef CGAL::Gmpq ENT; //exact
number type
typedef CGAL::Simple_cartesian<double> CK; //construction kernel
typedef CGAL::Simple_cartesian<ENT> EK; //exact kernel
typedef
CGAL::Segment_Delaunay_graph_filtered_traits_without_intersections_2<CK,CGAL::Field_with_sqrt_tag,
EK, CGAL::Integral_domain_without_division_tag> Gt;
typedef CGAL::Segment_Delaunay_graph_2<Gt> SDG_2;


/*
//THIS WORKS (But it is obviously substantially slow)
typedef CGAL::Gmpq ENT;
//CGAL::Gmpzf and CORE::BigFloat work even faster than CGAL::Gmpq
typedef CGAL::Simple_cartesian<ENT > Kernel;
typedef
CGAL::Segment_Delaunay_graph_traits_without_intersections_2<Kernel,CGAL::Integral_domain_without_division_tag>
Gt;
typedef CGAL::Segment_Delaunay_graph_hierarchy_2<Gt> SDG_2; //this improves
performance dramatically over Segment_Delaunay_graph_2, but is still slow
*/

typedef SDG_2::Point_2 Point2;

int main(int argc, char *argv[]){

const int testSize=9;
Point2 ptData[testSize]={
Point2( 5000, 0 ),
Point2( 5000, 4000 ),
Point2( 0, 4000 ),
Point2( 2367, 3305 ),
Point2( 3854, 1366 ),
Point2( 3869, 1090 ),
Point2( 3779, 1360 ),
Point2( 2366, 3230 ),
Point2( 0, 3000 )
};


SDG_2 sdg;

//create segment sites for the closed polygon with the points as
vertices

for (int i = 0; i < testSize; ++i) {
std::cout<< "processing "<< i <<" of "<<testSize << std::endl;
int next = (i + 1) % testSize;

const SDG_2::Site_2
&site=SDG_2::Site_2::construct_site_2(ptData[i], ptData[next]);
sdg.insert(site);
}

}








Thanks!









  • [cgal-discuss] Re: Problems with CGAL SegmentDelaunay Graph., Pablo Miranda Carranza, 11/07/2011

Archive powered by MHonArc 2.6.16.

Top of Page