Chapter 2 Surface Representations
Many problems in engineering investigate the properties or deformation of surfaces. For example, the change of the position of a surface when a physical process deforms it, on what parts of a surface materials accumulate, or how much of the surface area is exposed to a particle source [33, 34, 35]; the interaction at the interfaces of different liquids, gasses, and solid boundaries during a multiphase flow [36, 37]; or the detection of objects in the vicinity of a laser scanner, that creates real time scans of the area around the scanner [38, 39, 40].
For many of these aforementioned engineering problems mathematical models exist that offer solution strategies. One fundamental aspect required to solve these engineering problems is the representation of the investigated surfaces. Most surfaces originating from real world geometries that are used in engineering applications are arbitrary, and thus, do not have a readily available differentiable mathematical description. Thus, the surfaces that describe these geometries have to be discretized to numerically apply these mathematical models. An example of three surface representations (i.e., point clouds, surface meshes, and implicit surfaces) used in this work, are shown in Figure 2.1.
Furthermore, some surface representations offer certain advantages depending on the mathematical models used in a simulation. Certain surface flux calculations use an explicit surface representations [18], since there exist powerful and performant algorithms to accomplish these tasks [41]. On the other hand, the merging of two different surfaces is better handled with an implicit surface representation [17].
In this chapter the discrete surface representations used in this thesis are formally defined. It is discussed how one basic geometric property (i.e., the normal vector) of the discrete surfaces can be defined. Additionally, methods of switching between the discrete surface representations are described.
2.1 Point Clouds
One of the most natural ways to represent a surface in a domain (e.g.,
2.1.1 Definition (Point Cloud) A set of points
The term cloud reflects the fact that a priori the relation between the points is not know. Point clouds usually originate from measurement data obtained from real world objects generated by, e.g., laser scanners [43]. However, point clouds can also be generated from other discrete surface representations, which is discussed in detail in Section 2.4.2.
2.1.1 Geometric Properties
As already mentioned in Definition 2.1.1, the spatial coherence of the points in the point cloud is only assumed and not explicit. Thus, before determining
the geometric properties of a specific point
The previously discussed approach of approximating the surface normal of a point cloud suggests that handling point clouds is computationally expensive, since both required steps (i.e., determining a neighborhood for each point in the point cloud and solving the quadratic optimization problem) are computationally demanding steps. However, when a point cloud is generated from an implicit surface (see Section 2.4.2) it is possible to maintain information about the spatial relation between the points. Furthermore, geometric properties of the implicit surface, e.g., the normal vector or the surface curvatures, can be preserved when a point cloud is generated from an implicit function. Thus, computationally expensive steps such as finding the neighborhood and solving a quadratic optimization problem can be substituted by the comparably cheap calculations on the implicit surface.
2.2 Surface Meshes
One big disadvantage of point clouds is the lack of explicit information of the position of points relative to each other. To obtain a surface representation that also stores information about its local neighborhood only considering points in space is not sufficient. Thus, a surface representation is needed that discretely represents a complex surface as a union of simple elements. The meaning of the term simple element is discussed further down in this section. Intuitively simple elements are the simplest geometries that describe a part of a surface (e.g., a line in 2D). Furthermore, these elements have to be consistently connected to each other, such that there are no partially connected (dangling) elements on the surface. A set of elements that fulfills these properties is called a mesh. Especially the condition about the consistent connectivity of the elements is important since otherwise the mesh would not represent a continuous surface and the definition of mathematical surface properties would not be possible.
The elements used to describe an
2.2.2 Definition (Affine Combination) Let
A point
The Convex hull of a set of points
2.2.5 Definition (k-simplex) Let
A
2.2.6 Definition (Face) Let
When only the
2.2.7 Definition (Facet) Let
A
To consistently represent a 3D surface with
2.2.8 Definition (Simplical Complex) A finite set of simplices is called a simplical complex
-
1.
contains every face of every simplex in . -
2. The intersection
of any two simplices is empty, or a face of and .
2.2.9 Definition (Triangulation) Let
-
1.
is the set of vertices in . -
2.
.
There are several definitions of meshes in literature, for this work a mesh is considered to be a special triangulation of a closed domain. The definition of a triangulation is expanded to preserve information about the boundary of the domain. Consider for example a domain that represents the geometry of a cube that has a hole, when this geometry is triangulated the holes at the bottom and top of the cube would be filled with elements. Thus, to gain a triangulation that maintains the original geometry (i.e., the hole in the cube) some elements from the triangulation have to be removed. The purpose of a mesh is to preserve the explicit information of the domain while constructing a triangulation [16].
2.2.10 Definition ((Conforming) Mesh) Let
-
1.
. -
2. The interior of every simplex in
is non-empty. -
3. The intersection of the interior of two faces in
is empty, or a face
The last condition in the previous definition guarantees that the faces of the mesh do not overlap with each other. Note that the terms mesh and surface mesh are used interchangeably in this work.
Mesh Quality
The shape of triangles is important for the quality, and robustness of numerical simulations using 3D surface meshes [47]. There are several metrics that
measure the quality of triangles [49]. In general, equilateral triangles tend to produce the best results in numerical simulations. Thus, the
smaller a single angle of a triangle gets, the worse the results of the numerical simulation. Triangles with one very obtuse angle (i.e.,
2.2.1 Geometric Properties
A vertex of a surface mesh cannot have a uniquely defined surface normal since in 2D a vertex connects 2 edges which normals may point in different directions. The normal of an edge
2.2.2 Boolean Operations between Surface Meshes
Constructive solid geometry (CSG) is a technique which allows for the creation of complex geometries out of simple geometries utilizing Boolean operations [51]. This technique can, for example, be used to create the geometry of a hammer by combining a cylinder with a cube. Performing a Boolean operation between two surface meshes requires the following steps [52]:
-
(a) Calculate the bounding boxes of the two meshes
-
(b) Use the bounding boxes to identify where the meshes intersect
-
(c) Identify faces that are affected by the Boolean operation
-
(d) Determine the domains that are changed by the Boolean operation
-
(e) Re-triangulate the domains.
Several of the above described steps are computationally expensive. Thus, in performance oriented applications, if possible, it should be avoided to perform CSG on surface meshes. In Sections 2.3.3 and 2.4.3 an efficient strategy for CSG using implicit surfaces is discussed [53].
2.3 Level-Set Functions (Implicit Surfaces)
Surface meshes allow to effectively describe surfaces and simultaneously allow easy access to neighboring elements of the surface. Although, as discussed in Section 2.2.2, topographical changes in a surface mesh require special considerations (e.g., Boolean operations on surface meshes). A surface representation that naturally handles topographical changes without special considerations, and still maintains the easy access to neighboring elements of the surface is an implicit representation of the surface [17].
An implicit surface can be motivated by considering a soap bubble, the soap film separates the inside of the soap bubble from the outside. Thus, the surface of the soap bubble is described by the set of points that separates the
inside of the soap bubble from the outside. Implicit surfaces describe a surface by constructing an interface that splits a domain (e.g.,
In an open domain
2.3.11 Definition (Level-Set function) A continuous function
In literature such functions are sometimes also referred to as signed distance functions.
It should be mentioned here that the choice of negative values for the inside and positive values for the outside is a common arbitrary convention. Furthermore, any other value than zero could be chosen to define the interface of the
level-set function. However, choosing
2.3.1 Geometric Properties
If the gradient of the level-set function
2.3.2 Discretization
Modern computer systems only have a limited amount of resources, therefore, it is unfeasible to store every value of an implicit function
2.3.13 Definition (Grid Cell) Let
This definition can naturally be adapted for 3D grid cells.
The values of the level-set function
However, this is not the only metric that can be used to discretize the level-set function. Whitaker proposed a level-set framework that uses the Manhattan norm (also known as the taxicab metric) to discretize the level-set function [55]
Furthermore, since not all
Euclidean Normalization
When the Euclidean distance is used to describe the level-set function (see Figure 2.5a) it fulfills the Eikonal equation with
Manhattan Normalization (Sparse Field Method)
Considering Equation 2.5 every point in
Which leads to the following description of the level-set function [55, 58]
Difference between Manhattan and Euclidean Normalization
The primary difference between Euclidean and Manhattan normalized level-sets is the way the signed distance function is constructed (see Section 4.1.2). When the Manhattan normalization is used it is sufficient to only store grid points at one side of the zero level-set (i.e., on the
inside or the outside). This is also possible when the Euclidean normalization is used, however, this negatively impacts the quality of the
2.3.3 Boolean Operations between Level-Set Functions
Boolean operations between implicit surfaces (e.g., level-set functions) are described by the following functions [8]
2.4 Switching Between Surface Representations
During a single simulation step several different mathematical models may be utilized to achieve the final result of this simulation step. These mathematical models can require different surface representations to achieve complementary goals (e.g., higher performance and more robust results). So a discussion on how to switch between different surface representations used during process TCAD simulations is presented in this section. Figure 2.7, shows the three discussed surface representations and the in this work discussed conversion between them.
2.4.1 Generating Surface Meshes from Implicit Surfaces (Marching Cubes)
A widely used and performant approach to extract a surface mesh from an implicitly defined surface is the marching cubes algorithm [62].
Depending on the dimension of the implicit surface the algorithm is also referred to as the marching squares algorithm (i.e., for 2D implicit surfaces) [63]. The marching cubes algorithm iterates over all chunks (i.e., the 4, or 8 grid points making up the corners of a square, or a cube) of the implicitly
defined function. If at least one sign of the
Figure 2.11 shows a 3D surface mesh extracted with the marching cubes algorithm. This mesh has several bad mesh elements (see red boxes).
Furthermore, the marching cubes algorithm works on the chunks of the grid thus, it creates several mesh elements that may not be required to represent the geometry. In Chapter 8 a surface simplification algorithm is presented that addresses the problem of surface elements that do not contribute information about the geometry.
2.4.2 Generating Point Clouds from Implicit Surfaces
A level-set function can easily be converted into a point cloud, since due to the construction of the level-set function we know the distance from each grid point to the zero level-set. When the level-set function satisfies the Eikonal
equation (see Equation 4.12) then the closest point on the zero level-set (
For level-set functions using the Manhattan normalization Equation 2.13 should not directly be used to create an explicit point cloud. A
level-set function utilizing the Manhattan normalization only stores the distance to the intersection point between the level-set function and the closest Cartesian grid line (see Figure 2.5). Thus, a different factor has to be used in Equation 2.13
that takes into account the different normalization of the
A performance-focused approximation to the calculations described above is to use the maximum coordinate value of the normal vector
One big advantage of point clouds generated from implicit surfaces is that there still exists a relation between a point on the explicit surface (i.e., the point cloud) and the associated grid point of the implicit surface. As long as the topography of the point cloud is not changed, this association allows for a direct mapping of calculated values on the point cloud (e.g., surface flux originating from Monte Carlo ray tracing simulations) back to the grid points of the level-set function.
2.4.3 Generating an Implicit Surface from a Surface Mesh
Another important conversion is the conversion from surface meshes to implicit surfaces. Basic geometries are straightforward to describe as surface meshes and Boolean operations are easily performed with implicit surfaces. Thus, creating initial geometries using CSG is realized by creating surface meshes of simple geometries (e.g., planes or cuboids) and subsequently convert them into implicit surfaces to perform the Boolean operations. The idea of the conversion for Manhattan and Euclidean normalized level sets is similar. However, the implementation differs quite significantly, so the two methods are discussed separately.
Euclidean Normalization
The conversion algorithm for Euclidean normalized level-set functions starts by calculating a bounding box of the surface mesh. Each grid point in the bounding box is visited and the distance to the surface mesh is calculated. If
the normal distance to the closest surface mesh face is smaller than a desired threshold parameter (e.g., the thickness of the narrow band) the distance to the surface mesh is then inserted into the level-set data structure at the grid
point, otherwise the next grid point is considered. The distance calculation differs depending on the dimension of the surface mesh. Figure 2.13 shows the three cases excluding reflections of how a point can lie in relation to a 2D surface segment (e.g., an edge) between
For 3D surface meshes a more complex approach is required [64]. Consider the triangle created by the points
The sign of the point
Manhattan Normalization
In a level-set framework that uses the Manhattan distance the distance calculation has to be adapted. It has to be checked if the grid lines in each coordinate direction intersect the faces of the surface mesh. The algorithm for Manhattan normalized level-set functions is an adaptation of the algorithm used for Euclidean level-sets. It is sufficient to calculate a bounding box for each face of the surface mesh and then determine all grid line intersections for that face.
As with the Euclidean normalized level-set the intersection test differs depending on the dimension of the surface. In the 2D case each Cartesian coordinate direction is checked if it intersects the line segment. This is achieved by
calculating the difference between the
For 3D surfaces the intersection test is more complicated. To determine if a grid line intersects a triangle in 3D the signed areas of the triangle have to be calculated. Given a triangle with the points