Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

A shading approach to non-convex clipping

Published: 01 May 1990 Publication History

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.

References

[1]
William M. Newman and Robert F. Sproull: Principles of Interactive Computer Graphics. Second Edition, McGraw-Hill, NY, 1979.
[2]
John A. Gerth: High Performance Processing in a High Level Language. SEAS Proceedings Anniversary Meeting 1986 Volume II, pp. 670-681, (ISSN 0254-6213), 1986.
[3]
Judson Rosebush: Using APL for Computer Graphics Notation. APL Techniques and Applications, Session Tutorials, APL89, ACM SIGAPL, NY, 1989.
[4]
IBM Publishing Systems DrawMaster. Program Number 5664-388, IBM Corporation, 1987.

Cited By

View all

Recommendations

Reviews

Edwin Robert Ashworth

The authors present a shading logic approach to deal with non-convex geometries for an APL audience. Their algorithm not only creates a clipped object, but also makes reverse clipping possible. APL procedures greatly simplify the task. The algorithm has been successfully applied in IBM's Draw Master program. The purpose of this paper is a general tutorial. The cross product feature illustrates the relationship of points and lines. One APL statement generates the coefficients of a line given any two points on the line. The authors show the clipping logic with an example and additional APL functions. The paper concludes with remarks on the matrix M and its geometric implications. In summary, the power of APL is utilized to solve the problem. Four references are provided. The paper could be improved if the 63 lines of APL code plus comments were also included.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM SIGAPL APL Quote Quad
ACM SIGAPL APL Quote Quad  Volume 20, Issue 4
APL 90: for the future conference proceedings (Copenhagen, Denmark, Aug. 13–17, 1990)
July 1990
425 pages
ISSN:0163-6006
DOI:10.1145/97811
Issue’s Table of Contents
  • cover image ACM Conferences
    APL '90: Conference proceedings on APL 90: for the future
    May 1990
    438 pages
    ISBN:089791371X
    DOI:10.1145/97808

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 1990
Published in SIGAPL Volume 20, Issue 4

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)32
  • Downloads (Last 6 weeks)12
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media