The Computational Geometry Algorithm Library Andreas Fabri INRIA Sophia-Antipolis CGAL.

Slides:



Advertisements
Similar presentations
Alpha Shapes. Used for Shape Modelling Creates shapes out of point sets Gives a hierarchy of shapes. Has been used for detecting pockets in proteins.
Advertisements

COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Problems in curves and surfaces M. Ramanathan Problems in curves and surfaces.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Proximity graphs: reconstruction of curves and surfaces
Computational Geometry II Brian Chen Rice University Computer Science.
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Convex Hulls in 3-space Jason C. Yang.
DEpthLAUNAY1 DEpthLAUNAY Manuel Abellanas Alfredo de las Vegas Facultad de Informática - UPM.
Computational Geometry Algorithms Library
Xianfeng Gu, Yaling Wang, Tony Chan, Paul Thompson, Shing-Tung Yau
Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
2. Voronoi Diagram 2.1 Definiton Given a finite set S of points in the plane , each point X of  defines a subset S X of S consisting of the points of.
3. Delaunay triangulation
Computational Geometry and Spatial Data Mining
1cs542g-term Notes. 2 Meshing goals  Robust: doesn’t fail on reasonable geometry  Efficient: as few triangles as possible Easy to refine later.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 l-Monotone Convex polygons are easy to triangulate. Unfortunately the partition.
The Design and Implementation of Planar Arrangements of Curves in CGAL Iddo Hanniel The research has been carried out at Tel Aviv University under the.
Exploring Computational Mathematics: Unfolding Polyhedra Brittany Terese Fasy, Duke University David Millman, UNC-Chapel Hill MathFest 2008.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 4 Chapter 6: Arrangements Monday,
CSE351/ IT351 Modeling And Simulation Choosing a Mesh Model Dr. Jim Holten.
TU/e computational geometry introduction Mark de Berg.
1 An Exact, Complete and Efficient Computation of Arrangements of Bézier Curves Iddo Hanniel – Technion, Haifa Ron Wein – Tel-Aviv University.
Area 1: Algorithms Dan Halperin, School of Computer Science, Tel Aviv University.
Computational Geometry Algorithms Library Source: CGAL web page
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Geometric Modeling.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
Voronoi Diagrams.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 3 Chapter 4: 3D Convex Hulls Chapter.
1 Street Generation for City Modeling Xavier Décoret, François Sillion iMAGIS GRAVIR/IMAG - INRIA.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
UNC Chapel Hill M. C. Lin Point Location Chapter 6 of the Textbook –Review –Algorithm Analysis –Dealing with Degeneracies.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
The Open Source Project Andreas Fabri GeometryFactory Lutz Kettner Max Planck Institute.
Algorithms for Triangulations of a 3D Point Set Géza Kós Computer and Automation Research Institute Hungarian Academy of Sciences Budapest, Kende u
Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga Office: South.
Accelerating Ray Tracing using Constrained Tetrahedralizations Ares Lagae & Philip Dutré 19 th Eurographics Symposium on Rendering EGSR 2008Wednesday,
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
3D Triangulations in Pierre Alliez.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
Computational Geometry Algorithms Library
TEL-AVIV UNIVERSITY RAYMOND AND BEVERLY SACKLER FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric.
Pierre Alliez The Computational Geometry Algorithm Library.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Mesh Coarsening zhenyu shu Mesh Coarsening Large meshes are commonly used in numerous application area Modern range scanning devices are used.
Computational Geometry Algorithms Library Andreas Fabri GeometryFactory Pierre Alliez INRIA Efi Fogel Tel Aviv University.
Geometric Modeling How to design a graphical model? How to create a digital description of a real-world object? Design Digitize.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Shewchuck 2D Triangular Meshing.
Chapter Area, Pythagorean Theorem, and Volume 14 Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
3D Polyhedral Surfaces in Pierre Alliez.
Arrangements Efi Fogel Tel Aviv University. Outline Arrangements Algorithms based on Arrangements Boolean Set Operations Minkowski Sums and Polygon Offset.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
Copyright © 2009 – Curt Hill Standard Template Library An Introduction.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
1/57 CS148: Introduction to Computer Graphics and Imaging Geometric Modeling CS148 Lecture 6.
1 Point Location Strategies Idit Haran
Recent Progress in Mesh Parameterization Speaker : ZhangLei.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Bigyan Ankur Mukherjee University of Utah. Given a set of Points P sampled from a surface Σ,  Find a Surface Σ * that “approximates” Σ  Σ * is generally.
Computer graphics 3D solid modeling.
Query Processing in Databases Dr. M. Gavrilova
Presentation transcript:

