0

Using CGAL, I have a 3D Delaunay Triangulation of a set of random points on the unit sphere, that I obtained via:

Delaunay T(points.begin(), points.end());

Now, what I would like to be able to do is query T (using locate() or something like that) to find the three vertices of the surface facet that an arbitrary point (also on the unit sphere) is contained inside.

When I use locate(), I get interior cells as results sometimes, which include the infinite vertex. I don't want any of these. I just want the surface facets and to be able to do this for any arbitrary point I try to find that is also on the unit sphere. Trying to figure this out has taken a lot longer than I thought it would.

Any help would be much obliged. Thanks.

kdottiemo
  • 79
  • 1
  • 8
  • I'm not sure your question is perfectly defined : you can consider the supporting plane of a surface triangle, and determine it's what you want if this plane separates the triangulation from your point. But there can be several valid answers this way. This is what locate() returns : any of these.Alternatively, you can decide to project the edges on the sphere the obvious way, which partitions the sphere and gives unique answers (except on edges themselves). For that, you could for example use find_conflicts() and pick the answer you prefer using a few orientation tests. – Sylvain Pion Jun 19 '14 at 23:06
  • Thanks for considering this. I only necessitate that the vertices that I obtain are a subset of the original random points on the unit sphere. And at this point, I don't really care exactly how the data is triangulated, just that I can roughly look at a lat-long map of values where the vertices are clearly my starting data-points. Could you explain a little more about the meaning of what I'm going to get in terms of "bfit" and "cit" if I go the find_conflicts() route? – kdottiemo Jun 19 '14 at 23:22
  • 1
    Add the center of the sphere to the triangulation and, instead of locating p, locate the midpoint of p and the center of the sphere, it is less likely to be outside of the polytope. – Marc Glisse Jun 20 '14 at 05:49

1 Answers1

1

So I would use find_conflit(), with CGAL::Emptyset_iterator for cit because you don't need these. In bfit, you will get the facets of the boundary of the "hole", and the hole is all tetrahedra in conflict with your point (whose circumscribing sphere contains the point, with a natural extension to the infinite vertex). So, for bfit, put them in a standard container using std::back_inserter for example. Then, iterate over these, tests if they are finite facets. The finite facets you get are those that separate your point from the rest of the triangulation, so, you can then do orientation() tests with the center of the sphere to get the one you are interested in.

Sylvain Pion
  • 575
  • 1
  • 4
  • 11
  • Ah, I think I understand what's going on. I'll try this; thanks! As an aside -> is this how you would have gone about doing this Delaunay-triangulation over the sphere? – kdottiemo Jun 20 '14 at 01:33
  • There are several ways to do a Delaunay on the sphere. You can check this paper : http://dl.acm.org/citation.cfm?id=2128836. Using Delaunay_3 is certainly a good way, although I fear it might be a bit more memory hungry than alternatives (just a guess), it depends on your needs. – Sylvain Pion Jun 20 '14 at 01:40