Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued)

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: , Jocelyn Meyron <>
  • Subject: Re: [cgal-discuss] Bug in halfspaces_intersection.h - or - How to efficiently compute intersection of half-planes (continued)
  • Date: Mon, 3 Nov 2014 15:23:09 +0100

Hi Ilya,

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 ?

Jocelyn Meyron (CC) worked on a robust version of this functionality as part of is Google Summer of Code, which should handle degenerate cases gracefully. Both versions will be included in an upcoming release of CGAL (maybe not the next one, but definitely the one after that) with a similar API.

Best,
Quentin

PS to Jocelyn: can you fix this in the gsoc repository?

I'm using file halfspaces_intersection.h that was published by you here:
http://cgal-discuss.949826.n4.nabble.com/How-to-efficiently-compute-intersection-of-half-planes-td4657312.html

It seems to me that there is a bug in it. There is a function that constructs duals of given planes, constructs a convex hull, and then maps polyhedron them back to primal space.
Inside the dual polyhedron construction there is the following code:


>       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());

When I try to run function halfspaces_intersection in my project the following error occurs:

> CGAL::Polyhedron_incremental_builder_3<HDS>::
> lookup_halfedge(): capacity error: more than 490 halfedges added while creating facet39.

So I suggest to change it as follows:

>      typename CGAL::Polyhedron_incremental_builder_3<HDS> B( hds, true);
>
>      B.begin_surface(_primal.size_of_facets(),
>                      _primal.size_of_vertices(),
>                      _primal.size_of_halfedges());

After this change the function begins to work.

I have tried to find whether anybody else use this function, but have found only this repo at GitHub:
https://github.com/mrgt/voronoi_covariance
The author of it is Quentin.

To all:
Is there any official way of fast and efficient computation of halfspaces intersections? Was it added to CGAL release?

--
Best regards,
Ilya Palachev

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page