The Half-Edge Data Structure. Computational Geometry, WS 2006/07 Lecture 9, Part I Prof. Dr. Thomas Ottmann Khaireel A. Mohamed. Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg. Overview.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
The Half-Edge Data Structure
Computational Geometry, WS 2006/07
Lecture 9, Part I
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 2006/07
Prof. Dr. Thomas Ottmann
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
Point anywhere on the polygon mesh and ask:
Planar subdivision
Euler’s formular: v – e + f = 2
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
e_v1[4]
v1
f1
e
f2
v2
e_v2[4]
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
f
e_next
HE_edge
v_orig
e_twin
e_prev
struct HE_edge {
HE_vert *v_orig;
HE_edge *e_twin;
HE_face *f;
HE_edge *e_next;
HE_edge *e_prev;
};
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
edge
HE_vert
p=(x,y)
struct HE_vert {
Gdiplus::PointF p;
HE_edge *edge;
};
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
struct HE_face_barebone {
HE_edge *edge;
};
HE_face_barebone
edge
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
innerComps[0]
HE_face
outerComp
struct HE_face {
HE_edge *outerComp;
HE_edge **innerComps;
};
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
v2
f1
edge
f2
v1
HE_vert *v1 = edgev_orig;
HE_vert *v2 = edgee_twinv_orig;
HE_vert *f1 = edgef;
HE_vert *f2 = edge e_twinf;
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
Example
vertex v1 = { (1, 2), h_edge(12) }
face f1 = {h_edge(15), [h_edge(67)] }
h_edge(54) = { v5, h_edge(45), f1, h_edge(43), h_edge(15) }
In terms of the structure definitions:
HE_vert v1;
v1p = new Point(1,2);
v1egde = e_12;
HE_face f1;
f1outerComp = e_15;
f1innerComp[0] = e_67;
HE_edge e_54;
e_54v_orig = v5;
e_54e_twin = e_45;
e_54f = f1;
e_54e_next = e_43;
e_54e_prev = e_15;
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
HE_edge *edge = faceouterComp;
do {
// Do something with edge.
edge = edgenext;
} while (edge != faceouterComp);
HE_edge *edge = vertexedge;
do {
// Do something with edge, edgee_twin, etc.
edge = edgee_twinnext;
} while (edge != vertexedge);
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
Determining the boundary-type:
f
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
c6
c3
c2
c7
c5
c1
c8
c4
Construct a graph G to representy boundary-cycles.
Holes
c3
c1
c8
c6
c2
c7
c5
Outside
c4
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
e
p
ev_orig
ee_twin
e2
p
e2e_twin
e1
ev_orig
e1e_twin
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
e
Insertion of new edges into the flow:
» Iterate edges at v.
» Exercise.
v
ev_orig
e2
v
e1
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
Plane sweep!
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
2
1
3
3
1
7
4
5
8
8
L
7
2
1
P
U(P)
C(P)
7
3
1
3
C(P)
2
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann
For a total of n vertices in both S1 and S2:
Computational Geometry, WS 2006/07
Prof. Dr. Thomas Ottmann