Garland-Heckbert algorithm

from Wikipedia, the free encyclopedia

The Garland-Heckbert algorithm is a computer graphics process with which the level of detail of a 3D body modeled as a triangular network can be reduced in a controlled manner without changing the basic appearance of the body. This is done incrementally , always deleting one edge of the triangular network and combining the two adjacent nodes into a single node. The edge is always deleted, the removal of which causes the slightest visual change in the body.

The algorithm was presented in 1997 in a publication by Michael Garland and Paul Heckbert .

algorithm

Edge contraction

In a triangular mesh, deleting an edge and merging the remaining nodes is called edge contraction or collapse. The algorithm provides information about which edge has to be deleted and where the newly created node will be placed.

For this purpose, a square of errors is used that is assigned to each node and edge. This provides information on how large the resulting optical error would be if the corresponding edge were to be contracted. At the same time, it can be used to calculate where the newly emerging node must be placed so that precisely this error (and not a larger one) occurs.

Pseudocode

Compute initially for each node b i the associated initale Fehlerquadrik Q b i . See further below.

Then iterate until the desired level of detail is achieved:

  1. Each edge receives as quadric Q E j the sum of the quadrics of its two end points.
  2. Using the quadric, calculate for each edge at which point the contracted node would have to be created in order to cause minimal errors when the edge collapses.
  3. Find the edge among all the edges whose error would be the smallest when collapsing. Collapse this edge.
  4. The new point created during the collapse is assigned the quadric that belonged to the collapsed edge.

Detailed description

Initial error squares

The error of two when combining node v 1 and v 2 to a new v newly formed, is defined as: the square of the sum of the distances, the v newly to all surfaces , has the triangles are defined by any of which at v 1 or v 2 limits.

To v initially the distance of a point re- calculate to an area F, the following formula may be used:

Here b is any point in the surface (e.g. one of the corner points of the triangle that lies in the surface), and n T is the normal vector of the surface ( transposed to the line vector ).

If you now square this distance as intended, you get:

If homogeneous coordinates are used , this calculation is equivalent to:

The matrix is called the square of errors of area F.

If one now considers a node b of the triangular network, the sum of the quadrics of its adjacent triangular areas F i can be assigned to it as the error quadric Q b .

The quadric Q b is calculated to initialize the algorithm for each node of the triangular network.

Iteration step

Calculation of the edge to be contracted

Each edge e j of the triangular network receives as quadric Q e j the sum of the quadrics of its end points b 1 and b 2 :

If the edge e j was not previously assigned a quadric (only in the first iteration step), or if the quadric has changed compared to the last iteration step (because one of the end points was moved by edge contraction), the following must now be calculated:

  • Which point v new when contracting e j would cause the smallest possible error
  • How big the error would be.

To the optimum point v newly determine, so you have the minimum value of the error function are found, d. H. all partial derivatives of must be 0.

If these derivatives are calculated, the following system of equations to be solved is obtained:

Several cases can arise:

  • The matrix can be inverted : The point v new can easily be calculated using the system of equations.
  • The matrix cannot be inverted: The optimal value for v new can be found on the link between the two edge endpoints b 1 and b 2 . We then describe v new as a linear combination of the two end points: and instead look for the minimum of with respect to λ. This is done by simply deriving the function according to λ and setting this derivation = 0.
  • If the second method does not produce a result either, the midpoint between b 1 and b 2 is used, or b 1 or b 2 itself.

Now that v is newly known, the resulting error is calculated. This error is entered in a priority queue , with the lowest error being the top element of the queue.

Contract the edge

The top element is removed from the queue. This element corresponds to the edge whose contraction causes the least error. The edge is now contracted, and the newly created point v new is assigned the error square of the edge destroyed in the process. This has the effect that the error in the following iteration steps not only depends on the current triangular network, but also includes the previous changes.

credentials

  1. M. Garland and P. Heckbert. Surface Simplification Using Quadric Error Metrics. In Proceedings of SIGGRAPH 97. ( PDF )