A shading approach to non-convex clipping

  • Authors:
  • Thomas L. Springall;Gustav Tollet

  • Affiliations:
  • IBM Corporation, 1133 Westchester Avenue, White Plains, NY;Strandbacken 2 D 14, SF-02230 Esbo, Finland

  • Venue:
  • APL '90 Conference proceedings on APL 90: for the future
  • Year:
  • 1990

Quantified Score

Hi-index 0.00

Visualization

Abstract

The conventional way of clipping a graphic object with a rectangular window or any convex polygon is to cut the object along a line tangent to each side of the polygon. Parts of the object on the exterior side of the line are thrown away. After repeating the process for all of the sides, what remains is the clipped object.However, this process fails if the clipping window is non-convex, i.e., has one or more corners that point inward, or if the window consists of more than one polygon. Too much then gets clipped away. One way of dealing with this situation is to break up the window into simple convex polygons. The object is clipped with each polygon in turn, and the results are joined together to form the final result.A different approach, presented here, is to use shading logic. The window is seen as an area to be shaded, and the object, as the shading pattern. That is, the window is shaded with the object. The method yields not only the clipped object, but also, as a by-product, the reverse clipping, i.e., that part of the object that lies outside the window. This is an advantage in graphics editing where both clippings are often needed in parallel.