<<

Convex Hulls (3D)

O’Rourke, Chapter 4 Outline • Polyhedra  • (Oriented) Mesh Representation Polyhedra Definition: A is a solid region in 3D space whose boundary is made up of planar polygonal faces comprising a connected 2D . Polyhedra The boundary of a polyhedron can be expressed as a combination of vertices, edges, and faces:  Intersections are proper: » Elements don’t overlap, or » They share a single vertex, or » They share an edge and the two vertices Polyhedra The boundary of a polyhedron can be expressed as a combination of vertices, edges, and faces:  Intersections are proper  Locally manifold: » Edges around a vertex can be sorted to match their incidence on faces. Polyhedra The boundary of a polyhedron can be expressed as a combination of vertices, edges, and faces:  Intersections are proper  Locally manifold: Alternatively,» Edges the around subgraph a vertex of the can dual be obtained sorted to by restricting tomatch the adjacent their incidence faces (the on faces. link) is connected. Polyhedra The boundary of a polyhedron can be expressed as a combination of vertices, edges, and faces:  Intersections are proper  Locally manifold: » Edges around a vertex can be sorted to match their incidence on faces. » Exactly two faces meet at each edge. Polyhedra The boundary of a polyhedron can be expressed as a combination of vertices, edges, and faces:  Intersections are proper  Locally manifold  Globally connected Definition Definition: Given an edge on a polyhedron, the dihedral of the edge is the internal angle between the two adjacent faces.

휋/2 Aside: The dihedral angle is a discrete measure of mean curvature. Definition Definition: Given a vertex on a polyhedron, the deficit angle at the vertex is 2휋 minus the sum of around the vertex.

휋/2

⇒ 휋/2 휋/2 휋/2 Aside: The deficit angle is a discrete measure of Gauss curvature. Polytopes A convex polyhedron is a :  Non-negative mean curvature: All dihedral angles are less than or equal to 휋. (Necessary and sufficient.)  Non-negative Gaussian curvature: Sum of angles around a vertex is at most 2휋. (Necessary but not sufficient). Platonic Solids Definition: A regular is a polygon with equal sides and equal angles.

… Platonic Solids Definition: A is a polygon with equal sides and equal angles. A regular polyhedron is a convex polyhedron, with all faces congruent regular and vertices having the same valence. Platonic Solids Claim: The five platonic solids are the only regular polyhedra.

[Images courtesy of Wikipedia] Platonic Solids Proof: Assume each face is 푝-sided: ⇒ The sum of angles in a face is 휋 푝 − 2 ⇒ The angle at each vertex is 휋(1 − 2/푝) Assume each vertex has valence 푣: ⇒ The angle-sum at a vertex is 푣휋 (1 − 2/푝) Platonic Solids Proof: Since the polyhedron is convex: 푣휋 1 − 2 푝 < 2휋 ⇔ 푣 1 − 2 푝 < 2 ⇔ 푣 푝 − 2 < 2푝 ⇔ 푣푝 − 2푣 − 2푝 < 0 ⇔ 푝 − 2 푣 − 2 − 4 < 0 Platonic Solids Proof: Since the polyhedron is convex: 푝 − 2 푣 − 2 − 4 < 0 Since 푝, 푣 ≥ 3, valid options are 푝, 푣 :

(3,3) (3,4) (4,3) (3,5) (5,3) Platonic Solids The platonic solids come in dual pairs, where one solid is obtained from the other by replacing faces with vertices: Icosahedron ↔ Dodecahedron ↔ Tetrahedron (3,3) (3,4) (4,3) (3,5) (5,3) Topological Polyhedra The boundary of a polyhedron can be expressed as a combination of vertices, edges, and faces:  Intersections are proper Geometric  Locally manifold Topological  Globally connected Topological Polyhedra If we ignore the vertex positions, we get a combinatorial structure composed of faces (cells), edges, and vertices.*

[Nivoliers and Levy, 2013] *These are CW complexes. (And, if faces are triangles, these are simplicial complexes). Topological Polyhedra Properties (CW Complex):  Faces intersect at edges and vertices.  Edges are topologically segments and intersect at vertices.  Interiors of faces have disk- and the boundary is a polygon made up of edges.   Topological Polyhedra Properties (Manifold):  Each vertex is on the boundary of some edge.  Each edge is on the boundary of some face.  An edge is on the boundary of two faces.  Edges around a vertex can be sorted. Topological Polyhedra Note: Given a topological polygon 푃, and given an edge 푒 ∈ 푃 that only occurs once on 푃:

