3D Geometric Modeling - personal.utdallas.edu

34
1 3D Geometric Modeling

Transcript of 3D Geometric Modeling - personal.utdallas.edu

Page 1: 3D Geometric Modeling - personal.utdallas.edu

1

3D Geometric Modeling

Page 2: 3D Geometric Modeling - personal.utdallas.edu

2/55

Geometric Modeling

• Surface representations– Industrial design

Page 3: 3D Geometric Modeling - personal.utdallas.edu

3/55

Geometric Modeling

• Surface representations– Industrial design– Movies and animation

Page 4: 3D Geometric Modeling - personal.utdallas.edu

4/55

Geometric Modeling

• Surface representations– Industrial design– Movies and animation

• Surface reconstruction/Visualization

Page 5: 3D Geometric Modeling - personal.utdallas.edu

5/38

Polygonal Representations

• Stores the boundary of a solid – Geometry: vertex locations

– Topology: connectivity information• Vertices• Edges• Faces

Page 6: 3D Geometric Modeling - personal.utdallas.edu

6/38

Polygonal Representations

• Constant time adjacency information– For each vertex, 

• Find edges/faces touching vertex– For each edge,

• Find vertices/faces touching edge– For each face,

• Find vertices/edges touching face

Page 7: 3D Geometric Modeling - personal.utdallas.edu

7/38

Polygonal Representations

• Typically assume the surface is manifold

• A surface is manifold

if, for every point, locally  the surface is equivalent to an open disk

Page 8: 3D Geometric Modeling - personal.utdallas.edu

8/38

Polygonal Representations

• Typically assume the surface is manifold

• A surface is manifold

if, for every point, locally  the surface is equivalent to an open disk

Locally manifold

Page 9: 3D Geometric Modeling - personal.utdallas.edu

9/38

Polygonal Representations

• Typically assume the surface is manifold

• A surface is manifold

if, for every point, locally  the surface is equivalent to an open disk

Non‐manifold edge

Page 10: 3D Geometric Modeling - personal.utdallas.edu

10/38

Polygonal Representations

• Typically assume the surface is manifold

• A surface is manifold

if, for every point, locally  the surface is equivalent to an open disk

Non‐manifold vertex

Page 11: 3D Geometric Modeling - personal.utdallas.edu

11/38

Winged Edge Data Structure

E

LN RN

RPLP

P

N

Left face Right face

Page 12: 3D Geometric Modeling - personal.utdallas.edu

12/38

Winged Edge Data Structure

E

LN RN

RPLP

P

N

Left face Right face

WingedEdge {WingedEdge nextLeft, nextRight,    

prevLeft, prevRight;Face leftFace, rightFace;Vertex prevVert, nextVert;

}

Face {WingedEdge edge;

}

Vertex {WingedEdge edge;

}

Page 13: 3D Geometric Modeling - personal.utdallas.edu

13/38

Winged Edge Data Structure

• Given a face, find all vertices touching that  face

• Given a vertex, find all edge‐adjacent vertices• Given a face, find alladjacent faces

E

LN RN

RPLP

P

N

Left face Right face

Page 14: 3D Geometric Modeling - personal.utdallas.edu

14/38

Half Edge Data Structure

HE

NHE

Flip

PHEV

faceE

Page 15: 3D Geometric Modeling - personal.utdallas.edu

15/38

Half Edge Data Structure

HE

NHE

Flip

PHEV

faceE

HalfEdge {HalfEdge next, prev, flip;Face face;Vertex origin;Edge edge;

}

Face {HalfEdge edge; // part of this face

}

Vertex {HalfEdge edge;  // points away

}

Edge {HalfEdge he;

}

Page 16: 3D Geometric Modeling - personal.utdallas.edu

16/38

Half Edge Data Structure

• Very similar to WingedEdge Data Structure,  but edges have unique orientation

• Slightly more storage

• Less conditional operations• Assumes polygons are oriented

HE

NHE

Flip

PHEV

faceE

Page 17: 3D Geometric Modeling - personal.utdallas.edu

17/38

Building a Topological Data Structure

• Must connect adjacent edges/faces/vertices

• Edges are critical in most data structures

HE

NHE

Flip

PHEV

faceE

Page 18: 3D Geometric Modeling - personal.utdallas.edu

18/38

Euler Characteristic

• V: number of vertices

• E: number of edges

• F: number of faces

