АвтоАвтоматизацияАрхитектураАстрономияАудитБиологияБухгалтерияВоенное делоГенетикаГеографияГеологияГосударствоДомДругоеЖурналистика и СМИИзобретательствоИностранные языкиИнформатикаИскусствоИсторияКомпьютерыКулинарияКультураЛексикологияЛитератураЛогикаМаркетингМатематикаМашиностроениеМедицинаМенеджментМеталлы и СваркаМеханикаМузыкаНаселениеОбразованиеОхрана безопасности жизниОхрана ТрудаПедагогикаПолитикаПравоПриборостроениеПрограммированиеПроизводствоПромышленностьПсихологияРадиоРегилияСвязьСоциологияСпортСтандартизацияСтроительствоТехнологииТорговляТуризмФизикаФизиологияФилософияФинансыХимияХозяйствоЦеннообразованиеЧерчениеЭкологияЭконометрикаЭкономикаЭлектроникаЮриспунденкция

Weiler–Atherton Clipping Algorithm

Читайте также:
  1. Boundary-Fill Algorithm
  2. Bresenham's Circle Algorithm
  3. Bresenham's Line Algorithm
  4. Chapter 5. Clipping
  5. Clipping in Nested Containers
  6. Clipping Region
  7. Computers and algorithms
  8. Cyrus–Beck Algorithm
  9. Liang–Barsky Algorithm
  10. Line Drawing Algorithms
  11. Scan-Line Polygon Fill Algorithm
  12. Shortening. Types of clipping: apocope, aphaeresis, syncope. Acronyms.

The Weiler–Atherton clipping algorithm [12] is used in computer graphics. It allows clipping of a subject polygon by an arbitrarily shaped clip polygon. It is generally applicable only in 2D. However, it can be used in 3D through visible surface determination and with improved efficiency through Z-ordering.

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.

Fig.5.1. Subdivision with the Weiler-Atherton algorithm

Two lists are created from the coordinates of each polygon A and B, where A is the clip region and B is the polygon to be clipped. The list entries are labeled as either inside or outside the other polygon. Various strategies can be used to improve the speed of this labeling, 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:

1. A is inside B – return A for clipping, B for merging.

2. B is inside A – return B for clipping, A for merging.

3. 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 very close to the edge of the other polygon may be considered as both in and out until their status can be confirmed after all the intersections have been found and verified, however this increases the complexity.


1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |

Поиск по сайту:



Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Студалл.Орг (0.003 сек.)