Greiner–Hormann clipping algorithm

The Greiner-Hormann algorithm is used in computer graphics for polygon clipping.[1] It is more performant than the Vatti clipping algorithm, but cannot handle degeneracies.[2] It can process both self-intersecting and non-convex polygons. It can be trivially generalized to compute other Boolean operations on polygons, such as union and difference.

The algorithm is based on the definition of the "inside" of a polygon based on the winding number. It considers regions with odd winding number to be inside the polygon; this is known as the even–odd rule. It takes two lists of polygons as input. Each polygon is represented as a linked list of vertices.

In its original form, the algorithm is divided into three phases:

The algorithm is not restricted to polygons and can handle arbitrary parametric curves as segments, as long as there is a suitable pairwise intersection procedure.

A major shortcoming of the original Greiner–Hormann algorithm is the fact that it cannot handle degeneracies, such as common edges or intersections exactly at a vertex. The original paper suggests perturbing the vertices to remove them.

See also

References

  1. Greiner, Günther; Kai Hormann (1998). "Efficient clipping of arbitrary polygons". ACM Transactions on Graphics. 17 (2): 71–83. Retrieved 2014-05-17.
  2. Ionel Daniel Stroe. "Efficient Clipping of Arbitrary Polygons". Retrieved 2014-05-17.

External links

This article is issued from Wikipedia - version of the 11/27/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.