The Half-Edge Data Structure Computational Geometry, WS 2007/08 Lecture 3, Part III Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,

Slides:



Advertisements
Similar presentations
Order-k Voronoi Diagram in the Plane
Advertisements

Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
Introduction to Computational Geometry Computational Geometry, WS 2007/08 Lecture 1 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
Convex Hulls Computational Geometry, WS 2007/08 Lecture 2 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Overlay of Two Subdivisions
Mesh Representation, part II based on: Data Structures for Graphics, chapter 12 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Klee’s Measure Problem Computational Geometry, WS 2007/08 Group Work Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part IV Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
The Half-Edge Data Structure
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
The Lower Envelope: The Pointwise Minimum of a Set of Functions Computational Geometry, WS 2006/07 Lecture 4 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
Voronoi Diagrams Computational Geometry, WS 2006/07 Lecture 10 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Introduction to Computational Geometry Computational Geometry, WS 2007/08 Lecture 1 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
Persistent Data Structures Computational Geometry, WS 2007/08 Lecture 12 Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
Polygonal Mesh – Data Structure and Smoothing
Linear Programming Computational Geometry, WS 2007/08 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Hidden-Line Elimination Computational Geometry, WS 2006/07 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Closest Pair of Points Computational Geometry, WS 2006/07 Lecture 9, Part II Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 - Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
CS CS 175 – Week 4 Triangle Mesh Smoothing Discrete Differential Geometry.
Brute-Force Triangulation
Ziting (Vivien) Zhou1 Drawing Graphs By Computer Graph from
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Mesh Data Structure. Meshes Boundary edge: adjacent to 1 face Regular edge: adjacent to 2 faces Singular edge: adjacent to >2 faces Mesh: straight-line.
Planar Subdivision Induced by planar embedding of a graph. Connected if the underlying graph is. edge vertex disconnected subdivision Complexity = #vertices.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Solid Modeling Ref. Mantyla. Introduction Aim of modeling: The search of a media of communication.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness)
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
Solid Modeling Prof. Lizhuang Ma Shanghai Jiao Tong University.
CS552: Computer Graphics Lecture 28: Solid Modeling.
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
An Introduction to Computational Geometry
Boundary Representations and Topology
Computational Geometry 2
Overlay of Two Subdivisions
Presentation transcript:

