Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Bounded versus unbounded simplices in Convex_hull_d

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Bounded versus unbounded simplices in Convex_hull_d


Chronological Thread 
  • From: Camille Wormser <>
  • To:
  • Subject: Re: [cgal-discuss] Bounded versus unbounded simplices in Convex_hull_d
  • Date: Wed, 17 Oct 2007 10:03:41 +0200

Ben Galehouse wrote:
I create a convex hull and then want to work through the (bounded) simplices. I basically have

for(Simplex_iterator s = hull.simplices_begin();
s != hull.simplices_end();
s++){
...
Point_d<Cartesian_d<Gmpq> >newPoint = hull.point_of_simplex(s, 0)
...
}

And the call to point_of_simplex then gives a segmentation fault. I'm still sorting through the different levels of header files to get a feel from the convex hull code, but it looks like it keeps tract of some unbounded simplices, as well as the bounded simplices that interest me. Would s iterate over these unbounded simplices?

Hi.
Yes, s iterates over all simplices of the underlying triangulation, which include unbounded simplices. If you want only bounded simplices, you should first check this property with

bool is_unbounded_simplex(Simplex_[const_]handle S)
or
bool is_bounded_simplex(Simplex_[const_]handle S)

Would a segmentation fault be expected when asking for a point of such?

Yes, it is expected: unbounded simplices are recognized by the fact that their Vertex_handle 0 is anti_origin_, which is the default Vertex_handle, with no vertex attached (search for anti_origin_ in the code to have some idea of what happens). It could as well have been called the "infinite vertex" handle.

Apologies if I'm missing something obvious in the documentation.

It seems that the boundedness tests are indeed missing in the documentation, but it probably comes from the fact that they are not supposed to be in the interface. Someone just forgot to redefine the simplices_iterator instead of using the ones from the base class (Regular_complex_d, which knows nothing about anti_origin_ anyway).

--
Camille Wormser



Archive powered by MHonArc 2.6.16.

Top of Page