Computational Geometry
Algorithms Library
Source: CGAL web page http://www.cgal.org and more…
Source: CGAL web page
* as of 2004
Source: CGAL web page
Source: CGAL web page
2D Convex Hull
Source: CGAL web page
2D Polygon Partitioning
Partitions
polygons
into convex
pieces.
i
Source: CGAL web page
Delaunay Triangulations
Source: CGAL web page
2D Boolean Operations
polyhedron in dimension d is a point set P ⊆ ℜ generated from a
d
“A
A Nef
Nef-polyhedron
finite number of open halfspaces by set complement and set intersection
operations.” [Nef78]
Source: CGAL web page
2D Arrangements
Source: CGAL web page
Spatial Searching
Source: CGAL web page
Geometric Optimization
Finds either
maximum
area or
maximum
perimeter
convex k-
gon whose
vertices are
vertices of
convex hull
of point set.
Source: CGAL web page
Geometric Optimization (continued)
Source: CGAL web page
Geometric Optimization (continued)
Source: CGAL web page
Robustness
Source: CGAL web page
CGAL Basics
• C++
• Can work with LEDA
• 3 Main Parts:
– Kernel
K l
• Geometric primitive objects & operations (such as
predicates) on them
– Unmodifiable
– Dual object representation
» Stand-alone classes parameterized by representation
class
» Members
M b off kkernell class
l
• Basic data structures & algorithms
– Parameterized by traits classes
e e interface
» Define te ace witht pprimitives
t es
• Non-geometric support facilities
Sources: CGAL Documentation and Handbook of Discrete and Computational Geometry
Sources: CGAL Documentation and Handbook of Discrete and Computational Geometry
Source: CGAL web page
Source: CGAL web page
Source: CGAL web page
Separate “algorithms
and data structures
from underlying
geometric kernel with
geometric traits class.”
e.g. Cartesian
representation
e.g. exact
Describe notion of an abstract data type “generically” and instantiate classes that
are type-specific versions of the generic class. Use C++ templates, as in STL.
Sources: CGAL web page and Deitel’s C++: How to Program, 4th edition and Handbook of Discrete and Computational Geometry
Source: CGAL web page
Source: CGAL web page
Simple Nongraphical CGAL Example
Simple Nongraphical CGAL Example
(continued)
Simple Nongraphical CGAL Example
(continued)
Simple Nongraphical CGAL Example
Simple CGAL Example with
OpenGL GUI
• See demo and C++ code
code…