The Computational Geometry Algorithm Library Andreas Fabri INRIA Sophia-Antipolis CGAL

Andreas Fabri, Meshing Roundtable European Project CGAL “Make the large body of geometric algorithms developed in the field of computational geometry available for industrial applications” Started in 1996 as joined project of: ETH Zurich, INRIA, MPI für Informatik, Tel-Aviv U, Utrecht U, Trier U, FU Berlin

CGALAndreas Fabri, Meshing Roundtable The CGAL Class Library 1200 C++ classes, 300 KLOC, 1100 p manual 40 developer years Supported Platforms –Irix 6.5 / SGI Mips CC 7.3, g++ –Solaris 2.6 / KCC, g++ –Wintel/ VC++6.0, Borland C++5.0, g downloads of each release CGAL is enabling technology

CGALAndreas Fabri, Meshing Roundtable Basic Library Structure of CGAL Support Library: Configuration, Assertions Visualization File I/O Number Types Generators STL extensions Point, Segment,... Predicates Kernel TriangulationsArrangements Halfedge Datastructure Convex HullOptimisation...

The Basic Library A collection of pearls

CGALAndreas Fabri, Meshing Roundtable Triangulations Basic, Delaunay, regular, constrained 2D Fully dynamic data structures Operations –point location, –traversal along a line –traversal of the triangulation

CGALAndreas Fabri, Meshing Roundtable Triangulations Hierarchy Alpha shapes Voronoi diagram, power diagram k-order Voronoi diagram 2D* Natural neighbors* Conforming Delaunay 3D**

CGALAndreas Fabri, Meshing Roundtable Polyhedral Surface Orientable 2-manifolds with boundary Based on half edge data structure Operations –Euler operations –rich low level API HEDS is highly configurable

CGALAndreas Fabri, Meshing Roundtable Convex Hull 2D Convex Hull –5 algorithms for points –CH of a simple polyline Convexity Test Extremal Points 3D Convex Hull –static, incremental, dynamic

CGALAndreas Fabri, Meshing Roundtable Boolean Operations on Polygons

CGALAndreas Fabri, Meshing Roundtable 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,..

CGALAndreas Fabri, Meshing Roundtable Optimization Smallest enclosing sphere in dD Polytope distance in dD Smallest enclosing circle/ellipse in 2D Rectangular p center Smallest enclosing annulus in dD

CGALAndreas Fabri, Meshing Roundtable and... Polygon decomposition Boolean operations on polyhedra ** Range trees, segment trees, kd-trees Visibility complex 2* Plane sweep framework* Largest empty rectangle* Smallest enclosing sphere of spheres*

The Kernel Robustness by Exactness Exact but Efficient

CGALAndreas Fabri, Meshing Roundtable Kernel Point, vector, direction, segment, ray, line, triangle, circle, sphere, tetrahedron Predicates –orientation, do_intersect, closer_than Constructions –intersection, distance, affine transformation

CGALAndreas Fabri, Meshing Roundtable Robustness of Predicates Correctness through –exact arithmetic, or –exact geometric predicates and constructions Challenge: Being exact and efficient Collinear iff det(M) == 0 Collinear iff det(M) in [ - ,  ] Collinear iff det(M) == 0

CGALAndreas Fabri, Meshing Roundtable Exact Arithmetic exact number types –integers: GMP_Z, leda_integer –rationals: Quotient, MP_Float –reals: Core, leda_real Leads to unacceptable slowdown

CGALAndreas Fabri, Meshing Roundtable Fast Exact Predicates Filtered arithmetic predicate Filtered geometric predicate Principle –interval arithmetic –fast inexact but certified computation –if filter fails: slow exact computation

