a (very) short intro to computational geometry
TRANSCRIPT
![Page 1: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/1.jpg)
IFT 6113A (VERY) SHORT INTRO TO
COMPUTATIONAL GEOMETRYtiny.cc/6113
Mikhail Bessmeltsev
Pic from https://www.cs.cmu.edu/~quake/triangle.defs.html
![Page 2: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/2.jpg)
Today
• Intro• Orientation and convex hulls• Line segment intersection• Polygons and triangulations• Voronoi diagrams• Delaunay triangulations
Credit: most of images and ideas from Dave Mount’s lecture noteshttp://www.cs.umd.edu/~mount/754/Lects/754lects.pdf
And David Kirkpatrick’s lectures
![Page 3: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/3.jpg)
Focus: 2D algorithms
• Typical problem: shortest paths
![Page 4: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/4.jpg)
Focus: 2D algorithms
• Typical problem: shortest paths
→ graph → Dijkstra algorithm?
![Page 5: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/5.jpg)
Focus: 2D algorithms
• Typical problem: shortest paths
→ graph → Dijkstra algorithm?
Use geometric ideas!→more efficient algorithms
![Page 6: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/6.jpg)
Complexity Analysis
• Big O notation• Mostly worst case (sometimes average)• Less attention to constants…
![Page 7: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/7.jpg)
Main objects
Convex hulls
Image from CGAL manual
![Page 8: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/8.jpg)
Main objects
Triangulations
![Page 9: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/9.jpg)
Main objects
Line arrangements
Image from CGAL manual
![Page 10: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/10.jpg)
Main objects
Delaunay triangulations and Voronoi diagrams
![Page 11: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/11.jpg)
Main objects
Queries:• Nearest neighbors?• Range searches?
![Page 12: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/12.jpg)
CONVEX HULLS
![Page 13: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/13.jpg)
Why do we need convex hulls?
• Collision detecton
• Reconstructing convex objects from point clouds
• Farthest distance computation
![Page 14: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/14.jpg)
Convex hulls
• A set 𝑆 is convex, if – for any two points 𝑝, 𝑞 ∈ 𝑆, the line segment 𝑝𝑞 ∈ 𝑆
![Page 15: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/15.jpg)
Convex hulls
• A set 𝑆 is convex, if – for any two points 𝑝, 𝑞 ∈ 𝑆, the line segment 𝑝𝑞 ∈ 𝑆
![Page 16: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/16.jpg)
Convex hulls
• A set 𝑆 is convex, if – for any two points 𝑝, 𝑞 ∈ 𝑆, the line segment 𝑝𝑞 ∈ 𝑆
• Convex hull of a set of points S = the smallest convex set that contains S
![Page 17: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/17.jpg)
CH: Representation
• A sequence of points!
![Page 18: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/18.jpg)
Simplest algorithm
• Ideas?
![Page 19: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/19.jpg)
Simplest algorithm
• Ideas?
• Try every possible 𝑝𝑞 ∈ 𝑆, test if all the other points lie on one side
• Complexity?
![Page 20: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/20.jpg)
Better: Gift Wrapping
• Start with some extreme point 𝑝0– (e.g. leftmost)– It belongs to CH
• Choose the next point so that 𝑝𝑖+1𝑝𝑖 has all other points on the right– Sort by angle, choose minimum– 𝑂(𝑛)
• Repeat
![Page 21: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/21.jpg)
Gift Wrapping
• Start with some extreme point 𝑝0
• Choose 𝑝𝑖, s.t.𝑝𝑖+1𝑝𝑖 has all other points on the right
• Repeat
Image from Wikipedia
![Page 22: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/22.jpg)
Gift Wrapping
Image from Wikipedia
![Page 23: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/23.jpg)
Output-sensitive complexity
𝑂 𝑛ℎ
ℎ - number of vertices on the CH
![Page 24: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/24.jpg)
Graham’s Scan
• Lower hull:• Store CH vertices in a stack: (… , 𝐻2, 𝐻1)
• Sort points by angle• Take new point 𝑝, check if the (𝑝, 𝐻1, 𝐻2)
is counterclockwise– Yes => push!– No => pop!
![Page 25: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/25.jpg)
Graham’s Scan
![Page 26: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/26.jpg)
Graham’s Scan
• Complexity?
![Page 27: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/27.jpg)
Divide-and-Conquer CH
• Sort by x• Split by the median point• Recursively find CH for left and right parts
• Merge
![Page 28: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/28.jpg)
Divide-and-Conquer CH
• Sort by x• Split by the median point• Recursively find CH for left and right parts
• Merge
![Page 29: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/29.jpg)
Divide-and-Conquer CH
• Sort by x: 𝑂(𝑛 log 𝑛)• Split by the median point• Recursively find CH for left and right parts
• Merge– Find common tangent line, 𝑂(𝑛)
![Page 30: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/30.jpg)
Today
✓Intro✓Orientation and convex hulls• Line segment intersection• Polygons and triangulations• Halfplane intersection and LP• Voronoi diagrams• Delaunay triangulations• Point location
Credit: most of images and ideas from Dave Mount’s lecture noteshttp://www.cs.umd.edu/~mount/754/Lects/754lects.pdf
And David Kirkpatrick’s lectures
![Page 31: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/31.jpg)
Line Segment Intersection
• Max # of intersections: 𝑂(𝑛2)• Need an output sensitive algorithm!• 𝐼 - # of intersections
![Page 32: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/32.jpg)
Plane Sweep
• Sweep virtual line• Stop at events
– segment started/finished– intersection
Image from geomalgorithms.com
![Page 33: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/33.jpg)
Plane Sweep
• Presort the endpoints• How to detect next intersection?
– If two segments are adjacent along the sweep line,– Check if they intersect to the right of the sweep line
![Page 34: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/34.jpg)
Today
✓Intro✓Orientation and convex hulls✓Line segment intersection• Polygons and triangulations• Voronoi diagrams• Delaunay triangulations
Credit: most of images and ideas from Dave Mount’s lecture noteshttp://www.cs.umd.edu/~mount/754/Lects/754lects.pdf
And David Kirkpatrick’s lectures
![Page 35: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/35.jpg)
Polygons and triangulations
• Why?– Decomposition of complex shapes
• How to compute area of a polygon?
– Art gallery problem• How many cameras and where?
![Page 36: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/36.jpg)
Art Gallery Problem
![Page 37: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/37.jpg)
Art Gallery Problem
![Page 38: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/38.jpg)
Art Gallery Problem
![Page 39: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/39.jpg)
Art Gallery Problem𝑛/3 cameras are
enough!
Is it optimal?
![Page 40: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/40.jpg)
Triangulations
• How to find a triangulation?
![Page 41: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/41.jpg)
Triangulations
Diagonal: line segment connecting two vertices completely within the polygon
![Page 42: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/42.jpg)
Triangulations
Diagonal: line segment connecting two vertices completely within the polygon
Every polygon has at least 1 diagonal!
![Page 43: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/43.jpg)
Triangulations
![Page 44: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/44.jpg)
Triangulations
![Page 45: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/45.jpg)
Triangulations
• Algorithm: add diagonal, repeat for the two new polygons
![Page 46: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/46.jpg)
Triangulations
• Algorithm: add diagonal, repeat for the two new polygons– Bottleneck?– Complexity?
![Page 47: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/47.jpg)
A better algorithm
• 𝑂 𝑛 log 𝑛• Input: cyclic list of vertices
– Presorted!
TODO list:1. Learn how to triangulate monotone
polygons2. Subdivide arbitrary polygon into
monotone ones3. Profit!
![Page 48: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/48.jpg)
Monotone polygonsPolygonal chain is x-monotone
every vertical line intersects chain in at most 1 point
Polygon is x-monotone can be split into two x-monotone chains
![Page 49: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/49.jpg)
Triangulating monotone polygons
• Sort vertices left to right– Doesn’t require actual sorting (why?)– Requires 𝑂(𝑛) time
• Line sweep– Triangulate everything to the left of the
sweep line– Discard the triangulated part– Testing diagonals is now constant-time
• Why?
![Page 50: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/50.jpg)
Triangulating monotone polygons
𝑂(𝑛)
![Page 51: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/51.jpg)
Triangulating monotone polygons
𝑂(𝑛)
Testing diagonals = keeping track of edge
orientations
![Page 52: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/52.jpg)
Today
✓Intro✓Orientation and convex hulls✓Line segment intersection✓Polygons and triangulations• Voronoi diagrams• Delaunay triangulations
Credit: most of images and ideas from Dave Mount’s lecture noteshttp://www.cs.umd.edu/~mount/754/Lects/754lects.pdf
And David Kirkpatrick’s lectures
![Page 53: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/53.jpg)
Triangulation Quality:Delaunay Criterion
circumcircle
Empty Circle Property: No other vertex is contained within the circumcircle of any triangle
![Page 54: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/54.jpg)
Non-Delaunay
Triangulation
Delaunay Triangulation
![Page 55: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/55.jpg)
Delaunay Triangulation
• Obeys empty-circle property
• Exists for any set of vertices
• Is unique (up to degenerate cases)
• Proven to provide best triangles in terms of quality for given vertex positions
• To test – enough to check pairs of triangles sharing common edge
![Page 56: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/56.jpg)
Edge flipping
Start with any triangulation 1. Find a non-Delaunay edge2. Flip edge3. Repeat
Converges to DelaunaySlow: 𝑂(𝑛2)
![Page 57: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/57.jpg)
Vertex Insertion
Start with Delaunay mesh covering domain• Typically 2 triangle bounding box
Insert one vertex at a time • Add vertex to mesh • Flip edges locally to maintain Delaunay property
Boundary recovery
Expected time 𝑂(𝑛 log 𝑛)
![Page 58: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/58.jpg)
X
Vertex Insertion
• Locate triangle containing X
• Subdivide triangle
• Recursively check adjoining triangles to ensure empty-circle property
![Page 59: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/59.jpg)
X
Vertex Insertion
• Locate triangle containing X
• Subdivide triangle
• Recursively check adjoining triangles to ensure empty-circle property
• Swap diagonal if needed
• Typically very small number of swaps
![Page 60: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/60.jpg)
),( yx
Starting triangle
Terminal triangle
Find Triangle - Efficiency
• Use Barycentric Coordinates• Test inside triangle• If outside - outside which edge?
![Page 61: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/61.jpg)
Vertex Insertion
• Start with Delaunay mesh covering domain– Typically 2 triangle bounding box
• Insert one vertex at a time – Add vertex to mesh (locate triangle to split)– Flip edges (locally) to preserve Delaunay
property
• Boundary recovery
![Page 62: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/62.jpg)
❑ Create bounding triangles
Example: Boundary Insertion
![Page 63: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/63.jpg)
Boundary Insertion
❑ Insert vertices using Delaunay method
![Page 64: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/64.jpg)
Boundary Insertion
❑Insert vertices using Delaunay method
![Page 65: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/65.jpg)
Boundary Insertion
❑Insert vertices using Delaunay method
![Page 66: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/66.jpg)
Boundary Insertion
❑Insert vertices using Delaunay method
![Page 67: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/67.jpg)
Boundary Insertion
❑Insert vertices using Delaunay method
![Page 68: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/68.jpg)
Vertex Insertion
• Start with Delaunay mesh covering domain– Typically 2 triangle bounding box
• Insert one vertex at a time – Add vertex to mesh (locate triangle to split)– Flip edges (locally) to preserve Delaunay
property
• Boundary recovery
![Page 69: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/69.jpg)
Boundary Recovery
• Delete outside triangles (if can)– Delaunay triangulation does not have to
obey polygon boundary
![Page 70: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/70.jpg)
Boundary Recovery
• Delaunay triangulation does not always obey polygon boundary
![Page 71: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/71.jpg)
Boundary Recovery
• Boundary Conforming Solution – Add vertices at intersections– Repeat if necessary
![Page 72: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/72.jpg)
Boundary Recovery -Constrained
• Not always can add boundary vertices (shared edges)
![Page 73: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/73.jpg)
Boundary Recovery -Constrained
• Swap edges between adjacent pairs of triangles• Repeat till recover the boundary
![Page 74: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/74.jpg)
Boundary Recovery -Constrained
• Swap edges between adjacent pairs of triangles• Repeat till recover the boundary
![Page 75: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/75.jpg)
Boundary Recovery -Constrained
• Swap edges between adjacent pairs of triangles• Repeat till recover the boundary
![Page 76: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/76.jpg)
Boundary Recovery -Constrained
Not actually Delaunay
![Page 77: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/77.jpg)
Voronoi DiagramDual to Delaunay Triangulation • Vertices -> faces• Voronoi edges =• perpendicular bisectors of Delaunay edges
![Page 78: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/78.jpg)
Sampling Using Centroidal Voronoi Diagrams
• Voronoi Diagram for given set of vertices: union of all locations at equal distance from two or more vertices
• Consists of – straight lines
• vertex bisectors– vertices
• bisector intersections
![Page 79: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/79.jpg)
Voronoi Diagram
• Diagram partitions space into regions “closer” to one vertex than other
• Can define using weighted distance function
![Page 80: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/80.jpg)
Voronoi Diagrams
Georgy VoronoiГеоргий Феодосьевич Вороной
1868-1908
Slides from Prof. Joseph S.B. Mitchell’s AMS 345 course materials
![Page 81: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/81.jpg)
Historical Origins and Diagrams in Nature
René Descartes1596-1650 1644: GravitationalInfluence of stars
Dragonfly wing
HoneycombConstrained soap bubbles
Giraffe pigmentation
Slides from Prof. Joseph S.B. Mitchell’s AMS 345 course materials
![Page 82: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/82.jpg)
Voronoi Applications
• Voronoi + point location search: nearest neighbor queries
• Facility location: Largest empty disk (centered at a Voronoi vertex)
• Shape description/approximation: medial axis
Slides from Prof. Joseph S.B. Mitchell’s AMS 345 course materials
![Page 83: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/83.jpg)
Post Office ProblemPost officesQuery point
Starbucks
Slides from Prof. Joseph S.B. Mitchell’s AMS 345 course materials
![Page 84: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/84.jpg)
Voronoi Diagram
Partition the plane into cells:
Voronoi cell of pi is open, convex
“cell complex” Slides from Prof. Joseph S.B. Mitchell’s AMS 345 course materials
![Page 85: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/85.jpg)
Example
Voronoi cell of p
pp
Slides from Prof. Joseph S.B. Mitchell’s AMS 345 course materials
![Page 86: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/86.jpg)
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 87: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/87.jpg)
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 88: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/88.jpg)
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 89: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/89.jpg)
Constructing Voronoi Diagrams
Given a half plane intersection algorithm…
Repeat for each site
Running Time: O( n2 log n )
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 90: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/90.jpg)
Constructing Voronoi Diagrams
• Half plane intersection O( n2 log n )
• Fortune’s Algorithm– Sweep line algorithm
• Voronoi diagram constructed as horizontal line sweeps the set of sites from top to bottom
• Incremental construction →maintains portion of diagram which doesn’t change as we sweep down
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 91: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/91.jpg)
Constructing Voronoi Diagrams
Idea: line sweep?
![Page 92: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/92.jpg)
Constructing Voronoi Diagrams
What is the invariant we are looking for?
Maintain a representation of the locus of points q that are closer to some site pi above the sweep line than to the line itself (and
thus to any site below the line).
ev
pi
Sweep Line
q
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 93: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/93.jpg)
Constructing Voronoi DiagramsWhich points are closer to a site above the
sweep line than to the sweep line itself?
Sweep Line
pi
q
Beach line: lower envelope of all parabolas
Equidistance
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 94: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/94.jpg)
Constructing Voronoi DiagramsBreak points trace out Voronoi edges.
Equidistance
Sweep Line
pi
q
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 95: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/95.jpg)
Constructing Voronoi DiagramsArcs flatten out as sweep line moves down.
Sweep Line
pi
q
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 96: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/96.jpg)
Eventually, the middle arc disappears.Constructing Voronoi Diagrams
Sweep Line
pi
q
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 97: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/97.jpg)
We have detected a circle that is empty (contains no sites) and touches 3 or more sites.
Constructing Voronoi Diagrams
Sweep Line
pi
q
Voronoi vertex!
![Page 98: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/98.jpg)
Beach Line properties
• Voronoi edges are traced by the break points
• Voronoi vertices are identified when two break points fuse– Decimation of an old arc identifies new
vertex
Slides from MIT CSAIL 6.838 Computational Geometry, 2001, taught by Allen Miu
![Page 99: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/99.jpg)
Fortune’s Algorithm
• Trace out the cells by line sweep• Maintain and track the beach line• No need to store parabolas, just store
the participating vertex
• 𝑂(𝑛 log 𝑛) time
![Page 100: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/100.jpg)
Fortune’s Algorithm
![Page 101: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/101.jpg)
Voronoi Diagram and Medial Axis
![Page 102: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/102.jpg)
Voronoi Diagram and Medial Axis
![Page 103: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/103.jpg)
Medial axis vs Voronoi diagram
“On the Evaluation of the Voronoi-Based Medial Axis”by Adriana Schulz, Francisco Ganacim and Leandro Cruz
![Page 104: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/104.jpg)
Medial axis vs Voronoi diagram
“On the Evaluation of the Voronoi-Based Medial Axis”by Adriana Schulz, Francisco Ganacim and Leandro Cruz
![Page 105: A (VERY) SHORT INTRO TO COMPUTATIONAL GEOMETRY](https://reader033.vdocument.in/reader033/viewer/2022041617/6253285391072300fd41aaf6/html5/thumbnails/105.jpg)
Looks familiar?