Skip to Content.
Sympa Menu

cgal-discuss - Bug in Delaunay?

Subject: CGAL users discussion list

List archive

Bug in Delaunay?


Chronological Thread 
  • From: "Tyver Ray" <>
  • To:
  • Subject: Bug in Delaunay?
  • Date: Mon, 9 Jul 2007 13:08:53 +0200

You're right I have the same problem...


---------- Forwarded message ----------
From: Patrick Hétroy <>
Date: 9 juil. 2007 08:24
Subject: Bug in Delaunay?
To:

Hello !

I'm trying to insert few points with the random function...
But the code crashes at line_walk code line.

Is there a reason?

In advance, thank you!

Yours sincerely,

Patrick


My code :



#include <iostream>
#include <string>
#include <fstream>
#include <list>
using namespace std;


#include <CGAL/Exact_predicates_inexact
_constructions_kernel.h>
#include <CGAL/Triangulation_euclidean_traits_xy_3.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_line_face_circulator_2.h>

struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef CGAL::Triangulation_euclidean_traits_xy_3<K>    Gt;
typedef CGAL::Delaunay_triangulation_2<Gt>                Delaunay;
typedef Delaunay::Line_face_circulator                    Line_face_circulator;
typedef Delaunay::Face_circulator                        Face_circulator;
typedef Delaunay::Face_handle                            Face_handle;
typedef Delaunay::Vertex_handle                            Vertex_handle;
typedef K::Point_3                                        Point3;

#define START_X        0
#define START_Y        0
#define END_X        100
#define END_Y        100

int main()
{
    Delaunay dt;

    srand ( time(NULL) );

    for(int i=0; i < 100; i++)
        dt.insert(Point3(rand()%100, 100, rand()%20));

        
    list<Point3> listOfBorderPoints;
    const Point3& start = Point3(END_X, END_Y, 0);
    const Point3& end = Point3(START_X, END_Y, 0);

    Line_face_circulator lfc = dt.line_walk(start, end), done(lfc);
    if (lfc != (CGAL_NULL_TYPE) NULL)
    {
        do
        {
            //Scan all the vertices of each triangles on the border
            if( !dt.is_infinite(lfc) )
            {
                listOfBorderPoints.push_back( lfc->vertex(0)->point() );
            }
        }
        while (++lfc != done);
    }

    return 0;
}



  • Bug in Delaunay?, Tyver Ray, 07/09/2007

Archive powered by MHonArc 2.6.16.

Top of Page