Lecture_010_Digital_Geometry_Processing

Problems in Geometry Processing

Reconstruction:

Upsampling: increase resolution via interpolation

Downsampling: decrease resolution

Resampling: modify sample distribution to improve quality (visualization vs solving equation)

Filter: remove noise or emphasize features

Compression: reduce storage size by remove redundant data or approximating unimportant data

Shape Analysis:

Re-meshing and Sampling

Delaunay Triangulation and Voronoi Diagram

Delaunay Triangulation and Voronoi Diagram

Metrics: how should we judge that our re-meshed result is good

Vertex Degree often affect the result of geometric processing

Vertex Degree often affect the result of geometric processing

In general, you can't have regular vertex degree everywhere.

Subdivision and Upsampling

Metrics:

Algorithms:

Catmull-Clark Subdivision: Note that the edge coords is different from edge midpoint

Catmull-Clark Subdivision: Note that the edge coords is different from edge midpoint

The equation, especially the weighting for the new vertex coordinate, here is quiet arbitrary.

Catmull-Clark: Quad subdivision

  1. split every polygon into quadrilaterals
  2. compute the coordinates of face center (by arithmetic mean)
  3. compute edge center positions by arithmetic mean
  4. calculate vertex coordinates

Catmull-Clark Edge Case

Catmull-Clark Edge Case

For edge case: we want the subdivision to behave the same if the tube gets cut in half

Catmull-Clark keeps original irregular vertices but does not introduce new vertices for quads. When applied to triangles, it generates irregular mesh everywhere.

Loop Subdivision

Loop Subdivision

Loop Subdivision: Triangle subdivision with C^2 continuity

  1. split each triangle into four
  2. assign new vertex position according to weights

Loop Subdivision can be implemented by split and flip.

Implementing Loop Subdivision

Implementing Loop Subdivision

Simplification and Downsampling

Greedy Algorithm: iteratively collapse edges

  1. assign edge with a cost function (quadratic error metric, Garland & Heckbert 1997 CMU)
  2. collapse edge with least cost using gradient descent
  3. repeat until target number is reached

Quadratic Error Metric

Quadratic Error Metric

Quadratic Error Metric: the distance between a vertex to its adjacent faces

To calculate the error in 3D coordinates, we need:

Note that we only need d and \vec{n} to describe a plane. To draw a plane in 3D, first find all the points in a surface of a ball of radius d from the origin. Then, notice every point of the surface have a different normal. Then we can pin point the plane using the normal we stored.

To calculate the error in homogeneous coordinates, we need:

Notice that we can represent a 3D plane in homogeneous coordinates as a point in 4D.

Signed distance to a plane is:

\vec{u} \cdot \vec{v} = ax + by + cz + d

Squared distance is

(\vec{u} \cdot \vec{v})^2 = \vec{u}^T(\vec{v}\vec{v}^T)\vec{u} = \vec{u}^TK\vec{u}\\ K = \vec{v}\vec{v}^T = \begin{bmatrix} a^2 & ab & ac & ad\\ ab & b^2 & bc & bd\\ ac & bc & c^2 & cd\\ ad & bd & cd & d^2\\ \end{bmatrix}

Notice matrix K encodes squared distance to plane \vec{v}. To find the squared distance for any point \vec{u}, you just do \vec{u}^TK\vec{u}.

Furthermore, if you want to find the distance to union of planes P_1, P_2, ..., you can just some multiple matrix K_1, K_2, .... Therefore you only need to do one matrix computation. Which means you can use all planes in your geometry. However, this might not be useful as every point will then be set to the center of the geometry.

Minimizing Quadratic Polynomial

Since gradient descent is costly, it might be possible to find a analytical solution to quadratic equations in 2D.

We can write the following 2D quadratic equation in matrix form:

f(x, y) = ax^2 + bxy + cy^2 + dx + ey + g
X = \begin{bmatrix} x\\ y\\ \end{bmatrix}, A = \begin{bmatrix} a & b/2\\ b/2 & c\\ \end{bmatrix} u = \begin{bmatrix} d\\ e\\ \end{bmatrix}\\ f(x, y) = x^T A x + u^T x + g

Now we can observe a critical point (when derivative is zero, there can be minimum, maximum, or saddle point) can be described by:

\begin{align*} 2Ax + u =& 0\\ x =& - \frac{1}{2}A^{-1}u\\ \end{align*}

The critical point is a minimum as long as it satisfy: (quadratic term greater than zero)

(\forall x) (x^T A x > 0)

There is a minimum point for quadratic equation that is "Positive-definite"

There is a minimum point for quadratic equation that is "Positive-definite"

Minimizing Quadratic Error

So we want to minimize the following formula:

\min_{\vec{u} \in \mathbb{R}^4} \vec{u}^T K \vec{u}

Firstly we break up quadratic function into:

\begin{align*} &\begin{bmatrix} \vec{x}^T & 1 \end{bmatrix} \cdot\begin{bmatrix} B & \vec{w}\\ \vec{w}^T & d^2\\ \end{bmatrix} \cdot\begin{bmatrix} \vec{x}\\ 1\\ \end{bmatrix}\\ =& \vec{x}^T B \vec{x} + 2\vec{w}^T \vec{x} + d^2\\ \to& \vec{x} = -B^{-1}\vec{w}\\ \end{align*}

We can guarantee B is a positive definite matrix because there exists one point that minimizes this error to zero.

Summary:

The information of the original geometry is never lost in the process of repeating collapse because they are tacked by K_{ij}.

In practice the algorithm might generate flipped triangles. In this case, don't do the operation.

Flipped Triangles when using Quadratic Error

Flipped Triangles when using Quadratic Error

Re-mesh

Delaunay Mesh

To obtain delaunay mesh, we can flip the edge if

\alpha + \beta > \pi

Obtaining Delaunay Triangles by Flipping Edges

Obtaining Delaunay Triangles by Flipping Edges

For planer triangulation (2D case), we can guarantee with O(n^2) (where n is the number of triangles) steps, we will eventually get a Delaunay mesh. However, it does not always work in 3D because there might be livelock (loop forever where one edge keeps flipping). But there are ways to detect such livelock and you don't need O(n^2) to get "ok" looking mesh.

Vertex Degree

Edge Flip if degree closer to 6

Edge Flip if degree closer to 6

Since the average degree of a geometry approaches to 6 as number of triangles increases, you might hope to get a mesh that is very close to degree 6.

There is no guarantee edge flip works. But it works in practice.

60 Degree

We can repeatably center vertices to make triangle more "round".

Laplacian Smoothing

Laplacian Smoothing

We can move vertices only in the direction that is tangent to the surface (by removing normal component of the moving direction. The normal direction is calculated using vertex's own neighbores)

Isotropic Re-meshing

Repeat Four Steps:

  1. split any edge over \frac{4}{3} mean edge length
  2. collapse edge less than \frac{4}{5} mean edge length
  3. Flip edges to improve vertex degree
  4. Center vertices tangentially

// QUESTION: how is the numbers here chosen?

Danger of Resampling

Resampling Image (by up/down/up/down sampling) reduce quality

Resampling Image (by up/down/up/down sampling) reduce quality

Signal Degradation with Mesh Geometry

Signal Degradation with Mesh Geometry

Table of Content