• G: genus of surface (number of holes)

)(22 GGFEV χ=−=+−

Page 19: 3D Geometric Modeling - personal.utdallas.edu

19/38

Euler Characteristic

• V: number of vertices

• E: number of edges

• F: number of faces

• G: genus of surface (number of holes)

0*226128 −=+−

)(22 GGFEV χ=−=+−

Page 20: 3D Geometric Modeling - personal.utdallas.edu

20/38

Euler Characteristic

• V: number of vertices

• E: number of edges

• F: number of faces

• G: genus of surface (number of holes)

0*22464 −=+−

)(22 GGFEV χ=−=+−

Page 21: 3D Geometric Modeling - personal.utdallas.edu

21/38

Euler Characteristic

• V: number of vertices

• E: number of edges

• F: number of faces

• G: genus of surface (number of holes)

1*22163216 −=+−

)(22 GGFEV χ=−=+−

Page 22: 3D Geometric Modeling - personal.utdallas.edu

22/38

Topological Operations: Hole Filling

• Find a half‐edge whose flip

is null• Use next

and flip

points to find next

adjacent 

half‐edge with null flip• Repeat until back at original half‐edge

• Create new half‐edges along boundary and face containing those edges

HE

NHE

nullFlip =

PHEV

face

E

Page 23: 3D Geometric Modeling - personal.utdallas.edu

23/32

Mesh Simplification

Create levels of detail (LOD) of objects:

Page 24: 3D Geometric Modeling - personal.utdallas.edu

24/32

Level of Details (LOD)

Distant objects use coarser LODs:

Page 25: 3D Geometric Modeling - personal.utdallas.edu

25/38

Topological Operations: Edge Collapse

Page 26: 3D Geometric Modeling - personal.utdallas.edu

26/38

Topological Operations: Edge Collapse

• Set origin

of all edges pointing outwards from  two vertices to new vertex and vertex to one of 

the half‐edges

Page 27: 3D Geometric Modeling - personal.utdallas.edu

27/38

Topological Operations: Edge Collapse

• Set origin of all edges pointing outwards from  two vertices to new vertex and vertex to one of 

the half‐edges

• Set flip

on outer edges to point to opposite edge

Page 28: 3D Geometric Modeling - personal.utdallas.edu

28/38

Topological Operations: Edge Collapse

• Set origin of all edges pointing outwards from  two vertices to new vertex and vertex to one of 

the half‐edges

• Set flip

on outer edges to point to opposite edge

• Make sure half‐edge pointer for edges point to  correct half‐edge

Page 29: 3D Geometric Modeling - personal.utdallas.edu

29/38

Topological Operations: Edge Collapse

• Set origin of all edges pointing outwards from  two vertices to new vertex and vertex to one of 

the half‐edges

• Set flip

on outer edges to point to opposite edge

• Make sure half‐edge pointer for edges point to  correct half‐edge

• Update half‐edge forwing‐vertices

Page 30: 3D Geometric Modeling - personal.utdallas.edu

30/38

Topological Operations: Edge Collapse

• Set origin of all edges pointing outwards from  two vertices to new vertex and vertex to one of 

the half‐edges• Set flip

on outer edges to point to opposite edge

• Make sure half‐edge pointer for edges point to  correct half‐edge

• Update half‐edge forwing‐vertices

• Delete faces/edges/vertices

Page 31: 3D Geometric Modeling - personal.utdallas.edu

31/38

Topological Operation: Edge Collapse

• Edge collapse preserves topology as long as  the local Euler characteristic of the surface 

remains the same)(GFEV χ=+−

Page 32: 3D Geometric Modeling - personal.utdallas.edu

32/38

Topological Operation: Edge Collapse

• Edge collapse preserves topology as long as  the local Euler characteristic of the surface 

remains the same)(GFEV χ=+−

2ˆ3ˆ1ˆ

−=

−=

−=

FF

EE

VV

FEVFEVFEV +−=−+−−−=+− )2()3()1(ˆˆˆ

Page 33: 3D Geometric Modeling - personal.utdallas.edu

33/38

Topological Operation: Edge Collapse

• Edge collapse does NOT always preserve  topology

Page 34: 3D Geometric Modeling - personal.utdallas.edu

34/38

Detecting Unsafe Edge Collapses

• Let N(v) be the set of vertices edge‐adjacent  to v

• Safe to collapse if

1v 2v

2)()( 21 =∩ vNvN