• Aucun résultat trouvé

Introduction to the Computational Geometry Algorithms Library

N/A
N/A
Protected

Academic year: 2022

Partager "Introduction to the Computational Geometry Algorithms Library"

Copied!
31
0
0

Texte intégral

(1)

Introduction to the

Computational Geometry Algorithms Library

Monique Teillaud

www.cgal.org

January 2013

(2)

Overview

The CGAL Open Source Project Contents of the Library

Kernels and Numerical Robustness

(3)

Part I

The CGAL Open Source Project

(4)

Goals

•Promote the research in Computational Geometry (CG)

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

robust programs

(5)

History

•Development started in 1995

(6)

History

•Development started in 1995

•January, 2003: creation ofGEOMETRY FACTORY

INRIA startup

sells commercial licenses, support, customized developments

•November, 2003: Release 3.0 -Open Source Project new contributors

•September, 2012: Release 4.1

(7)

License

a few basic packages underLGPL most packages underGPLv3+

◦free use for Open Source code

◦commercial license needed otherwise

(8)

Distribution

•from the INRIA gforge

•included in Linux distributions (Debian, etc)

•available through macport

•CGAL triangulations integrated in Matlab

•Scilab interface to CGAL triangulations and meshes

•CGAL-bindings

CGAL triangulations, meshes, etc, can be used in Java or Python implemented with SWIG

(9)

CGAL in numbers

•500,000 lines ofC++code

•several platforms

g++ (Linux MacOS Windows), VC++

•>1,000 downloads per month on the gforge

•50 developers registered on developer list (∼20 active)

(10)

Development process

•Packages arereviewed.

•1 internal release per day

•Automatictest suitesrunning on all supported compilers/platforms

(11)

Users

List of identified users in various fields

Molecular Modeling

Particle Physics, Fluid Dynamics, Microstructures

Medical Modeling and Biophysics

Geographic Information Systems

Games

Motion Planning

Sensor Networks

Architecture, Buildings Modeling, Urban Modeling

Astronomy

2D and 3D Modelers

Mesh Generation and Surface Reconstruction

Geometry Processing

Computer Vision, Image Processing, Photogrammetry

Computational Topology and Shape Matching

Computational Geometry and Geometric Computing More non-identified users. . .

(12)

Customers of G

EOMETRY

F

ACTORY (end 2008)

(13)

Part II

Contents of CGAL

(14)

Structure

Kernels

Various packages Support Library

STLextensions,I/O, generators, timers. . .

(15)

Some packages

(16)

Part III

Numerical Robustness

(17)

The CGAL Kernels

2D, 3D, dD “Rational” kernels 2D circular kernel

3D spherical kernel

(18)

In the kernels

Elementary geometric objects Elementary computations on them

Primitives Predicates Constructions 2D, 3D, dD •comparison •intersection

•Point •Orientation •squared distance

•Vector •InSphere . . .

•Triangle . . .

•Circle . . .

(19)

Affine geometry

Point - Origin→Vector Point - Point→Vector Point + Vector→Point

Point Vector Origin

Point + Pointillegal

midpoint(a,b) = a + 1/2 x (b-a)

(20)

Kernels and number types

Cartesian representation Point

x = hwhx y = hwhy

Homogeneous representation Point

hx hy hw

- ex: Intersection of two lines - a1x+b1y+c1=0

a2x+b2y+c2=0

(x,y) =

b1 c1

b2 c2

a1 b1 a2 b2

,

a1 c1

a2 c2

a1 b1 a2 b2

a1hx+b1hy+c1hw =0 a2hx+b2hy+c2hw =0

(hx,hy,hw) =

b1 c1

b2 c2

,

a1 c1

a2 c2

,

a1 b1

a2 b2

Field operations Ring operations

(21)

Kernels and number types

Cartesian representation Point

x = hwhx y = hwhy

Homogeneous representation Point

hx hy hw - ex: Intersection of two lines - a1x+b1y+c1=0

a2x+b2y+c2=0

(x,y) =

b1 c1

b2 c2

a1 b1 a2 b2

,

a1 c1

a2 c2