For any vertices 푣1, 푣2 ∈ 푃 there is a path from 푣1 to 푣2 that doesn’t pass through 푒.

푣2

푣1 Topological Polyhedra Claim:

If 푓1 and 푓2 are distinct faces of a topological polyhedron which share an edge 푒, then:

 replacing 푓1 and 푓2 with 푓1 ∪ 푓2, and  removing 푒 from the edge list, we still have a valid topological polyhedron.

푓1 푓2

푒 Topological Polyhedra Proof (CW Complex):

The edges/vertices of 푓1 ∪ 푓2 are in the complex (since 푒 is not on the boundary).

* Since the intersection 푓1 ∩ 푓2 is connected and the interiors of 푓1 and 푓2 have disk- topology, the interior of 푓1 ∪ 푓2 also has disk- topology.

*This is just a sketch of the proof. Topological Polyhedra Proof (CW Complex):

The boundary of 푓1 ∪ 푓2 is connected. • Let 푣 ∈ 푒 be an end-point.

• For 푣1, 푣2 ∈ 푓1 ∪ 푓2, there is a curve connecting 푣 to each 푣푖 that does not contain the edge 푒.

• Concatenating the two curves we connect 푣1 to 푣2 along the boundary of 푓1 ∪ 푓2. Topological Polyhedra Proof (Manifold): The smaller polyhedron still passes through all the vertices. The edge 푒 is removed and all other edges remain adjacent to a face. Topological Polyhedra Proof (Manifold Edges): The old edges still have only two faces on them (or one face twice). Topological Polyhedra Proof (Manifold Vertices): If 푣 ∉ 푒, we can use the old edge ordering.

푓2

푒 푒 푒1 2 푓1 푣 푒4 푒3 Topological Polyhedra Proof (Manifold Vertices): If 푣 ∉ 푒, we can use the old edge ordering.

푓 ∪ 푓 1 2 푒 푒2 1 푣 푒4 푒3 Topological Polyhedra Proof (Manifold Vertices): If 푣 ∉ 푒, we can use the old edge ordering.

If 푣 ∈ 푒 let {푒1, 푒2, … , 푒푘} be the old ordered edges around 푣, shifted so that 푒1 = 푒.

Then 푒푘 and 푒2 are consecutive edges on 푓1 ∪ 푓2 so {푒2, … , 푒푘} is a valid ordering.

푓2 푒 푒2 푓1 푣 푒4 푒3 Topological Polyhedra Proof (Manifold Vertices): If 푣 ∉ 푒, we can use the old edge ordering.

If 푣 ∈ 푒 let {푒1, 푒2, … , 푒푘} be the old ordered edges around 푣, shifted so that 푒1 = 푒.

Then 푒푘 and 푒2 are consecutive edges on 푓1 ∪ 푓2 so {푒2, … , 푒푘} is a valid ordering.

