Mesh simplification is the process of reducing the number of vertices, edges and triangles in a three-dimensional (3D) mesh while preserving the overall shape and salient features of the mesh. A popular strategy for this is edge collapse, where an edge connecting two vertices is merged into a single vertex. The edge to collapse is chosen based on a cost function that estimates the error introduced by this collapse. This paper presents a comprehensive, implementation-oriented guide to edge collapse for practitioners and researchers seeking both theoretical grounding and practical insight. We review and derive the underlying mathematics and provide reference implementations for foundational cost functions including Quadric Error Metrics (QEM) and Lindstrom-Turk's geometric criteria. We also explain the mathematics behind attribute-aware edge collapse in QEM variants and Hoppe's energy-based method used in progressive meshes. In addition to cost functions, we outline the complete edge collapse algorithm, including the specific sequence of operations and the data structures that are commonly used. To create a robust system, we also cover the necessary programmatic safeguards that prevent issues like mesh degeneracies, inverted normals, and improper handling of boundary conditions. The goal of this work is not only to consolidate established methods but also to bridge the gap between theory and practice, offering a clear, step-by-step guide for implementing mesh simplification pipelines based on edge collapse.
Triangles are the most commonly used drawing primitive in computer graphics. They are natively supported by almost all graphics libraries and hardware systems, making triangular meshes the dominant representation in 3D modeling. Modern graphics systems are capable of rendering models composed of millions of triangles, thanks to decades of hardware advancements. However, with Moore's Law plateauing and the geometric complexity of meshes increasing rapidly, relying on brute-force parallel processing is no longer viable. This makes mesh simplification techniques more essential than ever for achieving real-time performance and scalability in interactive and large-scale applications. Mesh simplification forms the basis of level of detail (LOD) systems to ease GPU workload, accelerates collision detection in games, and enables faster coarse approximations in FEA simulations.
Among the various mesh simplification techniques available, edge collapse is most widely adopted in practice. This strategy is implemented in many major graphics libraries and tools like CGAL , QSlim, and meshoptimizer. An edge collapse operation merges the two endpoints of an edge into a single new vertex, effectively removing the edge and the two triangles that shared it. Repeating this operation iteratively leads to a simplified mesh that maintains the overall structure of the original. Cost functions help determine which edge to collapse and where to place the resulting vertex in order to best preserve the model’s visual and geometric details. While mesh simplification is a well-studied topic, newcomers to the field often face a steep learning curve when engaging with foundational papers. Many of these works emphasize final equations or high-level algorithmic descriptions, offering little insight into the underlying geometric reasoning or the practical implementation details. As a result, readers may struggle to build an intuitive understanding of how and why edge collapse-based simplification works, or how to translate theory into working code.
This paper aims to bridge that gap by offering a detailed, implementation-aware analysis of edge collapse-based mesh simplification on a manifold mesh. Our contributions are as follows:
โข We present a complete, end-to-end simplification pipeline that includes well-chosen data structures for representing mesh connectivity, deep analysis of cost functions presented in foundational papers in this space, and the edge collapse algorithm that binds both of these.
โข Unlike many prior works that present only the final cost metrics or optimization functions, we derive and explain them along with the geometric meaning behind these formulations, allowing readers to understand the rationale behind each step.
โข Our goal is two-fold: to serve as a conceptual guide for learners who want to understand the inner workings of simplification algorithms, and to act as a practical reference for developers looking to implement their own systems.
In this paper, we first categorize and review different families of mesh simplification algorithms. Since the efficiency of edge-collapse operations depends on fast access to mesh connectivity and rapid local updates, int the following section, we discusse data structures that can be employed to store and manage the mesh connectivity information. We then present a comprehensive edge-collapse algorithm, including detailed programmatic checks to prevent mesh degeneracies. Our most extensive section examines cost computation strategies, explaining the mathematical formulations from foundational papers alongside practical implementations. In the next section, we cover advance edge collapse techinques that account for per-vertex attributes. Finally, we provide supplemental mathematical results and proofs that support these techniques.
Mesh simplification techniques vary widely, but most can be grouped by the strategy they use to reduce geometric complexity while maintaining topology as presented in [Cignoni et al. 1998]. We have supplemented this list with recent advances in the field that leverage modern techniques such as machine learning and neural networks.
An early strategy for mesh decimation focused on detecting coplanar or nearly coplanar surface patches and merging them into larger polygonal regions as presented in [De-Haemer Jr and Zyda 1991] and [Hinker and Hansen 1993]. These regions are subsequently re-triangulated to produce a mesh with fewer faces. Despite its simplicity, the method often degraded geometric detail and introduced topological inconsistencies.
Another method, known as vertex clustering, groups nearby vertices based on spatial proximity and replaces each cluster with a single representative vertex, followed by local re-triangulation as presented in [Rossignac and Borrel 1993] and improved in [Low and Tan 1997]. While faster, this method was again found to compromise detail and topological accuracy.
A more refined and topology-sensitive method is iterative local decimation, which incrementally removes vertices, edges, or faces based on localized geometric evaluations.
These operations are typically guided by cost functions designed to preserve the mesh’s overall structure and appearance [Garland and Heckbert 1997;Lindstrom and Turk 1998;Schroeder et al. 1992]. Extensions such as simplification envelopes [Cohen et al. 1996] presents bounded error control by forcing the resulting simplified mesh to lie between two offset meshes.
In energy-based optimization methods, such as the one presented in [Hoppe et al. 1993], a global cost function evaluates the overall quality of the mesh. Simplification is carried out through iterative edge-based operations such as collapse, swap, or split that aims at minimizing both the local and global cost function. Although this approach with global optimization promises a better overall structural preservation, it is less commonly used in practice due to its computational complexity.
A different strategy is retiling, introduced in [Turk 1992], which begins by randomly placing a user-defined reduced number of new vertices on the original surface which are then adjusted based on areas of high curvature. A new reduced triangulation is built on this vertex set. Although effective in reducing triangle count, this method lacks support for per-vertex attributes, making it less suitable for applications like computer-aided design (CAD) or physical simulations where such data is essential.
Another notable approach to mesh simplification is voxelization, as used by works such as [He et al. 1995] and [He et al. 1996]. Here, the mesh is first sampled into a voxel grid, and a low-pass filter is applied at each grid point to generate a discrete scalar field. A triangulated surface is then extracted from this field using the standard marching cubes algorithm or an adaptive variant of it at an isovalue dictated by the filter. The detail of voxel-based meshes can be adjusted via resolution, but the method sees limited industrial use. It smooths sharp features making itself unsuitable for CAD and is computationally expensive due to volumetric processing, and lacks explicit geometric error control, making output quality difficult to guarantee.
Recent work has explored neural methods that either simplify meshes directly or offer implicit representations enabling level-of-detail control. [Potamias et al. 2022] employs a differentiable neural network to select a subset of input vertices using a sparse attention mechanism and re-triangulate the selected vertices, producing simplified meshes in a data-driven, generalizable manner without per-mesh retraining. [Chen et al. 2023] generates a coarse base mesh using QEM, followed by neural remeshing through face splits. A per-face latent feature representation is transmitted and decoded on the client-side to reconstruct finer meshes. This approach implicitly generates simplified representations across multiple LODs. [Park et al. 2019] learns a signed distance field (SDF) representation from a voxelized representation of mesh. [Takikawa et al. 2021] extends it by creating multiscale SDFs giving real-time rendering at various LODs via ray marching. Although simplified triangle meshes can be extracted using methods like marching cubes, this undermines the efficiency of its implicit representation.
Mesh connectivity data structures are designed to efficiently organize and manage the relationships between elements of a mesh such as which faces share an edge, which edges are connected to a vertex, or which vertices make up a face. They allow algorithms to rapidly traverse and manipulate the mesh’s topology. Below are two data structures commonly used to represent mesh connectivity, along with an evaluation of their suitability for supporting edge collapse operations. The Corner Table data structure introduced in [Rossignac 2002] is a compact mesh representation where each triangle’s three “corners” (vertex-triangle associations) are stored in a list. For edge collapse, it efficiently manages the edge-collapse updates and supports fast querying on the mesh. The Half-Edge data structure presented in [McGuire 2000], is widely used due to its intuitive design and broad support across mesh libraries. In this structure, each mesh edge is represented by a pair of half-edges pointing in opposite directions, each storing connectivity to associated elements such as vertices, faces, and neighboring edges. While not the most memory-efficient option, it enables fast mesh queries and local updates, making it ideal for operations like edge collapse. In the code listing below, we present the interfaces that a typical connectivity data structure would support. The queries listed in table. 1 are necessary for the edge collapse-based mesh simplification algorithm, so they must be handled efficiently by the chosen mesh connectivity data structure. As Table 1 illustrates, both the Half-Edge and Corner Table structures are adept at handling these queries with optimal time complexities, making them well-suited for edge-collapse based mesh simplification.
Time complexity (half-edge / corner table )
Get all triangles connected to vertex ๐ฃ ๐(degree(๐ฃ))
Get all edges connected to vertex ๐ฃ ๐(degree(๐ฃ))
Get all vertices connected to vertex ๐ฃ ๐(degree(๐ฃ))
Get all edges connected to vertex ๐ฃ ๐(degree(๐ฃ))
Table 1. Mesh query operations and their time complexities using different data structures
Edge collapse-based simplification iteratively reduces the number of triangles in a mesh while preserving its overall shape and features. The core algorithm remains largely consistent across different implementations, with key differences lying in the cost metric and vertex placement strategies. The algorithm typically involves the following steps:
Cost assignment and optimal vertex placement calculation 1. A cost is computed for each edge in the mesh to estimate the geometric error introduced by collapsing it. Simultaneously, the optimal position for the resulting merged vertex is determined. This step is critical, as it is where most edge collapse based simplification strategies diverge.
- The computed cost, along with the edge and its optimal replacement vertex, is stored in a priority queue.
A target triangle count is either defined internally by the program or specified externally by the client code. Then, the following steps are repeated until the target triangle count is reached:
-
Select the edge with the lowest collapse cost from the priority queue.
-
Perform validity checks to ensure that collapsing that edge preserves the mesh’s manifoldness. (The three validity checks we employ are explained below.)
-
If the edge passes all validity checks, collapse it by replacing the edge with the computed vertex and removing the two adjacent triangles.
-
Since the collapse locally alters the mesh, recompute the costs of all the edges connected to the collapsed edge, and update the corresponding entries in the priority queue to maintain accuracy for the next iteration.
-
Update the mesh’s connectivity data structure to reflect the changes made by the collapse.
Checks 1 and 2 follow the criteria established in [Hoppe et al. 1993], while check 3 is derived empirically. These checks are crucial for avoiding degeneracies that may result in invalid or non-manifold mesh structures. 2. Two-neighbor connectivity check: Verify that exactly one pair of edges is merged on each side of the collapsing edge. This condition holds when the two collapsing vertices share exactly two common neighbors. A connectivity-related nonmanifold triangle formation is illustrated in Figure 4.
In edge collapse-based mesh simplification, an error metric is assigned to each edge that estimates the cost of collapsing it. Edges with the lowest error are prioritized for collapse. Additionally, we need effective strategies to determine the best new vertex position that will replace the collapsed edge while minimizing the geometric distortion.
The IConstraint class below defines an interface for error metrics. The cost function classes implementing this interface compute the cost โ(๐ฃ) of collapsing an edge for a candidate vertex position ๐ฃ. Implementations of this class compute the cost as โ(๐ฃ) = ๐ฃ ๐ ๐ป๐ฃ + 2๐ ๐ ๐ฃ + ๐, and store the entities {๐ป, ๐, ๐} in this equation in m_H, m_c, m_k.
These will be used to obtain the optimal vertex placement as well, as detailed in section 7.
This method, described in [Garland and Heckbert 1997], defines error as the sum of distances from the new vertex to the planes of surrounding triangles, treating each vertex as their intersection. This captures how much the new vertex deviates from the original geometry, reflecting the introduced distortion.
Referring to Figure 6, we collapse the edge (๐ฃ 1 , ๐ฃ 2 ) into a new vertex ๐ฃ, removing the two adjacent triangles(in planes ๐ 1 and ๐ 6 ) and forming a local geometric approximation. The error is measured as the sum of distances from ๐ฃ to the original surrounding planes ๐ 1 through ๐ 10 . Let โ = {๐ 1 , ๐ 2 , โฆ , ๐ ๐ }, the set of planes that surround the edge being collapsed. Let โ be the error introduced by the newly added vertex ๐ฃ, given by:
where (๐, ๐) represent the unit normal ๐ and scalar ๐ in the equation ๐ โข ๐ + ๐ = 0 of each plane ๐ โ โ.
The term ๐ ๐ ๐ฃ + ๐ gives the signed distance from the vertex to the plane. Squaring it ensures that the error is always non-negative, penalizing both positive and negative deviations equally.
Expanding,
To minimize the error, we set its gradient to zero and solve for ๐ฃ:
Note: When โ takes this form, the matrix ๐ป is its Hessian matrix. In this specific case, ๐ป turns out to be positive semidefinite. So, the point that makes โโ = 0 corresponds to a minimum point rather than a maximum or a saddle point.
If the matrix ๐ป is non-invertible (i.e., det(๐ป) = 0), the optimal vertex position cannot be computed this way. In such cases, fallback strategies or alternative constraints are used. For this cost function, a non-invertible ๐ป indicates that the surface surrounding the edge collapse is flat, as explained below:
in block notation. This means that each term of the sum is itself a non-invertible matrix, as all its columns are parallel to ๐. So, when ๐ป is non-invertible, all the normals of the planes forming ๐ป are parallel. This occurs if the local surface is flat.
The “quadric” in the name of this method is derived from the form this error takes when ๐ฃ is represented in homogeneous 4-dimensional coordinates as the vector ( ๐ฃ 1 ). In that case, the error โ is expressed as follows:
where the authors define the 4x4 matrix ๐ = ( ๐ป ๐ ๐ ๐ ๐ ) above as the total error quadric for this edge. It can further be decomposed as the sum of fundamental error quadrics ๐พ ๐ for each plane ๐ โ โ:
However, the same authors in [Garland and Heckbert 1998] found this formulation impractical because it requires computationally expensive matrix operations on higherdimensional matrices, like inversion. For this reason, it won’t be discussed further.
The standard QEM method struggles with boundary edges -those with only one adjacent face. As noted in [Garland and Heckbert 1998], a modified QEM was proposed to address this and preserve boundary edges. Consider the red boundary edge between ๐ฃ 1 and ๐ฃ 2 , selected for collapse under two distinct surrounding geometries. The new vertex ๐ฃ is computed as the intersection of the adjacent planes ๐ 1 , ๐ 2 and ๐ 3 because the distance of that point from all these planes is zero -resulting in the minimum possible quadric error. Depending on their configuration, this intersection may lie above or below the original boundary.
In conventional QEM, no explicit constraint anchors the new vertex to the boundary. Consequently, collapsing a boundary edge tends to displace the vertex away from the boundary, a deviation that compounds as more boundary edges are collapsed. This progressive drift results in noticeable degradation of mesh quality, as seen in Figure 8. To counteract this effect, [Garland and Heckbert 1998] introduces an imaginary plane ๐ โฒ as shown in Figure 9 in addition to the actual planes adjacent to the collapsing edge. ๐ โฒ is defined as the plane perpendicular to the mesh plane containing edge (๐ฃ 1 , ๐ฃ 2 ). A new term, ๐ 2 (๐ฃ, ๐ โฒ ), representing the squared distance between the vertex and ๐ โฒ , is incorporated into the error metric. As ๐ฃ moves away from the boundary, this term increases, exerting a corrective pull toward the boundary. To strengthen this constraint, the quadric for ๐ โฒ is scaled by a large constant before being added to the quadrics of the edge endpoints. The method is further extended to treat edges separating faces with different attribute values (e.g., material indices) as boundaries. This ensures that such attribute boundaries are preserved during simplification, concentrating edges and faces along these divisions for improved alignment. An example of this extension is shown in Figure 10.
This constraint, introduced in [Lindstrom and Turk 1998] helps preserve the mesh volume. If the new vertex replacing the collapsed edge isn’t chosen carefully, it can distort the model. For instance, using the edge midpoint as the new vertex might increase the volume in concave areas or decrease it in convex ones. The goal of this constraint is to preserve volume locally at each collapse, thereby minimizing the overall volume change across the whole model.
Neither boundary nor volume preservation guarantee geometric integrity; boundaries may deform, and surfaces can lose detail. However, these constraints serve as useful heuristics. Preserving simple, quantifiable properties like area and volume helps reduce extreme distortions, even if local features like sharp edges or curves are lost. While these constraints don’t capture fine geometric details, they provide an efficient way to maintain overall structure, balancing accuracy and performance without the complexity of exact boundary or volume preservation.
When an edge ๐ is collapsed, it sweeps out a tetrahedral volume as illustrated in Let ๐ก = [๐ฃ 1 , ๐ฃ 2 , ๐ฃ 3 ], ๐ก โฒ = [๐ฃ, ๐ฃ 2 , ๐ฃ 3 ], and the volume swept by ๐ก as ๐ฃ 1 moves linearly to ๐ฃ be ๐(๐ฃ, ๐ฃ 1 , ๐ฃ 2 , ๐ฃ 3 ). ๐ is positive if ๐ฃ is above the plane of ๐ก and negative otherwise.
Thus, to preserve the local volume at the site of an edge collapse, the sum of volumes of tetrahedra swept with all triangles ๐ = {๐ก 1 , ๐ก 2 , …, ๐ก ๐ } connected to edge ๐ are considered. The change in volume is given by (the superscript ๐ก indicates the vertices belonging to triangle ๐ก):
Solving for โ = 0 and expanding the determinant along the fourth row, we get,
Representing the determinants that include ๐ฃ as scalar triple products, we get,
Simplifying the term
, we get:
where ๐ ๐ก is the normal of the plane containing
with magnitude equal to triangle area.
Substituting the above simplified term in Equation 1, we get,
The above equation is of the form ๐ฃ โข ๐ = ๐ท which defines a plane. This implies that the vector ๐ฃ is restricted to lie on a plane. So, any point on that plane will satisfy the equation above, implying that volume preservation alone is not enough to fully determine ๐ฃ: we need 2 other constraint equations to do so. By contrast, volume preservation only ensures that the total volume added and removed balances out to zero. And, as we know, it forces the vertex to lie on a plane but doesn’t tell us exactly where on that plane to place it, so it leaves some freedom. Moreover, it can lead to local distortions if large volumes are added and subtracted in different areas.
From the volume preservation constraint formulation, we know that the change of volume induced by an edge collapse is:
where:
โข ๐(๐ฃ, ๐ฃ 1 , ๐ฃ 2 , ๐ฃ 3 ) is the volume swept out by ๐ก when ๐ฃ 1 moves in a linear path to ๐ฃ If the vertex ๐ฃ is above the plane of a triangle ๐ก, the signed volume ๐ of the tetrahedron is positive. If below, it’s negative. But for optimization, we care about how much the volume changes, not the direction. So, we use the unsigned volume change. To get unsigned volume, we could use |๐| or ๐ 2 . We use ๐ 2 because it is differentiable everywhere. This matters because optimization algorithms rely on gradients and |๐| has a kink at zero where the gradient is undefined.
So we express โ as the sum of squares of volumes instead. So we get,
and we get,
This constraint uniquely determines ๐ฃ, except in degenerate cases where det(๐ป) = 0. Just like the case of QEM, this happens in locally flat regions of the geometry, since we know that ๐ป is defined as:
which has the form used in QEM. So, ๐ป becomes non-invertible in flat regions, where all ๐ ๐ก are parallel and the sum reduces to scaled rank-1 terms. In such situations, alternative constraints or fallback strategies are required for vertex placement.
This constraint is discussed in [Lindstrom and Turk 1998]. It helps compute optimal vertex placement and edge collapse error by preserving the area of boundaries. In Figure 12, the image on the left shows a boundary edge (in red) on a planar hole, while the image on the right shows it being replaced by a new vertex (red dot) after edge collapse. As a result, although the total shaded area is preserved (red area loss offset by blue area gain), the boundary’s shape and structure are visibly altered. Thus, the constraint preserves area, not the boundary itself.
As per Figure 13, let edge (๐ฃ 1 , ๐ฃ 2 ) be collapsed into vertex ๐ฃ and let โ be the net area change. Collapsing a boundary edge connects the new vertex ๐ฃ to two other boundary Collapsing a boundary edge connects two others, forming three triangles (๐ = 3) as shown in Figure 14. The squared norm is used for computational simplicity. The error is then defined as the squared magnitude of the total area change induced by vertex ๐ฃ as:
as ๐ธ 1 and
as ๐ธ 2 . This gives,
To simplify the cross-product term, ๐ธ 1 ร ๐ฃ can be written as ๐ฎ๐ฃ, where ๐ฎ is the skewsymmetric matrix for the cross product with ๐ธ 1 :
Simplifying the squared norm gives:
which has the same form as in QEM, suggesting that the solution should be the same: ๐ฃ = -๐ป -1 ๐.
However, for this constraint, ๐ป is non-invertible as ๐ฎ is non-invertible, being a skewsymmetric matrix. Therefore, ๐ฃ cannot be fully determined. Below is a demonstration of the constraints that can actually be extracted from setting the gradient to zero.
= ๐ธ 1 ร ๐ธ 2 -๐ธ 1 (๐ธ 1 โข ๐ฃ) + ๐ฃ(๐ธ 1 โข ๐ธ 1 ) … using vector triple product
This is a 3D vector equation in ๐ฃ, which can be split into 3 scalar equations to solve for its components. We can choose any basis for this, but for convenience, we choose:
Projecting Equation 2 onto ๐พ gives us:
Projecting Equation 2 onto ๐ธ 1 gives us:
This simplifies to 0 = 0, which is a degenerate result. This indicates that the component of ๐ฃ parallel to ๐ธ 1 is not determined by this minimization problem, as it does not affect the value of the error function.
Projecting Equation 2 onto ๐ธ 1 ร ๐พ gives us:
Thus, the solution space of this optimization lies in the intersection of two planes defined by:
Even with this approach of minimizing โ, ๐ฃ remains undetermined. Thus, additional constraints are needed alongside the two equations to solve for ๐ฃ.
The boundary optimization constraint introduced in [Lindstrom and Turk 1998] minimizes boundary triangle area like boundary preservation, but focuses on unsigned area. The error is expressed as a sum of squared signed areas, giving:
where,
โข ๐ฃ โ โ 3 Expanding Equation 3gives:
, gives:
To simplify the cross-product term, ๐ฃ ร ๐ 1 can be written as ๐ฎ๐ฃ, where ๐ฎ is the skewsymmetric matrix for the cross product with ๐ 1 . Also, the scalar triple product identity can be used to rearrange 2(๐ฃ ร ๐ 1 ) ๐ ๐ 2 = 2(๐ 1 ร ๐ 2 ) ๐ ๐ฃ.
which is of the same form as earlier constraints, so we obtain ๐ฃ as ๐ฃ = -๐ป -1 ๐.
As in earlier constraints, if det(๐ป) = 0, the constraint becomes degenerate and we need to use other constraints or use fallback strategies for vertex placement.
Triangle shape optimization tries to improve triangle quality. Skinny or stretched triangles can cause shading issues, while more even, equilateral triangles make the mesh look and work better. As shown in Figure 15, the vertex placement on the left side leads to a cleaner triangle structure thanks to its more regular, evenly shaped triangles. The placement on the right side contains long, stretched triangles, which make the mesh look less tidy and visually less appealing.
Before analyzing this further, an important triangle shape quality metric needs to be introduced: the area-to-perimeter ratio. Regular triangles (like equilateral ones) have a higher area-to-perimeter ratio, which means they’re more compact and less stretched.
In the triangle shape preservation constraint, the goal is to maximize the area-toperimeter ratio. We make an assumption that the region around the collapsing edge is nearly flat. This means the total area of the nearby triangles doesn’t change much after the edge collapse. So, to improve their area-to-perimeter ratio, we can focus on reducing the perimeter alone, which is determined by the edge lengths.
That’s why we minimize the sum of the squared lengths of the edges connected to the new vertex. This pulls the vertex into a position where the edges are more evenly distributed and shorter, leading to more balanced, less skinny triangles.
We formulate this error โ as:
where ๐ฃ ๐ refers to each neighboring vertex {๐ฃ 1 , โฆ , ๐ฃ ๐ } connected to ๐ฃ in the mesh.
On expanding this equation for โ, we get,
๐ผ is an identity matrix = ๐ฃ ๐ ๐ป๐ฃ + 2๐ ๐ ๐ฃ + ๐ which can be solved in the same way as in other constraints. Here, it leads to this solution:
Thus, optimizing triangle shape will lead to choosing the centroid of the neighboring vertices.
Skinny triangles are avoided because they cause shading artifacts. Rasterization interpolates per-vertex data (e.g., normals) using barycentric coordinates, defined as:
In skinny triangles, the denominator ๐ด๐๐๐(โง๐ด๐ต๐ถ) becomes very small, making the coordinates numerically unstable. Small floating-point errors in the vertex positions or sub-areas can then cause large interpolation errors, producing shading artifacts.
When the matrix used to compute ๐ฃ is non-invertible, fallback strategies are needed. A simple and common fallback is to place the new vertex at the midpoint of the edge (๐ฃ 1 , ๐ฃ 2 ) being collapsed:
vec3 GetFallbackVertex(IEdge * collapse_edge) { auto verts = collapse_edge->GetVertices(); return 0.5 * (verts[0]->GetPosition() + verts[1]->GetPosition()); }
To solve for the new vertex ๐ฃ, a system of linear equations is formed from several constraints as discussed in the earlier sections. Each linear equation is of the form:
Here, each ๐ represents the normal of a constraint plane, and ๐ is the corresponding offset. Geometrically, we are finding the point ๐ฃ that lies at the intersection of all these planes in โ 3 . In theory, only three linearly independent constraints (planes) are needed to uniquely determine a point in 3D. However, the algorithm includes more than three constraints to ensure robustness. That’s because:
โข some constraints may become redundant (linearly dependent).
โข some may become degenerate in flat or symmetric regions.
The final vertex placement includes only the best three by checking for linear independence and stability using the following criteria while adding constraints one by one: First Constraint(๐ ๐ ): Is it valid?
return length(A) > 0; } Second Constraint(๐ ๐ ): Is it linearly independent from the first?
This checks if the angle ๐ between the first and second constraint normals is sufficiently large, that is, that they are not almost parallel. ๐ผ is a threshold angle used to determine acceptable linear independence.
This ensures that the third constraint’s normal ๐ 3 does not lie in the plane formed by the normals of the first two constraints, again up to a threshold angle ๐ผ. This guarantees that the three planes intersect at a single point in 3D space, defining a unique solution for the new vertex.
Note that, here we use sin(๐ผ) and not cos(๐ผ) when computing the dot product. We define ๐ผ as the angle between the plane formed by ๐ 1 and ๐ 2 and the new vector ๐ 3 . So as Figure 16 suggests, the angle between the vectors ๐ 1 ร ๐ 2 and ๐ 3 will be 90ยฐ-๐ผ. So we have,
Putting it all together, we revisit the overall edge collapse algorithm and implement all its components. We begin by computing the constraints described above in an order that best suits our use case. Next, we apply the constraint selection criteria to form a set of solvable constraints. Finally, we compute the optimal vertex position based on this set, resorting to our fallback strategy if the system remains unsolvable. The resulting optimal position and its associated cost are then returned for further handling in the priority queue.
void GetCollapseVertex(const IMesh * mesh, const IEdge &collapse_edge , vec3 &collapse_vertex, float &collapse_error) { vector constraints;
If needed, they can be determined using the Gram-Schmidt process, which begins with ๐ linearly independent vectors and iteratively removes components parallel to previously computed basis vectors.
Let the plane be determined by three points ๐, ๐, ๐ โ โ ๐ . As shown in Figure 17, two orthogonal axes ๐ 1 and ๐ 2 can be defined on the plane spanned by (๐, ๐, ๐):
โข ๐ 1 is the unit vector in the direction ๐ -๐, i.e., ๐ 1 = ๐ -๐ โ โ โ โ ๐ -๐ โ โ โ โ
โข Using the Gram-Schmidt process, ๐ 2 can be obtained by taking the vector ๐ -๐, removing its projection onto ๐ 1 (to ensure orthogonality with ๐ 1 ), and then normalizing. In other words,
Next, a point ๐ lying on the plane is chosen, and the vector from ๐ to ๐ฃ, i.e ๐ค = ๐ฃ -๐, is expressed as the sum of its components along the orthonormal basis {๐ 1 , ๐ 2 , โฆ , ๐ ๐ }:
Next, the components along the plane i.e (๐ 1 , ๐ 2 ) are removed from ๐ค, giving us a vector ๐ข:
Here, ๐ข is the perpendicular from ๐ฃ to the plane, whose squared length is precisely โ:
Expanding this out further using ๐ค = ๐ฃ -๐, we get:
= ๐ฃ ๐ ๐ป๐ฃ + 2๐ ๐ ๐ฃ + ๐ Note that this expression matches the form of the error used in the original QEM method. This means that, aside from differences in the values and dimensions of the entities {๐ป, ๐, ๐}, the procedure for calculating the cost and determining the optimal ๐ฃ remains unchanged: the optimal ๐ฃ is still given by -๐ป -1 ๐.
Furthermore, once computed, ๐ฃ not only represents the optimal vertex position but also encodes the optimal values for all associated scalar attributes. [Hoppe 1996] introduced progressive meshes -sequences of meshes representing varying levels of detail of an input mesh, each created through successive edge collapse operations. They propose an alternative method to compute the cost of each edge collapse by defining it as the difference in an energy function. The cost reflects how much the energy function of the mesh changes before and after the collapse, with edges causing smaller energy differences considered better candidates for collapse. Their approach also handles discrete face attributes and scalar vertex attributes at each level of detail.
Before introducing the cost function, we define key geometric entities and setup steps needed to compute the cost of an edge collapse. Figure 18 shows an example.
The original mesh (before any edge collapse operations) is denoted as:
โข Vertices: V = {๐ฃ 1 , โฆ , ๐ฃ ๐ } , where each ๐ฃ ๐ โ โ 3 These points will serve to approximate M in the energy functions.
For each ๐ฅ ๐ , compute its scalar attribute ๐ฅ ๐ โ โ ๐ via barycentric interpolation on its containing face yielding the attribute set ๐ corresponds to ๐:
Consider the mesh M after some edge collapses. Let ๐ โ be the state before collapsing another edge, and ๐ the state after edge collapse. The cost for this collapse is formulated as:
Here, the spring constant ๐
weights this term.
๐ธ ๐ ๐๐๐๐๐ is similar to ๐ธ ๐๐๐ ๐ก , but for scalar attributes. It measures the squared difference between the attributes of each sampled point ๐ฅ ๐ and those of its projection ๐(๐ฅ ๐ ):
where ๐ ๐ ๐๐๐๐๐ weights this term.
๐ท ๐๐๐ ๐ penalizes collapsing a sharp edge ๐ that affects discontinuities tracked by ๐ โฒ :
Here, numProject(๐ โฒ , ๐) denotes the number of points in ๐ โฒ projecting onto ๐. This term is applied only if the collapse alters the discontinuity connectivity, based on criteria presented in [Hoppe 1996]. To forbid the collapses entirely, set ๐ท ๐๐๐ ๐ = โ.
Recall that ๐ โ is the state of the mesh before collapsing the current edge, and ๐ the mesh after the collapse. The new vertex is placed at position ๐ฃ with attributes ๐ฃ. We need to compute ๐ฃ and ๐ฃ that minimize the cost โ.
As per Equation 4, the terms in โ depend on ๐ฃ and ๐ฃ as follows:
โข ๐ธ ๐๐๐ ๐ก (๐) and ๐ธ ๐ ๐๐๐๐๐ (๐) depend only on ๐ฃ.
โข ๐ธ ๐ ๐๐๐๐๐ (๐) depends only on ๐ฃ.
โข ๐ท ๐๐๐ ๐ and the energy terms for ๐ โ are independent of both ๐ฃ or ๐ฃ. So, they only affect the cost โ but not the optimization.
Thus, here are the steps to compute โ, ๐ฃ and ๐ฃ for a given edge collapse:
-
Minimize โ๐ธ ๐๐๐ ๐ก + โ๐ธ ๐ ๐๐๐๐๐ over ๐ฃ.
-
Minimize โ๐ธ ๐ ๐๐๐๐๐ over ๐ฃ.
-
If the discontinuity criteria hold, compute ๐ท ๐๐๐ ๐ .
-
Return โ = โ๐ธ ๐๐๐ ๐ก + โ๐ธ ๐ ๐๐๐๐๐ + โ๐ธ ๐ ๐๐๐๐๐ + ๐ท ๐๐๐ ๐ along with the optimal ๐ฃ and ๐ฃ.
Minimizing the error โ is more complex than previous error functions and requires a staged optimization process. We describe that process in detail below, and the data required for computing and optimizing the error is shown in an example in Figure 19.
We can observe that any edge with unchanged endpoints in ๐ and ๐ โ cancels out in โ๐ธ ๐ ๐๐๐๐๐ . Since differences occur only near the collapsed edge, only two edge sets contribute nonzero terms:
-
๐: edges in ๐ incident on the new vertex at ๐ฃ.
-
๐ โ : edges in ๐ โ incident on the collapsed edge.
Thus, we can simplify โ๐ธ ๐ ๐๐๐๐๐ as follows:
where the projection of the same sampled point ๐ฅ ๐ is ๐(๐ฅ ๐ ) in ๐ and ๐ โ (๐ฅ ๐ ) in ๐ โ . Since ๐ and ๐ โ differ only in the vicinity of the one edge being collapsed, most points project identically in both states and cancel out. Thus, only points ๐ โ ๐ projecting onto the neighborhood of the edge contribute:
We define the neighborhood of an edge as the set of faces connected to either endpoint of that edge in ๐ or ๐ โ . This simplification is based on a locality assumption: the new vertex ๐ฃ stays near the collapsed edge, so the projections of distant points in ๐ remain unchanged. Although allowing ๐ฃ farther away could lower the cost, it would require recomputing over all ๐. In practice, restricting ๐ฃ and using the simplified โ๐ธ ๐๐๐ ๐ก works well.
Since where ๐ lies on some face in ๐ with vertices (๐ฃ ๐ , ๐ฃ ๐ , ๐ฃ ๐ ). We use barycentric coordinates ๐ฝ = (๐ฝ ๐ , ๐ฝ ๐ , ๐ฝ ๐ ) to express ๐:
We can define a function ๐ฝ(๐ฆ) to denote the projected barycentric coordinates for any point ๐ฆ: ๐ฝ(๐ฆ) = arg min ๐ฝ โ๐ฆ -๐๐ฝโ 2 , ๐(๐ฆ) = ๐๐ฝ(๐ฆ)
Now, since both ๐ and ๐ฝ are face-specific, we extend ๐ to the full mesh ๐ with ๐ vertices {๐ฃ 1 , โฆ , ๐ฃ, โฆ , ๐ฃ ๐ } and any given ๐ฝ to an ๐-dimensional vector, zeroing out the entries for all vertices except (๐ฃ ๐ , ๐ฃ ๐ , ๐ฃ ๐ )
Thus, ๐ธ ๐๐๐ ๐ก (๐) can be rewritten in terms of ๐ฃ (as contained within ๐):
We can now minimize ๐ธ ๐๐๐ ๐ก (๐) over ๐ฃ. Since evaluating it requires projecting each ๐ฆ ๐ via an inner minimization in ฮฒ space, the problem becomes nested: an outer minimization over ๐ฃ and inner minimizations over all ฮฒ(๐ฆ ๐ ).
We solve the nested minimization iteratively as shown in Figure 20, starting with an initial guess for ๐ฃ and alternating between: optimizing ๐ฃ with fixed ฮฒ(๐ฆ ๐ ), then updating ฮฒ(๐ฆ ๐ ) with fixed ๐ฃ. This repeats until convergence, i.e., when the values of ๐ฃ and each ฮฒ(๐ฆ ๐ ) don’t change much between iterations. In practice, a small number of iterations is sufficient.
The inner minimization -over each ฮฒ(๐ฆ ๐ ) with fixed ๐ฃ -is called the projection subproblem, i.e., projecting all points in ๐ onto ๐. A brute-force method is to try projecting every ๐ฆ ๐ on every face of ๐ and compute ฮฒ(๐ฆ ๐ ) corresponding to the closest face. But, [Hoppe 1996] adds two speedups to this approach:
-
Use a spatial partitioning structure to find candidate faces in ๐(1) time per point, especially useful early on or after edge collapses in new regions.
-
If ๐ฆ ๐ was projected onto ๐ โ , limit its projection on ๐ to the faces neighboring the previous one, leveraging locality.
The outer minimization -over ๐ฃ while keeping all ฮฒ(๐ฆ ๐ ) constant -is now solved by rewriting ๐ธ ๐๐๐ ๐ก (๐) using that constancy.
Here, ๐ โ ๐ is a local subset of sample attribute vectors. We define this neighborhood as the set of all sample points on the faces adjacent to the edge being collapsed, consistent with the approach used for ๐ธ ๐๐๐ ๐ก .
Since ๐ธ ๐ ๐๐๐๐๐ ( ๐ โ ) is independent of ๐ฃ, it is ignored in the optimization process and added only to the final cost.
The optimization is simplified by reusing the barycentric coordinate sets computation ฮฒ and ฮฒ โ from the previous optimization of โ๐ธ ๐๐๐ ๐ก . ๐
In this paper, we investigated mesh simplification using edge collapse in detail by performing a deep dive into four important papers providing variations on this algorithm: [Garland and Heckbert 1997;Lindstrom and Turk 1998;Garland and Heckbert 1998;Hoppe 1996].
We started by discussing the basics of mesh simplification and the different categories of algorithms that are used for that purpose. We then focused on edge collapse and the half-edge data structure typically used to implement it. Next, we outlined the general algorithm used for simplification via edge collapses, including important edge cases that need to be considered. We then performed an elaborate analysis of the process of computing the error introduced by a candidate vertex placement through a variety of metrics, and discussed how the associated constraints can be assembled to form a solvable system of linear equations that yield the final, optimal vertex placement for a given edge collapse.
In the process, we also dealt with other important considerations while performing mesh simplification, such as handling boundary edges and vertex/face attributes.
We believe this work can help people interested in geometry processing and mesh simplification to understand these potent algorithms and metrics in depth, implement them for their use cases, and inspire further work in this field.
This content is AI-processed based on open access ArXiv data.