Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued)
Chronological Thread
- From: Quentin Merigot <>
- To: Илья Палачев <>
- Cc: "" <>, "Laurent Rineau (CGAL/GeometryFactory)" <>, Jocelyn Meyron <>
- Subject: Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued)
- Date: Thu, 6 Nov 2014 10:10:59 +0100
Quentin
Hi,I'm using 4.3 version of CGAL. Do you advise to update it?Ilya uses 'true' for the second parameter:
I did not change anything in Quentin's code except one that line.BTW, I've found another issue related with this function.After construction of the intersection, the assertion is_strongly_convex_3 fails.Here is my code:static VectorXd buildStartingVector(SupportFunctionDataPtr data){// Some code/* Construct intersection of support halfspaces represented by planes */std::vector<Plane_3> planes = data->supportPlanes();Polyhedron_3 intersection;globalPCLDumper(PCL_DUMPER_LEVEL_DEBUG,".support-planes-for-halfspaces_intersection.txt")<< planes;CGAL::internal::halfspaces_intersection(planes.begin(), planes.end(),intersection, Kernel());ASSERT(is_strongly_convex_3(intersection));// Some code}I have printed planes to file and attached them to this mail. Here is the way they were printed:std::ostream &operator<<(std::ostream &stream, std::vector<Plane_3> planes){for (auto plane = planes.begin(); plane != planes.end(); ++plane)stream << plane->a() << " " << plane->b() << " " << plane->c()<< " " << plane->d() << std::endl;return stream;}It is interesting that even if I remove check "ASSERT(is_strongly_convex_3(intersection))" and if I get the hull of its points, the assertion also fails:Polyhedron_3 hull;std::vector<Point_3> points;for (auto vertex = intersection.vertices_begin();vertex != intersection.vertices_end(); ++vertex){points.push_back(vertex->point());}CGAL::convex_hull_3(points.begin(), points.end(), hull);ASSERT(is_strongly_convex_3(hull));Do you think that upgrade to CGAL 4.5 can resolve this issue?Best regards,IlyaLe Monday 03 November 2014 15:23:09 Quentin Merigot a écrit :
Thank you for this bug report, it is now fixed in my repository. However, I
must say that I am surprised that it did not work before this change: the
numbers provided to the constructor of Polyhedron_incremental_builder_3 are
in principle only used as estimations to reserve memory. What version of
CGAL are you using ?The constructor of CGAL::Polyhedron_incremental_builder has a second parameter
that is a Boolean:
http://doc.cgal.org/latest/Polyhedron/classCGAL_1_1Polyhedron__incremental__builder__3.html#acb8216ef40323e777f57cd4656d98c83
When it is set to 'true', then that class template does extra checks, and
display diagnostics.
Ilya uses 'true' for the second parameter:typename CGAL::Polyhedron_incremental_builder_3<HDS> B( hds, true);
B.begin_surface(_primal.size_of_facets(),
_primal.size_of_vertices(),
_primal.size_of_vertices());That explains the reported behavior.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Quentin Merigot, 11/03/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Laurent Rineau (CGAL/GeometryFactory), 11/03/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Илья Палачев, 11/05/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Quentin Merigot, 11/06/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Илья Палачев, 11/06/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Sebastien Loriot (GeometryFactory), 11/07/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Илья Палачев, 11/06/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Quentin Merigot, 11/06/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Илья Палачев, 11/05/2014
- Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued), Laurent Rineau (CGAL/GeometryFactory), 11/03/2014
Archive powered by MHonArc 2.6.18.