Subject: CGAL users discussion list
List archive
- From: "Max" <>
- To: "" <>
- Subject: [cgal-discuss][Nef_polyhedron]A more complex but still simple question
- Date: Sat, 19 Jan 2008 12:28:47 +0800
- Disposition-notification-to: "Max" <>
- Organization: LoadCom
Hello,
It seems that I probably have not understood CGAL::Nef_3 well,
for I just keep coming across problems with it.
Here's still a simple question/problem related to Nef_polyhedron:
I'm reading a closed polyhedron and then convert it into a Nef_3,
the code is as this:
template <class Polyhedron_3>
bool ReadPolyhedron(std::string path, Polyhedron_3& P)
{
try
{
std::ifstream is(path.c_str());
is >> P;
is.close();
}
catch(...) { return false; }
return true;
}
typedef CGAL::Homogeneous<CGAL::Gmpzf> Kernel;
typedef Kernel::Point_3 Point_3;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron_3;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron_3;
int main(int argc, char*argv[])
{
std::string path("simple.off");
Polyhedron_3 P1;
if(!ReadPolyhedron(path, P1)) return 1;
std::cout << P1;
if(! P1.is_closed())
{
cout << "not a closed polyhedron" << endl;
return 1;
}
Nef_polyhedron_3 N1(P1); // convert to nef
cout << N1;
}
The program ceased, under debug mode, at assertions.cpp:
assertion_fail( const char* expr,
const char* file,
int line,
const char* msg )
{
(*_error_handler)("assertion", expr, file, line, msg);
switch (_error_behaviour) {
case ABORT:
CGAL_CLIB_STD::abort();
case EXIT:
CGAL_CLIB_STD::exit(1); // EXIT_FAILURE
case EXIT_WITH_SUCCESS:
CGAL_CLIB_STD::exit(0); // EXIT_SUCCESS
case THROW_EXCEPTION:
throw Assertion_exception("CGAL", expr, file, line, msg); //
HERE !!!
case CONTINUE:
;
}
}
and seems to be called by converting P into a Nef_3.
I'm using CGAL 3.3.1+WinXP/SP2+VS2005/SP1.
the .off file is attached.
Please tell me what's wrong.
Thanks
B/Rgds
Max
Attachment:
simple.off
Description: Binary data
Attachment:
simple.gif
Description: GIF image
- [cgal-discuss] Coordinate Transformation, Max, 01/17/2008
- Re: [cgal-discuss] Coordinate Transformation, Max, 01/17/2008
- [cgal-discuss][Nef_polehedron]convert_to_Polyhedron ( Polyhedron& P), Max, 01/17/2008
- Re: [cgal-discuss][Nef_polehedron]convert_to_Polyhedron ( Polyhedron& P), Peter Hachenberger, 01/17/2008
- Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron (Polyhedron& P), Max, 01/18/2008
- Re: Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron (Polyhedron& P), Max, 01/18/2008
- Re: Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron (Polyhedron& P), Peter Hachenberger, 01/18/2008
- Re: Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron(Polyhedron& P), Max, 01/18/2008
- [cgal-discuss][Nef_polyhedron]A more complex but still simple question, Max, 01/19/2008
- Re: Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron(Polyhedron& P), Max, 01/18/2008
- Re: Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron (Polyhedron& P), Peter Hachenberger, 01/18/2008
- Re: Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron (Polyhedron& P), Max, 01/18/2008
- [cgal-discuss] Order of including CGAL header files, Max, 01/18/2008
- Re: Re: [cgal-discuss][Nef_polyhedron]convert_to_Polyhedron (Polyhedron& P), Max, 01/18/2008
- Re: [cgal-discuss][Nef_polehedron]convert_to_Polyhedron ( Polyhedron& P), Peter Hachenberger, 01/17/2008
Archive powered by MHonArc 2.6.16.