Popular explanation of surface parameterization (triangular grid parameterization) is how to do it

Surface Parameterization (Triangular Mesh Parameterization)

Surface Parameterization, Plane Parameterization, Surface Parameterization, Triangle Mesh Parameterization, Surface Parameterization, Planar Parameteriazation, Mesh Parameterization.

With so many names on it, it's easy to get confused. So let me first talk about what the surface parameterization in this article is for. It is to find a method to compress a three-dimensional surface or a three-dimensional object into an expanded two-dimensional plane. If this is what you want to know, you're in the right direction.


1. The use of surface parameterization

Surface parameterization, the word literally means finding a formula or a set of formulas for the surface to express. In fact, after understanding it, I feel that "parameterization" should be understood as finding the mapping from a three-dimensional surface to a two-dimensional surface. One-to-one correspondence of two-dimensional planes in topology, angle, triangle area, etc.

Expanding a three-dimensional surface to a two-dimensional surface has many uses, and the most common use is to do texture mapping (texture mapping).

A texture is two-dimensional. To paste it on a three-dimensional grid surface, it is not like in reality to dip some glue on the back of the texture and then pat it on the grid surface with one hand. On the computer, it is necessary to find that each color point on the map should be pasted to a specific spatial coordinate point on the grid surface, and as the intermediate medium is the expanded two-dimensional surface obtained by parameterization. Use the following figure to illustrate:
insert image description here

However, those who read this article should know what surface parameterization can do, and what they care about is how to do surface parameterization, so I won’t say much about its role, and let’s start with how to do it.


2. How to do surface parameterization

First, the parameterized methods are divided into two categories, one is the fixed boundary method, and the other is the free boundary method . Use the following figure to understand:

insert image description here
The difference between the free boundary and the fixed boundary is obvious, that is, whether the boundary of the model after parameterization is aligned with the boundary of the circle or the square. Whether it is fixed or not will have its own optimal use. For example, if I want to do texture mapping, my texture map is a square picture. Then I choose the method of homeomorphism with the square to expand the 3D model into a square. It will be more convenient to map the texture. Fidelity, roughly this is the consideration.

The question is, where does the boundary of the model come from?

If it is a triangular mesh surface, the surface itself will have a boundary; if it is a closed model, then cut the mesh by yourself, and the cutting line will be used as the boundary of the expansion. Examples of cutting are as follows:
insert image description here


3. Fixed boundary method - convex combination method

Let’s talk about the concept of barycentric coordinates first, and look at the picture first:
insert image description here
the three coordinates A, B, and C of the triangle are known. There is a point P inside it, and P is any point, which can be represented by three points A, B, and C, or it can be interpolated through the three vertices of A, B, and C. Anyway, just find out the three weight values ​​of w1, w2, and w3. (Note: Point P is inside, so the sum of the three weight values ​​is equal to 1, and the weight value must be non-negative, so that the weight w is the only solution. This is also called a convex combination . )

Conversely, if you know what the weight value is, then you can find the only coordinate of point P.

The weight here is determined by calculating the area ratio of the three triangles divided internally, and these three weight values ​​are the barycentric coordinates of point P. Of course, point P is arbitrarily specified here, and the coordinates are known, so the area of ​​the small inner triangle can be calculated. The three weight values ​​correspond to the three unknowns w1, w2, and w3, and then formulate the equations according to the calculated area ratio, and add w1 + w2 + w3 = 1 to solve the equations .

The above is the concept of convex combination derived from barycentric coordinates, and P can be represented by adjacent vertices. What we want to do next is to use the vertices of the border to represent the vertices of the interior.

To extend this concept, the above is to calculate the convex combination of points inside a single triangle, and then start the polygon below. If you are facing a grid, see the following figure: The coordinates of P are also given arbitrarily, and its
insert image description here
adjacency The coordinates of the vertices are all known numbers. Now the convex combination of ABCDEF of point P is required, that is, the weight of adjacency. Do you think it can be obtained?

Of course it can be found, the essence is still: 
P = w1 * A + w2 * B + w3 * C + w4 * D + w5 * E + w6 * F
and w1 + w2 + w3 + w4 + w5 + w6 = 1
as long as there is a suitable The weight calculation method can be calculated

Let's extend it again, and make it more complicated:

insert image description here

This time there are two internal coordinates P and Q, can you solve it? --able

It should be noted that to represent the coordinates of point P, only all the points adjacent to it are needed, that is, points C, D, and E in the above figure do not directly contribute to point P, so it is necessary to list points C, D, and E If the convex combination of P points is entered, then the weight w corresponding to these three points is 0.

So it is necessary to distinguish clearly: the above picture is divided into two parts, which are two convex combinations of P and Q.
The adjacent points of point P are Q, F, G, H, A, B - forming a convex combination for finding P, in which an internal point Q appears. The adjacent
points of point Q are P, B, C, D, E, F —— Form a convex combination for Q, in which an internal point P appears

Therefore, the convex combination of Q can be substituted into the convex combination of P to solve.

Take a look at the more complicated picture below:
insert image description here

How to express the convex combination of P, Q, R this time, does it feel clear at a glance?

