Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Function for finding the index of a neighboring cell when adjacency relations haven't been set?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Function for finding the index of a neighboring cell when adjacency relations haven't been set?


Chronological Thread 
  • From: Adam Getchell <>
  • To:
  • Subject: [cgal-discuss] Function for finding the index of a neighboring cell when adjacency relations haven't been set?
  • Date: Mon, 22 Jun 2015 16:52:51 -0700

Hello all,

I might have missed it, but I’m looking for a function that finds the index of a neighboring cell with respect to the first cell.

The catch is I have just created these cells.

I can use something like:

int neighbor_index;
first->has_neighbor(second, neighbor_index)

But that only works when adjacency relationships are set. (When they are not set, these ints seem to point to memory addresses.)

I’m working on the opposite problem, setting adjacencies by finding cells with overlapping sets of vertices.

So far I’m using std::set_difference and set::union from <algorithm> to do this by brute force.

That is, given a list of newly created 3D cells, pairwise find those that have exactly 3 vertices in common using set::union, and then use set_adjacency(first, neighbor_index, second, neighbor_mirror_index) to set adjacency relations.

(In higher dimensions I would change the criteria accordingly.)

BTW, it seems these want sorted ranges. Are Vertex_handles sortable (is operator< defined)?

Thank you for any comments.


Adam Getchell
about.me/adamgetchell




Archive powered by MHonArc 2.6.18.

Top of Page