The Sutherland Hodgeman
Polygon Clipping
Algorithm
What is clipping?
Generally, any procedure, that identifies those portion of a
picture that are either inside or outside of a specified region
of a space is referred as a clipping algorithm or simply
clipping.
Polygon Clipping (Sutherland Hodgman Algorithm)
• A polygon can also be clipped by specifying the clipping window. Sutherland
Hodgeman polygon clipping algorithm is used for polygon clipping. In this
algorithm, all the vertices of the polygon are clipped against each edge of the
clipping window.
• First the polygon is clipped against the left edge of the polygon window to get new
vertices of the polygon. These new vertices are used to clip the polygon against
right edge, top edge, bottom edge, of the clipping window as shown in the
following figure.
• While processing an edge of a polygon with clipping window, an intersection point
is found if edge is not completely inside clipping window and the a partial edge
from the intersection point to the outside edge is clipped. The following figures
show left, right, top and bottom edge clippings −
Let us understand this clipping method -
• Example-
Steps to solve polygon clipping-
Four categories of polygon clipping-
CLIP POLYGON ABCDE AGAINST WINDOW PQRS.
THE CO-ORDINATES OF THE POLYGON ARE
A(80,200); B(220,120); C(150,100); D(100,30);
E(10,120). CO-ORDINATES OF THE WINDOW ARE
P(200,50); Q(50,150); R(200,150); S(50,50).
•Convex Clipping Window: The algorithm is designed to work primarily with convex clipping
windows,
such as rectangles. It does not handle concave clipping regions effectively without modification.
•Complex Polygons: For complex polygons (e.g., those with holes, self-intersecting polygons),
the algorithm may produce incorrect results
. The algorithm assumes that the polygon to be clipped is simple, meaning it does not self-intersect.
•Handling Degenerate Cases: In some edge cases, such as when a polygon edge lies exactly on the
clipping
boundary or when a vertex coincides with a clipping boundary, the algorithm can produce unexpected
or
ambiguous results. Special handling may be needed for these cases.
•Performance: While the algorithm is efficient for small numbers of vertices and simple polygons, it
may
become less efficient for polygons with a large number of vertices or for cases where multiple clipping
operations are required.
Does Not Handle All Clipping Regions: The Sutherland-Hodgman algorithm works by
iteratively clipping against the edges of the clipping window. It is not designed for arbitrary
or complex clipping regions that may require non-rectangular clipping boundaries.
Numerical Precision: Like many algorithms that involve geometric computations, the
Sutherland-Hodgman algorithm can be sensitive to numerical precision issues, especially
when working with floating-point coordinates.
No Support for 3D Clipping: The Sutherland-Hodgman algorithm is primarily a 2D
algorithm. It does not directly handle 3D polygon clipping, which would require extending
the logic to operate in three dimensions.
Thank You

polygon clipping IN COMPUTER GRAPHICS.pptx

  • 1.
  • 2.
    What is clipping? Generally,any procedure, that identifies those portion of a picture that are either inside or outside of a specified region of a space is referred as a clipping algorithm or simply clipping.
  • 3.
    Polygon Clipping (SutherlandHodgman Algorithm) • A polygon can also be clipped by specifying the clipping window. Sutherland Hodgeman polygon clipping algorithm is used for polygon clipping. In this algorithm, all the vertices of the polygon are clipped against each edge of the clipping window. • First the polygon is clipped against the left edge of the polygon window to get new vertices of the polygon. These new vertices are used to clip the polygon against right edge, top edge, bottom edge, of the clipping window as shown in the following figure.
  • 4.
    • While processingan edge of a polygon with clipping window, an intersection point is found if edge is not completely inside clipping window and the a partial edge from the intersection point to the outside edge is clipped. The following figures show left, right, top and bottom edge clippings −
  • 5.
    Let us understandthis clipping method - • Example-
  • 7.
    Steps to solvepolygon clipping-
  • 9.
    Four categories ofpolygon clipping-
  • 14.
    CLIP POLYGON ABCDEAGAINST WINDOW PQRS. THE CO-ORDINATES OF THE POLYGON ARE A(80,200); B(220,120); C(150,100); D(100,30); E(10,120). CO-ORDINATES OF THE WINDOW ARE P(200,50); Q(50,150); R(200,150); S(50,50).
  • 15.
    •Convex Clipping Window:The algorithm is designed to work primarily with convex clipping windows, such as rectangles. It does not handle concave clipping regions effectively without modification. •Complex Polygons: For complex polygons (e.g., those with holes, self-intersecting polygons), the algorithm may produce incorrect results . The algorithm assumes that the polygon to be clipped is simple, meaning it does not self-intersect. •Handling Degenerate Cases: In some edge cases, such as when a polygon edge lies exactly on the clipping boundary or when a vertex coincides with a clipping boundary, the algorithm can produce unexpected or ambiguous results. Special handling may be needed for these cases. •Performance: While the algorithm is efficient for small numbers of vertices and simple polygons, it may become less efficient for polygons with a large number of vertices or for cases where multiple clipping operations are required.
  • 16.
    Does Not HandleAll Clipping Regions: The Sutherland-Hodgman algorithm works by iteratively clipping against the edges of the clipping window. It is not designed for arbitrary or complex clipping regions that may require non-rectangular clipping boundaries. Numerical Precision: Like many algorithms that involve geometric computations, the Sutherland-Hodgman algorithm can be sensitive to numerical precision issues, especially when working with floating-point coordinates. No Support for 3D Clipping: The Sutherland-Hodgman algorithm is primarily a 2D algorithm. It does not directly handle 3D polygon clipping, which would require extending the logic to operate in three dimensions.
  • 17.