2081 2

CSC214 ยท 2081 ยท 10 marks

What is the major drawback of Sutherland Hodgeman Polygon Clipping Algorithm? Illustrate with a suitable example. Explain B-spline curve and its properties.

What is the major drawback of Sutherland Hodgeman Polygon Clipping Algorithm? Illustrate with a suitable example. Explain B-spline curve and its properties.[10]

Computer GraphicsChapter 3: Two-Dimensional Geometric TransformationsClipping

Quick answer

The Sutherland-Hodgman algorithm clips a polygon against each edge of the rectangular clipping window one at a time. It processes the polygon vertex list against: 1. Left boundary 2. Right boundary 3. Bottom boundary 4. Top boundary

Sutherland-Hodgman Polygon Clipping: Major Drawback + B-Spline Curves


Part 1: Major Drawback of Sutherland-Hodgman Algorithm

The Algorithm (Brief Recap)

The four inside-outside cases for each edge are:

  • Out โ†’ In: Add intersection point V' and Vi+1
  • In โ†’ In: Add Vi+1
  • In โ†’ Out: Add intersection point V' only
  • Out โ†’ Out: Add nothing

Major Drawback: Incorrect Clipping of Concave (Non-Convex) Polygons

The Sutherland-Hodgman algorithm works correctly only for convex polygons. When applied to concave (non-convex) polygons, it produces incorrect results by generating spurious (extra, unwanted) edges that do not belong to the actual clipped polygon.

When a concave polygon is clipped, the algorithm may connect vertices that should not be connected, producing a polygon with extra edges crossing through the exterior region. The output polygon may appear distorted or have additional triangular/spurious regions.


Illustration with Example

Consider a concave (non-convex) polygon with vertices:

V1(10, 40), V2(40, 80), V3(70, 40), V4(40, 60)

This polygon is concave (the vertex V4 is indented inward, creating a "dent").

Clipping Window: Xmin=20, Ymin=30, Xmax=60, Ymax=70

        V2(40,80)
       /         \
V1(10,40)       V3(70,40)
       \         /
        V4(40,60)   <-- concave indentation

What should happen (correct result): The clipping should produce two separate polygon regions (two disjoint pieces) after clipping against the window boundaries, because the concave polygon, when clipped, naturally splits into two parts.

What Sutherland-Hodgman produces (incorrect result): Instead of two separate polygons, the algorithm connects the two separate pieces with a spurious edge along the clipping boundary, producing one single (incorrect) polygon with an extra edge that runs along the window boundary where no actual polygon edge exists.

Correct Output:          S-H Output (Incorrect):
  [Piece 1]  [Piece 2]     [Single polygon with
                            spurious connecting edge]

Diagram:

  ___________
 |    /\     |
 |   /  \    |   <-- Correct: two separate triangular regions
 |  /    \   |
 |_/______\__|

  ___________
 |    /\     |
 |   /  \    |   <-- S-H Output: spurious edge connects
 |  /____\   |       the two regions incorrectly
 |___________|

The spurious edge appears along the clipping boundary, connecting two intersection points that should not be connected. This creates a filled region that does not actually belong to the original polygon.


Summary of Drawback

AspectDetail
ProblemIncorrect output for concave polygons
CauseAlgorithm cannot detect when clipped regions should be separate
EffectSpurious/extra edges appear along clipping boundary
SolutionUse Weiler-Atherton Algorithm, which correctly handles concave polygons

Part 2: B-Spline Curve and Its Properties

Definition

A B-spline curve (Basis spline curve) is a piecewise polynomial curve defined by a set of control points (polygon vertices) and a set of basis functions called B-spline basis functions. Unlike Bezier curves, B-spline curves provide local control over the shape of the curve.

The general equation of a B-spline curve is:

$$P(t) = \sum_{i=0}^{n} P_i \cdot N_{i,k}(t)$$

Where:

  • $P_i$ = control points (i = 0, 1, 2, ..., n)
  • $N_{i,k}(t)$ = B-spline basis functions of order k
  • $k$ = order of the curve (degree = k - 1)
  • $t$ = parameter value

B-Spline Basis Functions (Cox-de Boor Recursion)

The basis functions are defined recursively:

Order 1 (k=1): $$N_{i,1}(t) = \begin{cases} 1 & \text{if } t_i \leq t < t_{i+1} \ 0 & \text{otherwise} \end{cases}$$

Higher orders: $$N_{i,k}(t) = \frac{t - t_i}{t_{i+k-1} - t_i} N_{i,k-1}(t) + \frac{t_{i+k} - t}{t_{i+k} - t_{i+1}} N_{i+1,k-1}(t)$$

Where $t_i$ are the knot values forming the knot vector.


Example from Notes

Construct a B-spline curve of order 4 with 4 polygon vertices:

  • A(1,1), B(2,3), C(4,3), D(6,2)

Given: n = 3 (4 control points: P0, P1, P2, P3), k = 4 (order 4)

Knot vector for uniform B-spline with n=3, k=4: Number of knots = n + k + 1 = 3 + 4 + 1 = 8

Uniform knot vector: T = {0, 0, 0, 0, 1, 1, 1, 1}

The knot value 0 is repeated k = 4 times at the start and 1 is repeated k = 4 times at the end (a clamped/open uniform knot vector). Since n - k + 2 = 3 - 4 + 2 = 1, there are no interior knot spans, so the curve reduces to a single Bezier-like segment defined over t โˆˆ [0, 1] that passes through the first and last control points, A(1,1) and D(6,2).


Properties of B-Spline Curves

  • Local Control: Moving one control point $P_i$ only affects the portion of the curve where its basis function $N_{i,k}(t)$ is non-zero, unlike a Bezier curve where every control point influences the entire curve.
  • Degree Independent of Control Points: The degree of a B-spline curve (k - 1) can be chosen independently of the number of control points, whereas a Bezier curve's degree is always (n) for n+1 control points.
  • Convex Hull Property: The curve lies within the union of the convex hulls of each successive group of k control points.
  • Continuity: A B-spline curve is $C^{k-2}$ continuous at simple (non-repeated) interior knots, allowing smoother joins between segments.
  • Variation Diminishing Property: The curve does not oscillate more than its defining control polygon.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.