So, you need computational geometry. It could be you need some nice Voronoi division of some domain. Or you need to mesh a surface. Whatever your needs, you may know there is this CGAL project that has these things implemented in a very professional manner.
Here is a list of steps in order to get these routines working for you.
- Basic programming, in any language:
- variables, statements, loops, and so on
- Basic c/c++ programming:
- ¡passing by reference! (c++)
- Object-oriented c++
- classes and structs
- inheritance (just the basics)
- The c++ STL:
- ¡lists! (life without indices)
- Download CGAL libs and compile them with cmake.
- In order to create your new project, create an new directory, then
- (for convenience)
export CGAL_DIR=~/Software/CGAL-3.8(or whereever CGAL libs are)
cmake -DCGAL_DIR=$CGAL_DIR .(notice the period at the end!)
- if you get errors regarding the Qt libs, edit the
CMakeLists.txtfile and remove all references to them
- for additional compiling options, run
cmake -DCGAL_DIR=CGAL_DIR -DCMAKE_CXX_FLAGS="-g" .
- If you need extra libs in your code, such as the GSL, run
pkg-config --libs lib_nameto see the options you need. For example,
pkg-config --libs gsl returns -lgsl -lgslcblas -lm. This shortcut should also work (actually, it quite does not for me):
cmake -DCGAL_DIR=CGAL_DIR/CGAL-3.8 -DCMAKE_CXX_FLAGS=`pkg-config --libs gsl`.
- run your project!