2D Convex Hull in http://www.cgal.org Pierre Alliez http://www.cgal.org.

Slides:



Advertisements
Similar presentations
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
Advertisements

2/9/06CS 3343 Analysis of Algorithms1 Convex Hull  Given a set of pins on a pinboard  And a rubber band around them  How does the rubber band look when.
Lecture 3: Parallel Algorithm Design
Jarvis March Graham Scan Chan’s Algorithm
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
algorithms and data structures
Computing Convex Hulls CLRS 33.3
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
Largest and Smallest Convex Hulls for Imprecise Points Maarten Löffler Marc van Kreveld Center for Geometry, Imaging and Virtual Environments Utrecht University.
Geometric Algorithms João Comba. Example: Convex Hull convex Non-convex.
The Divide-and-Conquer Strategy
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 6 Ack : Carola Wenk nad Dr. Thomas Ottmann tutorials.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
A Recursive Algorithm for Calculating the Relative Convex Hull Gisela Klette AUT University Computing & Mathematical Sciences Auckland, New Zealand.
Andrew's Monotone Chain Convex Hull Algorithm. Andrew's Monotone Chain Scan A left-to-right variant of Graham's scan Discovered by Andrew in 1979 Using.
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
Informal Definition : Let S is set of nails sticking out from a board. the convex hull can be visualized as the shape formed by a tight rubber band that.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
Computational Geometry Algorithms Library
ADA: 16. CG Topics1 Objective o an examination of four important CG topics o just a taster of a very large research area Algorithm Design and Analysis.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Computational Geometry The art of finding algorithms for solving geometrical problems Literature: –M. De Berg et al: Computational Geometry, Springer,
Computational Geometry The art of finding algorithms for solving geometrical problems Literature: –M. De Berg et al: Computational Geometry, Springer,
1.4 Exercises (cont.) Definiton: A set S of points is said to be affinely (convex) independent if no point of S is an affine combination of the others.
Algorithm 1. (Convex Hull) - Pseudo code - Input. A set of points in the plane. Output. A list containing the vertices of Conv ( P). 1. Sort the points.
Computational Geometry Algorithms Library Source: CGAL web page
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
1 Iterators & Algorithms Iterators provide a link between containers and algorithms Example: We wish to write a function sum() that adds up the members.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
3D Triangulations in Pierre Alliez.
Computational Geometry Algorithms Library
1 Iterators Good reference site:
CMPS 3120: Computational Geometry Spring 2013
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
Kansas State University Department of Computing and Information Sciences Friday, July 13, 2001 Mantena V. Raju Department of Computing and Information.
3D Polyhedral Surfaces in Pierre Alliez.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Computational Geometry 2D Convex Hulls
A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave.
CLASSIFYING POLYGONS UNIT 1 LESSON 6. Classifying Polygons In geometry, a figure that lies in a plane is called a plane figure. A polygon is a closed.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
Simplex “walk on the vertices of the feasible region” v = current vertex if  neighbor v’ of v with better objective then move to v’
Applied Discrete Mathematics Week 2: Functions and Sequences
After studying this section, you will be able to:
Lecture 3: Parallel Algorithm Design
Andrew's Monotone Chain Convex Hull Algorithm
Convex Hull R.L. Graham’s Algorithm Computer Graphics.
Convex Hull.
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Computational Geometry Capter:1-2.1
AMS 345/CSE 355 Computational Geometry
Convex Sets & Concave Sets
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
CHAPTER 33 Computational Geometry
CMPS 3130/6130: Computational Geometry Spring 2017
CMPS 3120: Computational Geometry Spring 2013
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Convex Hull - most ubiquitous structure in computational geometry
Presentation transcript:

2D Convex Hull in http://www.cgal.org Pierre Alliez http://www.cgal.org

Outline Definitions Convex hull in CGAL Exercise Interface Extreme points Subsequences of hull points Convexity Checking Exercise

Definitions A subset S  IR2 is convex if for any two points p and q in the set the line segment with endpoints p and q is contained in S. The convex hull of a set S is the smallest convex set containing S. The convex hull of a set of points P is a convex polygon with vertices in P.

Definitions A point in P is an extreme point (with respect to P) if it is a vertex of the convex hull of P. A point set is said to be strongly convex if it consists of only extreme points.

Convex Hull in CGAL 5 algorithms to compute the counterclockwise sequence of extreme points for a 2D point set. 1 6 5 2 4 3

Convex Hull in CGAL n input points with h extreme points Algorithms: [Bykat 78] O(nh) output-sensitive [Akl & Toussaint] O(nlogn) worst case [Graham-Andrew] O(nlogn) [Jarvis 73] O(nh) [Eddy] O(nh)

Interface template <class InputIterator, class OutputIterator> OutputIterator convex_hull_2(InputIterator first, InputIterator beyond, OutputIterator result, Traits ch_traits = Default_traits) generates the counterclockwise sequence of extreme points of the points in the range [first,beyond). The resulting sequence is placed starting at position result, and the past-the-end iterator for the resulting sequence is returned (it is not specified at which point the cyclic sequence of extreme points is cut into a linear sequence).

Interface template <class InputIterator, class OutputIterator> OutputIterator convex_hull_2(InputIterator first, InputIterator beyond, OutputIterator result, Traits ch_traits = Default_traits) InputIterator::value_type OutputIterator::value_type Traits contains types and functions: Traits::Point_2, Traits::Less_xy_2, Traits::Less_yx_2, Traits::Leftturn_2. Traits::Point_2

Default... #include <CGAL/Cartesian.h> #include <CGAL/convex_hull_2.h> #include <list> typedef CGAL::Cartesian<double> kernel; typedef kernel::Point_2 Point; std::list<Point> points; std::list<Point> hull; points.push_back(Point(0,0)); points.push_back(Point(0,1)); // ... CGAL::convex_hull_2(points.begin(), points.end(), std::inserter(hull,hull.begin()));

Graham-Andrew #include <CGAL/Cartesian.h> #include <CGAL/graham_andrew.h> #include <list> typedef CGAL::Cartesian<double> kernel; typedef kernel::Point_2 Point; std::list<Point> points; std::list<Point> hull; points.push_back(Point(0,0)); points.push_back(Point(0,1)); // ... CGAL::ch_graham_andrew(points.begin(), points.end(), std::inserter(hull,hull.begin()));

Extreme Points North, South, East, West and combinations. N E W S

SubSequences of Hull Points Lower Hull Upper Hull 2 1 4 1 3 2

Convexity Checking #include <CGAL/convexity_check_2.h> template <class ForwardIterator, class Traits> bool is_ccw_strongly_convex_2 ( ForwardIterator first, ForwardIterator beyond, Traits ch_traits = Default_traits) returns true iff the point elements in [first,beyond) form a counterclockwise-oriented strongly convex polygon.

Exercise