Subject: CGAL users discussion list
List archive
- From:
- To:
- Subject: Problems with Convex Hull
- Date: Tue, 8 Jan 2008 09:05:36 +0100
Hello,
I am attaching one simple convex hull testing program. This code run only
for 4 input points. More than 4 points, the 1GB ram memory starts swapping
and nothing is produced.
This simple program work correctly with Qhull code. ( For reference )
Chaman Singh
#include <CGAL/Cartesian.h>
#include <CGAL/Convex_hull_traits_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <iostream>
#include <fstream>
#include <vector>
#include "vtk.h"
using namespace std;
typedef CGAL::Cartesian<double> K;
typedef CGAL::Point_3<K> Point3D;
typedef CGAL::Polyhedron_3<K> Polyhedron;
void convex_hull_3d()
{
vector<Point3D> vpoints;
int numPoints = 5;
for( int i = 0; i < numPoints; i++) {
double x = drand48();
double y = drand48();
double z = drand48();
vpoints.push_back( Point3D(x,y,z) );
}
//vtk_points( "p.vtk", vpoints);
cout << " Convex hull Start " << endl;
Polyhedron p;
CGAL::Object obj;
CGAL::convex_hull_3( vpoints.begin(), vpoints.end(), obj);
CGAL::assign(p, obj);
cout << " Convex hull Done " << endl;
cout << p;
}
int main()
{
convex_hull_3d();
}
- Problems with Convex Hull, csv610, 01/08/2008
Archive powered by MHonArc 2.6.16.