ArticleslgStudy

computer science

Weiler–Atherton clipping algorithm

Weiler–Atherton clipping algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Weiler–Atherton clipping algorithm rather than just read about it. In short: The Weiler–Atherton is a polygon-clipping algorithm. It is used in areas like computer graphics and games development where clipping of polygons is needed.

Weiler–Atherton clipping algorithm — main illustration
Weiler–Atherton clipping algorithm — illustration

Key takeaways

  • Weiler–Atherton clipping algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Weiler–Atherton clipping algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Weiler–Atherton clipping algorithm from memory before moving on to harder problems.

Reference excerpt

The Weiler–Atherton is a polygon-clipping algorithm. It is used in areas like computer graphics and games development where clipping of polygons is needed. It allows clipping of a subject or candidate polygon by an arbitrarily shaped clipping polygon/area/region. 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.

Preconditions

Before being applied to a polygon, the algorithm requires several preconditions to be fulfilled:

Candidate polygons need to be oriented clockwise. Candidate polygons should not be self-intersecting (i.e., re-entrant). The algorithm can support holes (as counter-clockwise polygons wholly inside their parent polygon), but requires additional algorithms to decide which polygons are holes, after which merging of the polygons can be performed using a variant of the algorithm.

Algorithm Given polygon A as the clipping region and polygon B as the subject polygon to be clipped, the algorithm consists of the following steps:

List the vertices of the clipping-region polygon A and those of the subject polygon B. Label the listed vertices of subject polygon B as either inside or outside of clipping region A. Find all the polygon intersections and insert them into both lists, linking the lists at the intersections. Generate a list of "inbound" intersections – the intersections where the vector from the intersection to the subsequent vertex of subject polygon B begins inside the clipping region. Follow each intersection clockwise around the linked lists until the start position is found. If there are no intersections then one of three conditions must be true:

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.

Conclusion 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. Various strategies can be used to improve the speed of this labeling, and to avoid needing to proceed further. Care will be needed where the polygons share an edge.

See also Sutherland–Hodgman clipping algorithm Vatti clipping algorithm Greiner–Hormann clipping algorithm

References

Weiler, Kevin and Atherton, Peter. "Hidden Surface Removal using Polygon Area Sorting", Computer Graphics, 11(2):214-222, 1977.

Worked examples

Example 1 — a first encounter with Weiler–Atherton clipping algorithm

Start with the simplest possible case. Write down what Weiler–Atherton clipping algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Weiler–Atherton clipping algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Weiler–Atherton clipping algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Weiler–Atherton clipping algorithm

In research
Weiler–Atherton clipping algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Weiler–Atherton clipping algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Weiler–Atherton clipping algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer graphics stubs, Polygon clipping algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Weiler–Atherton clipping algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Weiler–Atherton clipping algorithm” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Weiler–Atherton clipping algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Weiler–Atherton clipping algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Weiler–Atherton clipping algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Weiler–Atherton clipping algorithm in simple terms?

The Weiler–Atherton is a polygon-clipping algorithm. It is used in areas like computer graphics and games development where clipping of polygons is needed.

Why does Weiler–Atherton clipping algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Weiler–Atherton clipping algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Weiler–Atherton clipping algorithm.

Tags

  • Computer graphics stubs
  • Polygon clipping algorithms

Keep exploring