CGALAndreas Fabri, Meshing Roundtable Fast Exact Constructions Store history of computation in a DAG of geometric constructions* S2 S1 S4 S3 S1 P2 P1 P2 P1 Q S2S3S4 intersect construct S S

Library Design Let’s play Lego

CGALAndreas Fabri, Meshing Roundtable Design Goals Offer trade-off between –robustness and efficiency –flexibility and ease of use Technical decision –C++ class library –Generic programming paradigm [Musser89]

CGALAndreas Fabri, Meshing Roundtable int min(int a, int b) float min(float a, float b) template 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

CGALAndreas Fabri, Meshing Roundtable Parameterization in the Kernel Point CartesianHomogeneous double Quotient MP_Float int gmpz typedef Cartesian C; typedef Filtered_kernel K; typedef K::Point_3 Point;

CGALAndreas Fabri, Meshing Roundtable How to use ucb_Delaunay(ucb_list ) cmu::AlphaHull(cmu::PointList) in your application class point A Third Party Code Problem

CGALAndreas Fabri, Meshing Roundtable template class Delaunay_triangulation_2 { void insert(Geometry::Point t) { if(Geometry::orientation(p,q,t)==..) if(Geometry::incircle(p,q,r,t)) } }; Geometry as Parameter Works with CGAL kernels Works with projections kernels Write thin glue layer for your kernel

CGALAndreas Fabri, Meshing Roundtable Combinatorics as Parameter template class Delaunay_triangulation_2{ void insert(Point p) {.. Facet v = Combinatorics::create_facet();.. } }; Combinatorics allocates vertices, facets –Default data structure is facet based –It could be half edge based

CGALAndreas Fabri, Meshing Roundtable Iterators and Circulators A concept: generalisation of pointers Decouple algorithms and datastructures template class Delaunay_triangulation_2 { template void insert(Iterator begin, Iterator end) { Point p = *begin; ++begin;..} Vertex_iterator vertices_begin(){..} };

CGALAndreas Fabri, Meshing Roundtable Hello Triangle #include typedef Cartesian Geometry; typedef Triangulation_2 Triangulation ; typedef Triangulation::Vertex_circulator Vertex_circulator; typedef Geometry::Point_2 Point; int main() { Triangulation t; Point p; while (cin >> p) { t.insert(p); } Vertex_circulator vc = t.incident_vertices(t.infinite_vertex()), done(vc); do{ cout point(); } while(++vc != done); } 

CGALAndreas Fabri, Meshing Roundtable Robust and Fast Hello Triangle #include typedef Cartesian K; typedef Filtered_kernel Geometry; typedef Triangulation_2 T; typedef Triangulation_hierarchy_2 Triangulation; typedef Triangulation::Vertex_circulator Vertex_circulator; typedef Geometry::Point_2 Point; int main() { Triangulation t; Point p; while (cin >> p) { t.insert(p); } Vertex_circulator vc = t.incident_vertices(t.infinite_vertex()), done(vc); do{ cout point(); } while(++vc != done); }

CGALAndreas Fabri, Meshing Roundtable Points in a Coordinate Array #include typedef CGAL::Cartesian Geometry; typedef CGAL::Triangulation_cell_base_3 Cell; typedef CGAL::Triangulation_vertex_base_pointer_3 Vertex; typedef CGAL::Triangulation_data_structure_3 Combinatorics; typedef CGAL::Delaunay_triangulation_3 Triangulation; typedef Geometry::Point_3 Point; double xyz[4][4] = { {0,0,0, 6}, {3,0,0, 5}, {0,4,0, 9.3}, {2,2,2, 0.1}}; int main( ) { Triangulation t; for(int i=0; i < 4; i++) { t.insert((Point&) (*xyz[i])); } return 0; }

CGALAndreas Fabri, Meshing Roundtable The C++ is Slow Myth std::sort is faster than clib sort Delaunay 3D –51,095 points, 340,275 cells in sec. –2 mio points, in 156 sec, P3 1Ghz HPC projects Blitz++

CGALAndreas Fabri, Meshing Roundtable GeometryFactory Library has reached a critical mass Acceptance of exact computing paradigm Maturity of compilers Acceptance of generic programming (STL) The right moment to found a company