19
http://www.cgal.org http://www.cgal.org Pierre Alliez Pierre Alliez The Computational The Computational Geometry Algorithm Geometry Algorithm Library Library

Http:// Pierre Alliez The Computational Geometry Algorithm Library

Embed Size (px)

Citation preview

http://www.cgal.orghttp://www.cgal.org

Pierre AlliezPierre Alliez

The Computational The Computational Geometry Algorithm Geometry Algorithm

LibraryLibrary

http://http://www.cgal.orgwww.cgal.org

GoalsGoals

• Promote Research in Computational Promote Research in Computational Geometry (CG)Geometry (CG)

• ““make the large body of geometric make the large body of geometric algorithms developed in the field of CG algorithms developed in the field of CG available for industrial applications”available for industrial applications”

-> robust programs-> robust programs

http://http://www.cgal.orgwww.cgal.org

CG Impact Task Force CG Impact Task Force Report, 1996Report, 1996

Among the Among the key key recommendationsrecommendations::

• Production and distribution of Production and distribution of usable (and useful) geometric usable (and useful) geometric codescodes

• Reward structure for Reward structure for implementations in academiaimplementations in academia

http://http://www.cgal.orgwww.cgal.org

The CGAL ProjectThe CGAL Project

Started in 1996 as joined project of:Started in 1996 as joined project of:

• ETH ZurichETH Zurich

• INRIAINRIA

• MPI für InformatikMPI für Informatik

• Tel-Aviv UTel-Aviv U

• Utrecht UUtrecht U

• Trier UTrier U

• FU BerlinFU Berlin

http://http://www.cgal.orgwww.cgal.org

Structure of CGALStructure of CGAL

Basic Library

Support Library: Configuration, Assertions

• Visualization• File I/O• Number Types• Generators• STL extensions

Point, Segment,... Predicates

Kernel

Tria

ngul

atio

ns

Arr

ange

men

ts

Hal

fedg

eD

atas

truc

ture

Con

vex

Hul

l

Opt

imis

atio

n

...

The Basic LibraryThe Basic Library

http://http://www.cgal.orgwww.cgal.org

Convex HullConvex Hull

• 2D Convex Hull2D Convex Hull– 5 algorithms for points5 algorithms for points– CH of a simple polylineCH of a simple polyline

• Convexity TestConvexity Test• Extremal PointsExtremal Points

• 3D Convex Hull3D Convex Hull– static, incremental, dynamicstatic, incremental, dynamic

http://http://www.cgal.orgwww.cgal.org

Planar SubdivisionsPlanar Subdivisions

• Framework for arrangements of 2D Framework for arrangements of 2D curvescurves– based on planar maps based on planar maps

– based on topological maps based on topological maps

– Models exist for polylines, Models exist for polylines, circles, conic arcscircles, conic arcs

• Operations Operations – point location, overlay, point location, overlay,

ray shooting,..ray shooting,..

http://http://www.cgal.orgwww.cgal.org

Search StructuresSearch Structures

• Multi dimensional data structuresMulti dimensional data structures– range tree, segment treerange tree, segment tree– kD treekD tree

• Operations Operations – window querieswindow queries– nearest neighbor nearest neighbor

http://http://www.cgal.orgwww.cgal.org

Triangulations in 2D and Triangulations in 2D and 3D3D

• Delaunay, regular, Delaunay, regular, constrained, conformal constrained, conformal DelaunayDelaunay

• Rich APIsRich APIs– fast point location, fast point location, – insertion, removal of insertion, removal of

points and constraintspoints and constraints– traversal along a linetraversal along a line– traversal of the triangulationtraversal of the triangulation

http://http://www.cgal.orgwww.cgal.org

TriangulationsTriangulations

• 2D, 3D Alpha shapes2D, 3D Alpha shapes• 2D, 3D Voronoi diagram, power diagram2D, 3D Voronoi diagram, power diagram• 2D Delaunay mesh, 3D Delaunay mesh2D Delaunay mesh, 3D Delaunay mesh• Natural neighborsNatural neighbors**• k-order Voronoi diagram 2k-order Voronoi diagram 2**• Voronoi of segments Voronoi of segments **• Voronoi of circlesVoronoi of circles

(*) on-going(*) on-going

http://http://www.cgal.orgwww.cgal.org

OptimizationOptimization

• Based on LP/QP solvers Based on LP/QP solvers – Smallest enclosing Smallest enclosing

circle/ellipse in 2Dcircle/ellipse in 2D– Smallest enclosing Smallest enclosing

sphere in dDsphere in dD– Rectangular p center, Rectangular p center,

for p = 2, 3, 4for p = 2, 3, 4– Polytope distances in dDPolytope distances in dD– Smallest enclosing annulus in dDSmallest enclosing annulus in dD

– Smallest enclosing sphere of spheresSmallest enclosing sphere of spheres**

http://http://www.cgal.orgwww.cgal.org

Nef Polyhedra 2,3Nef Polyhedra 2,3**

http://http://www.cgal.orgwww.cgal.org

and ...and ...

• dD Delaunay/VoronoidD Delaunay/Voronoi• Polygon decompositionPolygon decomposition• Polyhedral surfacesPolyhedral surfaces• Halfedge data structureHalfedge data structure

Library DesignLibrary Design

Let’s play LegoLet’s play Lego

http://http://www.cgal.orgwww.cgal.org

int min(int a, int b) float min(float a, float 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

Generic Programming Generic Programming [Musser 89][Musser 89]

http://http://www.cgal.orgwww.cgal.org

Parameterization of Kernel Parameterization of Kernel ClassesClasses

Point_3

Cartesian Homogeneousdouble

Gmpqleda::Real

intGmpz

Concepts: NumberType and Kernel

core::Expr

http://http://www.cgal.orgwww.cgal.org

template < template < GeometryGeometry > >class Delaunay_triangulation_2 class Delaunay_triangulation_2 {{ void insert(void insert(Geometry::PointGeometry::Point t) t) {{

if(if(Geometry::orientation(Geometry::orientation(p,q,tp,q,t))==..)==..)

if(if(Geometry::incircle(Geometry::incircle(p,q,r,tp,q,r,t)))) }}};};

Parameterization of Parameterization of DatastructuresDatastructures

• works with CGAL kernelsworks with CGAL kernels• works with projections kernelsworks with projections kernels• write thin glue layer for your kernelwrite thin glue layer for your kernel

http://http://www.cgal.orgwww.cgal.org

Value for UsersValue for Users

• High quality of most componentsHigh quality of most components

• Interoperability of components Interoperability of components • Rich functionalityRich functionality

– allows rapid prototypingallows rapid prototyping– allows focus on application domainallows focus on application domain– Reduces time to market Reduces time to market

(publication)(publication)