200 likes | 389 Views
The Computational Geometry Algorithm Library. Pierre Alliez. http://www.cgal.org. Goals. Promote Research in Computational Geometry (CG) “make the large body of geometric algorithms developed in the field of CG available for industrial applications” -> robust programs.
E N D
The Computational Geometry Algorithm Library Pierre Alliez http://www.cgal.org
Goals • Promote Research in Computational Geometry (CG) • “make the large body of geometric algorithms developed in the field of CG available for industrial applications” -> robust programs
CG Impact Task Force Report, 1996 Among the key recommendations: • Production and distribution of usable (and useful) geometric codes • Reward structure for implementations in academia
The CGAL Project • Started in 1996 as joined project of: • ETH Zurich • INRIA • MPI für Informatik • Tel-Aviv U • Utrecht U • Trier U • FU Berlin
Basic Library HalfedgeDatastructure Triangulations Arrangements Convex Hull Optimisation ... • Visualization • File I/O • Number Types • Generators • STL extensions Point, Segment,... Predicates Kernel Support Library:Configuration, Assertions Structure of CGAL
Convex Hull • 2D Convex Hull • 5 algorithms for points • CH of a simple polyline • Convexity Test • Extremal Points • 3D Convex Hull • static, incremental, dynamic
Planar Subdivisions • Framework for arrangements of 2D curves • based on planar maps • based on topological maps • Models exist for polylines, circles, conic arcs • Operations • point location, overlay, ray shooting,..
Search Structures • Multi dimensional data structures • range tree, segment tree • kD tree • Operations • window queries • nearest neighbor
Triangulations in 2D and 3D • Delaunay, regular, constrained, conformal Delaunay • Rich APIs • fast point location, • insertion, removal of points and constraints • traversal along a line • traversal of the triangulation
Triangulations • 2D, 3D Alpha shapes • 2D, 3D Voronoi diagram, power diagram • 2D Delaunay mesh, 3D Delaunay mesh • Natural neighbors* • k-order Voronoi diagram 2* • Voronoi of segments * • Voronoi of circles (*) on-going
Optimization • Based on LP/QP solvers • Smallest enclosing circle/ellipse in 2D • Smallest enclosing sphere in dD • Rectangular p center, for p = 2, 3, 4 • Polytope distances in dD • Smallest enclosing annulus in dD • Smallest enclosing sphere of spheres*
and ... • dD Delaunay/Voronoi • Polygon decomposition • Polyhedral surfaces • Halfedge data structure
Library Design Let’s play Lego
Generic Programming [Musser 89] float min(float a, float b) int min(int a, int b) template < CompType> CompType min(CompType a, CompType b) { return (a<b) ? a : b; } BigInt n(9), m(8), r; r = min( n, m ); BigInt is a model for the concept CompType
Point_3 Cartesian Homogeneous int double Gmpz Gmpq leda::Real core::Expr Concepts: NumberType and Kernel Parameterization of Kernel Classes
Parameterization of Datastructures template < Geometry > class Delaunay_triangulation_2 { void insert(Geometry::Point t) { if(Geometry::orientation(p,q,t)==..) if(Geometry::incircle(p,q,r,t)) } }; • works with CGAL kernels • works with projections kernels • write thin glue layer for your kernel
Value for Users • High quality of most components • Interoperability of components • Rich functionality • allows rapid prototyping • allows focus on application domain • Reduces time to market (publication)