Introduction of programming best practices in c++ through the learning of different knowledges and skills :
- Generic and oriented object programming.
- Design patterns.
- Building Makefile.
- Automatic testing.
It will deserve a wider context in digital geometry.
- doc is a folder containing Latex and bibtex source files for the report and the algorithm used during the programming.
- inc is a folder containing the .h files.
- stests is a folder containing all the program test.
- stools is a folder containing the display tool.
- tools is a folder containing all the GNUPlot plot
- Makefile : Compiling all files. ( --depreciated -- see CMakeLists.txt)
- CMakeLists : Building project.
- .gitignore : ignoring upload of temporary and binaries files.
- README.md : This wiki presentation
- PointVector2D.h is the main class implementing point and vector in two dimensions.
- RayIntersectableStraightLine.h and RayIntersectableCircle.h implement some 'ray intersectable' class. We try to used some generic concept in order to computed the same way on different shape. At the beginning, we start with the straight line then the circle.
- We follow with algorithms computing the convergent points of a rationnel : testConvergents.cpp, the convex hull of a discrete circle : OutputSensitiveConvexHull.h and the alpha-shape of a straight-line and a discrete circle : testAlphaShapeStraightLine.cpp and OutputSensitiveAlphaShape.h.
- toolAlphaShape.cpp produce a graph witch visualize the number of vertices of the convex hull, the alpha-shape with alpha = 0, and the alpha-shape with alpha < 0 in function to the the size of the radius. We create 100 random circles with a center in [0,1]x[0,1] and a radius proportional to the predicate increasing by 2^2.
- toolDisplay.cpp used DGtal librairie to print the shape on a board.
Class and templates initialization explain with the creation of functional tools in planar geometry. We elaborate some useful concepts in discrete geometry :
- Points / Vectors
- Lines
- Circles
We provide some programming conveniences :
- Class members
- Inner types
- Standard services
- Read access
- Comparisons
- Operations
- Norms
Compile and execute the test files by launching this command in a terminal :
# Create build folder and go inside
mkdir build; cd build
# Generate files
cmake ..
# Compile files
make
# Execute all the test
make test
# Specific testing
./stests/test*
# For post-processing
./stools/tool*
- Implementing testing : Basic operators, arithmetic operators, norms...
- Intersecable testing : Various intersections cases...
- Concrete application : Geometric gcd.
- Accuracy and validity of the algorithms : geometric-gcd, convex hull, alpha-shape.
In the huge topic of digital geometry, I am mainly interested by the well-known issue of discrete circle shape in 2d on regular lattice. Particularly, I try to design and implement the alpha-shape computation in a output sensitive complexity.
An alpha-hull is a generalization of the convex-hull algorithm for alpha = 0. It consist on recover the the edge of the circle with a new constraint, neighbors vertices have to be closed in a same ball of radius 1/alpha.
A more accurate and mathematical definition,
For alpha < 0, the alpha-shape is defined as the intersection of all closed complements of discs with radius -1/alpha that contain all the points inside the circle.
For alpha > 0, the alpha-shape is defined as the intersection of all the closed discs with radius 1/alpha that contain all the points inside the circle.
If I put an Euclidean circle on a lattice, all the points which belong to the inside are part of discrete circle.
In our repository, we constructed them by different methods :
- The circumcircle formed by a triangle itself defined by three point of the grid.
- The integer value to the quadruple (a,b,c,d) of the circle equation : ax + by + c(x^2 + y^2) + d = 0.
The source code will be available under the GPLv3. You can download it here.
- Instructor : ROUSSILLON Tristan : https://github.com/troussil
- Trainee : LAFOND Thomas : https://github.com/homeostasie