Presentation is loading. Please wait.

Presentation is loading. Please wait.

Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.

Similar presentations


Presentation on theme: "Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für."— Presentation transcript:

1 Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg

2 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann2 Line Segment Intersection Motivation: Computing the overlay of several maps The Sweep-Line-Paradigm: A visibility problem Line Segment Intersection Overlay of planar subdivisions

3 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann3 Maps

4 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann4 Motivation Thematic map overlay in Geographical Information Systems road riveroverlaid maps 1. Thematic overlays provide important information. 2. Roads and rivers can both be regarded as networks of line segments.

5 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann5 Planar Subdivisions Euler Formula: v – e + f = 2 edges e vertices v faces f

6 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann6 Overlay of Two Subdivisions

7 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann7 Doubly Connected Edge List (DCEL) Example node 1 = { ((1, 2)), 12 } face 1 = { 15, [67] } halfedge 54 = { 5, 45, 1, 43, 15 } 3 Records: vertex { Coordinates Incident Edge }; face { Outer Component Inner Component }; halfedge { Origin Twin Incident Face Next Prev };

8 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann8 Computing the Overlay of Two Subdivisions Halfedge records that are not intersected can be reused. Plane sweep!

9 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann9 Halfedges and Vertices Example: Edge e of one component cuts a node of the other.

10 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann10 Halfedges and Vertices Example: Edge e of one component cuts a node of the other. Generate two halfedge records e´, e´´ with v as origin. Set twin-pointers and double edges. Set Next and Prev at end points of e. Set Next and Prev at node v. Time O(1 + deg(v)) at node v. Time O(n log n + k log n) altogether, k complexity of O(S1, S2)

11 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann11 Faces Difference inside and outside by 180° f

12 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann12 Faces c6 c7 c3 c5 c1 c2 c4 c8 Difference same surface Applies only to linked nodes! c1 c6 c3 c2 c5 c8 c4 c7 Outside Hole s

13 Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann13 Boolean Operations For Polygons P1 P2 P1 AND P2 P1 OR P2 P1 – P2 (new surfaces in overlap) (all surfaces in overlap) (old faces) - (newly generated faces) Let n = |P1| + |P2| All 3 operations can be calculated in O(n log n + k log n), k is output size


Download ppt "Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für."

Similar presentations


Ads by Google