푓1 ∪ 푓2 푒2 푣 푒4 푒3 Curves A (connected) curve on a topological polyhedron is a list of edges such that the ending vertex of one edge is the starting vertex of the next. Curves A (connected) curve on a topological polyhedron is a list of edges such that the ending vertex of one edge is the starting vertex of the next. A closed curve is a curve whose starting and ending points are the same. Genus-0 Polyhedra A polyhedron is genus-0 (or simply connected) if every non-trivial closed curve disconnects the faces of the polyhedron.   Genus-0 Polyhedra Aside: The definition can be extended to surfaces with boundary if we curves that start and end the boundary are also considered closed. Genus-0 Polyhedra Equivalently, given a topological polyhedron 푃 we can define the dual graph 푃∗ = (푉∗, 퐸∗). ⇒ A curve 퐶 ⊂ 퐸 corresponds to a set of dual edges 퐶∗ ⊂ 퐸∗ of the dual. ⇒ 푃 is genus-0 if removing 퐶∗ disconnects 푃∗. Genus-0 Polyhedra 1. There is a continuous map from a polytope to a . (e.g. Put the center of mass at the origin and normalize the positions.) 2. By the Jordan Curve Theorem the sphere is genus-zero. One Can Show: ⇒ The polytope must also be genus-0. Euler’s Formula For a genus-0 polyhedron 푃, the number of vertices, |푉|, the number of edges, |퐸|, and the number of faces, |퐹|, satisfy: |푉| − |퐸| + |퐹| = 2 Euler’s Formula (by Induction on |푭|) Base case: 퐹 = 1 We have:

 푉 = 푣1, … , 푣푛 * The edges on the boundary of 푣6 푣5 the face form a connected 푣7 푣4 tree (otherwise there is a closed loop and the interior of 푣1 푣 the face is disconnected). 푣2 3 Then there are 푛 − 1 edges: 푉 − 퐸 + 퐹 = 푛 − 푛 − 1 + 1 = 2 *This is just a sketch of the proof. Euler’s Formula (by Induction on |푭|) Induction: Assume true for 퐹 = 푛 − 1 Find 푒 ∈ 퐸 shared by two distinct faces. If no such 푒 exists, then all faces are adjacent to themselves, which contradicts the assumption that the polyhedron is connected. Euler’s Formula (by Induction on |푭|) Induction: Assume true for 퐹 = 푛 − 1 Find 푒 ∈ 퐸 shared by two distinct faces. Remove 푒 and merge the two adjoining faces. Claim: The new polyhedron, 푃′, is still genus-0. Euler’s Formula (by Induction on |푭|) Proof (푃′ is genus-zero): Let 퐶 be a non-trivial curve on 푃′. ⇒ 퐶 is a non-trivial curve on 푃 with 푒 ∉ 퐶.

⇒ 푓1 and 푓2 are in the same component.

⇒ 퐶 disconnects 푓1 ∪ 푓2 from a face 푔 on 푃.

⇒ 퐶 disconnects 푓1 ∪ 푓2 from 푔 in 푃′. Euler’s Formula (by Induction on |푭|) Induction: Assume true for 퐸 = 푛 − 1 Find 푒 ∈ 퐸 shared by two distinct faces. Remove 푒 and merge the two adjoining faces. 푃′ is genus-0 with 퐸 − 1 edges, 퐹 − 1 faces, and |푉| vertices. By the induction hypothesis we have: 푉 − 퐸 − 1 + 퐹 − 1 = 2 ⇕ 푉 − 퐸 + 퐹 = 2 Euler’s Formula 푉 − 퐸 + 퐹 = 2 More Generally: If a polygon mesh is genus-푔 (푔 is the number of handles) then: 푉 − 퐸 + 퐹 = 2 − 2푔.

푉 = 24, 퐸 = 48, 퐹 = 24 [Wikipedia: Toroidal Polyhedron] Euler’s Formula Implication: The number of faces and edges is linear in the number of vertices. Euler’s Formula Proof: Assume all faces are triangles. (Triangulating only increase |퐹| and |퐸|.) Since each edge is shared by two triangles: 퐸 = 3 퐹 /2 Using Euler’s Formula: 푉 − 퐸 + 퐹 = 2 ⇕ 퐹 = 2 푉 − 4 and 퐸 = 3 푉 − 6 Outline • Polyhedra • (Oriented) Mesh Representation  Face-vertex data-structure  Winged-edge data-structure (Oriented) Mesh Representation Face-Vertex Lists: Most often (e.g. ply, obj, etc. formats) polygon meshes are represented using vertex and face lists:  Vertex Entry: (푥, 푦, 푧) coordinates.  Face Entry: Count and CCW indices of the vertices.

푣4 푣5

푣1 푣3

푣2 (Oriented) Mesh Representation Face-Vertex Lists: Most often (e.g. ply, obj, etc. formats) polygon meshes are represented using vertex and face lists:  Vertex Entry: (푥, 푦, 푧) coordinates.  Face Entry: Count and CCW indices of the vertices.

푣4 푣5 Vertex List Face List 푓1 Id 풙 풚 풛 Id # Indices 푓 푓 푣 1 -1 -1 0 1 4 1 3 5 4 푣1 푓3 4 5 3

2 0 0 -1 2 3 1 2 3 푓2 3 1 -1 0 3 3 4 2 1 푣2 4 -1 1 0 4 3 5 2 4 5 1 1 -1 5 3 3 2 5 (Oriented) Mesh Representation Face-Vertex Lists: Most often (e.g. ply, obj, etc. formats) polygon meshes are represented using vertex and face lists:  Vertex Entry: (푥, 푦, 푧) coordinates.  Face Entry: Count and CCW indices of the vertices.