a1 b1 a2 b2

a1hx+b1hy+c1hw =0 a2hx+b2hy+c2hw =0

(hx,hy,hw) =

b1 c1

b2 c2

,

a1 c1

a2 c2

,

a1 b1

a2 b2

Field operations Ring operations

(22)

Kernels and number types

Cartesian representation Point

x = hwhx y = hwhy

Homogeneous representation Point

hx hy hw - ex: Intersection of two lines - a1x+b1y+c1=0

a2x+b2y+c2=0

(x,y) =

b1 c1

b2 c2

a1 b1 a2 b2

,

a1 c1

a2 c2

a1 b1 a2 b2

a1hx+b1hy+c1hw =0 a2hx+b2hy+c2hw =0

(hx,hy,hw) =

b1 c1

b2 c2

,

a1 c1

a2 c2

,

a1 b1

a2 b2

Field operations Ring operations

(23)

The “rational” Kernels

CGAL::Cartesian< FieldType >

CGAL::Homogeneous< RingType >

−→Flexibility

typedef double NumberType;

typedef Cartesian< NumberType > Kernel;

typedef Kernel::Point_2 Point;

(24)

Numerical robustness issues

Predicates = signs of polynomial expressions Ex:Orientation of 2D points

p

q r

orientation(p,q,r) = sign

det

px py 1 qx qy 1 rx ry 1

= sign((qx−px)(ry−py)−(qy−py)(rx−px))

(25)

Numerical robustness issues

Predicates = signs of polynomial expressions Ex:Orientation of 2D points

p= (0.5+x.u, 0.5+y.u) 0≤ x,y <256, u=2−53 q = (12,12)

r = (24,24) orientation(p,q,r) evaluated withdouble (x,y)7→ >0 , =0 , <0

double−→inconsistenciesin predicate evaluations

(26)

Numerical robustness issues

Speed and exactness through

Exact Geometric Computation

6=

exact arithmetics Filtering Techniques(interval arithmetics, etc) exact arithmetics only when needed

Degenerate casesexplicitly handled

(27)

Numerical robustness issues

Speed and exactness through

Exact Geometric Computation

6=

exact arithmetics Filtering Techniques(interval arithmetics, etc) exact arithmetics only when needed

Degenerate casesexplicitly handled

(28)

Numerical robustness issues

Speed and exactness through

Exact Geometric Computation

6=

exact arithmetics Filtering Techniques(interval arithmetics, etc) exact arithmetics only when needed

Degenerate casesexplicitly handled

(29)

The circular/spherical kernels

Circular/spherical kernels

• solve needs for e.g. intersection of circles.

extendthe CGAL (linear) kernels

Exact computations on algebraic numbers of degree 2

= roots of polynomials of degree 2

Algebraic methods reducecomparisonsto

computations ofsigns of polynomial expressions

(30)

Application of the 2D circular kernel

Computation of arrangements

of 2D circular arcs and line segments

Pedro M.M. de Castro, Master internship

(31)

Application of the 3D spherical kernel

Computation of arrangements of 3D spheres

Sébastien Loriot, PhD thesis

Références

Documents relatifs

In this paper, we design an exact algorithm based on symbolic homotopy for solving semidefinite programs without assumptions on the feasible set, and we analyze its complexity..

This allows us to reduce the resolution of our problem to solving polynomial systems encoding critical points of our objective function restricted to a de- formation of the feasible

Keywords: Analysis of algorithms, complex asymptotics, digital tree, Mellin transform, memoryless sources,

Under the assumption that β is a hyperbolic Perron number, we will see that it is possible to compute the set of the β-fractional parts of sums of two β-integers, using a

Numerical domains can only abstract directly environments over cells of real type, not pointer type. We abstract each component independently: one cell of integer type is allocated

[r]

Among the unexpected features of recent developments in technol- ogy are the connections between classical arithmetic on the one hand, and new methods for reaching a better security

- Pierre Arnoux, Université de la Méditerranée, - Pierre Cartier, École Normale Supérieure de Paris, - Julien Cassaigne, Institut de Mathématiques de Luminy, - Sébastien