Docsity

Weiler Atherton Polygon clipping Algorithm, Lecture notes of Computer Graphics

Partial preview of the text

Download Weiler Atherton Polygon clipping Algorithm and more Lecture notes Computer Graphics in PDF only on Docsity!

WEILER & ATHERTON

(POLYGON CLIPPING)

By:

Arvind Kumar

Assistant Professor

Vidya College of Engineering

2D This Algorithm is capable of clipping of a concave polygon.

Polygon to be Clipped : Subject Polygon

Clipping Window : Clip Polygon

Clockwise Processing

2D Algorithm:

Assume the polygon listed in clockwise order.

If the edge enter the clip polygon, record the

intersection points and continue to trace the

subject polygon.

If the edge leaves the clip polygon, record the

intersection point and make a right follow the clip

polygon in same manner. i.e treat clip polygon as

subject polygon.

Continue until vertex reach visited vertex.

2D

Example: Clip the Subject Polygon.

w1 w w4^ w V V V V V V Clip Polygon Subject Polygon

2D

Solution:

2. Start from V1 vertex to V2 vertex in clockwise

direction, both outside vertices then leave.

w1 w w4^ w V V V V V V Clip Polygon Subject Polygon I I I I

2D

Solution:

3. From V 2 vertex to Vertex V 3 in clockwise direction, Here V 2 is outside and V 3 is inside. so, record Intersection Point I 1 and continue to subject polygon to V 3 Vertex. w1 w w4^ w V V V V V V Clip Polygon Subject Polygon I I I I

2D

Solution:

5. From V 4 vertex to Vertex V 5 in clockwise direction. Here both V 4 in inside point and V 5 is outside. so, continue to Clip Polygon clockwise to intersection point from I 2 to I 1. Also clip the polygon. w1 w w4^ w V V V V V V Clip Polygon Subject Polygon I I I I

2D

Solution:

6. From V 5 vertex to Vertex V 6 in clockwise direction. Here both V 5 is outside and V 6 is inside. so, continue to subject polygon to V 6 Vertex. w1 w w4^ w V V V V V V Clip Polygon Subject Polygon I I I I

2D

Solution:

8. Final Clipped part of subject polygon is w1 w w4 w V V V Clip Polygon I I I I