푣4 푣5 Vertex List Face List 푓1 Id 풙 풚 풛 Id # Indices 푓 푓 푣 1 -1 -1 0 1 4 1 3 5 4 푣1 푓3 4 5 3

2 0 0 -1 2 3 1 2 3 푓2 3 1 -1 0 3 3 4 2 1 Limitation: 푣2 4 -1 1 0 4 3 5 2 4 • Variable sized rows 5 1 1 -1 5 3 3 2 5 • No explicit connectivity (Oriented) Mesh Representation Winged-Edge List: Common representation for connectivity querying, represented using vertex, half-edge, and face lists:  Vertex Entry: » (푥, 푦, 푧) coordinates » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 » in/out wing h.e. indices 푣2 » opposite h.e. index » end vertex index » face index Vertex List (Oriented)Id 풙 풚 풛 h Mesh Representation 1 -1 -1 0 4 2Winged0 0 --1Edge2 List: 3 1 -1 0 3 4Common-1 1 0 representation6 for connectivity querying, 5represented1 1 -1 … using vertex, half-edge, and face lists:  Vertex Entry: » (푥, 푦, 푧) coordinates » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 » in/out wing h.e. indices 푣2 » opposite h.e. index » end vertex index » face index Vertex List Face List (Oriented)Id 풙 풚 풛 h MeshId h Representation 1 -1 -1 0 4 1 4 2Winged0 0 --1Edge2 List2 3: 3 1 -1 0 3 3 5 4Common-1 1 0 representation6 4 … for connectivity querying, 5represented1 1 -1 … using5 … vertex, half-edge, and face lists:  Vertex Entry: » (푥, 푦, 푧) coordinates » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 » in/out wing h.e. indices 푣2 » opposite h.e. index » end vertex index » face index Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 » in/out wing h.e. indices 푣2 » opposite h.e. index » end vertex index » face index Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 풗ퟏ 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4, 푣2 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4, 푣2 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 » (푥, 푦, 푧) coordinates … » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4, 푣2 Vertex List Face List Half-Edge List (Oriented)Id 풙 풚 풛 h MeshId h RepresentationId o wi wo v f 1 -1 -1 0 4 1 4 1 2 3 … 2 2 2Winged0 0 --1Edge2 List2 3: 2 1 … 5 1 3 3 1 -1 0 3 3 5 3 4 … 1 1 2 4Common-1 1 0 representation6 4 … 4 3for6 connectivity… 3 1 querying, 5represented1 1 -1 … using5 … vertex,5 6 half2 -…edge,4 3 and face lists:  Vertex Entry: 6 5 ... 4 1 1 Computational» (푥, 푦, 푧) coordinates complexity is …linear in output size. » Outgoing h.e. index 푣4 푣5 푓 푒5 푒6 1  Face Entry: 푒4 푓 푓 푣 » h.e. index 푣1 푓3 4 5 3 푒 푒 3  Half-Edge Entry: 1 푓2 푒2 Example: 푣2

Find CCW vertices around 푣1: 푣3, 푣4, 푣2 (Oriented) Mesh Representation

GenerateHalfEdge( V , F , _V , _E , _F )  _V.resize( v.size() ) , _F.resize( F.size() )  for( i=0 ; i

 unordered_map< long long , int > fMap

 ConstructFaceMap( F, fMap )  _E.resize( fMap.size() )

 SetVertexAndFaceIndices( fMap , _V , _E , _F )  SetHalfEdges( fMap , F , _E ) (Oriented) Mesh Representation

ConstructFaceMap( F , fMap )  for( f=0 ; f

Assuming that: • Indexing is modulo the face size • We don’t lose precision due to casting/shifting. (Oriented) Mesh Representation

SetVertexAndFaceIndices( fMap , _V , _E , _F )  int count = 0  for( iter i=fMap.begin() ; i!=fMap.end() ; i++ ) » int v = i.key>>32 , f = i.value » _E[count].v = v , _E[count].f = f » _V[v].he = _F[f].he = i.value = count++

Note that the values of the face map are over-written with the edge indices. (Oriented) Mesh Representation

SetHalfEdges( fMap , F , _E )  for( f=0 ; f