CGAL
SUMMARY OF THIS WEEK:
I've downloaded the library in the laptop. And finished the installation. The following is the summary of the 1st chapter of the documentary called "Getting Started with CGAL."
Geometric Algorithms are used in many application domains such as computer graphics, robotics, geographic information systems, computer vision, etc.
It is not easy to implement these algorithms.
Therefore the computational geometry community itself started to develop a well-designed library: CGAL, Computations Geometry Algorithms Library.
It is developed by 7 different institutions:
It contains several different parts:
Consists of primitive, constant size geometric objects, such as points, lines, spheres, etc. and predicates on them, such as orientation test for points, intersection tests, etc.
Contains standard geometric algorithms and data structures such as convex hull, smallest enclosing circle, and triangulation.
Contains a support library, for example for I/O, visualization, and random generators.
Currently the library contains mainly 2D or 3D objects but in the future it will support objects of arbitrary dimensions.
CGAL is developed for different groups of users:
To fulfill the demands of all these different users CGAL is based on a number of design goals such as robustness, generality, efficiency and ease of use.
In geometric algorithms, many decisions are based on geometric predicates. If these predicates are not computed exactly, the algorithm may easily give errors.
In CGAL the following rule is used:
"A correct result of an algorithm can only be guaranteed if geometric predicates are evaluated exactly."
Because of this, in CGAL there is strong emphasis on the specification of algorithms. It is always clear for which inputs and for which number types a correct result is guaranteed.
To make the library as general as possible, C++ templates are heavily used. This allows the user to choose an appropriate number type for doing computations. To some extent it is even possible to replace a CGAL data type with a user defined one.
Such a CG library must be efficient to be really useful. Whenever possible the most efficient version of algorithm is used.
Because a library algorithm cannot be the best solution for every application, so sometimes multiple versions of an algorithm are supplied.
The abundant uses of templates seem to make the library difficult to use for some people, but this can mostly be solved by using appropriate C++ typedefs. The algorithms in the library contain many pre and post condition checks that help a lot when debugging. To facilitate using CGAL with existing code, CGAL types and algorithms are placed in namespace CGAL_.