I'm planning on using CGAL Triangulation and Delaunay Triangulation classes as a backbone geometric structure for robot motion planning algorithms. The main difficulty that I have encountered so far is in assigning extra geometric data to full cells in an abstract complex. For example, in order to find the shortest path through a full cell I need to compute a set of normal vectors to all facets. For this purpose, I use expensive pseudo inverse procedure. Since, these computations have to be done several times in each full cell, I prefer to store this data once it is computed, and retrieve it during successive computations. In addition, I would like to store collision data for each full cell instead of recomputing it all over again after refining given triangulation.
Browsing some answers here and trying to understand the structure of CGAL, I reached some understanding on this subject:
- It is a really bad idea to rewrite geometric kernel just for this...
- I've seen examples of using a vertex base class with info in which points are augmented with indices here. Although using
Triangulation_cell_base_with_info
seems as an easy workaround, I consider it as an inelegant hack because it requires me to implement a wrapper class for keeping additional data and pass this class to the planning algorithm. - I can derive a cell class from
Triangulation_ds_cell_base
. This looks like the most acceptable way to do things, but I cannot find a good example of code that will help me to get started. I need not only class derivation, but also example code on how to access cell data in various scenarios: through iterator, vertex adjacency, and so on.
So, here are my two questions:
- What is CGAL way to store and retrieve additional geometric data per cell?
- Is there a good example of code doing exactly that?
EDIT: I forgot to mention that I need to use dD triangulation introduced in CGAL 4.6