Weiler-Atherton clipping algorithm

Weiler-Atherton clipping algorithm

Weiler-Atherton clipping algorithm used in computer graphics.It allows clipping of a "subject polygon" by an arbitrarily shaped "clip polygon". It is generally applicable only in 2D.

Description

The algorithm requires polygons to be clockwise and not reentrant (self intersecting). The algorithm can support holes (as counter-clockwise polygons wholly inside their parent polygon), but requires additional algorithms to decide which polygons are holes. Merging of polygons can also be performed by a variant of the algorithm.

Two lists are created from the coordinates of each polygons A and B.

The list entries are labelled as either inside or outside the other polygon. Various strategies can be used to improve the speed of this labelling, and to avoid needing to proceed further.

All the polygon intersections are then found and are inserted into both lists, linking the lists at the intersections. Care will be needed where the polygons share an edge.

If there are no intersections then one of three situations exist:
# A is inside B - return A for clipping, B for merging.
# B is inside A - return B for clipping, A for merging.
# A and B do not overlap - return None for clipping or A & B for merging.

A list of inbound intersections is then generated. Each intersection in the list is then followed clockwise around the linked lists until the start position is found. One or more concave polygons may produce more than one intersecting polygon. Convex polygons will only have one intersecting polygon.

The same algorithm can be used for merging two polygons by starting at the outbound intersections rather than the inbound ones. However this can produce counter-clockwise holes.

Some polygon combinations may be difficult to resolve, especially when holes are allowed.

Points on the edge of the polygon may be considered as both in and out until their status can be confirmed after the intersections have been found and verified, however this increases the complexity.

ee also

*Sutherland-Hodgman clipping algorithm

References

* [http://www.cs.drexel.edu/~david/Classes/CS430/HWs/p214-weiler.pdf HIDDEN SURFACE REMOVAL USING POLYGON AREA SORTING - Kevin Weiler and Peter Atherton]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Sutherland-Hodgman clipping algorithm — The Sutherland Hodgman algorithm is used for clipping polygons. It works by extending each line of the clip polygon in turn and selecting only vertices from the subject polygon that are on the visible side.DescriptionBegin with a set of all… …   Wikipedia

  • Clipping (computer graphics) — Any procedure which identifies that portion of a picture which is either inside or outside a picture is referred to as a clipping algorithm or clipping. The region against which an object is to be clipped is called clipping window. Contents 1… …   Wikipedia

  • Hidden Surface Removal — Oben: Ansicht einer Szene mit Betrachter. Unten links: projizierte Objekte ohne Verdeckungsberechnung. Unten rechts: gerendertes Bild nach Verdeckungsberechnung, bei der ermittelt wurde, dass die blaue Kugel und das graue Dreieck die gelbe Kugel… …   Deutsch Wikipedia

  • Sichtbarkeitsentscheid — Oben: Ansicht einer Szene mit Betrachter. Unten links: projizierte Objekte ohne Verdeckungsberechnung. Unten rechts: gerendertes Bild nach Verdeckungsberechnung, bei der ermittelt wurde, dass die blaue Kugel und das graue Dreieck die gelbe Kugel… …   Deutsch Wikipedia

  • Verdeckungsberechnung — Oben: Ansicht einer Szene mit Betrachter. Unten links: projizierte Objekte ohne Verdeckungsberechnung. Unten rechts: gerendertes Bild nach Verdeckungsberechnung, bei der ermittelt wurde, dass die blaue Kugel und das graue Dreieck die gelbe Kugel… …   Deutsch Wikipedia

  • Algoritmo de Cohen-Sutherland — El algoritmo de Cohen Sutherland es un algoritmo de recorte de líneas usado en gráficos por computadora. Fue desarrollado por Danny Cohen e Ivan Sutherland en 1967. Contenido 1 Introducción 2 Funcionamiento 2.1 Códigos de frontera …   Wikipedia Español

  • Algoritmo de Liang-Barsky — El algoritmo de Liang Barsky es un algoritmo de recorte de líneas similar al algoritmo de Cohen Sutherland. Usa la ecuación paramétrica de la línea y desigualdades describiendo el rango del área de recorte para determinar las intersecciones entre …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”