Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] bad output for Apollonius graph with EPIC kernel?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] bad output for Apollonius graph with EPIC kernel?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] bad output for Apollonius graph with EPIC kernel?
  • Date: Wed, 18 Dec 2013 21:27:15 +0100
  • Organization: GeometryFactory

Try using a different kernel like this example:
http://doc.cgal.org/latest/Apollonius_graph_2/Apollonius_graph_2_2ag2_filtered_traits_no_hidden_8cpp-example.html

Sebastien.

On 12/18/2013 07:53 PM,

wrote:
First off, just want to say that CGAL is an impressive piece of software!

I'm having trouble with colinear points in an ApolloniusGraph2.

It appears that inserting colinear points with an almost integer-valued weight
can lead to a bad Apollonius graph.

CGAL: 4.3
compiler: gcc 4.8.1
uname -a: Linux thistle 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
cpu: intel xeon x5570

installation:
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .
make

To compile the test program, called cgal_create_CMakeLists, then same cmake
command as above.

test program:
//----------------------
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Apollonius_graph_2.h>
#include <CGAL/Apollonius_graph_traits_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC_Kernel;
typedef EPIC_Kernel::Point_2 Point_2;
typedef CGAL::Apollonius_graph_traits_2<EPIC_Kernel> Traits;
typedef CGAL::Apollonius_graph_2<Traits> AG;
typedef AG::Site_2 Site_2;

int main(int argc,char **argv) {
double weight;
AG ag;

weight = 179.99999999999983;

ag.insert( Site_2( Point_2(0,-12),weight));
ag.insert( Site_2( Point_2(0,12),weight));
ag.insert( Site_2( Point_2(0,0),weight));

std::cout << ag ;

return 0;
}
//---------------


The output:
----------
4 4 2

0 -12 180 0
0 12 180 0
0 0 180 0

1 0 3
1 2 0 # !! this edge is suspicious
0 1 3
2 1 0 # !! this edge is suspicious

2 2 1
3 0 3
0 0 3
2 1 1
-------------

From a handful of test, it *appears* that the problem only arises when (a)
weights are large compared to distance between vertices, (b) weight is close
but not exactly an integer, and (c) the vertices are colinear.

I don't know CGAL that well, but when my code was using a previous version of
CGAL (but also older g++), it worked fine, so I'm wondering if this is a
regression in CGAL.

thanks for any help -
Rusty





Archive powered by MHonArc 2.6.18.

Top of Page