According to the above introduction, especially, if you know the coordinates of the boundary points and the coordinates of the internal vertices, you can actually find out how the internal vertices are interpolated by the external vertices, that is, the weight. The key point is to know how to calculate the weight . , that is, the method of calculating the weight . Calculate the weight, and all internal vertices can be represented by the weight of the boundary vertices.

So the summed up formula is: (this is to move all the internal vertices in the equation system to the left of the equal sign, and the boundary vertices to the right of the equal sign) internal vertices
= all (boundary vertices * weight) (if the boundary points are different from the internal points Adjacent, then weight value = 0)

The formula is: the coincidence in the formula refers to all internal vertices, all boundary vertices and all corresponding weights. The formula is actually a system of equations when expanded. It does not refer to the calculation of a single vertex.
insert image description here
This formula, when you look at the parametric papers on mesh surfaces, you must see the formula, because this is the main formula of parameterization.

(Important) The case of mesh surface parameterization is reversed from the above solution example: what is known is the weight, and what is unknown is the internal vertex coordinates. Now we need to use the boundary point coordinates to calculate the internal point coordinates, that is, the right side of the formula equal sign The content of is known.

Then put the situation into the actual situation, see the picture below: also officially started to talk about the fixed boundary parameterization method .
insert image description here
The image on the left is a 3D mesh surface that is intended to be unfolded into the 2D plane shown on the right. Do you feel a little out of ideas?

All the coordinate information of the left image is known, which means that you can calculate the adjacency weight of each internal vertex as long as you have a suitable calculation method for the weight of adjacent points (such as the barycentric coordinate method described above).

Let's not discuss the calculation method of weight.
Now if you want to calculate the parameterized plane that is homeomorphic to the disk, that is the right figure. First, the boundary points of the disk should be calculated (homeomorphism with the disk means that the surface will be expanded into a circle), and then the vertex coordinates inside the disk can be calculated through weights.

(Important paragraph) In the fixed boundary parameterization method, the first step is to determine the boundary of the disk. The most commonly used method is to extract the boundary of the three-dimensional mesh surface, calculate the total value of the arc length of the boundary (corresponding to the circumference of the disk), then calculate the arc length of each side, and then calculate the proportion, what is needed is this proportion value. Then map the boundary vertices of the surface to the boundary of the disc according to the ratio value, of course, according to the circumference of the disc multiplied by the above ratio value. The summary is to use the arc length calculation ratio to place the corresponding boundary vertices on the side of the disk.

insert image description here
Looking at the parameterized main formula again, now the boundary vertex values ​​on the right side of the equal sign are known, and the weight values ​​have been calculated in advance. Substituting into the above equations, all internal vertices can be calculated.

(Significance) The research on grid parameterization focuses on the calculation method of weight λ, and many surface parameterization methods are derived from it, which can basically be regarded as different calculation methods for weight λ. Because when calculating the weight, it is calculated on the surface of the three-dimensional mesh, and the surface itself has its own curvature and other influencing factors. to the plane), these influencing factors will affect the mapping results of the parametric plane. Therefore, to study different weight λ calculation methods, the goal is to reduce the deformation of the triangle as much as possible during mapping, keep the shape and characteristics of the original triangle mesh as much as possible, and reduce parametric distortion as much as possible.

The more classic and commonly used methods by solving weights are (excerpted from CGAL):

  • Tutte Barycentric Mapping: Tutte barycentric mapping theorem
  • Floater Shape Preserve: Floater's shape-preserving parameterization method
  • Floater Mean Value Coordinates: Floater's median coordinate method
  • Discrete Authalic Parameterization
  • Discrete Conformal Map
  • Iterative Authalic Parameterization

4. Fixed Boundary Method - Energy Minimization Method

Here we introduce the most commonly used harmonic mapping (one of the energy minimization methods), or the Harmonic parameterization method. The understanding is to find an energy equation and solve the extreme value of this energy equation, that is, to minimize the energy equation.

How to find the energy equation of the mesh surface?

A spring is added to each edge of the mesh surface, and the mesh surface is regarded as a spring system. The elastic potential energy of the mesh is the energy equation.
insert image description here

First of all, it is still necessary to determine the position of the boundary vertices, for example, use the disk and use the method mentioned above to determine the boundary vertices.

The interior space points are then parameterized by minimizing the elastic potential energy of the triangular mesh (computing all spring edges simultaneously).
insert image description here
E refers to the elastic potential energy (energy equation), and q(i,1) and q(i,2) refer to the positions of the two vertices of the i-th spring side in the disk (belonging to unknowns).

k is the elasticity coefficient of the harmonic map. There are many ways to calculate k , one of the examples is:
insert image description here

Among them, ɑ and β are the two opposite angles of the original two triangles where the i-th spring side is located.

Therefore, the above formula can be understood as: E is the energy accumulation result of each edge of the grid .

The next step is to minimize E, which is to minimize the energy:
insert image description here
as a result, all vertices of the grid surface are mapped to the coordinate points of the disk.

This type of method belongs to the method of minimizing energy (harmonic mapping is only one of them), which is different from the above convex combination method. But the boundaries are fixed.

5. Free Boundary Method

Guess you like

Origin blog.csdn.net/qq_37366618/article/details/128920805