cs133
play

CS133 Computational Geometry The Doubly-Connected Edge List (DCEL) - PowerPoint PPT Presentation

CS133 Computational Geometry The Doubly-Connected Edge List (DCEL) Data Structure 1 DCEL DCEL stands for Doubly-Connected Edge List It is a data structure for representing topological information about a planar graph It also has some


  1. CS133 Computational Geometry The Doubly-Connected Edge List (DCEL) Data Structure 1

  2. DCEL DCEL stands for Doubly-Connected Edge List It is a data structure for representing topological information about a planar graph It also has some applications in representing 3D meshes 2

  3. Terminology Vertex Edge Face 3

  4. Elements of DCEL Vertex Half Edges Face 4

  5. 1- The Vertex Object Each vertex stores a single pointer to a HalfEdge that is leaving this vertex A vertex stores the coordinates of this point (not needed in other applications when only topology is required) Vertex { HalfEdge* leaving; Double x, y; } 5

  6. 2- The HalfEdge Object The HalfEdge contains pointers to The origin Vertex The Face that is incident to the left of the HalfEdge The twin HalfEdge that points to the other half of this edge (the one to its right). The next HalfEdge that originates from the destination of this HalfEdge and is incident to the same face 6

  7. 2- The Half Edge Object HalfEdge{ Vertex* origin; Face* face; HalfEdge* twin; HalfEdge* next; } 7

  8. 3- The Face Object A Face contains a single pointer to an incident HalfEdge While a Face can be encloses in many HalfEdges, only a single pointer to one of them is needed Face { HalfEdge* edge; } To keep the structure consistent, we store a special infinite face 8

  9. Example 𝑤 1 𝑔 ∞ 𝑤 4 𝑔 2 𝑤 2 𝑔 1 𝑤 3 9

  10. Traversals Origin: Given a HalfEdge ( 𝑓 ), find its destination 𝑓 → 𝑢𝑥𝑗𝑜 → 𝑝𝑠𝑗𝑕𝑗𝑜 NextLeaving: Given a vertex ( 𝑤 ) and a HalfEdge ( 𝑓 ) leaving 𝑤 , find the next leaving HalfEdge in CW order 𝑓 → 𝑢𝑥𝑗𝑜 → 𝑜𝑓𝑦𝑢 10

Recommend


More recommend