Subject: CGAL users discussion list
List archive
- From: "Vu, Khuong" <>
- To: "" <>
- Subject: RE: [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error
- Date: Thu, 2 Jul 2009 15:27:38 -0500
- Accept-language: en-US
- Acceptlanguage: en-US
Dear Olivier,
It's nice to have reply from you! Yes, I posted 2 question in just a couple
of hours, but I had been posting a few many days before for the same problem!
I'm aware that Delaunay has an infinite vertex. So, there were 7 vertices if
the infinitive one counted. Anyway, only 5 faces were there for the dual
Voronoi diagram. If you have time, please run my small simple code below and
observe the results by yourself. If you don't have time, below is the
program's output:
**********************************************************
input sites: s 109 517 151 500 and s 224.5 638 154.5 136
number of Delaunay vertices: 6
number of Voronoi vertices: 5
don't believe? please see below for the list of Delaunay vertices
inf
p 109 517
p 151 500
s 109 517 151 500
p 224.5 638
p 154.5 136
s 224.5 638 154.5 136
**********************************************************
I truly appreciate your help.
Khuong
=================================================================================
#include <CGAL/basic.h>
// standard includes
#include <iostream>
#include <fstream>
#include <cassert>
#include <cmath>
// define the exact number type
# include <CGAL/Quotient.h>
# include <CGAL/MP_Float.h>
typedef CGAL::Quotient<CGAL::MP_Float> ENT;
// define the kernels
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<double> CK;
typedef CGAL::Simple_cartesian<ENT> EK;
// typedefs for the traits and the algorithm
#include <CGAL/Segment_Delaunay_graph_filtered_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_2.h>
#include <CGAL/Voronoi_diagram_2.h>
#include <CGAL/Segment_Delaunay_graph_adaptation_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_filtered_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_adaptation_policies_2.h>
typedef CGAL::Segment_Delaunay_graph_filtered_traits_2<CK,
/* The construction kernel allows for / and sqrt */
CGAL::Field_with_sqrt_tag,
EK,
/* The exact kernel supports field ops exactly */ CGAL::Field_tag> Gt;
typedef CGAL::Segment_Delaunay_graph_2<Gt> SDG2;
typedef CGAL::Segment_Delaunay_graph_degeneracy_removal_policy_2<SDG2> AP;
typedef CGAL::Segment_Delaunay_graph_adaptation_traits_2<SDG2>
AT;
typedef CGAL::Voronoi_diagram_2<SDG2, AT, AP> VD;
typedef AT::Site_2 Site_2;
typedef AT::Point_2 Point_2;
using namespace std;
int main(){
SDG2 sdg;
VD vd;
Point_2 p1(109, 517);
Point_2 p2(151, 500);
Point_2 p3(224.5, 638);
Point_2 p4(154.5, 136);
Site_2 site1 = site1.construct_site_2(p1, p2);
Site_2 site2 = site1.construct_site_2(p3, p4);
sdg.insert( site1);
vd.insert( site1);
sdg.insert( site2);
vd.insert( site2);
cout << endl << endl;
cout << "input sites: " << site1 << " and " << site2 << endl;
cout<< "number of Delaunay vertices: " << sdg.number_of_vertices() <<
endl;
cout<< "number of Voronoi vertices: " << vd.number_of_faces() << endl;
cout << "don't believe? please see below for the list of Delaunay
vertices\r\n";
SDG2::All_vertices_iterator iter_ver = sdg.all_vertices_begin();
do{
if (!sdg.is_infinite(iter_ver)){
cout << "\t" << (iter_ver)->site() << endl;
}else{
cout << "\tinf\r\n";
}
}while(++iter_ver != sdg.all_vertices_end());
}
________________________________________
From: Olivier Devillers
[]
Sent: Thursday, July 02, 2009 2:35 AM
To:
Subject: Re: [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error
Vu, Khuong a écrit :
> Hi all,
>
> I've posted a lot of my troubles but I haven't received any reply,
!!!! two hours between your 2 messages (and in the midle of the night
for most CGAL developers)
> 2 there were 6 vertices in the Delaunay graph, but only 5 Voronoi faces
be careful that Delaunay have an infinite vertex.
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] Voronoi edge dual from Delaunay edge error, Vu, Khuong, 07/02/2009
- [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error, Vu, Khuong, 07/02/2009
- Re: [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error, Olivier Devillers, 07/02/2009
- RE: [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error, Vu, Khuong, 07/02/2009
- Re: [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error, Olivier Devillers, 07/02/2009
- [cgal-discuss] RE: Voronoi edge dual from Delaunay edge error, Vu, Khuong, 07/02/2009
Archive powered by MHonArc 2.6.16.