Mesh final pzn_geo1004_2015_f3_2017
-
Upload
pirouz-nourian -
Category
Engineering
-
view
24 -
download
0
Transcript of Mesh final pzn_geo1004_2015_f3_2017
1Challenge the future
Boundary Representations
Polygon Mesh Models
Geo1004, Geomatics Master, Directed by Dr. Ir. Sisi Zlatannova
Dr. Ir. Pirouz NourianAssistant Professor of Design Informatics
2Challenge the future
General Idea
Representing Higher-Dimensional Objects with their Lower-Dimensional Boundary
e.g. representing a box only with a 6-face container; i.e. not representing the inner
volume.
3Challenge the future
What do we mean by representation
anyway?
Representing Higher-Dimensional Objects with their Lower-Dimensional Boundary
e.g. representing a box only with a 6-face container; i.e. not representing the inner
volume.
Representing a triangular surface by storing its border triangle; i.e. the triangle that
marks the boundary between what is in and out of this 2D space is itself a 1D space.
4Challenge the future
On terminology
โข Geometry: Point (0D), Line(1D), Polygon(2D), Polyhedron (3D)
โข Geometry: Point (0D), Curve(1D), Surface(2D), Solid (3D)
โข Topology: Vertex(0D), Edge(1D), Face(2D), Body(3D)
โข Graph Theory: Node, Link, (and n-Cliques)
5Challenge the future
Boundary Representations
โข 0D: Point
โข 1D: Curve (represented by boundary Points)
โข 2D: Surface (represented by boundary Curves)
โข 3D: Solid (represented by boundary Surfaces)
6Challenge the future
Boundary Representations & n-
Manifolds
โข 0D: Point (the space therein everywhere resembles a 0-dimensional Euclidean Space)
โข 1D: Curve (the space therein everywhere resembles a 1-dimensional Euclidean Space)
โข 2D: Surface (the space therein everywhere resembles a 2-dimensional Euclidean Space)
โข 3D: Solid (the space therein everywhere resembles a 3-dimensional Euclidean Space)
7Challenge the future
Boundary Representations
โข 0D: Point
โข 1D: Curve (represented by boundary Points)
โข 2D: Surface (represented by boundary Curves)
โข 3D: Solid (represented by boundary Surfaces)
โข Parametric surfaces (e.g.
NURBS)
โข Triangulated Irregular Networks
(TINS)
โข Grid (Networks)
โข Constrained Triangulation
โข Subdivision Surfaces
โข Polygon Meshes
8Challenge the future
Boundary Representations
โข 0D: Point
โข 1D: Curve (represented by boundary Points)
โข 2D: Surface (represented by boundary Curves)
โข 3D: Solid (represented by boundary Surfaces)
โข Parametric surfaces (e.g.
NURBS)
โข Triangulated Irregular Networks
(TINS)
โข Grid (Networks)
โข Constrained Triangulation
โข Subdivision Surfaces
โข Polygon Meshes
9Challenge the future
Nota Bene!
โข All these objects might be โembeddedโ geometrically in a 3D
space. Geometrically they are all 3D objects (3D point, 3D
curve, 3D surface, 3D solid); but their โinner spaceโ has
different topological dimensionality
โข The concept of manifold is adopted from differential
geometry and it is essentially about continuous space; here
we are talking about approximations of continuous objects
and generalized notions of manifold-ness.
โข In this course, we are focused on 2-Manifold Boundary
Representations modelled as โpolygon meshesโ and NOT
polyhedral meshes.
10Challenge the future
โข Example:
โข Important note:
the geometry of faces is not stored; only rendered when needed!
What you see on the screen is not necessarily what you store!
Mesh RepresentationA light-weight model composed of points and a set of topological
relations among them.
Points >Vertices Lines > Edges Polygons > Faces Mesh
T1: {0,4,3}T2:{0,1,4}Q1:{1,2,5,4}
11Challenge the future
โข The geometry of a Mesh can be represented by its points (known as [geometrical] vertices
in Rhino), i.e. a โlistโ of 3D points in โ3
โข The topology of a Mesh can be represented based on its [topological] vertices, referring
to a โsetโ of 3D points in โ3, there are multiple ways to describe how these vertices are
spatially related (connected or adjacent) to one another and also to edges and faces of the
Mesh
โข Same topology and different geometries:
MeshMesh Geometry versus Mesh Topology
T1: {0,4,3}T2:{0,1,4}Q1:{1,2,5,4}
T1
T2Q1
T1
T2Q1
0
3
1
45
2 0
3
1
4 5
2
12Challenge the future
Triangulated MeshesSome preliminary definitions: fan, star, strip
A triangle strip=:ABCDEF
ABC, CBD, CDE, and EDF
A
B
C
D
E
F
A Closed Triangle Fan or a โstarโ=:ABCDEF
A
B
C
D
E
F
ABC, ACD, ADE, and AEF
A Triangle Fan=: ABCDE
AB
CD
E
ABC, ACD, and ADE
13Challenge the future
Mesh BasicsSome preliminary definitions: free* vertices, free* edges
โข If an edge has less than two faces adjacent to it then it is considered free;โข If a vertex is part of such an edge it is considered as free too.
* In Rhinocommon free vertices/edges are referred to as naked.
14Challenge the future
Mesh BasicsSome preliminary definitions: border denoted as ๐น
โข A 1D border is the set of connected edges incident to only one face of a 2-manifold, i.e. composed of free edges. We can conclude that:
โข If every vertex has a closed fan (i.e. a star), or there is no edge of valence (number of neighbors) less than 2, the given manifold has no border. Example: a box!
non-manifold border manifold borderno [1D] border
15Challenge the future
โข if a Mesh is supposed to be a 2D manifold then it should meet these criteria:
1. each edge is incident to only one or two faces; and
2. the faces incident to a vertex form a closed or an open fan.
Non manifold Mesh examples: (note why!)
Images courtesy of Dr. Ching-Kuang Shene from Michigan Technological University
Manifold MeshA 2-manifold [everywhere] locally resembles a flat surface
โข if a Mesh is supposed to be orientable then, it should be possible to find
โcompatibleโ orientations for any two adjacent faces; in which, for each pair of
adjacent faces, the common edge of the two faces has opposite orders.
โข Example: Mรถbius band is a 2D manifold Mesh that is non-printable.
16Challenge the future
Mesh Topology: HomeomorphismEuler-Poincare Characteristic: key to homeomorphism
โข N-Manifold: Each point of an n-dimensional manifold has a neighborhood
that is homeomorphic to the Euclidean space of dimension n
โข Riddle: The above definition implies that for mapping some local geographic features 2D maps
are fine. What about the whole globe? That is not homoeomorphic to a rectangular surface!
How do we do it then?
17Challenge the future
Image Source: http://prateekvjoshi.com/2014/11/16/homomorphism-vs homeomorphism/
Mesh Topology: Homeomorphismclay models that are all topologically equal!
Images courtesy of Dr. Ching-Kuang Shene from Michigan Technological University
Two 2-manifold Meshes A and B are homeomorphic if their surfaces can be transformed to one another by topological transformations (bending, twisting, stretching, scaling, etc.) without cutting and gluing.
18Challenge the future
Image Source: https://www.shapeways.com/blog/archives/21752-a-3d-printed-topology-joke.html
Mesh Topology: Homeomorphismclay models that are all topologically equal!
Images courtesy of Dr. Ching-Kuang Shene from Michigan Technological University
Two 2-manifold Meshes A and B are homeomorphic if their surfaces can be transformed to one another by topological transformations (bending, twisting, stretching, scaling, etc.) without cutting and gluing.
This is how!
19Challenge the future
Mesh Topology: HomeomorphismEuler-Poincare Characteristic: key to homeomorphism
Only for 2D boundary representations*
Images courtesy of Dr. Ching-Kuang Shene from Michigan Technological University
๐ ๐ = ๐ โ ๐ธ + ๐น = 2 1 โ ๐ โ ๐ฟ
๐ ๐ = ๐ โ ๐ธ + ๐น = 2 1 โ 2 โ 0 = โ2
* The Euler characteristic equation will take the form of V-E+F-B
โข ๐ฟ is the number of [connected] borders
โข ๐ is the number of โgeneraโ (pl. of genus) or handles
โข Irrespective of tessellation!
20Challenge the future
Mesh Topology: HomeomorphismEuler-Poincare Characteristic: key to homeomorphism
โข Irrespective of tessellation!
๐ ๐ = ๐ โ ๐ธ + ๐น = โ2 ๐๐๐ ๐๐๐ข๐๐๐ ๐ก๐๐๐(โ๐๐๐๐๐๐๐๐โ๐๐ ๐ก๐ ๐ ๐๐๐๐๐ ๐ค๐๐กโ 2 โ๐๐๐๐ )
๐ ๐ = ๐ โ ๐ธ + ๐น = 0 ๐๐๐ ๐ก๐๐๐ (โ๐๐๐๐๐๐๐๐โ๐๐ ๐ก๐ ๐ ๐๐๐๐๐ ๐ค๐๐กโ 1 โ๐๐๐)
๐ ๐ = ๐ โ ๐ธ + ๐น = 1 ๐๐๐ ๐๐๐ ๐๐ (โ๐๐๐๐๐๐๐๐โ๐๐ ๐ก๐ ๐ ๐ข๐๐๐๐๐๐ )
๐ ๐ = ๐ โ ๐ธ + ๐น = 2 ๐๐๐ ๐๐๐๐๐ (โ๐๐๐๐๐๐๐๐โ๐๐ ๐ก๐ ๐ ๐๐๐๐๐ ๐ค๐๐กโ๐๐ข๐ก โ๐๐๐๐ )
21Challenge the future
Mesh Topology: HomeomorphismEuler-Poincare Characteristic: key to homeomorphism
Images courtesy of Dr. Ching-Kuang Shene from Michigan Technological University
๐ ๐ = ๐ โ ๐ธ + ๐น = 2 1 โ ๐ โ ๐ฟ
โข ๐ฟ is the number of borders
โข ๐ is the number of โgeneraโ (pl. of genus) or holes
โข Irrespective of tessellation!
๐ ๐ = ๐ โ ๐ธ + ๐น = 2 1 โ 2 โ 0 = โ2
22Challenge the future
Poincare Dualitya pairing between k-dimensional features and dual
features of dimension n-k in โ๐
PRIMAL DUAL
0D vertex (e.g. as a point) 1D edge
1D edge (e.g. as a line segment) 0D vertex
PRIMAL DUAL
0D vertex (e.g. a point) 2D face
1D edge (e.g. a line segment) 1D edge
2D face (e.g. a triangle or a pixel) 0D vertex
PRIMAL DUAL
0D vertex (e.g. a point) 3D body
1D edge (e.g. a line segment) 2D face
2D face (e.g. a triangle or a pixel) 1D edge
3D body (e.g. a tetrahedron or a voxel) 0D vertex
โ
โ3
โ2
23Challenge the future
Poincare Dualitya pairing between k-dimensional features and dual
features of dimension n-k in โ๐
PRIMAL DUAL
0D vertex (e.g. as a point) 1D edge
1D edge (e.g. as a line segment) 0D vertexโ
A hypothetical street network: a Junction-to-Junction adjacency graph (left) versus a Street-to-Street adjacency graph (right), both โundirectedโ, after Batty (Batty, 2004): red dots
represent graph nodes, and blue arcs represent graph links.
Batty, M., 2004. A New Theory of Space Syntax. CASA Working Paper Series, March.
24Challenge the future
Poincare Dualitya pairing between k-dimensional features and dual
features of dimension n-k in โ๐
PRIMAL DUAL
0D vertex (e.g. a point) 2D face
1D edge (e.g. a line segment) 1D edge
2D face (e.g. a triangle or a pixel) 0D vertex
โ2
A Voronoi tessellation of 2D space and its dual that is a Delaunay triangulation
25Challenge the future
Poincare Dualitya pairing between k-dimensional features and dual
features of dimension n-k in โ๐
PRIMAL DUAL
0D vertex (e.g. a point) 3D body
1D edge (e.g. a line segment) 2D face
2D face (e.g. a triangle or a pixel) 1D edge
3D body (e.g. a tetrahedron or a voxel) 0D vertex
โ3
representing adjacencies between 3D cells or bodies via their dual vertices (Lee, 2001)
Lee, J., 2001. 3D Data Model for Representing Topological Relations of Urban Features. San Diego, CA, s.n.
26Challenge the future
โข formally an ordered set of Vertices, Edges and Faces or ๐ = (๐, ๐ธ, ๐น)
โข The ordered set describes a set of vertices and a set of faces describing how the vertices construct convex polygons by the
set of edges connecting them when embedded in โ3. (In a set there is no duplicate element. Therefore, the vertices,
edges and faces in the above definition are unique in their sets and have no duplicates.)
โข Edges and faces should not intersect or self-intersect.
โข Edges correspond to straight lines, faces are generators of convex and planar polygons. A Mesh represents a polyhedron if
it has planar faces without self-intersection.
โข Mesh has a topological structure, in which edges are tuples of vertex indices and faces are composed of (CW/CCW
ordered) tuples of integers referring to indices of the vertices or edges
โข Ensuring flatness of faces is most convenient with triangular faces. This is one of many reasons that triangular Meshes are
most common and used for rendering engines.
โข Faces or edges should not be degenerate; e.g. an edge that effectively corresponds to a line of length zero, or a face
giving rise to a polygon that has zero surface area. Faces (polygons) should not be self intersecting; edges should not self-
intersect either.
Valid Mesh (often expected to be a 2โManifold Surface)
27Challenge the future
Quiz:Check Euler-Poincare Characteristic on two spherical meshes
โข Question: we know that the Euler-Poincare Characteristic is independent of
tessellation; check this fact on the two spheres below; explain the discrepancy.
Hints: http://4.rhino3d.com/5/rhinocommon/ look at Mesh[class] members
๐ ๐ = 2๐ ๐ = 66!?
28Challenge the future
Mesh Topological Structure
โข Mesh Topological Data Models:
Face-Vertex: e.g. ๐น0 = {๐0, ๐5, ๐4} & ๐0 โ ๐น0, ๐น1, ๐น12, ๐น15, ๐น7
Images courtesy of David Dorfman, from Wikipedia
Face-Vertex (as implemented in Rhinoceros)
29Challenge the future
Vertex-Vertex: e.g. ๐0~{๐1, ๐4, ๐3}
Face-Vertex: e.g. ๐น0 = ๐0, ๐5, ๐4 , ๐0 โ ๐น0, ๐น1, ๐น12, ๐น15, ๐น7
Winged-Edge: e.g. ๐น0 = ๐ธ4, ๐ธ8, ๐ธ9 , ๐ธ0 = ๐0, ๐1 , ๐ธ0~ ๐น1, ๐น12 , ๐ธ0~ ๐ธ9, ๐ธ23, ๐ธ10, ๐ธ20
Half-Edge: each half edge has a twin edge in opposite direction, a previous and a next
Mesh Topological Structures
Image courtesy of David Dorfman, from Wikipedia
What is explicitly stored as topology of a Mesh: E.g.
Face-Vertex (as implemented in Rhinoceros)
http://doc.cgal.org/latest/HalfedgeDS/index.html
30Challenge the future
Mesh Topological Structure
โข Mesh Topological Data Models:
Face-Vertex Example:
http://4.rhino3d.com/5/rhinocommon/html/AllMembers_T_Rhino_Geometry_Collections_MeshTopologyVertexList.htm
Face-Vertex (as implemented in Rhinoceros)
Name Description
ConnectedFaces Gets all faces that are connected to a given vertex.
ConnectedTopologyVertices(Int32) Gets all topological vertices that are connected to a given vertex.
ConnectedTopologyVertices(Int32, Boolean) Gets all topological vertices that are connected to a given vertex.
The MeshTopologyVertexList type exposes the following members.
Half-Edge: Half-Edge Mesh Data Structure, example implementation by Daniel Piker: http://www.grasshopper3d.com/group/plankton
32Challenge the future
Mesh Intersections
โข Boolean operation on Meshes:
1. ๐ด โช ๐ต: Boolean Union
2. ๐ด โ ๐ต: Boolean Difference
3. ๐ด โฉ ๐ต: Boolean Intersection
33Challenge the future
Normal Vectors of a Mesh
โข Topological Vertices versus Geometrical Points
โข Joining Mesh objects: What is a Mesh box?
โข Welding Meshes: how does it work?
โข Face Normal versus Vertex Normal
Where do they come from and what do they represent?
34Challenge the future
How to Compute Mesh Normals?
โข
00,
00 ),(vvuuv
p
u
pvun
1
( ) ( )
0
( )( )N
x i next i i next i
i
N y y z z
1
( ) ( )
0
( )( )N
z i next i i next i
i
N x x y y
1
( ) ( )
0
( )( )N
y i next i i next i
i
N z z x x
Martin Newell at Utah (remember the teapot?)
Why?
35Challenge the future
Repairing/Reconstructing Geometry
โข Example: Coonsโ Patch
โข Code it and get bonus points!
Image courtesy of CVG Lab
36Challenge the future
Mesh Smoothing
โข
for (int k = 0; k <= L - 1; k++) {List<Point3d> SmoothV = new List<Point3d>();for (int i = 0; i <= M.Vertices.Count - 1; i++) {
List<Point3d> Neighbours = Neighbors(M, i);Point3d NVertex = new Point3d(0, 0, 0);foreach (point3d neighbor in Neighbours ) {
NVertex = NVertex + neighbor;}NVertex = (1 / Ngh.Count) * NVertex;SmoothV.Add(NVertex);
}M.Vertices.Clear();M.Vertices.AddVertices(SmoothV);A = M;
}