Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am using CGAL for some geometric operations on polyhedrons. In particular I am using the Polyhedron_3 and Nef_polyhedron_3 with the following kernel etc.... :
#include "CGAL/Simple_cartesian.h"
#include "CGAL/Polyhedron_3.h"
#include "CGAL/Nef_polyhedron_3.h"
#include "CGAL/Gmpz.h"
#include "CGAL/Polyhedron_incremental_builder_3.h"
#include "CGAL/IO/Polyhedron_iostream.h"
namespace ARECGAL
typedef CGAL::Simple_cartesian<CGAL::Gmpz> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_Polyhedron;
typedef Polyhedron::HalfedgeDS HalfedgeDS;
typedef Nef_Polyhedron::Vector_3 Vector_3;
typedef Nef_Polyhedron::Aff_transformation_3 Aff_transformation_3;
And I am performing an intersection using this method:
Polyhedron intersection(Polyhedron & i_poly1,Polyhedron & i_poly2)
if (i_poly1.is_closed() && i_poly2.is_closed())
Nef_Polyhedron NP1(i_poly1);
Nef_Polyhedron NP2(i_poly2);
Nef_Polyhedron NP = NP1 * NP2;
//useless code for the topic
throw Utils::ProcessControl::AREException(notClosedGeoErrorMsg,
__FUNCTION__,
notClosedGeoErrorValue);
catch (Utils::ProcessControl::AREException & exception)
throw exception;
With the following inputs:
8 12 0
-2e+07 -2e+07 1.00006e+07
-2e+07 2e+07 1.00008e+07
2e+07 -2e+07 1.00001e+07
2e+07 2e+07 1.00005e+07
-2e+07 -2e+07 4e+07
-2e+07 2e+07 4e+07
2e+07 -2e+07 4e+07
2e+07 2e+07 4e+07
3 2 0 1
3 3 2 1
3 5 4 6
3 5 6 7
3 2 4 0
3 2 6 4
3 0 5 1
3 0 4 5
3 3 6 2
3 3 7 6
3 1 7 3
3 1 5 7
8 12 0
-2e+07 -2e+07 -1.99998e+07
-2e+07 2e+07 -1.99998e+07
2e+07 -2e+07 -1.99998e+07
2e+07 2e+07 -1.99998e+07
-2e+07 -2e+07 6.99999e+07
-2e+07 2e+07 6.99999e+07
2e+07 -2e+07 6.99999e+07
2e+07 2e+07 6.99999e+07
3 2 0 1
3 3 2 1
3 5 4 6
3 5 6 7
3 2 4 0
3 2 6 4
3 0 5 1
3 0 4 5
3 3 6 2
3 3 7 6
3 1 7 3
3 1 5 7
It crashes at the first Polyhedron to Nef_polyhedron conversion launching the following assertion (in debug mode):
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: h.has_on(p)
File: /home/giorgio/Scrivania/Librerie/CGAL-4.4/include/CGAL/Nef_3/SNC_intersection.h
Line: 377
What's wrong?
Thank you,
Giorgio
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.