Computational Geometry Algorithm Library
Efi Fogel
Tel Aviv University
Computational Geometry
- Apr. 7th, 2014
Computational Geometry Algorithm Library Efi Fogel Tel Aviv - - PowerPoint PPT Presentation
Computational Geometry Algorithm Library Efi Fogel Tel Aviv University Computational Geometry Apr. 7 th , 2014 Cgal : Mission Make the large body of geometric algorithms developed in the field of computational geometry available for
Computational Geometry Algorithm Library 2
Bounding Volumes Polyhedral Surfaces Boolean Operations Triangulations Voronoi Diagrams Mesh Generation Subdivision Simplification Parametrisation Streamlines Ridge Detection Neighbor Search Kinetic Data Structures Envelopes Arrangements Intersection Detection Minkowski Sums PCA Polytope Distance QP Solver Computational Geometry Algorithm Library 3
Computational Geometry Algorithm Library 4
1
2
3
4
5
6
7
8
9
10 ETH Zürich 11 University of Crete and
12 Universitá della Svizzera
13 Universidade Federal de
14 Instituto Nacional de
Computational Geometry Algorithm Library 5
Computational Geometry Algorithm Library 6
Computational Geometry Algorithm Library 7
⋆ Polymorphism is resolved at compile time Computational Geometry Algorithm Library 8
Computational Geometry Algorithm Library 9
Computational Geometry Algorithm Library 10
Computational Geometry Algorithm Library 11
Computational Geometry Algorithm Library 12
Computational Geometry Algorithm Library 13
⋆ No reference-counting, inexact instantiation
Computational Geometry Algorithm Library 14
Computational Geometry Algorithm Library 15
⋆ Geometric constructions may be inexact due to round-off errors. ⋆ It is however more efficient and sufficient for most Cgal algorithms.
⋆ Its number type supports the exact square-root operation. Computational Geometry Algorithm Library 16
Computational Geometry Algorithm Library 17
#i n c l u d e <CGAL/ E x a c t _ p r e d i c a t e s _ i n e x a c t _ c o n s t r u c t i o n s _ k e r n e l . h> t y p e d e f CGAL : : E x a c t _ p r e d i c a t e s _ i n e x a c t _ c o n s t r u c t i o n s _ k e r n e l Kernel ; t y p e d e f Kernel : : Point_2 Point_2 ; i n t main () { Point_2 p (0 ,0) , q (10 ,3) , r ( 1 2 , 1 9 ) ; r e t u r n (CGAL : : o r i e n t a t i o n (q , p , r ) == CGAL : : LEFT_TURN) ? 0 : 1; }
#i n c l u d e <CGAL/ E x a c t _ p r e d i c a t e s _ i n e x a c t _ c o n s t r u c t i o n s _ k e r n e l . h> t y p e d e f CGAL : : E x a c t _ p r e d i c a t e s _ i n e x a c t _ c o n s t r u c t i o n s _ k e r n e l Kernel ; t y p e d e f Kernel : : Point_2 Point_2 ; t y p e d e f Kernel : : Orientation_2 Orientation_2 ; i n t main () { Kernel k e r n e l ; Orientation_2
Point_2 p (0 ,0) , q (10 ,3) , r ( 1 2 , 1 9 ) ; r e t u r n ( o r i e n t a t i o n (q , p , r ) == CGAL : : LEFT_TURN) ? 0 : 1; }
Computational Geometry Algorithm Library 18
#i n c l u d e <CGAL/ E x a c t _ p r e d i c a t e s _ i n e x a c t _ c o n s t r u c t i o n s _ k e r n e l . h> #i n c l u d e <CGAL/ i n t e r s e c t i o n s . h> t y p e d e f CGAL : : E x a c t _ p r e d i c a t e s _ i n e x a c t _ c o n s t r u c t i o n s _ k e r n e l Kernel ; t y p e d e f Kernel : : Point_2 Point_2 ; t y p e d e f Kernel : : Segment_2 Segment_2 ; t y p e d e f Kernel : : Line_2 Line_2 ; i n t main () { Point_2 p (1 ,1) , q (2 ,3) , r ( −12 ,19); Line_2 l i n e (p , q ) ; Segment_2 seg ( r , p ) ; auto r e s u l t = CGAL : : i n t e r s e c t i o n ( seg , l i n ) ; i f ( r e s u l t ) { i f ( const Segment_2∗ s = boost : : get<Segment_2>(&∗ r e s u l t )) { // handle segment } e l s e { const Point_2∗ p = boost : : get<Point_2 >(&∗ r e s u l t ) ; // handle p o i n t } } r e t u r n 0; }
Computational Geometry Algorithm Library 19
Computational Geometry Algorithm Library 20
On the design of Cgal a computational geometry algorithms library. Software — Practice and Experience, 30(11):1167–1202, 2000. Special Issue on Discrete Algorithm Engineering.
A generic lazy evaluation scheme for exact geometric computations. In 2nd Library-Centric Software Design Workshop, 2006.
Designing the computational geometry algorithms library Cgal. In Proceedings of ACM Workshop on Applied Computational Geometry, Towards Geometric Engineering, volume 1148, pages 53–58, London, UK, 1996. Springer. The Cgal Project. Cgal User and Reference Manual. Cgal Editorial Board, 4.4 edition, 2014. http://doc.cgal.org/4.2/CGAL.CGAL/html/index.html . Efi Fogel, Ron Wein, and Dan Halperin. Cgal Arrangements and Their Applications, A Step-by-Step Guide. Springer, 2012. Computational Geometry Algorithm Library 21