The Half-Edge Data Structure Computational Geometry, WS 2007/08 Lecture 3, Part III Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann2 Overview Planar subdivision representation Adjacency relationships and queries Boundary representation structure Baumgart’s winged-edge data structure Doubly-connected-edge-list (DCEL) Overlaying planar subdivisions Analyses

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann3 Representing a Polygon Mesh We require a convenient and efficient way to represent a planar subdivision. Components in the planar subdivision: –A list of vertices –A list of edges –A list of faces storing pointers for its vertices Must preserve adjacency relationships between components.

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann4 Possible Adjacency Queries Point anywhere on the polygon mesh and ask: Which faces use this vertex? Which edges use this vertex? Which faces border this edge? Which edges border this face? Which faces are adjacent to this face? Our deliberations: Constrained to manifold surfaces only.

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann5 Planar Subdivision Euler’s Formula: v – e + f = 2

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann6 Boundary Representation Structures To represent such queries efficiently, we use the boundary representation (B-rep) structure. B-rep explicitly models the edges, vertices, and faces of the planar subdivision PLUS additional adjacency information stored inside. Two most common examples of B-rep: –Baumgart’s winged-edge data structure –Doubly-connect-edge-list (DCEL)

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann7 Baumgart’s Winged-Edge DS The Edge DS is augmented with pointers to: –the two vertices it touches (v 1, v 2 ), –the two faces it borders (f 1, f 2 ), and –pointers to four of the edges which emanate from each end point (e_v 1 [4], e_v 2 [4]). We can determine which faces or vertices border a given edge in constant time. Other types of queries can require more expensive processing. e v1v1 v2v2 f2f2 f1f1 e_v 1 [4] e_v 2 [4]

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann8 The Doubly-Connected-Edge-List (DCEL) DCEL is a directed half-edge B-rep data structure. Allows all adjacency queries in constant time (per piece of information gathered). That is, for example; –When querying all edges adjacent to a vertex, the operation will be linear in the number of edges adjacent to the vertex, but constant time per edge. The DCEL is excellent in representing manifold surfaces: –Every edge is bordered by exactly two faces. –Cross junctions and internal polygons are not allowed.

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann9 DCEL Component – Half-edge The half-edges in the DCEL that border a face, form a circular linked-list around its perimeter (anti-clockwise); i.e. each half-edge in the loop stores a pointer to the face it borders (incident). Each half-edge is directed and can be described in a Java class as follows: H_Edge f eNext ePrev vOrigeTwin class H_Edge { Vertex vOrig; H_Edge eTwin; Face f; H_Edge eNext; H_Edge ePrev; }

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann10 DCEL Component - Vertex A vertex in the DCEL stores: –its actual location of the point on the plane, and –a pointer to exactly ONE of the H_Edge, which uses this vertex as its origin. There may be several H_Edge which origins start at the same vertex. We need only one, and it does not matter which one. Vertex hEdge p=(x,y) class Vertex { Point2D p; H_Edge hEdge; }

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann11 A face component stores –a reference to any one of the half-edges it borders (the face’s outer- most boundary), and –a set of references to half-edges of unique holes inside the face. For the unbounded face, the eOuterComp reference is NULL. DCEL Component – Face class Face { H_Edge eOuterComp; List eInnerComps; } Face eOuterComp eInnerComps[0]

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann12 DCEL Example: Planar Subdivision Vertex v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 p (1,1) (10,0) (9,5) (2,7) (5,8) (8,9) (5,11) (7,13) (1,13) (11,12) (6,15) hEdge e1_3 e2_3 e3_4 e4_9 e5_9 e6_7 e7_8 e8_6 e9_ v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8v9v9 v10 v11 f1f1 f3f3 f2f2 f4f4

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann13 DCEL Example: Planar Subdivision Half-Edge e1_3 e3_1 e2_3 e3_2 e10_3 e11_10 e9_11 e4_9 e3_4 e4_3 e9_4 e5_9 e3_5 e5_3 e9_5 e11_9 vOrig v1 eTwin e3_1 f f1 eNext e3_4 ePrev e3_ v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8v9v9 v10 v11 f1f1 f3f3 f2f2 f4f4

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann14 DCEL Example: Planar Subdivision Half-Edge e10_11 e3_10 e6_7 e8_6 e7_8 e8_7 e7_6 e6_8 vOrig v10 eTwin e11_10 f f3 eNext e11_9 ePrev e3_10 Face f1 f2 f3 f4 eOuterComp NULL eInnerComps e1_ v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8v9v9 v10 v11 f1f1 f3f3 f2f2 f4f4

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann15 Adjacency Queries Given a half-edge e, we can perform queries in constant time. Example: Vertex v1 = e. vOrig; Vertex v2 = e. eTwin. vOrig; Face f1 = e. f; Face f2 = e. eTwin. f; e f1 v2 v1 f2

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann16 Iterated Adjacency Queries Iterating over the half-edges adjacent to a given face f. H_Edge hEdge = f. eOuterComp; do { // Do something with edge. hEdge = hEdge. eNext; } while (

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann17 Iterated Adjacency Queries Iterating over the half-edges on a given vertex v. H_Edge hEdge = v. hEdge; do { // Do something with edge. hEdge = hEdge. eTwin. eNext; } while (

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann18 Splitting an Edge Given a half-edge e and a point p on e, we can split e into two sub- edges e1 and e2 in constant time. e p p e.eTwin e.vOrig e1 e2 e2.eTwin e1.eTwin

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann19 Splitting and Re-directing Edges Given a half-edge e and a vertex v of degree deg(v) on e, we can split and redirect the sub-edges of the DCEL at v in time O(1 + deg(v)). e e1 e2 e.vOrig v v Insertion of new edges into the flow: » Iterate edges at v. » Exercise (in next tutorial).

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann20 Face Records Determining the boundary-type: Is a complete edge-loop (boundary-cycle) an outer-boundary, or the boundary of a hole in the face? –Select the face f that we are interested in. –Identify the lowest of the left-most vertex v of any edge-loop. –Consider the two half-edges passing through v, and compute their angle . –If  is smaller than 180°, then the edge-loop is an outer-boundary. f

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann21 Overlaying Two Planar Subdivisions Plane sweep! Event-points (maintained in balanced binary search tree): –Vertices of S1 and S2 –All intersections between edges in S1 and S2 Status-structure (per event): –Neighbouring edges sorted in increasing x-order.

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann22 Handling Intersections Additional handling of ‘intersection’ event points: –Split and re-direct edges. –Check new nearest-neighbours for intersections. Recall (from Lecture 3b): U(P) C(P) P L

Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann23 Analysis For a total of n vertices in both S1 and S2: Sorting of n vertices: In time Runtime per ‘intersection’-vertex: In time Operation per ‘intersection’-vertex: In time Total ‘intersection’-vertices: k Total runtime: