Search code examples
indexingcellcgaltriangulationdelaunay

Periodic 3d triangulation - cell indexing


I am using CGAL to perform a 3d delaunay triangulation for a large point set.

My aim is to generate an output file with the format:

ICell  Vertex1 Vertex2 Vertex3 Vertex4 NeigborCell1 NeighborCell2 ....

Where all values are indices corresponding to a specific Cell and vertex.

To achieve this I have included "Map" library, and used it on vertex handles and Cell handles to bind them with an index.
This method appears to be perfectly working for vertices, but in the case of cells it outputs all the cells that have been generated in the triangulation (including all the periodic images of the same Cell).
Furthermore, as images of Cells get different cell handles, they are assigned a different index (so many neighbors are images too)

Is there a way to iterate between each Cell once? How can I index them in a way that each one of them gets a unique index number?

Thanks in advance for your help.


Solution

  • I am afraid that you cannot iterate the way you want, at least in the current version of the package. You can only do this on the tetrahedra (geometric embedding of cells) using Periodic_tetrahedron_iterator with the appropriate Iterator_type. You can probably hack the code of Periodic_tetrahedron_iterator to do what you need...