Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Polyhedron_3 and Nef_polyhedron_3 intersection problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Polyhedron_3 and Nef_polyhedron_3 intersection problem


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Polyhedron_3 and Nef_polyhedron_3 intersection problem
  • Date: Fri, 18 Jul 2014 10:54:27 +0200
  • Organization: GeometryFactory

Try replacing Gmpz -> Gmpq
or use an Homogeneous kernel.

For better performances, you should try using CGAL::Exact_predicates_exact_constructions_kernel as Kernel.

Sebastien.

On 07/17/2014 02:57 PM, GiorgioCGAL wrote:
Hi all,
I am using the Polyhedron_3 and Nef_polyhedron_3 in order to do some
geometrical operations. I use 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)
{
try
{
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
}
else
{
throw
Utils::ProcessControl::AREException(notClosedGeoErrorMsg,
__FUNCTION__,
notClosedGeoErrorValue);
}
}
catch (Utils::ProcessControl::AREException & exception)
{
throw exception;
}
}

With the following inputs:

OFF
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


OFF
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






--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Polyhedron-3-and-Nef-polyhedron-3-intersection-problem-tp4659564.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page