Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Accuracy Issues

Subject: CGAL users discussion list

List archive

[cgal-discuss] Accuracy Issues


Chronological Thread 
  • From: "S K BOSE" <>
  • To: <>
  • Subject: [cgal-discuss] Accuracy Issues
  • Date: Mon, 21 Mar 2011 12:36:10 +0530

Hi,

I have some problem regarding accuracy issues. I am using CGAL::Gmpq

For example in the following sample program

#include <fstream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Nef_3/SNC_indexed_items.h>
#include <CGAL/IO/Polyhedron_iostream.h>


typedef CGAL::Exact_predicates_exact_constructions_kernel kernel;
typedef CGAL::Polyhedron_3<kernel> Polyhedron_3;
typedef CGAL::SNC_indexed_items Items;
typedef CGAL::Nef_polyhedron_3<kernel,Items> Nef_polyhedron;
using namespace std;
int main()
{
Polyhedron_3 model;
fstream file;
file.open("test.off");
if (!file.is_open()) { return 0; }
file>>model;
file.close();
Nef_polyhedron poly(model);
return 0;
}

If I used

OFF
6 5 0
-0.5 -0.5 0.0
0.5 -0.5 0
-0.5 0.25 0.433012
0.5 0.25 0.433012
-0.5 0.25 -0.433012
0.5 0.25 -0.433012
4 0 1 3 2
4 2 3 5 4
4 4 5 1 0
3 0 2 4
3 5 3 1

Nef_polyhedron conversion is going through. But if I used following Dataset

OFF
6 5 0
-0.49999999999999989 -0.50000000000000011 0.0
0.50000000000000011 -0.49999999999999999 0
-0.50000000000000011 0.25000000011841639 0.43301270182385149
0.49999999999999994 0.25000000000011841661 0.43301270182385149
-0.5 0.24999999976316684 -0.43301270202895492
0.49999999999999994 0.24999999976316706 -0.43301270202895492
4 0 1 3 2
4 2 3 5 4
4 4 5 1 0
3 0 2 4
3 5 3 1

I am facing problem while Nef_polyhedron conversion. This is possibly run
into accuracy issues. It gives
CGAL error: assertion violation!
Expression : pe_prev->is_border() || pe_prev->facet()->plane().
has_on(pe_prev->
opposite()->vertex()->point())
File : D:\DRIVE D\CGAL\include\CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line : 219

I am using Microsoft Visual C++ 2008, 32 bit version. Please can anybody
point me the portion of the code, where I can tune the related parameters
which deals with accuracy so that both datasets will go through.

With Regards,

Bose




Archive powered by MHonArc 2.6.16.

Top of Page