Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] halfspace_intersection_3 crash

Subject: CGAL users discussion list

List archive

[cgal-discuss] halfspace_intersection_3 crash


Chronological Thread 
  • From: AndrewLiu <>
  • To:
  • Subject: [cgal-discuss] halfspace_intersection_3 crash
  • Date: Wed, 11 Jan 2017 01:03:55 -0800 (PST)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:Evxa2xaVOyTQkfiavhl+r+H/LSx+4OfEezUN459isYplN5qZr8y9bnLW6fgltlLVR4KTs6sC0LuK9fq/EjVasd6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCzbL52Ixi6txvdu8sZjYd/NKo8yQbCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4apnVAPkhSEaPDM/7WrZiNF/jLhDrRyvpxJx3Y3abpyaO/Vica3QZs8aSGhbU8pNSyBNHp2wYo0SBOQBJ+ZYqIz9qkMSoBu4GAasHv3gyzFOiH/3wK0xzuMsEQXH3AwmENIOsnXUo8vvOKYTUeC10bLFzTPHb/NOwzfx8onIfQo7rf6WQb18a9beyU82Gg7Dk16ep4vlPzaP2eQMtWiW9+xgWvi0hGE8rwF+vCKjydsrionMno4a1l/E+j99wIovIt24UkF7bNi5G5VTryGXL5Z6T8I8T21ypio3yrMLtYSmcCUExpkr3RHSZvKff4SV4x/vSvydLSl4iX9rYr6zmhi//Ea6xuD8VMS51ktBoDBfndnWrH8N0gTe6siZRft5+UeswTOP1g7U6uFeIkA4j6zbJIQ6zbErkpocr17PETPxmEXzlKOWd0Mk9fa06+n/f7nrp4GQO5Vqhgz+PKkigNGzDOo2PwQUUGWW9/yw1Lj58k34RLVKgOc2kq7csJ3CIcQbp6i5AwBX0oYi9RmzFTan0NQFnXQcKlJFfAqHj5LzN1HPOv/0F+2wjEi2nDh3wfDKJqfhDYnVLnjfjLfheq5w5FJTyAUpydBT/o9bCrAaIP3vR0/xr8fYAwQiMw20xubnEM9y2pkfWWKJGK+ZMbndvUWG5uI1cKGwY9oetz/5bvQk/PXzlmQRmFkHfKDv04FERmq/G6FPJUmDbGXIg8pJRWMLuAU8TeGsml2feThXf2z0Xqt67zp9A4TwXtSLfZyknLHUhHTzJZZRfG0TUl0=

Hi all,

When I changed the Exact_predicates_inexact_constructions_kernel to
Simple_cartesian<double> in halfspace_intersection_3 example
<http://doc.cgal.org/latest/Convex_hull_3/index.html#Convex_hull_3HalfspaceIntersection>

, the program may crash in some rare cases.
Here is the code.
-----------------------------------------------
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Convex_hull_3/dual/halfspace_intersection_3.h>
#include <CGAL/point_generators_3.h>
#include <list>
//typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Simple_cartesian<double> K;
typedef K::Plane_3 Plane;
typedef K::Point_3 Point;
typedef CGAL::Polyhedron_3<K> Polyhedron_3;
// compute the tangent plane of a point
template <typename K>
typename K::Plane_3 tangent_plane (typename K::Point_3 const& p) {
typename K::Vector_3 v(p.x(), p.y(), p.z());
v = v / sqrt(v.squared_length());
typename K::Plane_3 plane(v.x(), v.y(), v.z(), -(p - CGAL::ORIGIN) * v);
return plane;
}
int main (void) {
int i = 100000;

while (i--) {
// number of generated planes
int N = 200;
// generates random planes on a sphere
std::list<Plane> planes;
CGAL::Random_points_on_sphere_3<Point> g;
for (int i = 0; i < N; i++) {
planes.push_back(tangent_plane<K>(*g++));
}
// define polyhedron to hold the intersection
Polyhedron_3 P;
// compute the intersection
// if no point inside the intersection is provided, one
// will be automatically found using linear programming
CGAL::halfspace_intersection_3(planes.begin(),
planes.end(),
P,
boost::make_optional(Point(0, 0, 0)) );
}
std::cout << "Finished." << std::endl;

return 0;
}
-----------------------------------------------
I was wondering if there is any restriction of the Kernel used in
halfspace_intersection_3.
Am I supposed to use exact predicate only when using this function?

Thanks,

Andrew



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/halfspace-intersection-3-crash-tp4662456.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page