Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] problem creating Nef_polyhedron_3 from ".off"files

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] problem creating Nef_polyhedron_3 from ".off"files


Chronological Thread 
  • From: Gordan Sikic <>
  • To:
  • Subject: Re: [cgal-discuss] problem creating Nef_polyhedron_3 from ".off"files
  • Date: Fri, 01 Dec 2006 15:12:03 +0100

Andreas Fabri wrote:

Hello,

Thanks for so swift answer.


The coordinates must be integers. In your case they are
all rounded to 0 or 1.

I suppose that you are referring to nef_3 demo...

If I compile and start program with listing included in my previous
post, I will receive different message:

$a.out < cube01.off
CGAL error: assertion violation!
Expr: pe_prev->facet()->plane().
has_on(pe_prev->opposite()->vertex()->point())
File: /usr/local/CGAL/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 151
Aborted


Also, if I dump Polyhedron_3 back to the std::cout, all coordinates have
their original values.


Does it mean that converting Polyhedron_3 to Nef_Polyhedron_3 works with
integer coordinates only, regardless of number type used as kernel
definition parameter ?



regards,
Gordan


PS
For brevity, I'll include same listings again:


//main.cpp:
// direct cut'n'paste from xemacs,
// so it should compile without problems
//----------------------cut-----------------
// *read Polyhedron_3 from std::cin,
// *convert it into Nef_Polyhedron_3
//
#include <CGAL/Gmpz.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <fstream>

typedef CGAL::Gmpz NT;
//typedef CGAL::Homogeneous<NT> SK;
typedef CGAL::Cartesian<double> SK;
typedef CGAL::Extended_homogeneous<NT> EK;
typedef CGAL::Nef_polyhedron_3<SK> Nef_polyhedron_S;
//typedef CGAL::Nef_polyhedron_3<EK> Nef_polyhedron_E;

typedef CGAL::Polyhedron_3<SK> Polyhedron;

int main() {

// debugthread=29;
Polyhedron P;

std::cin >> P;

Nef_polyhedron_S S(P);
std::cout << S;

}
//----------------cut--------------





#cube01.off:
OFF
8 6 0
# vertices
-0.1 -0.1 0.1
-0.1 0.1 0.1
0.1 0.1 0.1
0.1 -0.1 0.1
-0.1 -0.1 -0.1
-0.1 0.1 -0.1
0.1 0.1 -0.1
0.1 -0.1 -0.1
# facets
4 3 2 1 0
4 0 1 5 4
4 6 5 1 2
4 3 7 6 2
4 4 7 3 0
4 4 5 6 7
#------------------------




Archive powered by MHonArc 2.6.16.

Top of Page